From f6032b754fd76ebbf0ae6ec4f3c8b2616add0e91 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 8 Jun 2020 18:03:22 +0100 Subject: tests: Update the locale use Create the PangoContext for the test after resetting the locale, and use the en_US.utf8 name, as it seems to be the name used by Fedora. --- tests/test-layout.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/test-layout.c') diff --git a/tests/test-layout.c b/tests/test-layout.c index 623b7a70..52617ce6 100644 --- a/tests/test-layout.c +++ b/tests/test-layout.c @@ -305,7 +305,7 @@ test_layout (gconstpointer d) gchar *diff; const char *old_locale = setlocale (LC_ALL, NULL); - setlocale (LC_ALL, "en_US.UTF-8"); + setlocale (LC_ALL, "en_US.utf8"); if (strstr (setlocale (LC_ALL, NULL), "en_US") == NULL) { char *msg = g_strdup_printf ("Locale en_US.UTF-8 not available, skipping layout %s", filename); @@ -314,6 +314,9 @@ test_layout (gconstpointer d) return; } + if (context == NULL) + context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); + expected_file = get_expected_filename (filename); dump = g_string_sized_new (0); @@ -355,8 +358,6 @@ main (int argc, char *argv[]) g_test_init (&argc, &argv, NULL); - context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); - /* allow to easily generate expected output for new test cases */ if (argc > 1) { -- cgit v1.2.1