fixes for Italian locale: ignore a final 'CET' string and don't test '%p' for it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59682 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -648,6 +648,14 @@ void DateTimeTestCase::TestTimeFormat()
|
||||
for ( size_t n = 0; n < WXSIZEOF(formatTestFormats); n++ )
|
||||
{
|
||||
const char *fmt = formatTestFormats[n].format;
|
||||
|
||||
// skip the check with %p for those locales which have empty AM/PM strings:
|
||||
// for those locales it's impossible to pass the test with %p...
|
||||
wxString am, pm;
|
||||
wxDateTime::GetAmPmStrings(&am, &pm);
|
||||
if (am.empty() && pm.empty() && wxStrstr(fmt, "%p") != NULL)
|
||||
continue;
|
||||
|
||||
wxString s = dt.Format(fmt);
|
||||
|
||||
// what can we recover?
|
||||
@@ -663,8 +671,12 @@ void DateTimeTestCase::TestTimeFormat()
|
||||
}
|
||||
else // conversion succeeded
|
||||
{
|
||||
// should have parsed the entire string
|
||||
CPPUNIT_ASSERT( !*result );
|
||||
// ParseFormat() should have parsed the entire string or left
|
||||
// some final useless strings (e.g. with Italian locale the
|
||||
// 's' string for the first test date looks like
|
||||
// "---> sab 29 mag 1976 18:30:00 CET"
|
||||
// so we just need to ignore CET)
|
||||
CPPUNIT_ASSERT( !*result || strcmp(result, "CET") == 0 );
|
||||
|
||||
switch ( kind )
|
||||
{
|
||||
|
Reference in New Issue
Block a user