Merge branch 'fix_gdate_tests' into 'main'

Fix unit test on date format '%Z' which is too versatile to be trustable

See merge request GNOME/glib!2482
This commit is contained in:
Philip Withnall 2022-02-15 11:46:59 +00:00
commit 27798cda22

View File

@ -722,7 +722,6 @@ test_strftime (void)
{ "%X", "12:00:00 AM" }, { "%X", "12:00:00 AM" },
{ "%x", "" }, { "%x", "" },
{ "%Y", "0001" }, { "%Y", "0001" },
{ "%Z", "Pacific Standard Time" },
#else #else
{ "%B", "January" }, { "%B", "January" },
{ "%b", "Jan" }, { "%b", "Jan" },
@ -802,6 +801,11 @@ test_strftime (void)
g_assert_cmpstr (buf, ==, strftime_checks[i].expect); g_assert_cmpstr (buf, ==, strftime_checks[i].expect);
} }
/* Time zone is too versatile on OS_WIN32 to be checked precisely */
#ifdef G_OS_WIN32
g_assert_cmpint (g_date_strftime (buf, sizeof (buf), "%Z", d), !=, 0);
#endif
g_date_free (d); g_date_free (d);
setlocale (LC_ALL, oldlocale); setlocale (LC_ALL, oldlocale);