summaryrefslogtreecommitdiff
path: root/tests/test-itemize.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-07-10 17:14:39 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-07-21 08:19:53 -0400
commitcd4dde8a3dee8199c545d7f6a5ca9808d9634e7d (patch)
tree7ac3bfc64761c7c7d43ef507e304e2df663a152e /tests/test-itemize.c
parenta4ad59a23a5ab169644bad157a0890c415c5da6c (diff)
downloadpango-cd4dde8a3dee8199c545d7f6a5ca9808d9634e7d.tar.gz
tests: Locale handling fixes
The return value of setlocale is only good until the next call. Also, consistently use en_US.UTF-8.
Diffstat (limited to 'tests/test-itemize.c')
-rw-r--r--tests/test-itemize.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test-itemize.c b/tests/test-itemize.c
index d1447a0f..52556284 100644
--- a/tests/test-itemize.c
+++ b/tests/test-itemize.c
@@ -237,13 +237,14 @@ test_itemize (gconstpointer d)
GString *dump;
gchar *diff;
- const char *old_locale = setlocale (LC_ALL, NULL);
- setlocale (LC_ALL, "en_US.utf8");
+ char *old_locale = g_strdup (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 itemization %s", filename);
g_test_skip (msg);
g_free (msg);
+ g_free (old_locale);
return;
}
@@ -259,6 +260,7 @@ test_itemize (gconstpointer d)
g_assert_no_error (error);
setlocale (LC_ALL, old_locale);
+ g_free (old_locale);
if (diff && diff[0])
{