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() );
}
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()
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
}