From 9e9e323a2dcfb98944a8fadf32637b43ceee5113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 25 Jan 2022 12:14:12 +0400 Subject: [PATCH] glib/tests: set DE ThreadLocale to fix a test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau --- glib/tests/gdatetime.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c index 6714d2e32..a09ae7ee8 100644 --- a/glib/tests/gdatetime.c +++ b/glib/tests/gdatetime.c @@ -2467,6 +2467,12 @@ static void test_GDateTime_strftime_error_handling (void) { gchar *oldlocale; +#ifdef G_OS_WIN32 + LCID old_lcid; + + old_lcid = GetThreadLocale (); + SetThreadLocale (MAKELCID (MAKELANGID (LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT)); +#endif oldlocale = g_strdup (setlocale (LC_ALL, NULL)); setlocale (LC_ALL, "de_DE.utf-8"); @@ -2480,6 +2486,10 @@ test_GDateTime_strftime_error_handling (void) g_test_skip ("locale de_DE not available, skipping error handling tests"); setlocale (LC_ALL, oldlocale); g_free (oldlocale); + +#ifdef G_OS_WIN32 + SetThreadLocale (old_lcid); +#endif } static void