From: Bruno Haible <bruno@clisp.org>
Date: Wed, 18 Dec 2019 10:10:20 +0000 (+0100)
Subject: hard-locale: Avoid test failure on Haiku.
X-Git-Tag: v1.0~4482
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=9b3418df8ef2a9ab70f8dab5790ce3ab729c2233;p=gnulib.git

hard-locale: Avoid test failure on Haiku.

* tests/test-hard-locale.c (test_one): Treat Haiku like recent OpenBSD.
---

diff --git a/ChangeLog b/ChangeLog
index d0d4d11865..2f41e5e8a7 100644
--- 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.
diff --git a/tests/test-hard-locale.c b/tests/test-hard-locale.c
index f83dc27f5e..0ebfd40e22 100644
--- a/tests/test-hard-locale.c
+++ b/tests/test-hard-locale.c
@@ -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;