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() )
{
actual.Replace("%e", "%d");
#endif // __GLIBC__
- CPPUNIT_ASSERT_EQUAL( expected, actual );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( msg, expected, actual );
}
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