glib/tests: fix checking two-digit years on Windows

Fixes:
ok 10 /date/parse_locale_change

(when locale th_TH available)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2022-01-25 00:42:04 +04:00 committed by Philip Withnall
parent acb46f8b36
commit 051d000acd

View File

@ -1068,7 +1068,14 @@ test_parse_locale_change (void)
g_date_set_parse (&date, "07/04/76");
g_assert_cmpint (g_date_get_day (&date), ==, 4);
g_assert_cmpint (g_date_get_month (&date), ==, 7);
#ifdef G_OS_WIN32
/* Windows g_date_strftime() implementation doesn't use twodigit_years */
/* FIXME: check if the function can be changed to return 4 digit years instead
* See https://gitlab.gnome.org/GNOME/glib/-/issues/2604 */
g_assert_cmpint (g_date_get_year (&date), ==, 76);
#else
g_assert_cmpint (g_date_get_year (&date), ==, 1976);
#endif
setlocale (LC_ALL, "");
}