On macOS 15.4, the test-trim3.sh unit test randomly succeeds or fails:

FAIL: test-trim3.sh
===================

../../tests/test-trim.c:143: assertion 'strcmp (result, "\241\244foo") == 0' 
failed
../../tests/test-trim3.sh: line 15: 61193 Abort trap: 6           
LC_ALL=$LOCALE_ZH_CN ${CHECKER} ./test-trim${EXEEXT} 3
FAIL test-trim3.sh (exit status: 134)

My conclusion is that the GB18030 locale in macOS is broken.


2025-04-15  Bruno Haible  <br...@clisp.org>

        trim tests: Avoid test failures on macOS 15.4.
        * tests/test-trim.c (main): On macOS, disable test cases that randomly
        succeed or fail on macOS 15.4.

diff --git a/tests/test-trim.c b/tests/test-trim.c
index 68842b22ca..bca0afe3df 100644
--- a/tests/test-trim.c
+++ b/tests/test-trim.c
@@ -137,6 +137,10 @@ main (int argc, char *argv[])
 
       case '3':
         /* Locale encoding is GB18030.  */
+        #if (defined __APPLE__ && defined __MACH__) /* As of macOS 15.4 */
+        fputs ("Skipping test: The character properties in the GB18030 locale 
on this system are broken.\n", stderr);
+        return 77;
+        #endif
         #if !(defined __FreeBSD__ || defined __DragonFly__ || defined __sun)
         { /* U+2002 EN SPACE */
           char *result = trim ("\201\066\243\070\241\244foo\201\066\243\070");




Reply via email to