projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
utimens: simplify the logic of the previous change
[gnulib.git]
/
tests
/
test-setenv.c
diff --git
a/tests/test-setenv.c
b/tests/test-setenv.c
index
61be838
..
de589c1
100644
(file)
--- a/
tests/test-setenv.c
+++ b/
tests/test-setenv.c
@@
-1,5
+1,5
@@
/* Tests of setenv.
/* Tests of setenv.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 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
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 <stdlib.h>
#include <stdlib.h>
+#include "signature.h"
+SIGNATURE_CHECK (setenv, int, (char const *, char const *, int));
+
#include <errno.h>
#include <errno.h>
-#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <string.h>
#include <unistd.h>
-#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)
int
main (void)
@@
-52,9
+44,13
@@
main (void)
errno = 0;
ASSERT (setenv ("a=b", "", 0) == -1);
ASSERT (errno == EINVAL);
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);
errno = 0;
ASSERT (setenv (NULL, "", 0) == -1);
ASSERT (errno == EINVAL);
+#endif
return 0;
}
return 0;
}