X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-wcrtomb.c;h=a50817ffad5055c495bce15ffec67f3e1378de33;hb=6531b40e89ecb9a18480e87633f61b16286abe7e;hp=3ac33e0f4b557130b13a8980a3bcf0b83e778013;hpb=89ae4589dd58d12e7cbcf0e92c1d828c1e430f97;p=gnulib.git diff --git a/tests/test-wcrtomb.c b/tests/test-wcrtomb.c index 3ac33e0f4..a50817ffa 100644 --- a/tests/test-wcrtomb.c +++ b/tests/test-wcrtomb.c @@ -1,5 +1,5 @@ /* Test of conversion of wide character to multibyte character. - Copyright (C) 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2008-2011 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 @@ -24,21 +24,10 @@ SIGNATURE_CHECK (wcrtomb, size_t, (char *, wchar_t, mbstate_t *)); #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" /* Check the multibyte character s[0..n-1]. */ static void @@ -116,6 +105,14 @@ main (int argc, char *argv[]) } } + /* Test special calling convention, passing a NULL pointer. */ + { + ret = wcrtomb (NULL, '\0', NULL); + ASSERT (ret == 1); + ret = wcrtomb (NULL, btowc ('x'), NULL); + ASSERT (ret == 1); + } + if (argc > 1) switch (argv[1][0]) {