X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6e4ae332ac7d85be3592640ffef56a60924cc1c9..cfcc02a8a4f019e3846b73660209080602e44967:/tests/xlocale/xlocale.cpp diff --git a/tests/xlocale/xlocale.cpp b/tests/xlocale/xlocale.cpp index 9a6ba3aa36..07172bb09c 100644 --- a/tests/xlocale/xlocale.cpp +++ b/tests/xlocale/xlocale.cpp @@ -65,8 +65,11 @@ void XLocaleTestCase::TestCtor() CPPUNIT_ASSERT( wxXLocale("C").IsOk() ); #ifdef wxHAS_XLOCALE_SUPPORT CPPUNIT_ASSERT( wxXLocale(wxLANGUAGE_FRENCH).IsOk() ); - CPPUNIT_ASSERT( wxXLocale("fr_FR").IsOk() ); +#ifdef __WXMSW__ CPPUNIT_ASSERT( wxXLocale("french").IsOk() ); +#else + CPPUNIT_ASSERT( wxXLocale("fr_FR").IsOk() ); +#endif #endif CPPUNIT_ASSERT( !wxXLocale("bloordyblop").IsOk() ); } @@ -148,20 +151,20 @@ void XLocaleTestCase::TestCtypeFunctionsWith(const wxXLocale& loc) CPPUNIT_ASSERT( !wxIsxdigit_l('z', loc) ); // tolower - CPPUNIT_ASSERT_EQUAL( 'a', wxTolower_l('A', loc) ); - CPPUNIT_ASSERT_EQUAL( 'a', wxTolower_l('a', loc) ); - CPPUNIT_ASSERT_EQUAL( 'z', wxTolower_l('Z', loc) ); - CPPUNIT_ASSERT_EQUAL( 'z', wxTolower_l('z', loc) ); - CPPUNIT_ASSERT_EQUAL( '0', wxTolower_l('0', loc) ); - CPPUNIT_ASSERT_EQUAL( '9', wxTolower_l('9', loc) ); + CPPUNIT_ASSERT_EQUAL( 'a', (char)wxTolower_l('A', loc) ); + CPPUNIT_ASSERT_EQUAL( 'a', (char)wxTolower_l('a', loc) ); + CPPUNIT_ASSERT_EQUAL( 'z', (char)wxTolower_l('Z', loc) ); + CPPUNIT_ASSERT_EQUAL( 'z', (char)wxTolower_l('z', loc) ); + CPPUNIT_ASSERT_EQUAL( '0', (char)wxTolower_l('0', loc) ); + CPPUNIT_ASSERT_EQUAL( '9', (char)wxTolower_l('9', loc) ); // toupper - CPPUNIT_ASSERT_EQUAL( 'A', wxToupper_l('A', loc) ); - CPPUNIT_ASSERT_EQUAL( 'A', wxToupper_l('a', loc) ); - CPPUNIT_ASSERT_EQUAL( 'Z', wxToupper_l('Z', loc) ); - CPPUNIT_ASSERT_EQUAL( 'Z', wxToupper_l('z', loc) ); - CPPUNIT_ASSERT_EQUAL( '0', wxToupper_l('0', loc) ); - CPPUNIT_ASSERT_EQUAL( '9', wxToupper_l('9', loc) ); + CPPUNIT_ASSERT_EQUAL( 'A', (char)wxToupper_l('A', loc) ); + CPPUNIT_ASSERT_EQUAL( 'A', (char)wxToupper_l('a', loc) ); + CPPUNIT_ASSERT_EQUAL( 'Z', (char)wxToupper_l('Z', loc) ); + CPPUNIT_ASSERT_EQUAL( 'Z', (char)wxToupper_l('z', loc) ); + CPPUNIT_ASSERT_EQUAL( '0', (char)wxToupper_l('0', loc) ); + CPPUNIT_ASSERT_EQUAL( '9', (char)wxToupper_l('9', loc) ); } void XLocaleTestCase::TestCtypeFunctions() @@ -169,13 +172,15 @@ void XLocaleTestCase::TestCtypeFunctions() TestCtypeFunctionsWith(wxCLocale); #ifdef wxHAS_XLOCALE_SUPPORT - wxXLocale locFR("fr_FR"); + wxXLocale locFR(wxLANGUAGE_FRENCH); + CPPUNIT_ASSERT( locFR.IsOk() ); // doesn't make sense to continue otherwise + TestCtypeFunctionsWith(locFR); - CPPUNIT_ASSERT( wxIsalpha_l('é', locFR) ); - CPPUNIT_ASSERT( wxIslower_l('é', locFR) ); - CPPUNIT_ASSERT( !wxIslower_l('É', locFR) ); - CPPUNIT_ASSERT( wxIsupper_l('É', locFR) ); + CPPUNIT_ASSERT( wxIsalpha_l('\xe9', locFR) ); + CPPUNIT_ASSERT( wxIslower_l('\xe9', locFR) ); + CPPUNIT_ASSERT( !wxIslower_l('\xc9', locFR) ); + CPPUNIT_ASSERT( wxIsupper_l('\xc9', locFR) ); #endif }