summaryrefslogtreecommitdiff
path: root/tests/test-striconveh.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-03-03 19:11:45 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-03-03 19:11:45 +0100
commit7cf710f6587e71a193a55d84dd6d8ae1a8a69ce0 (patch)
treedb628840acea83dbccaf5676b89579a80e02ef51 /tests/test-striconveh.c
parentd83e85a2e6064c36f6ad3c848e39d8b8c101c4f7 (diff)
parent00893e79fc62966067af1a106567db96bd170338 (diff)
Update upstream source from tag 'upstream/1.2'
Update to upstream version '1.2' with Debian dir 16dafe941db3036235f48227f29c6a73587c376d
Diffstat (limited to 'tests/test-striconveh.c')
-rw-r--r--tests/test-striconveh.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/tests/test-striconveh.c b/tests/test-striconveh.c
index 15627f3d..71dfc3f7 100644
--- a/tests/test-striconveh.c
+++ b/tests/test-striconveh.c
@@ -1,5 +1,5 @@
/* Test of character set conversion with error handling.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -68,7 +68,7 @@ main ()
iconv_t cd_88592_to_utf8 = iconv_open ("UTF-8", "ISO-8859-2");
iconv_t cd_utf8_to_88592 = iconv_open ("ISO-8859-2", "UTF-8");
iconv_t cd_utf7_to_utf8 = iconv_open ("UTF-8", "UTF-7");
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
iconv_t cd_ascii_to_gb18030 = iconv_open ("GB18030", "ASCII");
iconv_t cd_utf8_to_gb18030 = iconv_open ("GB18030", "UTF-8");
iconv_t cd_88591_to_gb18030 = iconv_open ("GB18030", "ISO-8859-1");
@@ -82,7 +82,7 @@ main ()
iconveh_t cdeh_88591_to_utf8;
iconveh_t cdeh_utf8_to_88591;
iconveh_t cdeh_utf7_to_utf8;
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
iconveh_t cdeh_ascii_to_gb18030;
iconveh_t cdeh_88591_to_gb18030;
iconveh_t cdeh_utf7_to_gb18030;
@@ -93,7 +93,7 @@ main ()
ASSERT (cd_utf8_to_88591 != (iconv_t)(-1));
ASSERT (cd_88592_to_utf8 != (iconv_t)(-1));
ASSERT (cd_utf8_to_88592 != (iconv_t)(-1));
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
ASSERT (cd_ascii_to_gb18030 != (iconv_t)(-1));
ASSERT (cd_utf8_to_gb18030 != (iconv_t)(-1));
# endif
@@ -130,7 +130,7 @@ main ()
cdeh_utf7_to_utf8.cd1 = cd_utf7_to_utf8;
cdeh_utf7_to_utf8.cd2 = (iconv_t)(-1);
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
cdeh_ascii_to_gb18030.cd = cd_ascii_to_gb18030;
cdeh_ascii_to_gb18030.cd1 = cd_ascii_to_utf8;
cdeh_ascii_to_gb18030.cd2 = cd_utf8_to_gb18030;
@@ -330,7 +330,7 @@ main ()
}
}
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
/* Test conversion from ISO-8859-1 to GB18030 with no errors. */
for (h = 0; h < SIZEOF (handlers); h++)
{
@@ -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 && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || ((__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];
@@ -646,7 +648,7 @@ main ()
free (result);
}
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
/* Test conversion from UTF-7 to GB18030 with EINVAL. */
for (h = 0; h < SIZEOF (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 && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || ((__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];
@@ -922,7 +926,7 @@ main ()
free (result);
}
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
/* Test conversion from ISO-8859-1 to GB18030 with no errors. */
for (h = 0; h < SIZEOF (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 && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || ((__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];
@@ -1201,7 +1207,7 @@ main ()
}
}
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
/* Test conversion from ISO-8859-1 to GB18030 with no errors. */
for (h = 0; h < SIZEOF (handlers); h++)
{
@@ -1421,7 +1427,7 @@ main ()
free (result);
}
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
/* Test conversion from ISO-8859-1 to GB18030 with no errors. */
for (h = 0; h < SIZEOF (handlers); h++)
{