tests: properly set locale to C
authorRyan Lortie <desrt@desrt.ca>
Thu, 12 Sep 2013 18:22:56 +0000 (14:22 -0400)
committerRyan Lortie <desrt@desrt.ca>
Thu, 12 Sep 2013 18:40:24 +0000 (14:40 -0400)
We're testing for particular error messages, so we need to set to a C
locale to make sure we get the untranslated version.

Previously, this test set the LANG environment variable, but that's not
good enough if LANGUAGE is also set.  The only way to ensure that
LANGUAGE is ignored is to disable l10n with LC_ALL=C.

glib/tests/markup-parse.c

index 00e9336..29e88e2 100644 (file)
@@ -277,7 +277,7 @@ main (int argc, char *argv[])
   const gchar *name;
   gchar *path;
 
-  g_setenv ("LANG", "en_US.utf-8", TRUE);
+  g_setenv ("LC_ALL", "C", TRUE);
   setlocale (LC_ALL, "");
 
   g_test_init (&argc, &argv, NULL);