summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2020-06-08 18:03:22 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2020-06-08 18:03:22 +0100
commitf6032b754fd76ebbf0ae6ec4f3c8b2616add0e91 (patch)
treec044b208b8be4607b7184685015b1e7d9ee732be
parentc3de8bca2d084e90a77d50db40447f145520e4f5 (diff)
downloadpango-f6032b754fd76ebbf0ae6ec4f3c8b2616add0e91.tar.gz
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.
-rw-r--r--tests/test-break.c7
-rw-r--r--tests/test-itemize.c6
-rw-r--r--tests/test-layout.c7
3 files changed, 11 insertions, 9 deletions
diff --git a/tests/test-break.c b/tests/test-break.c
index cdb7e6c0..49eaa653 100644
--- a/tests/test-break.c
+++ b/tests/test-break.c
@@ -242,7 +242,7 @@ test_break (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 break %s", filename);
@@ -251,6 +251,9 @@ test_break (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);
@@ -293,8 +296,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)
{
diff --git a/tests/test-itemize.c b/tests/test-itemize.c
index 1709b834..3c58e18f 100644
--- a/tests/test-itemize.c
+++ b/tests/test-itemize.c
@@ -238,7 +238,7 @@ test_itemize (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 itemization %s", filename);
@@ -247,6 +247,8 @@ test_itemize (gconstpointer d)
return;
}
+ context = pango_font_map_create_context (pango_cairo_font_map_get_default ());
+
expected_file = get_expected_filename (filename);
dump = g_string_sized_new (0);
@@ -289,8 +291,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)
{
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)
{