* tests/test-fdopendir.c (main): Add more tests for EBADF.
2011-09-20 Bruno Haible <bruno@clisp.org>
+ fdopendir tests: EBADF tests.
+ * tests/test-fdopendir.c (main): Add more tests for EBADF.
+
openat tests: EBADF tests.
* tests/test-fchownat.c (main): Add tests for EBADF.
* tests/test-fstatat.c (main): Likewise.
ASSERT (unlink ("test-fdopendir.tmp") == 0);
/* A bad fd cannot be turned into a stream. */
- errno = 0;
- ASSERT (fdopendir (-1) == NULL);
- ASSERT (errno == EBADF);
+ {
+ errno = 0;
+ ASSERT (fdopendir (-1) == NULL);
+ ASSERT (errno == EBADF);
+ }
+ {
+ errno = 0;
+ ASSERT (fdopendir (99) == NULL);
+ ASSERT (errno == EBADF);
+ }
/* This should work. */
fd = open (".", O_RDONLY);