X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-btowc.c;h=9d11596097700a03a36302bfaf67a286756ca612;hb=2e9258c30f22f1ef53bea4a1e1b23fad4e8110fd;hp=ce9cfea621014a2fe54ff3fcc1bf67025b559fd3;hpb=b9053ab39aefc89bb3df2ef28b27518aaaa13cc8;p=gnulib.git diff --git a/tests/test-btowc.c b/tests/test-btowc.c index ce9cfea62..9d1159609 100644 --- a/tests/test-btowc.c +++ b/tests/test-btowc.c @@ -1,5 +1,5 @@ /* Test of conversion of unibyte character to wide character. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008, 2009, 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 @@ -20,21 +20,13 @@ #include +#include "signature.h" +SIGNATURE_CHECK (btowc, wint_t, (int)); + #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 (int argc, char *argv[]) @@ -51,20 +43,20 @@ main (int argc, char *argv[]) switch (argv[1][0]) { case '1': - /* Locale encoding is ISO-8859-1 or ISO-8859-15. */ - for (c = 0; c < 0x80; c++) - ASSERT (btowc (c) == c); - for (c = 0xA0; c < 0x100; c++) - ASSERT (btowc (c) != WEOF); - return 0; + /* Locale encoding is ISO-8859-1 or ISO-8859-15. */ + for (c = 0; c < 0x80; c++) + ASSERT (btowc (c) == c); + for (c = 0xA0; c < 0x100; c++) + ASSERT (btowc (c) != WEOF); + return 0; case '2': - /* Locale encoding is UTF-8. */ - for (c = 0; c < 0x80; c++) - ASSERT (btowc (c) == c); - for (c = 0x80; c < 0x100; c++) - ASSERT (btowc (c) == WEOF); - return 0; + /* Locale encoding is UTF-8. */ + for (c = 0; c < 0x80; c++) + ASSERT (btowc (c) == c); + for (c = 0x80; c < 0x100; c++) + ASSERT (btowc (c) == WEOF); + return 0; } return 1;