Avoid test failures on OSF/1, IRIX, HP-UX, AIX.
authorBruno Haible <bruno@clisp.org>
Thu, 29 Mar 2007 23:05:45 +0000 (23:05 +0000)
committerBruno Haible <bruno@clisp.org>
Thu, 29 Mar 2007 23:05:45 +0000 (23:05 +0000)
tests/test-striconveh.c
tests/test-striconveha.c
tests/uniconv/test-u16-conv-from-enc.c
tests/uniconv/test-u16-strconv-from-enc.c
tests/uniconv/test-u32-conv-from-enc.c
tests/uniconv/test-u32-strconv-from-enc.c
tests/uniconv/test-u8-conv-from-enc.c
tests/uniconv/test-u8-strconv-from-enc.c

index 31b7b721d12d6188af2061039c4aca180590f4c7..bb72662eaa18d1f081af4324e3606fc47a992d32 100644 (file)
@@ -64,8 +64,6 @@ 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");
 
-  ASSERT (cd_88591_to_88592 != (iconv_t)(-1));
-  ASSERT (cd_88592_to_88591 != (iconv_t)(-1));
   ASSERT (cd_88591_to_utf8 != (iconv_t)(-1));
   ASSERT (cd_utf8_to_88591 != (iconv_t)(-1));
   ASSERT (cd_88592_to_utf8 != (iconv_t)(-1));
@@ -457,8 +455,10 @@ main ()
       free (result);
     }
 
-  iconv_close (cd_88591_to_88592);
-  iconv_close (cd_88592_to_88591);
+  if (cd_88591_to_88592 != (iconv_t)(-1))
+    iconv_close (cd_88591_to_88592);
+  if (cd_88592_to_88591 != (iconv_t)(-1))
+    iconv_close (cd_88592_to_88591);
   iconv_close (cd_88591_to_utf8);
   iconv_close (cd_utf8_to_88591);
   iconv_close (cd_88592_to_utf8);
index f105161e767fd2d742e403cd9e0ab4a04b3ff693..6717856dcb75599b71fd45712d55699a16d55e75 100644 (file)
@@ -311,6 +311,8 @@ main ()
        }
     }
 
+  /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2.  */
+# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__)
   /* Test conversions from autodetect_jp to UTF-8.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {
@@ -402,6 +404,7 @@ main ()
          free (result);
        }
     }
+# endif
 
 # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 || _LIBICONV_VERSION >= 0x0105
   /* Test conversion from UTF-8 to ISO-8859-1 with transliteration.  */
index 65287263342c516300155ad9d45b72d388c7f726..506af0ec70523ca8d5b4ab9c1d478e3cea36110b 100644 (file)
@@ -122,6 +122,8 @@ main ()
        }
     }
 
+  /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2.  */
+# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__)
   /* Test conversions from autodetect_jp to UTF-16.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {
@@ -219,6 +221,7 @@ main ()
          free (result);
        }
     }
+# endif
 
 #endif
 
index a4be00c8864500938a019a86cdacc3cab0d7fb9a..ea805d67b74bd8cf3f987e8f902995b070807ce8 100644 (file)
@@ -74,6 +74,8 @@ main ()
       free (result);
     }
 
+  /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2.  */
+# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__)
   /* Test conversions from autodetect_jp to UTF-16.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {
@@ -114,6 +116,7 @@ main ()
       ASSERT (u16_strcmp (result, expected) == 0);
       free (result);
     }
+# endif
 
 #endif
 
index 4ca4f1ad0c3daa05c035ae7b0dc30aa226a5b9fc..3226767ba2b0258d8bc65b349f6ceef5555270af 100644 (file)
@@ -122,6 +122,8 @@ main ()
        }
     }
 
+  /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2.  */
+# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__)
   /* Test conversions from autodetect_jp to UTF-16.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {
@@ -219,6 +221,7 @@ main ()
          free (result);
        }
     }
+# endif
 
 #endif
 
index ab648cbc2ea65678153728e6d89a937de33ca6f7..ab8b86c147a95738b5b897796a7f75e1ec28617c 100644 (file)
@@ -74,6 +74,8 @@ main ()
       free (result);
     }
 
+  /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2.  */
+# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__)
   /* Test conversions from autodetect_jp to UTF-16.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {
@@ -114,6 +116,7 @@ main ()
       ASSERT (u32_strcmp (result, expected) == 0);
       free (result);
     }
+# endif
 
 #endif
 
index 69e44d54a6ec2daf997ca3d4d9d82caec704c54f..e74bc5893db7c898ef5343c86cc3a75fddd7f78f 100644 (file)
@@ -117,6 +117,8 @@ main ()
        }
     }
 
+  /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2.  */
+# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__)
   /* Test conversions from autodetect_jp to UTF-8.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {
@@ -205,6 +207,7 @@ main ()
          free (result);
        }
     }
+# endif
 
 #endif
 
index 6193bfa9c0bf9cf63d84ae9645a652b1bf528043..2d640992e00cc624d71629e6a407d6877a056fe4 100644 (file)
@@ -65,6 +65,8 @@ main ()
       free (result);
     }
 
+  /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2.  */
+# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__)
   /* Test conversions from autodetect_jp to UTF-8.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {
@@ -96,6 +98,7 @@ main ()
       ASSERT (u8_strcmp (result, expected) == 0);
       free (result);
     }
+# endif
 
 #endif