[pango/pango2-windows] test-layout: Skip test on Visual Studio



commit 24fdb6552a2de47ec55aa36865ccef2296957016
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Jun 17 16:29:26 2022 +0800

    test-layout: Skip test on Visual Studio
    
    The setlocale() call with the UTF-8 locale is supported on Windows 10
    1809 or later, but is not enough for the purposes of the test program,
    so skip this test on Visual Studio builds.

 tests/test-layout.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/tests/test-layout.c b/tests/test-layout.c
index 54bfbfeb..093f31d2 100644
--- a/tests/test-layout.c
+++ b/tests/test-layout.c
@@ -46,10 +46,20 @@ test_layout (gconstpointer d)
   PangoLayout *layout;
 
   char *old_locale = g_strdup (setlocale (LC_ALL, NULL));
+  gboolean skip_test = FALSE;
   setlocale (LC_ALL, "en_US.UTF-8");
-  if (strstr (setlocale (LC_ALL, NULL), "en_US") == NULL)
+
+  skip_test = (strstr (setlocale (LC_ALL, NULL), "en_US") == NULL);
+
+#ifdef _MSC_VER
+  /* later UCRT versions allows setlocale using en_US.UTF-8 but is not enough to support items in this test 
*/
+  if (!skip_test)
+    skip_test = TRUE;
+#endif
+
+  if (skip_test)
     {
-      char *msg = g_strdup_printf ("Locale en_US.UTF-8 not available, skipping layout %s", filename);
+      char *msg = g_strdup_printf ("Locale en_US.UTF-8 not available or is insufficient, skipping layout 
%s", filename);
       g_test_skip (msg);
       g_free (msg);
       g_free (old_locale);


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