X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-iconv-utf.c;h=e348041b40002b9219f2fb1bc8d76c5b86c94142;hb=a4f38ec6be21630e9640cf8ead742c3a8d733fc2;hp=ec8d03767d5d6c4ce0eeac464219b2929de85912;hpb=e220635fc952c63b533873f2af39ec76aed4b4e3;p=gnulib.git diff --git a/tests/test-iconv-utf.c b/tests/test-iconv-utf.c index ec8d03767..e348041b4 100644 --- a/tests/test-iconv-utf.c +++ b/tests/test-iconv-utf.c @@ -1,5 +1,5 @@ /* Test of character set conversion. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2010 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 @@ -23,21 +23,9 @@ #endif #include -#include -#include #include -#define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (stderr); \ - abort (); \ - } \ - } \ - while (0) +#include "macros.h" int main () @@ -69,8 +57,8 @@ main () outptr = buf; outbytesleft = sizeof (buf); res = iconv (cd, - (ICONV_CONST char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); + (ICONV_CONST char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); ASSERT (res == 0 && inbytesleft == 0); ASSERT (outptr == buf + (sizeof (expected) - 1)); ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0); @@ -100,8 +88,8 @@ main () outptr = buf; outbytesleft = sizeof (buf); res = iconv (cd, - (ICONV_CONST char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); + (ICONV_CONST char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); ASSERT (res == 0 && inbytesleft == 0); ASSERT (outptr == buf + (sizeof (expected) - 1)); ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0); @@ -131,8 +119,8 @@ main () outptr = buf; outbytesleft = sizeof (buf); res = iconv (cd, - (ICONV_CONST char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); + (ICONV_CONST char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); ASSERT (res == 0 && inbytesleft == 0); ASSERT (outptr == buf + (sizeof (expected) - 1)); ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0); @@ -162,8 +150,8 @@ main () outptr = buf; outbytesleft = sizeof (buf); res = iconv (cd, - (ICONV_CONST char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); + (ICONV_CONST char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); ASSERT (res == 0 && inbytesleft == 0); ASSERT (outptr == buf + (sizeof (expected) - 1)); ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0); @@ -193,8 +181,8 @@ main () outptr = buf; outbytesleft = sizeof (buf); res = iconv (cd, - (ICONV_CONST char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); + (ICONV_CONST char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); ASSERT (res == 0 && inbytesleft == 0); ASSERT (outptr == buf + (sizeof (expected) - 1)); ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0); @@ -224,8 +212,8 @@ main () outptr = buf; outbytesleft = sizeof (buf); res = iconv (cd, - (ICONV_CONST char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); + (ICONV_CONST char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); ASSERT (res == 0 && inbytesleft == 0); ASSERT (outptr == buf + (sizeof (expected) - 1)); ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0); @@ -255,8 +243,8 @@ main () outptr = buf; outbytesleft = sizeof (buf); res = iconv (cd, - (ICONV_CONST char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); + (ICONV_CONST char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); ASSERT (res == 0 && inbytesleft == 0); ASSERT (outptr == buf + (sizeof (expected) - 1)); ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0); @@ -286,8 +274,8 @@ main () outptr = buf; outbytesleft = sizeof (buf); res = iconv (cd, - (ICONV_CONST char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); + (ICONV_CONST char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); ASSERT (res == 0 && inbytesleft == 0); ASSERT (outptr == buf + (sizeof (expected) - 1)); ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0);