Commit 5574315b authored by Ting-Wei Lan's avatar Ting-Wei Lan

tests: Fix tests that fail with non-English locales

Some tests check whether the translated messages are expected, so we have to
force the use of English locales for them.

https://bugzilla.gnome.org/show_bug.cgi?id=748610
parent f9af40a1
......@@ -379,7 +379,7 @@ main (int argc, char** argv)
3000, 3001, 3002, 3998, 3999, 4000, 4001, 4002, 4003
};
g_setenv ("LANG", "en_US.utf-8", TRUE);
g_setenv ("LC_ALL", "en_US.utf-8", TRUE);
setlocale (LC_ALL, "");
#ifdef G_OS_WIN32
SetThreadLocale (MAKELCID (MAKELANGID (LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT));
......
......@@ -905,6 +905,7 @@ int
main (int argc,
char *argv[])
{
g_setenv ("LC_ALL", "C", TRUE);
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/fileutils/build-path", test_build_path);
......
......@@ -373,6 +373,7 @@ TestCase error_cases[] = /* error cases */
int
main (int argc, char **argv)
{
g_setenv ("LC_ALL", "C", TRUE);
g_test_init (&argc, &argv, NULL);
add_tests (test, "/glib/markup/subparser/success", test_cases);
add_tests (test, "/glib/markup/subparser/failure", error_cases);
......
......@@ -71,8 +71,6 @@ print_help (GOptionContext *options, gchar **argv)
gint argc = 3;
GError *error = NULL;
g_setenv ("LANG", "C", TRUE);
g_option_context_parse (options, &argc, &argv, &error);
g_option_context_free (options);
exit(0);
......@@ -2487,6 +2485,7 @@ main (int argc,
int i;
gchar *test_name;
g_setenv ("LC_ALL", "C", TRUE);
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("http://bugzilla.gnome.org/");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment