diff --git a/tests/test-localename.c b/tests/test-localename.c index c0952a1..74b7a93 100644 --- a/tests/test-localename.c +++ b/tests/test-localename.c @@ -155,7 +155,16 @@ test_locale_name (void) if (setlocale (LC_ALL, "") != NULL) { name = gl_locale_name (LC_CTYPE, "LC_CTYPE"); +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, here, + gl_locale_name_thread (LC_CTYPE, "LC_CTYPE") + may return either "de_DE" or NULL, whereas + gl_locale_name_posix (LC_CTYPE, "LC_CTYPE") + returns "de_DE.UTF-8". */ + ASSERT (strcmp (name, "de_DE") == 0 || strcmp (name, "de_DE.UTF-8") == 0); +#else ASSERT (strcmp (name, "de_DE.UTF-8") == 0); +#endif name = gl_locale_name (LC_MESSAGES, "LC_MESSAGES"); ASSERT (strcmp (name, "fr_FR.UTF-8") == 0); } @@ -473,8 +482,11 @@ test_locale_name_thread (void) } } #else - /* Check that gl_locale_name_thread always returns NULL. */ + /* Check that gl_locale_name_thread always returns NULL, + except on native Windows. */ +# if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) ASSERT (gl_locale_name_thread (LC_CTYPE, "LC_CTYPE") == NULL); +# endif ASSERT (gl_locale_name_thread (LC_MESSAGES, "LC_MESSAGES") == NULL); #endif }