[glib: 3/6] glib/tests: set DE ThreadLocale to fix a test




commit 9e9e323a2dcfb98944a8fadf32637b43ceee5113
Author: Marc-André Lureau <marcandre lureau redhat com>
Date:   Tue Jan 25 12:14:12 2022 +0400

    glib/tests: set DE ThreadLocale to fix a test
    
    Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>

 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]