I did: > 2024-05-21 Bruno Haible <br...@clisp.org> > > mcel tests: Run the test in several locales. > * tests/test-mcel-1.sh: New file, based on tests/test-mbrtowc-1.sh. > * tests/test-mcel-2.sh: New file, based on tests/test-mbrtowc-2.sh. > * tests/test-mcel-3.sh: New file, based on tests/test-mbrtowc-3.sh. > * tests/test-mcel-4.sh: New file, based on tests/test-mbrtowc-4.sh. > * tests/test-mcel-5.sh: New file, based on tests/test-mbrtowc-5.sh.
This patch was incomplete. Other tests of the GB18030 locale are skipped on platforms where the GB18030 converter is known to be buggy. The same thing needs to be done here. 2024-05-25 Bruno Haible <br...@clisp.org> mcel tests: Avoid test failures due to broken GB18030 converter. * tests/test-mcel.c (main): Skip most GB18030 tests on platforms where the GB18030 converter is known to be broken. diff --git a/tests/test-mcel.c b/tests/test-mcel.c index ab6b7dd8d3..e0e9f87814 100644 --- a/tests/test-mcel.c +++ b/tests/test-mcel.c @@ -44,7 +44,7 @@ test_mcel_vs_mbrtoc32 (unsigned char uc, mcel_t c, size_t n, char32_t ch) } int -main (void) +main (int argc, char *argv[]) { /* configure should already have checked that the locale is supported. */ if (setlocale (LC_ALL, "") == NULL) @@ -75,6 +75,18 @@ main (void) if (ch == CHAR_MAX) break; } + + if (argc > 1 && argv[1][0] == '5') + { + /* Locale encoding is GB18030. */ + if (test_exit_status != EXIT_SUCCESS) + return test_exit_status; + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) + fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); + return 77; + #endif + } + for (int ch = 0x80; ch < 0x200; ch++) { mcel_t c = mcel_ch (ch, 2);