dup2 tests: EBADF tests.
authorBruno Haible <bruno@clisp.org>
Tue, 20 Sep 2011 19:56:23 +0000 (21:56 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 20 Sep 2011 19:56:23 +0000 (21:56 +0200)
* tests/test-dup2.c (main): Add more tests for EBADF.

ChangeLog
tests/test-dup2.c

index f226320..87aa4a2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2011-09-20  Bruno Haible  <bruno@clisp.org>
 
+       dup2 tests: EBADF tests.
+       * tests/test-dup2.c (main): Add more tests for EBADF.
+
        Tests for module 'dup'.
        * modules/dup-tests: New file.
        * tests/test-dup.c: New file.
index e2ad88b..37454e9 100644 (file)
@@ -121,6 +121,9 @@ main (void)
   ASSERT (dup2 (-1, fd) == -1);
   ASSERT (errno == EBADF);
   errno = 0;
+  ASSERT (dup2 (99, fd) == -1);
+  ASSERT (errno == EBADF);
+  errno = 0;
   ASSERT (dup2 (AT_FDCWD, fd) == -1);
   ASSERT (errno == EBADF);
   ASSERT (is_open (fd));