X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-nl_langinfo.c;h=06a4c9d0b771bc01bbc6957c13c97967c339e25c;hb=refs%2Ftags%2Fdebian%2F20140202%2Bstable-1;hp=337e6ecc94e108a4400d64d970f76b107c27f1a2;hpb=9a9d32fbb36e8363c32de6068765829d8232949e;p=gnulib.git diff --git a/tests/test-nl_langinfo.c b/tests/test-nl_langinfo.c index 337e6ecc9..06a4c9d0b 100644 --- a/tests/test-nl_langinfo.c +++ b/tests/test-nl_langinfo.c @@ -1,5 +1,5 @@ /* Test of nl_langinfo replacement. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009-2014 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,24 +20,22 @@ #include +#include "signature.h" +SIGNATURE_CHECK (nl_langinfo, char *, (nl_item)); + #include -#include #include #include #include "c-strcase.h" +#include "macros.h" -#define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (stderr); \ - abort (); \ - } \ - } \ - while (0) +/* For GCC >= 4.3, silence the warnings + "comparison of unsigned expression >= 0 is always true" + in this file. */ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# pragma GCC diagnostic ignored "-Wtype-limits" +#endif int main (int argc, char *argv[]) @@ -114,7 +112,11 @@ main (int argc, char *argv[]) /* nl_langinfo items of the LC_MONETARY category */ { const char *currency = nl_langinfo (CRNCYSTR); - ASSERT (strlen (currency) >= (pass > 0 ? 1 : 0)); + ASSERT (strlen (currency) >= 0); +#if !defined __NetBSD__ + if (pass > 0) + ASSERT (strlen (currency) >= 1); +#endif } /* nl_langinfo items of the LC_MESSAGES category */ ASSERT (strlen (nl_langinfo (YESEXPR)) > 0);