tests: Use g_test_skip() instead of a message in GDateTime tests

There are some GDateTime tests which need to be skipped if changing the
locale fails. Use g_test_skip() to do that, rather than just a
human-readable message.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2017-11-21 12:42:42 +00:00
parent ca32be3bf2
commit 0dc68e5d46

View File

@ -1415,14 +1415,13 @@ test_non_utf8_printf (void)
setlocale (LC_ALL, "ja_JP.eucjp"); setlocale (LC_ALL, "ja_JP.eucjp");
if (strstr (setlocale (LC_ALL, NULL), "ja_JP") == NULL) if (strstr (setlocale (LC_ALL, NULL), "ja_JP") == NULL)
{ {
g_test_message ("locale ja_JP.eucjp not available, skipping non-UTF8 tests"); g_test_skip ("locale ja_JP.eucjp not available, skipping non-UTF8 tests");
g_free (oldlocale); g_free (oldlocale);
return; return;
} }
if (g_get_charset (NULL)) if (g_get_charset (NULL))
{ {
g_test_message ("locale ja_JP.eucjp may be available, but glib seems to think that it's equivalent to UTF-8, skipping non-UTF-8 tests."); g_test_skip ("locale ja_JP.eucjp may be available, but glib seems to think that it's equivalent to UTF-8, skipping non-UTF-8 tests. This is a known issue on Darwin");
g_test_message ("This is a known issue on Darwin");
setlocale (LC_ALL, oldlocale); setlocale (LC_ALL, oldlocale);
g_free (oldlocale); g_free (oldlocale);
return; return;
@ -1545,7 +1544,7 @@ test_modifiers (void)
TEST_PRINTF_DATE (2011, 7, 1, "%_Om", " \333\267"); /* ' 7' */ TEST_PRINTF_DATE (2011, 7, 1, "%_Om", " \333\267"); /* ' 7' */
} }
else else
g_test_message ("locale fa_IR not available, skipping O modifier tests"); g_test_skip ("locale fa_IR not available, skipping O modifier tests");
setlocale (LC_ALL, oldlocale); setlocale (LC_ALL, oldlocale);
g_free (oldlocale); g_free (oldlocale);
} }