diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2018-07-17 20:16:50 +0200 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2018-07-17 20:51:47 +0200 |
commit | 27eb6b4290c74c582691ccaa3cd2ce5fa6c0a708 (patch) | |
tree | afc0adeb01017a31acd438b0732edf4512c5f268 | |
parent | bb8420f117d27c89a9ae49a374b336e43dc7c1b2 (diff) | |
download | glib-27eb6b4290c74c582691ccaa3cd2ce5fa6c0a708.tar.gz |
tests: Compare month names case-insensitively in date tests
This has the same rationale as the corresponding change to the gdatetime
tests; commit 9cadb90b35af5820bc1ee9f527fcf92a2f145cb3.
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
https://gitlab.gnome.org/GNOME/glib/issues/1447
-rw-r--r-- | glib/tests/date.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/glib/tests/date.c b/glib/tests/date.c index b1057d932..106e5c1f3 100644 --- a/glib/tests/date.c +++ b/glib/tests/date.c @@ -212,15 +212,21 @@ test_month_names (void) g_test_skip ("libc doesn’t support all alternative month names"); #else -#define TEST_DATE(d,m,y,f,o) \ +#define TEST_DATE(d,m,y,f,o) G_STMT_START { \ + gchar *o_casefold, *buf_casefold; \ g_date_set_dmy (gdate, d, m, y); \ g_date_strftime (buf, 100, f, gdate); \ - g_assert_cmpstr (buf, ==, (o)); \ + buf_casefold = g_utf8_casefold (buf, -1); \ + o_casefold = g_utf8_casefold ((o), -1); \ + g_assert_cmpstr (buf_casefold, ==, o_casefold); \ + g_free (buf_casefold); \ + g_free (o_casefold); \ g_date_set_parse (gdate, buf); \ g_assert (g_date_valid (gdate)); \ g_assert_cmpint (g_date_get_day (gdate), ==, d); \ g_assert_cmpint (g_date_get_month (gdate), ==, m); \ - g_assert_cmpint (g_date_get_year (gdate), ==, y); + g_assert_cmpint (g_date_get_year (gdate), ==, y); \ +} G_STMT_END oldlocale = g_strdup (setlocale (LC_ALL, NULL)); #ifdef G_OS_WIN32 |