X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-setenv.c;h=0a53ac4644411d519ba4831db4d9f833a340a9d8;hb=38e8c084b95e98c4e763df8cfc43a141aa93fc5f;hp=61be8381bc36ab8d5538da74e3fcdca0a3bec76b;hpb=8dffeb6f35aff7e201bed55c43ea83b62139803e;p=gnulib.git diff --git a/tests/test-setenv.c b/tests/test-setenv.c index 61be8381b..0a53ac464 100644 --- a/tests/test-setenv.c +++ b/tests/test-setenv.c @@ -1,5 +1,5 @@ /* Tests of setenv. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009-2013 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 (setenv, int, (char const *, char const *, int)); + #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 (void) @@ -52,9 +44,13 @@ main (void) errno = 0; ASSERT (setenv ("a=b", "", 0) == -1); ASSERT (errno == EINVAL); +#if 0 + /* glibc and gnulib's implementation guarantee this, but POSIX no + longer requires it: http://austingroupbugs.net/view.php?id=185 */ errno = 0; ASSERT (setenv (NULL, "", 0) == -1); ASSERT (errno == EINVAL); +#endif return 0; }