tests: Unset CHARSET when testing locales to avoid it breaking tests

The charset set in `CHARSET` overrides the charset after the `.` in any
`LC_*` category (set via the environment or `setlocale()`). This will
break many tests, but in particular it definitely breaks the
`/GDateTime/format_mixed/` tests which are specifically checking
different charsets being set for different `LC_*` categories.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2514
This commit is contained in:
Philip Withnall 2021-11-26 12:08:02 +00:00
parent 7dc7b84a52
commit 3fecaa3924

View File

@ -3047,6 +3047,10 @@ main (gint argc,
* Unset it to avoid interference with tests using setlocale and translation. */
g_unsetenv ("LANGUAGE");
/* GLib uses CHARSET to allow overriding the character set used for all locale
* categories. Unset it to avoid interference with tests. */
g_unsetenv ("CHARSET");
g_test_init (&argc, &argv, NULL);
/* GDateTime Tests */