* tests/test-c-ctype.c: Include <stdlib.h>.
(main): Test the return value of setlocale(). Try not only de_DE, but
also de_DE.ISO-8859-1.
* tests/test-vasnprintf-posix3.c (main): Try not only fa_IR.UTF-8, but
also fa_IR.
* tests/test-vasnwprintf-posix3.c (main): Likewise.
+2024-07-13 Bruno Haible <bruno@clisp.org>
+
+ tests: Don't depend on the exact locale name.
+ * tests/test-c-ctype.c: Include <stdlib.h>.
+ (main): Test the return value of setlocale(). Try not only de_DE, but
+ also de_DE.ISO-8859-1.
+ * tests/test-vasnprintf-posix3.c (main): Try not only fa_IR.UTF-8, but
+ also fa_IR.
+ * tests/test-vasnwprintf-posix3.c (main): Likewise.
+
2024-07-10 Pip Cet <pipcet@protonmail.com>
timespec-sub: Fix compilation error on clang.
#include <ctype.h>
#include <limits.h>
#include <locale.h>
+#include <stdlib.h>
#include "macros.h"
test_all ();
- setlocale (LC_ALL, "de_DE");
- test_all ();
+ /* Run the tests in a German unibyte locale. */
+ if ((setlocale (LC_ALL, "de_DE") != NULL
+ || setlocale (LC_ALL, "de_DE.ISO-8859-1") != NULL)
+ && MB_CUR_MAX == 1)
+ test_all ();
- setlocale (LC_ALL, "ja_JP.EUC-JP");
- test_all ();
+ /* Run the tests in a traditional Japanese locale. */
+ if (setlocale (LC_ALL, "ja_JP.EUC-JP") != NULL
+ && MB_CUR_MAX == 2)
+ test_all ();
return test_exit_status;
}
{
#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__
/* Select a locale with Arabic 'outdigits'. */
- if (setlocale (LC_ALL, "fa_IR.UTF-8") == NULL)
+ if (setlocale (LC_ALL, "fa_IR.UTF-8") == NULL
+ && setlocale (LC_ALL, "fa_IR") == NULL)
{
fprintf (stderr, "Skipping test: no Iranian locale is installed\n");
return 77;
{
#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__
/* Select a locale with Arabic 'outdigits'. */
- if (setlocale (LC_ALL, "fa_IR.UTF-8") == NULL)
+ if (setlocale (LC_ALL, "fa_IR.UTF-8") == NULL
+ && setlocale (LC_ALL, "fa_IR") == NULL)
{
fprintf (stderr, "Skipping test: no Iranian locale is installed\n");
return 77;