From 9b3418df8ef2a9ab70f8dab5790ce3ab729c2233 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 18 Dec 2019 11:10:20 +0100 Subject: [PATCH] hard-locale: Avoid test failure on Haiku. * tests/test-hard-locale.c (test_one): Treat Haiku like recent OpenBSD. --- ChangeLog | 15 +++++---------- tests/test-hard-locale.c | 6 +++--- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index d0d4d11865..2f41e5e8a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2019-12-18 Bruno Haible + + hard-locale: Avoid test failure on Haiku. + * tests/test-hard-locale.c (test_one): Treat Haiku like recent OpenBSD. + 2019-12-18 Bruno Haible 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 - - hard-locale: Make multithread-safe. - * lib/hard-locale.h (hard_locale): Move documentation to here. - * lib/hard-locale.c: Don't include . - (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 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; -- 2.39.5