]> Savannah Git Hosting - gnulib.git/commitdiff
hard-locale: Avoid test failure on Haiku.
authorBruno Haible <bruno@clisp.org>
Wed, 18 Dec 2019 10:10:20 +0000 (11:10 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 18 Dec 2019 10:10:20 +0000 (11:10 +0100)
* tests/test-hard-locale.c (test_one): Treat Haiku like recent OpenBSD.

ChangeLog
tests/test-hard-locale.c

index d0d4d11865e25243331a17087f1d5c5fcfa44ceb..2f41e5e8a711d715fcbdbcd19512c4403df381b9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-12-18  Bruno Haible  <bruno@clisp.org>
+
+       hard-locale: Avoid test failure on Haiku.
+       * tests/test-hard-locale.c (test_one): Treat Haiku like recent OpenBSD.
+
 2019-12-18  Bruno Haible  <bruno@clisp.org>
 
        setlocale-null: Handle NULL result from setlocale.
@@ -5,16 +10,6 @@
        * lib/setlocale_null.c (setlocale_null_unlocked): Handle NULL result
        from setlocale or _wsetlocale.
 
-2019-12-18  Bruno Haible  <bruno@clisp.org>
-
-       hard-locale: Make multithread-safe.
-       * lib/hard-locale.h (hard_locale): Move documentation to here.
-       * lib/hard-locale.c: Don't include <stdlib.h>.
-       (GLIBC_VERSION): Remove macro.
-       (hard_locale): Assume that all systems name the "C" and "POSIX" locales
-       "C" or "POSIX". Invoke setlocale_null instead of setlocale.
-       * modules/hard-locale (Depends-on): Remove strdup. Add setlocale-null.
-
 2019-12-18  Bruno Haible  <bruno@clisp.org>
 
        hard-locale: Add test.
index f83dc27f5e125a123e340a88b9cd5293f3ad5ea2..0ebfd40e2252ce9f7ba9377288c2944f9a8608a9 100644 (file)
@@ -39,8 +39,8 @@ test_one (const char *name, int failure_bitmask)
       /* musl libc has special code for the C.UTF-8 locale; other than that,
          all locale names are accepted and all locales are trivial.
          OpenBSD returns the locale name that was set, but we don't know how it
-         behaves under the hood.  */
-#if defined MUSL_LIBC || defined __OpenBSD__
+         behaves under the hood.  Likewise for Haiku.  */
+#if defined MUSL_LIBC || defined __OpenBSD__ || defined __HAIKU__
       expected = true;
 #else
       expected = !all_trivial;
@@ -63,7 +63,7 @@ test_one (const char *name, int failure_bitmask)
       expected = false;
 #elif defined MUSL_LIBC
       expected = strcmp (name, "C.UTF-8") != 0;
-#elif defined __OpenBSD__ && HAVE_DUPLOCALE /* OpenBSD >= 6.2 */
+#elif (defined __OpenBSD__ && HAVE_DUPLOCALE) || defined __HAIKU__ /* OpenBSD >= 6.2, Haiku */
       expected = true;
 #else
       expected = !all_trivial;