diff options
Diffstat (limited to 'sal/qa/rtl/locale/rtl_locale.cxx')
-rw-r--r-- | sal/qa/rtl/locale/rtl_locale.cxx | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/sal/qa/rtl/locale/rtl_locale.cxx b/sal/qa/rtl/locale/rtl_locale.cxx index 3879ad8a2048..4dffc21f56da 100644 --- a/sal/qa/rtl/locale/rtl_locale.cxx +++ b/sal/qa/rtl/locale/rtl_locale.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,7 +40,7 @@ namespace rtl_locale // default locale for test purpose void setDefaultLocale() { - rtl::OLocale::setDefault(rtl::OUString::createFromAscii("de"), rtl::OUString::createFromAscii("DE"), /* rtl::OUString() */ rtl::OUString::createFromAscii("hochdeutsch") ); + rtl::OLocale::setDefault(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("de")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DE")), /* rtl::OUString() */ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("hochdeutsch")) ); } class getDefault : public CppUnit::TestFixture @@ -68,7 +69,7 @@ public: void getDefault_001() { - // rtl::OLocale::setDefault(rtl::OUString::createFromAscii("de"), rtl::OUString::createFromAscii("DE"), rtl::OUString()); + // rtl::OLocale::setDefault(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("de")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DE")), rtl::OUString()); rtl::OLocale aLocale = ::rtl::OLocale::getDefault(); CPPUNIT_ASSERT_MESSAGE("locale must not null", aLocale.getData() != NULL); } @@ -100,7 +101,7 @@ public: // insert your test code here. void setDefault_001() { - rtl::OLocale::setDefault(rtl::OUString::createFromAscii("en"), rtl::OUString::createFromAscii("US"), rtl::OUString()); + rtl::OLocale::setDefault(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("US")), rtl::OUString()); rtl::OLocale aLocale = ::rtl::OLocale::getDefault(); CPPUNIT_ASSERT_MESSAGE("locale must not null", aLocale.getData() != NULL); @@ -135,14 +136,14 @@ public: rtl::OLocale aLocale = ::rtl::OLocale::getDefault(); rtl::OUString suLanguage = aLocale.getLanguage(); t_print("Language: %s\n", rtl::OUStringToOString(suLanguage, osl_getThreadTextEncoding()).getStr()); - CPPUNIT_ASSERT_MESSAGE("locale language must be 'de'", suLanguage.equals(rtl::OUString::createFromAscii("de"))); + CPPUNIT_ASSERT_MESSAGE("locale language must be 'de'", suLanguage.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("de")))); } void getLanguage_002() { rtl::OLocale aLocale = ::rtl::OLocale::getDefault(); rtl::OUString suLanguage = rtl_locale_getLanguage(aLocale.getData()); t_print("Language: %s\n", rtl::OUStringToOString(suLanguage, osl_getThreadTextEncoding()).getStr()); - CPPUNIT_ASSERT_MESSAGE("locale language must be 'de'", suLanguage.equals(rtl::OUString::createFromAscii("de"))); + CPPUNIT_ASSERT_MESSAGE("locale language must be 'de'", suLanguage.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("de")))); } // Change the following lines only, if you add, remove or rename @@ -174,14 +175,14 @@ public: rtl::OLocale aLocale = ::rtl::OLocale::getDefault(); rtl::OUString suCountry = aLocale.getCountry(); t_print("Country: %s\n", rtl::OUStringToOString(suCountry, osl_getThreadTextEncoding()).getStr()); - CPPUNIT_ASSERT_MESSAGE("locale country must be 'DE'", suCountry.equals(rtl::OUString::createFromAscii("DE"))); + CPPUNIT_ASSERT_MESSAGE("locale country must be 'DE'", suCountry.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DE")))); } void getCountry_002() { rtl::OLocale aLocale = ::rtl::OLocale::getDefault(); rtl::OUString suCountry = rtl_locale_getCountry(aLocale.getData()); t_print("Country: %s\n", rtl::OUStringToOString(suCountry, osl_getThreadTextEncoding()).getStr()); - CPPUNIT_ASSERT_MESSAGE("locale country must be 'DE'", suCountry.equals(rtl::OUString::createFromAscii("DE"))); + CPPUNIT_ASSERT_MESSAGE("locale country must be 'DE'", suCountry.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DE")))); } // Change the following lines only, if you add, remove or rename @@ -213,14 +214,14 @@ public: rtl::OLocale aLocale = ::rtl::OLocale::getDefault(); rtl::OUString suVariant = aLocale.getVariant(); t_print("Variant: %s\n", rtl::OUStringToOString(suVariant, osl_getThreadTextEncoding()).getStr()); - CPPUNIT_ASSERT_MESSAGE("locale variant must be 'hochdeutsch'", suVariant.equals(rtl::OUString::createFromAscii("hochdeutsch"))); + CPPUNIT_ASSERT_MESSAGE("locale variant must be 'hochdeutsch'", suVariant.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("hochdeutsch")))); } void getVariant_002() { rtl::OLocale aLocale = ::rtl::OLocale::getDefault(); rtl::OUString suVariant = rtl_locale_getVariant(aLocale.getData()); t_print("Variant: %s\n", rtl::OUStringToOString(suVariant, osl_getThreadTextEncoding()).getStr()); - CPPUNIT_ASSERT_MESSAGE("locale variant must be 'hochdeutsch'", suVariant.equals(rtl::OUString::createFromAscii("hochdeutsch"))); + CPPUNIT_ASSERT_MESSAGE("locale variant must be 'hochdeutsch'", suVariant.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("hochdeutsch")))); } // Change the following lines only, if you add, remove or rename @@ -288,8 +289,8 @@ public: // insert your test code here. void equals_001() { - rtl::OLocale aLocale1 = rtl::OLocale::registerLocale(rtl::OUString::createFromAscii("en"), rtl::OUString::createFromAscii("US"), rtl::OUString()); - rtl::OLocale aLocale2 = rtl::OLocale::registerLocale(rtl::OUString::createFromAscii("en"), rtl::OUString::createFromAscii("US")); + rtl::OLocale aLocale1 = rtl::OLocale::registerLocale(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("US")), rtl::OUString()); + rtl::OLocale aLocale2 = rtl::OLocale::registerLocale(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("US"))); sal_Bool bLocaleAreEqual = sal_False; bLocaleAreEqual = (aLocale1 == aLocale2); @@ -299,8 +300,8 @@ public: void equals_002() { - rtl::OLocale aLocale1 = rtl::OLocale::registerLocale(rtl::OUString::createFromAscii("en"), rtl::OUString::createFromAscii("US"), rtl::OUString()); - rtl::OLocale aLocale2 = rtl::OLocale::registerLocale(rtl::OUString::createFromAscii("en"), rtl::OUString::createFromAscii("US")); + rtl::OLocale aLocale1 = rtl::OLocale::registerLocale(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("US")), rtl::OUString()); + rtl::OLocale aLocale2 = rtl::OLocale::registerLocale(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("US"))); sal_Int32 nEqual = rtl_locale_equals(aLocale1.getData(), aLocale2.getData()); t_print("rtl_locale_equals() result: %d\n", nEqual); @@ -341,3 +342,5 @@ void RegisterAdditionalFunctions(FktRegFuncPtr) rtl_locale::setDefaultLocale(); t_print("Initialization Done.\n" ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |