projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix a warning in last patch.
[gnulib.git]
/
tests
/
test-striconveha.c
diff --git
a/tests/test-striconveha.c
b/tests/test-striconveha.c
index
6717856
..
e3d120c
100644
(file)
--- a/
tests/test-striconveha.c
+++ b/
tests/test-striconveha.c
@@
-28,11
+28,21
@@
#endif
#include <errno.h>
#endif
#include <errno.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
#include <stdlib.h>
#include <string.h>
#define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+ do \
+ { \
+ if (!(expr)) \
+ { \
+ fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+ abort (); \
+ } \
+ } \
+ while (0)
/* Magic number for detecting bounds violations. */
#define MAGIC 0x1983EFF1
/* Magic number for detecting bounds violations. */
#define MAGIC 0x1983EFF1
@@
-312,7
+322,7
@@
main ()
}
/* autodetect_jp is only supported when iconv() support ISO-2022-JP-2. */
}
/* autodetect_jp is only supported when iconv() support ISO-2022-JP-2. */
-# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__)
+# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__
|| defined __sun
)
/* Test conversions from autodetect_jp to UTF-8. */
for (h = 0; h < SIZEOF (handlers); h++)
{
/* Test conversions from autodetect_jp to UTF-8. */
for (h = 0; h < SIZEOF (handlers); h++)
{
@@
-547,6
+557,8
@@
main ()
free (result);
}
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__ || defined __sun)
/* Test conversions from autodetect_jp to UTF-8. */
for (h = 0; h < SIZEOF (handlers); h++)
{
/* Test conversions from autodetect_jp to UTF-8. */
for (h = 0; h < SIZEOF (handlers); h++)
{
@@
-578,6
+590,7
@@
main ()
ASSERT (strcmp (result, expected) == 0);
free (result);
}
ASSERT (strcmp (result, expected) == 0);
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. */
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 || _LIBICONV_VERSION >= 0x0105
/* Test conversion from UTF-8 to ISO-8859-1 with transliteration. */