+ CPPUNIT_ASSERT( wxIsalpha_l(wxT('\xe9'), locFR) );
+ CPPUNIT_ASSERT( wxIslower_l(wxT('\xe9'), locFR) );
+ CPPUNIT_ASSERT( !wxIslower_l(wxT('\xc9'), locFR) );
+ CPPUNIT_ASSERT( wxIsupper_l(wxT('\xc9'), locFR) );
+ CPPUNIT_ASSERT( wxIsalpha_l(wxT('\xe7'), locFR) );
+ CPPUNIT_ASSERT( wxIslower_l(wxT('\xe7'), locFR) );
+ CPPUNIT_ASSERT( wxIsupper_l(wxT('\xc7'), locFR) );
+
+
+ // italian
+
+ if (!wxLocale::IsAvailable(wxLANGUAGE_ITALIAN))
+ return; // you should have italian support installed to continue this test!
+
+ wxXLocale locIT(wxLANGUAGE_ITALIAN);
+ CPPUNIT_ASSERT( locIT.IsOk() ); // doesn't make sense to continue otherwise
+
+ TestCtypeFunctionsWith(locIT);
+
+ CPPUNIT_ASSERT( wxIsalpha_l(wxT('\xe1'), locIT) );
+ CPPUNIT_ASSERT( wxIslower_l(wxT('\xe1'), locIT) );
+#endif
+}
+
+void XLocaleTestCase::TestStdlibFunctions()
+{
+ TestStdlibFunctionsWith(wxCLocale);
+
+#if wxUSE_UNICODE
+ wchar_t* endptr;
+#else
+ char* endptr;
+#endif
+
+ // strtod checks specific for C locale
+ endptr = NULL;
+ CPPUNIT_ASSERT_EQUAL( 0.0, wxStrtod_l(wxT("0.000"), NULL, wxCLocale) );
+ CPPUNIT_ASSERT_EQUAL( 1.234, wxStrtod_l(wxT("1.234"), NULL, wxCLocale) );
+ CPPUNIT_ASSERT_EQUAL( -1.234E-5, wxStrtod_l(wxT("-1.234E-5"), NULL, wxCLocale) );
+ CPPUNIT_ASSERT_EQUAL( 365.24, wxStrtod_l(wxT("365.24 29.53"), &endptr, wxCLocale) );
+ CPPUNIT_ASSERT_EQUAL( 29.53, wxStrtod_l(endptr, NULL, wxCLocale) );
+
+#ifdef wxHAS_XLOCALE_SUPPORT
+
+ // french
+
+ if (!wxLocale::IsAvailable(wxLANGUAGE_FRENCH))
+ return; // you should have french support installed to continue this test!
+
+ wxXLocale locFR(wxLANGUAGE_FRENCH);
+ CPPUNIT_ASSERT( locFR.IsOk() ); // doesn't make sense to continue otherwise
+
+ TestCtypeFunctionsWith(locFR);
+
+ // comma as decimal point:
+ CPPUNIT_ASSERT_EQUAL( 1.234, wxStrtod_l(wxT("1,234"), NULL, locFR) );
+
+ // space as thousands separator is not recognized by wxStrtod_l():
+ CPPUNIT_ASSERT( 1234.5 != wxStrtod_l(wxT("1 234,5"), NULL, locFR) );
+
+
+ // italian
+
+ if (!wxLocale::IsAvailable(wxLANGUAGE_ITALIAN))
+ return; // you should have italian support installed to continue this test!
+
+ wxXLocale locIT(wxLANGUAGE_ITALIAN);
+ CPPUNIT_ASSERT( locIT.IsOk() ); // doesn't make sense to continue otherwise
+
+ TestStdlibFunctionsWith(locIT);
+
+ // comma as decimal point:
+ CPPUNIT_ASSERT_EQUAL( 1.234, wxStrtod_l(wxT("1,234"), NULL, locIT) );
+
+ // dot as thousands separator is not recognized by wxStrtod_l():
+ CPPUNIT_ASSERT( 1234.5 != wxStrtod_l(wxT("1.234,5"), NULL, locIT) );