On Slackware 14, I see this test failure:

FAIL: test-striconveh
=====================

../../gltests/test-striconveh.c:510: assertion 'length == strlen (expected)' 
failed
FAIL test-striconveh (exit status: 134)

The conversion produces a question mark instead of the expected U+FFFD
character. Ultimately this can be reduced to a bug in glibc's GB18030 converter:
  printf '\357\277\275' | iconv -f UTF-8 -t GB18030
produces an error on glibc 2.15. It's fixed in glibc 2.16.


2023-04-08  Bruno Haible  <br...@clisp.org>

        striconveh tests: Avoid test failure on glibc 2.15.
        * tests/test-striconveh.c (main): Skip some of the GB18030 tests on
        glibc < 2.16.

diff --git a/tests/test-striconveh.c b/tests/test-striconveh.c
index 2f769fc234..5e72d8e6cb 100644
--- a/tests/test-striconveh.c
+++ b/tests/test-striconveh.c
@@ -462,8 +462,10 @@ main ()
         }
     }
 
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
-  /* Test conversion from ASCII to GB18030 with invalid input (EILSEQ).  */
+# if defined _LIBICONV_VERSION || ((__GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2) 
&& !defined __UCLIBC__)
+  /* Test conversion from ASCII to GB18030 with invalid input (EILSEQ).
+     Note: glibc's GB18030 converter was buggy in glibc-2.15; fixed by
+     Andreas Schwab on 2012-02-06.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {
       enum iconv_ilseq_handler handler = handlers[h];
@@ -746,8 +748,10 @@ main ()
             }
         }
 
-#   if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
-      /* Test conversion from UTF-7 to GB18030 with EILSEQ.  */
+#   if defined _LIBICONV_VERSION || ((__GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2) 
&& !defined __UCLIBC__)
+      /* Test conversion from UTF-7 to GB18030 with EILSEQ.
+         Note: glibc's GB18030 converter was buggy in glibc-2.15; fixed by
+         Andreas Schwab on 2012-02-06.  */
       for (h = 0; h < SIZEOF (handlers); h++)
         {
           enum iconv_ilseq_handler handler = handlers[h];
@@ -985,8 +989,10 @@ main ()
         }
     }
 
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
-  /* Test conversion from ASCII to GB18030 with invalid input (EILSEQ).  */
+# if defined _LIBICONV_VERSION || ((__GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2) 
&& !defined __UCLIBC__)
+  /* Test conversion from ASCII to GB18030 with invalid input (EILSEQ).
+     Note: glibc's GB18030 converter was buggy in glibc-2.15; fixed by
+     Andreas Schwab on 2012-02-06.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {
       enum iconv_ilseq_handler handler = handlers[h];




Reply via email to