[glib: 2/5] glib/tests: fix checking two-digit years on Windows
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 2/5] glib/tests: fix checking two-digit years on Windows
- Date: Wed, 16 Feb 2022 00:07:54 +0000 (UTC)
commit 051d000acd4e6a88e02e1df2bdc5e443ce5aecec
Author: Marc-André Lureau <marcandre lureau redhat com>
Date: Tue Jan 25 00:42:04 2022 +0400
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>
glib/tests/date.c | 7 +++++++
1 file changed, 7 insertions(+)
---
diff --git a/glib/tests/date.c b/glib/tests/date.c
index 87f4c2da0..5a799dc05 100644
--- a/glib/tests/date.c
+++ b/glib/tests/date.c
@@ -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, "");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]