utimens, futimens, fdutimensat tests: EBADF tests.
authorBruno Haible <bruno@clisp.org>
Tue, 20 Sep 2011 20:29:28 +0000 (22:29 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 20 Sep 2011 21:27:58 +0000 (23:27 +0200)
* tests/test-futimens.h (test_futimens): Add more tests for EBADF.

ChangeLog
tests/test-futimens.h

index ead3b95..29048f5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2011-09-20  Bruno Haible  <bruno@clisp.org>
 
+       utimens, futimens, fdutimensat tests: EBADF tests.
+       * tests/test-futimens.h (test_futimens): Add more tests for EBADF.
+
        Tests for function fstat().
        * modules/fstat-tests: New file.
        * tests/test-fstat.c: New file.
index 451edd9..2cd7c01 100644 (file)
@@ -74,12 +74,21 @@ test_futimens (int (*func) (int, struct timespec const *),
   }
 
   /* Invalid arguments.  */
-  errno = 0;
-  ASSERT (func (AT_FDCWD, NULL) == -1);
-  ASSERT (errno == EBADF);
-  errno = 0;
-  ASSERT (func (-1, NULL) == -1);
-  ASSERT (errno == EBADF);
+  {
+    errno = 0;
+    ASSERT (func (AT_FDCWD, NULL) == -1);
+    ASSERT (errno == EBADF);
+  }
+  {
+    errno = 0;
+    ASSERT (func (-1, NULL) == -1);
+    ASSERT (errno == EBADF);
+  }
+  {
+    errno = 0;
+    ASSERT (func (99, NULL) == -1);
+    ASSERT (errno == EBADF);
+  }
   {
     int fd = dup (0);
     ASSERT (0 <= fd);