diff options
author | Theo van Klaveren <theo.van.klaveren@gmail.com> | 2011-03-17 13:22:55 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-03-18 09:34:59 +0000 |
commit | df8e3ca428e3216ec5e33efd38a25cae952ad7e3 (patch) | |
tree | 313a56a146a2f0a83476025ec9eb399741b40795 /sal | |
parent | d08d6ce8003330a9f99429fc961a0adddb7f3af1 (diff) |
Make the qa/rtl/rtl_locale test compile again.
Diffstat (limited to 'sal')
-rw-r--r-- | sal/qa/rtl/locale/rtl_locale.cxx | 62 |
1 files changed, 36 insertions, 26 deletions
diff --git a/sal/qa/rtl/locale/rtl_locale.cxx b/sal/qa/rtl/locale/rtl_locale.cxx index 4dffc21f56da..004c640bb922 100644 --- a/sal/qa/rtl/locale/rtl_locale.cxx +++ b/sal/qa/rtl/locale/rtl_locale.cxx @@ -31,9 +31,12 @@ #include "precompiled_sal.hxx" // autogenerated file with codegen.pl -#include <testshl/simpleheader.hxx> -#include <rtl/locale.hxx> #include <osl/thread.h> +#include <rtl/locale.hxx> + +#include <cppunit/TestFixture.h> +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/plugin/TestPlugIn.h> namespace rtl_locale { @@ -49,6 +52,8 @@ public: // initialise your test code values here. void setUp() { + // start message + rtl_locale::setDefaultLocale(); } void tearDown() @@ -91,6 +96,8 @@ public: // initialise your test code values here. void setUp() { + // start message + rtl_locale::setDefaultLocale(); } void tearDown() @@ -124,6 +131,8 @@ public: // initialise your test code values here. void setUp() { + // start message + rtl_locale::setDefaultLocale(); } void tearDown() @@ -135,14 +144,14 @@ public: { rtl::OLocale aLocale = ::rtl::OLocale::getDefault(); rtl::OUString suLanguage = aLocale.getLanguage(); - t_print("Language: %s\n", rtl::OUStringToOString(suLanguage, osl_getThreadTextEncoding()).getStr()); + printf("Language: %s\n", rtl::OUStringToOString(suLanguage, osl_getThreadTextEncoding()).getStr()); 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()); + printf("Language: %s\n", rtl::OUStringToOString(suLanguage, osl_getThreadTextEncoding()).getStr()); CPPUNIT_ASSERT_MESSAGE("locale language must be 'de'", suLanguage.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("de")))); } @@ -163,6 +172,8 @@ public: // initialise your test code values here. void setUp() { + // start message + rtl_locale::setDefaultLocale(); } void tearDown() @@ -174,14 +185,14 @@ public: { rtl::OLocale aLocale = ::rtl::OLocale::getDefault(); rtl::OUString suCountry = aLocale.getCountry(); - t_print("Country: %s\n", rtl::OUStringToOString(suCountry, osl_getThreadTextEncoding()).getStr()); + printf("Country: %s\n", rtl::OUStringToOString(suCountry, osl_getThreadTextEncoding()).getStr()); 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()); + printf("Country: %s\n", rtl::OUStringToOString(suCountry, osl_getThreadTextEncoding()).getStr()); CPPUNIT_ASSERT_MESSAGE("locale country must be 'DE'", suCountry.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DE")))); } @@ -202,6 +213,8 @@ public: // initialise your test code values here. void setUp() { + // start message + rtl_locale::setDefaultLocale(); } void tearDown() @@ -213,14 +226,14 @@ public: { rtl::OLocale aLocale = ::rtl::OLocale::getDefault(); rtl::OUString suVariant = aLocale.getVariant(); - t_print("Variant: %s\n", rtl::OUStringToOString(suVariant, osl_getThreadTextEncoding()).getStr()); + printf("Variant: %s\n", rtl::OUStringToOString(suVariant, osl_getThreadTextEncoding()).getStr()); 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()); + printf("Variant: %s\n", rtl::OUStringToOString(suVariant, osl_getThreadTextEncoding()).getStr()); CPPUNIT_ASSERT_MESSAGE("locale variant must be 'hochdeutsch'", suVariant.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("hochdeutsch")))); } @@ -241,6 +254,8 @@ public: // initialise your test code values here. void setUp() { + // start message + rtl_locale::setDefaultLocale(); } void tearDown() @@ -252,14 +267,14 @@ public: { rtl::OLocale aLocale = ::rtl::OLocale::getDefault(); sal_Int32 nHashCode = aLocale.hashCode(); - t_print("Hashcode: %d\n", nHashCode); + printf("Hashcode: %d\n", nHashCode); CPPUNIT_ASSERT_MESSAGE("locale hashcode must be 3831", nHashCode != 0); } void hashCode_002() { rtl::OLocale aLocale = ::rtl::OLocale::getDefault(); sal_Int32 nHashCode = rtl_locale_hashCode(aLocale.getData()); - t_print("Hashcode: %d\n", nHashCode); + printf("Hashcode: %d\n", nHashCode); CPPUNIT_ASSERT_MESSAGE("locale hashcode must be 3831", nHashCode != 0); } @@ -280,6 +295,8 @@ public: // initialise your test code values here. void setUp() { + // start message + rtl_locale::setDefaultLocale(); } void tearDown() @@ -304,7 +321,7 @@ public: 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); + printf("rtl_locale_equals() result: %d\n", nEqual); CPPUNIT_ASSERT(nEqual != 0); } @@ -319,13 +336,13 @@ public: }; // class equals // ----------------------------------------------------------------------------- -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_locale::getDefault, "rtl_locale"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_locale::setDefault, "rtl_locale"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_locale::getLanguage, "rtl_locale"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_locale::getCountry, "rtl_locale"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_locale::getVariant, "rtl_locale"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_locale::hashCode, "rtl_locale"); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_locale::equals, "rtl_locale"); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_locale::getDefault); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_locale::setDefault); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_locale::getLanguage); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_locale::getCountry); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_locale::getVariant); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_locale::hashCode); +CPPUNIT_TEST_SUITE_REGISTRATION(rtl_locale::equals); } // namespace rtl_locale @@ -333,14 +350,7 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_locale::equals, "rtl_locale"); // this macro creates an empty function, which will called by the RegisterAllFunctions() // to let the user the possibility to also register some functions by hand. -// NOADDITIONAL; -void RegisterAdditionalFunctions(FktRegFuncPtr) -{ - // start message - t_print("Initializing ...\n" ); - rtl_locale::setDefaultLocale(); - t_print("Initialization Done.\n" ); -} +CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |