X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-wcrtomb.c;h=a50817ffad5055c495bce15ffec67f3e1378de33;hb=bc2a3d7068f04e1da758a7c02cf19b132ae574cc;hp=4fe972b46e56f1e3323677172934980963e8c2d3;hpb=441aa3044f43e5572f58c354f01e6bc070acd5c7;p=gnulib.git diff --git a/tests/test-wcrtomb.c b/tests/test-wcrtomb.c index 4fe972b46..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 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 @@ -20,22 +20,14 @@ #include +#include "signature.h" +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 @@ -113,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]) {