diff --git a/tests/intl/intltest.cpp b/tests/intl/intltest.cpp index 57cfb44096..a7e90e71bb 100644 --- a/tests/intl/intltest.cpp +++ b/tests/intl/intltest.cpp @@ -180,7 +180,7 @@ void IntlTestCase::DateTimeFmtFrench() static const char *FRENCH_DATE_FMT = "%d.%m.%Y"; #endif static const char *FRENCH_LONG_DATE_FMT = "%a %d %b %Y"; - static const char *FRENCH_DATE_TIME_FMT = "%a %d %b %Y %H:%M:%S %Z"; + static const char *FRENCH_DATE_TIME_FMT = "%a %d %b %Y %H:%M:%S"; #else static const char *FRENCH_DATE_FMT = "%d/%m/%Y"; static const char *FRENCH_LONG_DATE_FMT = "%A %d %B %Y"; @@ -192,15 +192,24 @@ void IntlTestCase::DateTimeFmtFrench() WX_ASSERT_EQUAL_FORMAT( "French long date", FRENCH_LONG_DATE_FMT, wxLocale::GetInfo(wxLOCALE_LONG_DATE_FMT) ); - const wxString fmtDT = wxLocale::GetInfo(wxLOCALE_DATE_TIME_FMT); + wxString fmtDT = wxLocale::GetInfo(wxLOCALE_DATE_TIME_FMT); + INFO("French date and time format is \"" << fmtDT << "\""); + #ifdef __WXOSX__ // Things are difficult to test under macOS as the format keeps changing, // e.g. at some time between 10.10 and 10.12 a new " à " string appeared in // its middle, so test it piece-wise and hope it doesn't change too much. - INFO("French date and time format is \"" << fmtDT << "\""); CHECK( fmtDT.StartsWith("%A %d %B %Y") ); CHECK( fmtDT.EndsWith("%H:%M:%S") ); #else + // Some glic versions have " %Z" at the end of the locale and some don't. + // The test is still useful if we just ignore this difference. + #ifdef __GLIBC__ + wxString fmtDTWithoutTZ; + if ( fmtDT.EndsWith(" %Z", &fmtDTWithoutTZ) ) + fmtDT.swap(fmtDTWithoutTZ); + #endif + WX_ASSERT_EQUAL_FORMAT( "French date and time", FRENCH_DATE_TIME_FMT, fmtDT ); #endif WX_ASSERT_EQUAL_FORMAT( "French time", "%H:%M:%S",