+2023-06-13 Bruno Haible <bruno@clisp.org>
+
+ Make internationalization tests stricter on musl systems.
+ --
+ * m4/locale-fr.m4 (gt_LOCALE_FR): On musl systems, set LOCALE_FR_UTF8 to
+ "fr_FR.UTF-8" instead of "none". Set and substitute
+ LC_COLLATE_IMPLEMENTED, LC_NUMERIC_IMPLEMENTED, LC_TIME_IMPLEMENTED,
+ LC_MONETARY_IMPLEMENTED.
+ * m4/iswdigit.m4 (gl_FUNC_ISWDIGIT): Skip testing a certain locale if
+ that locale is "none".
+ * m4/iswxdigit.m4 (gl_FUNC_ISWXDIGIT): Likewise.
+ * m4/mbrlen.m4 (gl_MBRLEN_RETVAL): Likewise.
+ * m4/mbrtowc.m4 (gl_MBRTOWC_RETVAL): Likewise.
+ * m4/mbrtoc32.m4 (gl_MBRTOC32_SANITYCHECK): Likewise.
+ * m4/mbsrtowcs.m4 (gl_MBSRTOWCS_WORKS): Likewise.
+ * m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Likewise.
+ --
+ * tests/test-c32isalpha.c (main): On musl libc, disable tests that fail.
+ * tests/test-c32iscntrl.c (main): Likewise.
+ * tests/test-c32isgraph.c (main): Likewise.
+ * tests/test-c32islower.c (main): Likewise.
+ * tests/test-c32isprint.c (main): Likewise.
+ * tests/test-c32toupper.c (main): Likewise.
+ * tests/test-nl_langinfo1.c (main): Likewise.
+ * tests/test-nl_langinfo2.c (main): Likewise.
+ * modules/c32isalpha-tests (Files): Add musl.m4.
+ (configure.ac): Invoke gl_MUSL_LIBC.
+ * modules/c32iscntrl-tests (Files): Add musl.m4.
+ (configure.ac): Invoke gl_MUSL_LIBC.
+ * modules/c32isgraph-tests (Files): Add musl.m4.
+ (configure.ac): Invoke gl_MUSL_LIBC.
+ * modules/c32islower-tests (Files): Add musl.m4.
+ (configure.ac): Invoke gl_MUSL_LIBC.
+ * modules/c32isprint-tests (Files): Add musl.m4.
+ (configure.ac): Invoke gl_MUSL_LIBC.
+ * modules/c32toupper-tests (Files): Add musl.m4.
+ (configure.ac): Invoke gl_MUSL_LIBC.
+ * modules/nl_langinfo-tests (Files): Add musl.m4.
+ (configure.ac): Invoke gl_MUSL_LIBC.
+ --
+ * tests/test-strtod1.sh: Skip the test if LC_NUMERIC_IMPLEMENTED is
+ false.
+ * tests/test-strtold1.sh: Likewise.
+ * tests/test-vasnprintf-posix2.sh: Likewise.
+ * tests/test-vasnwprintf-posix2.sh: Likewise.
+ * modules/strtod-tests (Makefile.am): Set LC_NUMERIC_IMPLEMENTED in the
+ tests environment.
+ * modules/strtold-tests (Makefile.am): Likewise.
+ * modules/vasnprintf-posix-tests (Makefile.am): Likewise.
+ * modules/vasnwprintf-posix-tests (Makefile.am): Likewise.
+
2023-06-12 Bruno Haible <bruno@clisp.org>
vasnwprintf-posix: Work around another musl libc bug.
-# iswdigit.m4 serial 3
+# iswdigit.m4 serial 4
dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
int is;
int result = 0;
- if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+ if (strcmp ("$LOCALE_FR", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_FR") != NULL)
{
/* This fails on mingw, MSVC 14. */
/* U+00B2 SUPERSCRIPT TWO */
if (!(is == 0))
result |= 1;
}
- if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ if (strcmp ("$LOCALE_JA", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_JA") != NULL)
{
/* This fails on NetBSD 8.0. */
/* U+FF11 FULLWIDTH DIGIT ONE */
if (!(is == 0))
result |= 2;
}
- if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ if (strcmp ("$LOCALE_FR_UTF8", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
{
/* This fails on FreeBSD 13.0, NetBSD 8.0, MSVC 14. */
/* U+0663 ARABIC-INDIC DIGIT THREE */
if (!(is == 0))
result |= 8;
}
- if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ if (strcmp ("$LOCALE_ZH_CN", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
{
/* This fails on NetBSD 8.0, Solaris 10, Solaris 11.4. */
/* U+FF11 FULLWIDTH DIGIT ONE */
-# iswxdigit.m4 serial 3
+# iswxdigit.m4 serial 4
dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
int is;
int result = 0;
- if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ if (strcmp ("$LOCALE_JA", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_JA") != NULL)
{
/* This fails on NetBSD 8.0. */
/* U+FF21 FULLWIDTH LATIN CAPITAL LETTER A */
if (!(is == 0))
result |= 1;
}
- if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ if (strcmp ("$LOCALE_FR_UTF8", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
{
/* This fails on FreeBSD 13.0. */
/* U+0663 ARABIC-INDIC DIGIT THREE */
if (!(is == 0))
result |= 4;
}
- if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ if (strcmp ("$LOCALE_ZH_CN", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
{
/* This fails on Solaris 10, Solaris 11.4. */
/* U+FF11 FULLWIDTH DIGIT ONE */
dnl Determine the name of a french locale with UTF-8 encoding.
AC_DEFUN_ONCE([gt_LOCALE_FR_UTF8],
[
+ AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AM_LANGINFO_CODESET])
AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [
- AC_LANG_CONFTEST([AC_LANG_SOURCE([[
+ case "$host_os" in
+ *-musl* | midipix*)
+ dnl On musl libc, all kinds of ll_CC.UTF-8 locales exist, even without
+ dnl any locale file on disk. But they are effectively equivalent to the
+ dnl C.UTF-8 locale, except for locale categories (such as LC_MESSSAGES)
+ dnl for which localizations (.mo files) have been installed.
+ gt_cv_locale_fr_utf8=fr_FR.UTF-8
+ ;;
+ *)
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
#include <locale.h>
#include <time.h>
#if HAVE_LANGINFO_CODESET
#endif
return 0;
}
- ]])])
- if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
- case "$host_os" in
- # Handle native Windows specially, because there setlocale() interprets
- # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
- # "fr" or "fra" as "French" or "French_France.1252",
- # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
- # "ja" as "Japanese" or "Japanese_Japan.932",
- # and similar.
- mingw*)
- # Test for the hypothetical native Windows locale name.
- if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
- gt_cv_locale_fr_utf8=French_France.65001
- else
- # None found.
- gt_cv_locale_fr_utf8=none
- fi
- ;;
- *)
- # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
- # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
- # configure script would override the LC_ALL setting. Likewise for
- # LC_CTYPE, which is also set at the beginning of the configure script.
- # Test for the usual locale name.
- if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
- gt_cv_locale_fr_utf8=fr_FR
- else
- # Test for the locale name with explicit encoding suffix.
- if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
- gt_cv_locale_fr_utf8=fr_FR.UTF-8
- else
- # Test for the Solaris 7 locale name.
- if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
- gt_cv_locale_fr_utf8=fr.UTF-8
+ ]])])
+ if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
+ case "$host_os" in
+ # Handle native Windows specially, because there setlocale() interprets
+ # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+ # "fr" or "fra" as "French" or "French_France.1252",
+ # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+ # "ja" as "Japanese" or "Japanese_Japan.932",
+ # and similar.
+ mingw*)
+ # Test for the hypothetical native Windows locale name.
+ if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=French_France.65001
else
# None found.
gt_cv_locale_fr_utf8=none
fi
- fi
- fi
- ;;
- esac
- fi
- rm -fr conftest*
+ ;;
+ *)
+ # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
+ # configure script would override the LC_ALL setting. Likewise for
+ # LC_CTYPE, which is also set at the beginning of the configure script.
+ # Test for the usual locale name.
+ if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=fr_FR
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=fr_FR.UTF-8
+ else
+ # Test for the Solaris 7 locale name.
+ if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=fr.UTF-8
+ else
+ # None found.
+ gt_cv_locale_fr_utf8=none
+ fi
+ fi
+ fi
+ ;;
+ esac
+ fi
+ rm -fr conftest*
+ ;;
+ esac
])
LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
AC_SUBST([LOCALE_FR_UTF8])
+
+ dnl Users of $LOCALE_FR_UTF8 need to know which of the locale categories they
+ dnl can rely on.
+ case "$host_os" in
+ *-musl* | midipix*)
+ dnl On musl libc, locale categories other than LC_CTYPE and LC_MESSAGES
+ dnl are effectively unimplemented.
+ LC_COLLATE_IMPLEMENTED=false
+ LC_NUMERIC_IMPLEMENTED=false
+ LC_TIME_IMPLEMENTED=false
+ LC_MONETARY_IMPLEMENTED=false
+ ;;
+ *)
+ LC_COLLATE_IMPLEMENTED=true
+ LC_NUMERIC_IMPLEMENTED=true
+ LC_TIME_IMPLEMENTED=true
+ LC_MONETARY_IMPLEMENTED=true
+ ;;
+ esac
+ AC_SUBST([LC_COLLATE_IMPLEMENTED])
+ AC_SUBST([LC_NUMERIC_IMPLEMENTED])
+ AC_SUBST([LC_TIME_IMPLEMENTED])
+ AC_SUBST([LC_MONETARY_IMPLEMENTED])
])
-# mbrlen.m4 serial 11 -*- coding: utf-8 -*-
+# mbrlen.m4 serial 12 -*- coding: utf-8 -*-
dnl Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
{
int result = 0;
/* This fails on Solaris. */
- if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ if (strcmp ("$LOCALE_FR_UTF8", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
{
char input[] = "B\303\274\303\237er"; /* "Büßer" */
mbstate_t state;
}
}
/* This fails on HP-UX 11.11. */
- if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ if (strcmp ("$LOCALE_JA", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_JA") != NULL)
{
char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
mbstate_t state;
-# mbrtoc32.m4 serial 14
+# mbrtoc32.m4 serial 15
dnl Copyright (C) 2014-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
/* This fails on native Windows:
mbrtoc32 returns (size_t)-1.
mbrtowc returns 1 (correct). */
- if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+ if (strcmp ("$LOCALE_FR", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_FR") != NULL)
{
mbstate_t state;
wchar_t wc = (wchar_t) 0xBADFACE;
/* This fails on FreeBSD 13.0 and Solaris 11.4:
mbrtoc32 returns (size_t)-2 or (size_t)-1.
mbrtowc returns 4 (correct). */
- if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ if (strcmp ("$LOCALE_ZH_CN", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
{
mbstate_t state;
wchar_t wc = (wchar_t) 0xBADFACE;
-# mbrtowc.m4 serial 40 -*- coding: utf-8 -*-
+# mbrtowc.m4 serial 41 -*- coding: utf-8 -*-
dnl Copyright (C) 2001-2002, 2004-2005, 2008-2023 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
int result = 0;
int found_some_locale = 0;
/* This fails on Solaris. */
- if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ if (strcmp ("$LOCALE_FR_UTF8", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
{
char input[] = "B\303\274\303\237er"; /* "Büßer" */
mbstate_t state;
found_some_locale = 1;
}
/* This fails on HP-UX 11.11. */
- if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ if (strcmp ("$LOCALE_JA", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_JA") != NULL)
{
char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
mbstate_t state;
-# mbsrtowcs.m4 serial 15
+# mbsrtowcs.m4 serial 16
dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
int result = 0;
/* Test whether the function supports a NULL destination argument.
This fails on native Windows. */
- if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+ if (strcmp ("$LOCALE_FR", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_FR") != NULL)
{
const char input[] = "\337er";
const char *src = input;
}
/* Test whether the function works when started with a conversion state
in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */
- if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ if (strcmp ("$LOCALE_FR_UTF8", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
{
const char input[] = "B\303\274\303\237er";
mbstate_t state;
result |= 2;
}
}
- if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ if (strcmp ("$LOCALE_JA", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_JA") != NULL)
{
const char input[] = "<\306\374\313\334\270\354>";
mbstate_t state;
result |= 4;
}
}
- if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ if (strcmp ("$LOCALE_ZH_CN", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
{
const char input[] = "B\250\271\201\060\211\070er";
mbstate_t state;
-# wcrtomb.m4 serial 17
+# wcrtomb.m4 serial 18
dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
int main ()
{
int result = 0;
- if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+ if (strcmp ("$LOCALE_FR", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_FR") != NULL)
{
if (wcrtomb (NULL, 0, NULL) != 1)
result |= 1;
}
- if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ if (strcmp ("$LOCALE_FR_UTF8", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
{
if (wcrtomb (NULL, 0, NULL) != 1)
result |= 2;
result |= 2;
}
}
- if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ if (strcmp ("$LOCALE_JA", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_JA") != NULL)
{
if (wcrtomb (NULL, 0, NULL) != 1)
result |= 4;
}
- if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ if (strcmp ("$LOCALE_ZH_CN", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
{
if (wcrtomb (NULL, 0, NULL) != 1)
result |= 8;
m4/locale-ja.m4
m4/locale-zh.m4
m4/codeset.m4
+m4/musl.m4
Depends-on:
mbrtoc32
gt_LOCALE_FR_UTF8
gt_LOCALE_JA
gt_LOCALE_ZH_CN
+gl_MUSL_LIBC
Makefile.am:
TESTS += test-c32isalpha.sh
m4/locale-ja.m4
m4/locale-zh.m4
m4/codeset.m4
+m4/musl.m4
Depends-on:
mbrtoc32
gt_LOCALE_FR_UTF8
gt_LOCALE_JA
gt_LOCALE_ZH_CN
+gl_MUSL_LIBC
Makefile.am:
TESTS += test-c32iscntrl.sh
m4/locale-ja.m4
m4/locale-zh.m4
m4/codeset.m4
+m4/musl.m4
Depends-on:
mbrtoc32
gt_LOCALE_FR_UTF8
gt_LOCALE_JA
gt_LOCALE_ZH_CN
+gl_MUSL_LIBC
Makefile.am:
TESTS += test-c32isgraph.sh
m4/locale-ja.m4
m4/locale-zh.m4
m4/codeset.m4
+m4/musl.m4
Depends-on:
mbrtoc32
gt_LOCALE_FR_UTF8
gt_LOCALE_JA
gt_LOCALE_ZH_CN
+gl_MUSL_LIBC
Makefile.am:
TESTS += test-c32islower.sh
m4/locale-ja.m4
m4/locale-zh.m4
m4/codeset.m4
+m4/musl.m4
Depends-on:
mbrtoc32
gt_LOCALE_FR_UTF8
gt_LOCALE_JA
gt_LOCALE_ZH_CN
+gl_MUSL_LIBC
Makefile.am:
TESTS += test-c32isprint.sh
m4/locale-ja.m4
m4/locale-zh.m4
m4/codeset.m4
+m4/musl.m4
Depends-on:
mbrtoc32
gt_LOCALE_FR_UTF8
gt_LOCALE_JA
gt_LOCALE_ZH_CN
+gl_MUSL_LIBC
Makefile.am:
TESTS += test-c32toupper.sh
m4/locale-fr.m4
m4/codeset.m4
m4/intl-thread-locale.m4
+m4/musl.m4
Depends-on:
c-strcase
gt_LOCALE_FR
gt_LOCALE_FR_UTF8
gt_FUNC_USELOCALE
+gl_MUSL_LIBC
Makefile.am:
TESTS += test-nl_langinfo1.sh test-nl_langinfo2.sh test-nl_langinfo-mt
TESTS += test-strtod1.sh
TESTS_ENVIRONMENT += \
LOCALE_FR='@LOCALE_FR@' \
- LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
+ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+ LC_NUMERIC_IMPLEMENTED='@LC_NUMERIC_IMPLEMENTED@'
check_PROGRAMS += test-strtod1
test_strtod1_LDADD = $(LDADD) $(SETLOCALE_LIB)
TESTS += test-strtold1.sh
TESTS_ENVIRONMENT += \
LOCALE_FR='@LOCALE_FR@' \
- LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
+ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+ LC_NUMERIC_IMPLEMENTED='@LC_NUMERIC_IMPLEMENTED@'
check_PROGRAMS += test-strtold1
test_strtold1_LDADD = $(LDADD) $(SETLOCALE_LIB)
Makefile.am:
TESTS += test-vasnprintf-posix test-vasnprintf-posix2.sh test-vasnprintf-posix3
-TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
+TESTS_ENVIRONMENT += \
+ LOCALE_FR='@LOCALE_FR@' \
+ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+ LC_NUMERIC_IMPLEMENTED='@LC_NUMERIC_IMPLEMENTED@'
check_PROGRAMS += test-vasnprintf-posix test-vasnprintf-posix2 test-vasnprintf-posix3
test_vasnprintf_posix2_LDADD = $(LDADD) $(SETLOCALE_LIB)
test_vasnprintf_posix3_LDADD = $(LDADD) $(SETLOCALE_LIB)
Makefile.am:
TESTS += test-vasnwprintf-posix test-vasnwprintf-posix2.sh test-vasnwprintf-posix3
-TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
+TESTS_ENVIRONMENT += \
+ LOCALE_FR='@LOCALE_FR@' \
+ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+ LC_NUMERIC_IMPLEMENTED='@LC_NUMERIC_IMPLEMENTED@'
check_PROGRAMS += test-vasnwprintf-posix test-vasnwprintf-posix2 test-vasnwprintf-posix3
test_vasnwprintf_posix_LDADD = $(LDADD) $(MBRTOWC_LIB)
test_vasnwprintf_posix2_LDADD = $(LDADD) $(SETLOCALE_LIB) $(MBRTOWC_LIB)
/* U+3001 IDEOGRAPHIC COMMA */
is = for_character ("\343\200\201", 3);
ASSERT (is == 0);
- #if !(defined __GLIBC__ || defined _AIX || defined __sun || defined __CYGWIN__)
+ #if !(defined __GLIBC__ || defined MUSL_LIBC || defined _AIX || defined __sun || defined __CYGWIN__)
/* U+FF11 FULLWIDTH DIGIT ONE */
is = for_character ("\357\274\221", 3);
ASSERT (is == 0);
/* U+00A0 NO-BREAK SPACE */
is = for_character ("\302\240", 2);
ASSERT (is == 0);
- #if !(defined __GLIBC__ || defined __FreeBSD__ || defined __DragonFly__ || defined _AIX || defined __sun || defined __CYGWIN__)
+ #if !(defined __GLIBC__ || defined MUSL_LIBC || defined __FreeBSD__ || defined __DragonFly__ || defined _AIX || defined __sun || defined __CYGWIN__)
/* U+202E RIGHT-TO-LEFT OVERRIDE */
is = for_character ("\342\200\256", 3);
ASSERT (is != 0);
/* U+3000 IDEOGRAPHIC SPACE */
is = for_character ("\343\200\200", 3);
ASSERT (is == 0);
- #if !(defined __GLIBC__ || defined __FreeBSD__ || defined __DragonFly__ || defined _AIX || defined __sun || defined __CYGWIN__)
+ #if !(defined __GLIBC__ || defined MUSL_LIBC || defined __FreeBSD__ || defined __DragonFly__ || defined _AIX || defined __sun || defined __CYGWIN__)
/* U+FEFF ZERO WIDTH NO-BREAK SPACE */
is = for_character ("\357\273\277", 3);
ASSERT (is != 0);
/* U+20000 <CJK Ideograph> */
is = for_character ("\360\240\200\200", 4);
ASSERT (is == 0);
- #if !(defined __GLIBC__ || defined __FreeBSD__ || defined __DragonFly__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__))
+ #if !(defined __GLIBC__ || defined MUSL_LIBC || defined __FreeBSD__ || defined __DragonFly__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__))
/* U+E0001 LANGUAGE TAG */
is = for_character ("\363\240\200\201", 4);
ASSERT (is != 0);
/* U+2002 EN SPACE */
is = for_character ("\342\200\202", 3);
ASSERT (is == 0);
- #if !(defined __GLIBC__ || defined _AIX || defined __sun || defined __CYGWIN__)
+ #if !(defined __GLIBC__ || defined MUSL_LIBC || defined _AIX || defined __sun || defined __CYGWIN__)
/* U+202E RIGHT-TO-LEFT OVERRIDE */
is = for_character ("\342\200\256", 3);
ASSERT (is == 0);
/* U+3000 IDEOGRAPHIC SPACE */
is = for_character ("\343\200\200", 3);
ASSERT (is == 0);
- #if !(defined __GLIBC__ || defined _AIX || defined __sun || defined __CYGWIN__)
+ #if !(defined __GLIBC__ || defined MUSL_LIBC || defined _AIX || defined __sun || defined __CYGWIN__)
/* U+FEFF ZERO WIDTH NO-BREAK SPACE */
is = for_character ("\357\273\277", 3);
ASSERT (is == 0);
is = for_character ("\360\240\200\200", 4);
ASSERT (is != 0);
#endif
- #if !(defined __GLIBC__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__))
+ #if !(defined __GLIBC__ || defined MUSL_LIBC || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__))
/* U+E0001 LANGUAGE TAG */
is = for_character ("\363\240\200\201", 4);
ASSERT (is == 0);
/* U+00B2 SUPERSCRIPT TWO */
is = for_character ("\302\262", 2);
ASSERT (is == 0);
- #if !(defined __GLIBC__ || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__))
+ #if !(defined __GLIBC__ || defined MUSL_LIBC || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__))
/* U+00B5 MICRO SIGN */
is = for_character ("\302\265", 2);
ASSERT (is == 0);
is = for_character ("\342\200\202", 3);
ASSERT (is != 0);
#endif
- #if !(defined __GLIBC__ || defined _AIX || defined __sun || defined __CYGWIN__)
+ #if !(defined __GLIBC__ || defined MUSL_LIBC || defined _AIX || defined __sun || defined __CYGWIN__)
/* U+202E RIGHT-TO-LEFT OVERRIDE */
is = for_character ("\342\200\256", 3);
ASSERT (is == 0);
is = for_character ("\343\200\200", 3);
ASSERT (is != 0);
#endif
- #if !(defined __GLIBC__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__))
+ #if !(defined __GLIBC__ || defined MUSL_LIBC || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__))
/* U+FEFF ZERO WIDTH NO-BREAK SPACE */
is = for_character ("\357\273\277", 3);
ASSERT (is == 0);
is = for_character ("\360\240\200\200", 4);
ASSERT (is != 0);
#endif
- #if !(defined __GLIBC__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__))
+ #if !(defined __GLIBC__ || defined MUSL_LIBC || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__))
/* U+E0001 LANGUAGE TAG */
is = for_character ("\363\240\200\201", 4);
ASSERT (is == 0);
mb = for_character ("\302\262", 2);
ASSERT (mb.nbytes == 2);
ASSERT (memcmp (mb.buf, "\302\262", 2) == 0);
- #if !(defined __GLIBC__ || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__ || defined _AIX || defined __sun || defined __CYGWIN__)
+ #if !(defined __GLIBC__ || defined MUSL_LIBC || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__ || defined _AIX || defined __sun || defined __CYGWIN__)
/* U+00B5 MICRO SIGN */
mb = for_character ("\302\265", 2);
ASSERT (mb.nbytes == 2);
mb = for_character ("\303\211", 2);
ASSERT (mb.nbytes == 2);
ASSERT (memcmp (mb.buf, "\303\211", 2) == 0);
+ #if !defined MUSL_LIBC
/* U+00DF LATIN SMALL LETTER SHARP S */
mb = for_character ("\303\237", 2);
ASSERT (mb.nbytes == 2);
ASSERT (memcmp (mb.buf, "\303\237", 2) == 0);
+ #endif
#if !(defined _WIN32 && !defined __CYGWIN__)
/* U+00E9 LATIN SMALL LETTER E WITH ACUTE */
mb = for_character ("\303\251", 2);
{
const char *currency = nl_langinfo (CRNCYSTR);
ASSERT (strlen (currency) >= 0);
-#if !defined __NetBSD__
+#if !(defined MUSL_LIBC || defined __NetBSD__)
if (pass > 0)
ASSERT (strlen (currency) >= 1);
#endif
ASSERT (c_strcasecmp (fr_CODESET, "UTF-8") == 0
|| c_strcasecmp (fr_CODESET, "UTF8") == 0);
+ /* In musl libc, locales differ at most in the LC_MESSAGES
+ category. */
+ #if !defined MUSL_LIBC
+
/* nl_langinfo items of the LC_NUMERIC category */
const char *fr_RADIXCHAR = nl_langinfo (RADIXCHAR);
ASSERT (strcmp (fr_RADIXCHAR, ",") == 0);
&& strcmp (fr_CRNCYSTR + 1, "€") == 0);
#endif
+ #endif
+
/* nl_langinfo items of the LC_MESSAGES category */
+ /* In musl libc, this works only if the package 'musl-locales' is
+ installed. */
+ #if !defined MUSL_LIBC
const char *fr_YESEXPR = nl_langinfo (YESEXPR);
ASSERT (c_strcasestr (fr_YESEXPR, "o" /* from "oui" */) != NULL);
+ #endif
skipped_all = false;
}
exit 77
fi
+if $LC_NUMERIC_IMPLEMENTED; then
+ :
+else
+ echo "Skipping test: LC_NUMERIC category of locales is not implemented"
+ exit 77
+fi
+
if test $LOCALE_FR != none; then
LC_ALL=$LOCALE_FR ${CHECKER} ./test-strtod1${EXEEXT} || exit 1
fi
exit 77
fi
+if $LC_NUMERIC_IMPLEMENTED; then
+ :
+else
+ echo "Skipping test: LC_NUMERIC category of locales is not implemented"
+ exit 77
+fi
+
if test $LOCALE_FR != none; then
LC_ALL=$LOCALE_FR ${CHECKER} ./test-strtold1${EXEEXT} || exit 1
fi
fi
fi
+if $LC_NUMERIC_IMPLEMENTED; then
+ :
+else
+ echo "Skipping test: LC_NUMERIC category of locales is not implemented"
+ exit 77
+fi
+
LC_ALL=$testlocale \
${CHECKER} ./test-vasnprintf-posix2${EXEEXT}
fi
fi
+if $LC_NUMERIC_IMPLEMENTED; then
+ :
+else
+ echo "Skipping test: LC_NUMERIC category of locales is not implemented"
+ exit 77
+fi
+
LC_ALL=$testlocale \
${CHECKER} ./test-vasnwprintf-posix2${EXEEXT}