diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2020-06-08 17:30:12 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2020-06-08 17:30:12 +0100 |
commit | 984ed4597d51a1f81f6bb9006dc503901cc6401a (patch) | |
tree | b781c1f1da595acbe19149793c3b5c8d5f7da60c | |
parent | 85167fff28951658fa89b3bcfe13a78176d2a8d7 (diff) | |
download | pango-984ed4597d51a1f81f6bb9006dc503901cc6401a.tar.gz |
Skip test-break when the en_US locale is missing
Just like test-layout and test-itemize.
-rw-r--r-- | tests/test-break.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/test-break.c b/tests/test-break.c index f4faaab3..e92cbe8e 100644 --- a/tests/test-break.c +++ b/tests/test-break.c @@ -241,6 +241,16 @@ test_break (gconstpointer d) GString *dump; gchar *diff; + const char *old_locale = setlocale (LC_ALL, NULL); + setlocale (LC_ALL, "en_US.UTF-8"); + if (strstr (setlocale (LC_ALL, NULL), "en_US") == NULL) + { + char *msg = g_strdup_printf ("Locale en_US.UTF-8 not available, skipping break %s", filename); + g_test_skip (msg); + g_free (msg); + return; + } + expected_file = get_expected_filename (filename); dump = g_string_sized_new (0); @@ -260,6 +270,8 @@ test_break (gconstpointer d) g_string_free (dump, TRUE); g_free (expected_file); + + setlocale (LC_ALL, old_locale); } int @@ -270,9 +282,6 @@ main (int argc, char *argv[]) const gchar *name; gchar *path; - g_setenv ("LC_ALL", "en_US.UTF-8", TRUE); - setlocale (LC_ALL, ""); - g_test_init (&argc, &argv, NULL); context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); |