On macOS 12.5, I'm seeing this test failure:

$ ./test-striconveha
../../tests/test-striconveha.c:426: assertion 'retval == 0' failed

Apparently the transliteration of /usr/lib/libiconv.2.dylib does
not work like the GNU libiconv one.
Either this is a copy of GNU libiconv 1.11 with modified transliteration,
or it's a backport of the bastard Apple iconv that they deploy on newer
macOS releases since fall 2023.

This patch avoids the failure.


2024-02-24  Bruno Haible  <br...@clisp.org>

        striconveha tests: Avoid test failure on macOS 12.5.
        * tests/test-striconveha.c (main): Skip transliteration tests when using
        Apple's modified GNU libiconv or the bastard Apple iconv.

diff --git a/tests/test-striconveha.c b/tests/test-striconveha.c
index c401177e29..376f3cb603 100644
--- a/tests/test-striconveha.c
+++ b/tests/test-striconveha.c
@@ -406,7 +406,7 @@ main ()
     }
 # endif
 
-# if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) && !defined 
__UCLIBC__) || _LIBICONV_VERSION >= 0x0105
+# if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) && !defined 
__UCLIBC__) || (_LIBICONV_VERSION >= 0x0105 && !(_LIBICONV_VERSION == 0x10b && 
defined __APPLE__))
   /* Test conversion from UTF-8 to ISO-8859-1 with transliteration.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {
@@ -586,7 +586,7 @@ main ()
     }
 # endif
 
-# if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) && !defined 
__UCLIBC__) || _LIBICONV_VERSION >= 0x0105
+# if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) && !defined 
__UCLIBC__) || (_LIBICONV_VERSION >= 0x0105 && !(_LIBICONV_VERSION == 0x10b && 
defined __APPLE__))
   /* Test conversion from UTF-8 to ISO-8859-1 with transliteration.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {




Reply via email to