diff --git a/tests/intl/intltest.cpp b/tests/intl/intltest.cpp index b5c34d9b03..40f31f06bd 100644 --- a/tests/intl/intltest.cpp +++ b/tests/intl/intltest.cpp @@ -123,7 +123,8 @@ void IntlTestCase::Headers() CPPUNIT_ASSERT_EQUAL( "", m_locale->GetHeaderValue("X-Not-Here") ); } -static void CompareFormats(const wxString& expected, wxString actual) +static void +CompareFormats(const char *msg, const wxString& expected, wxString actual) { if ( actual.empty() ) { @@ -138,7 +139,7 @@ static void CompareFormats(const wxString& expected, wxString actual) actual.Replace("%e", "%d"); #endif // __GLIBC__ - CPPUNIT_ASSERT_EQUAL( expected, actual ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( msg, expected, actual ); } void IntlTestCase::DateTimeFmt() @@ -149,25 +150,31 @@ void IntlTestCase::DateTimeFmt() #ifdef __GLIBC__ // glibc also uses dots for French locale separator for some reason (the // standard format uses slashes) - static const char *FRENCH_DATE_FMT = "%d.%m.%y"; + static const char *FRENCH_DATE_FMT = "%d.%m.%Y"; #else static const char *FRENCH_DATE_FMT = "%d/%m/%y"; #endif - CompareFormats( FRENCH_DATE_FMT, m_locale->GetInfo(wxLOCALE_SHORT_DATE_FMT) ); - CompareFormats( "%a %d %b %Y", m_locale->GetInfo(wxLOCALE_LONG_DATE_FMT) ); - CompareFormats( "%a %d %b %Y %H:%M:%S %Z", + CompareFormats( "French short date", FRENCH_DATE_FMT, + m_locale->GetInfo(wxLOCALE_SHORT_DATE_FMT) ); + CompareFormats( "French long date", "%a %d %b %Y", + m_locale->GetInfo(wxLOCALE_LONG_DATE_FMT) ); + CompareFormats( "French date and time", "%a %d %b %Y %H:%M:%S %Z", m_locale->GetInfo(wxLOCALE_DATE_TIME_FMT) ); - CompareFormats( "%H:%M:%S", m_locale->GetInfo(wxLOCALE_TIME_FMT) ); + CompareFormats( "French time", "%H:%M:%S", + m_locale->GetInfo(wxLOCALE_TIME_FMT) ); // also test for "C" locale setlocale(LC_ALL, "C"); - CompareFormats( "%m/%d/%y", m_locale->GetInfo(wxLOCALE_SHORT_DATE_FMT) ); - CompareFormats( "%a %b %d %Y", m_locale->GetInfo(wxLOCALE_LONG_DATE_FMT) ); - CompareFormats( "%a %b %d %H:%M:%S %Y", + CompareFormats( "C short date", "%m/%d/%y", + m_locale->GetInfo(wxLOCALE_SHORT_DATE_FMT) ); + CompareFormats( "C long date", "%a %b %d %Y", + m_locale->GetInfo(wxLOCALE_LONG_DATE_FMT) ); + CompareFormats( "C date and time", "%a %b %d %H:%M:%S %Y", m_locale->GetInfo(wxLOCALE_DATE_TIME_FMT) ); - CompareFormats( "%H:%M:%S", m_locale->GetInfo(wxLOCALE_TIME_FMT) ); + CompareFormats( "C time", "%H:%M:%S", + m_locale->GetInfo(wxLOCALE_TIME_FMT) ); } #endif // wxUSE_INTL