From 9cadb90b35af5820bc1ee9f527fcf92a2f145cb3 Mon Sep 17 00:00:00 2001 From: Rafal Luzynski Date: Tue, 13 Mar 2018 01:02:11 +0100 Subject: [PATCH] tests: Compare month names case-insensitively This patch relaxes the comparison rules and allow the month names to be in a mixed case. Translators should be allowed to provide the month names in a different case (lower/upper case, not grammatical case) from the content of glibc because it is disputable at the moment whether the month names should follow the language rules strictly and be titlecased only if it is obligatory to titlecase them or they should be also titlecased in the standalone case. Hopefully in future a conversion specifier will be invented to control the upper/lower case individually. https://bugzilla.gnome.org/show_bug.cgi?id=793645 --- glib/tests/gdatetime.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c index b06e2eacc..5a2190d5f 100644 --- a/glib/tests/gdatetime.c +++ b/glib/tests/gdatetime.c @@ -1330,8 +1330,12 @@ GDateTime *__dt = g_date_time_new_local (2009, 10, 24, 0, 0, 0);\ #define TEST_PRINTF_DATE(y,m,d,f,o) G_STMT_START { \ GDateTime *dt = g_date_time_new_local (y, m, d, 0, 0, 0); \ gchar *p = g_date_time_format (dt, (f)); \ - g_assert_cmpstr (p, ==, (o)); \ + gchar *o_casefold = g_utf8_casefold (o, -1); \ + gchar *p_casefold = g_utf8_casefold (p, -1); \ + g_assert_cmpstr (p_casefold, ==, (o_casefold)); \ g_date_time_unref (dt); \ + g_free (p_casefold); \ + g_free (o_casefold); \ g_free (p); } G_STMT_END #define TEST_PRINTF_TIME(h,m,s,f,o) G_STMT_START { \