Remove "C" locale date and time formats test
This test didn't make sense at all as it didn't actually test "C" locale formats as calling setlocale(LC_ALL, "C") didn't actually change the values returned by wxLocale::GetInfo(), so it still returned the values corresponding to the French locale set in this test setUp() method and the test only passed because it used wrong values (i.e. the same ones as in French locale test). We also don't have any simple way to test "C" locale formats, we can only test them for wxLANGUAGE_DEFAULT, but this corresponds to the OS defaults which can be customized by user (e.g. in the control panel under MSW) and so we can't expect them to be equal to any fixed values. The simplest solution is to just drop this test, as it's not very useful anyhow (French locale test above already covers the same code).
This commit is contained in:
@@ -42,7 +42,6 @@ private:
|
|||||||
CPPUNIT_TEST( Domain );
|
CPPUNIT_TEST( Domain );
|
||||||
CPPUNIT_TEST( Headers );
|
CPPUNIT_TEST( Headers );
|
||||||
CPPUNIT_TEST( DateTimeFmtFrench );
|
CPPUNIT_TEST( DateTimeFmtFrench );
|
||||||
CPPUNIT_TEST( DateTimeFmtC );
|
|
||||||
CPPUNIT_TEST( IsAvailable );
|
CPPUNIT_TEST( IsAvailable );
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
|
||||||
@@ -50,7 +49,6 @@ private:
|
|||||||
void Domain();
|
void Domain();
|
||||||
void Headers();
|
void Headers();
|
||||||
void DateTimeFmtFrench();
|
void DateTimeFmtFrench();
|
||||||
void DateTimeFmtC();
|
|
||||||
void IsAvailable();
|
void IsAvailable();
|
||||||
|
|
||||||
static wxString GetDecimalPoint()
|
static wxString GetDecimalPoint()
|
||||||
@@ -212,35 +210,6 @@ void IntlTestCase::DateTimeFmtFrench()
|
|||||||
m_locale->GetInfo(wxLOCALE_TIME_FMT) );
|
m_locale->GetInfo(wxLOCALE_TIME_FMT) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void IntlTestCase::DateTimeFmtC()
|
|
||||||
{
|
|
||||||
// again, glibc uses different defaults
|
|
||||||
#ifdef __GLIBC__
|
|
||||||
static const char *C_DATE_FMT = "%m/%d/%y";
|
|
||||||
static const char *C_LONG_DATE_FMT = "%a %b %d %Y";
|
|
||||||
static const char *C_DATE_TIME_FMT = "%a %b %d %H:%M:%S %Y";
|
|
||||||
#else
|
|
||||||
static const char *C_DATE_FMT = "%d/%m/%Y";
|
|
||||||
static const char *C_LONG_DATE_FMT = "%A %d %B %Y";
|
|
||||||
#ifdef __WXOSX__
|
|
||||||
static const char *C_DATE_TIME_FMT = "%A %d %B %Y %H:%M:%S";
|
|
||||||
#else
|
|
||||||
static const char *C_DATE_TIME_FMT = "%d/%m/%Y %H:%M:%S";
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
setlocale(LC_ALL, "C");
|
|
||||||
|
|
||||||
WX_ASSERT_EQUAL_FORMAT( "C short date", C_DATE_FMT,
|
|
||||||
m_locale->GetInfo(wxLOCALE_SHORT_DATE_FMT) );
|
|
||||||
WX_ASSERT_EQUAL_FORMAT( "C long date", C_LONG_DATE_FMT,
|
|
||||||
m_locale->GetInfo(wxLOCALE_LONG_DATE_FMT) );
|
|
||||||
WX_ASSERT_EQUAL_FORMAT( "C date and time", C_DATE_TIME_FMT,
|
|
||||||
m_locale->GetInfo(wxLOCALE_DATE_TIME_FMT) );
|
|
||||||
WX_ASSERT_EQUAL_FORMAT( "C time", "%H:%M:%S",
|
|
||||||
m_locale->GetInfo(wxLOCALE_TIME_FMT) );
|
|
||||||
}
|
|
||||||
|
|
||||||
void IntlTestCase::IsAvailable()
|
void IntlTestCase::IsAvailable()
|
||||||
{
|
{
|
||||||
const wxString origLocale(setlocale(LC_ALL, NULL));
|
const wxString origLocale(setlocale(LC_ALL, NULL));
|
||||||
|
Reference in New Issue
Block a user