Commit 9b3418df authored by Bruno Haible's avatar Bruno Haible
Browse files

hard-locale: Avoid test failure on Haiku.

* tests/test-hard-locale.c (test_one): Treat Haiku like recent OpenBSD.
parent e144ded4
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.
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment