ftruncate tests: Avoid a test failure on mingw.
authorBruno Haible <bruno@clisp.org>
Wed, 21 Sep 2011 20:22:46 +0000 (22:22 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 21 Sep 2011 20:22:46 +0000 (22:22 +0200)
* tests/test-ftruncate.c (main): Allow a failure with EACCES.

ChangeLog
tests/test-ftruncate.c

index 415dfc1..f215c17 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-09-21  Bruno Haible  <bruno@clisp.org>
 
+       ftruncate tests: Avoid a test failure on mingw.
+       * tests/test-ftruncate.c (main): Allow a failure with EACCES.
+
+2011-09-21  Bruno Haible  <bruno@clisp.org>
+
        select tests: Avoid test failures on OSF/1 5.1 and mingw.
        * tests/test-select.h (test_bad_fd): Disable all tests on OSF/1 and
        native Windows.
index 60590a6..c5da4eb 100644 (file)
@@ -49,7 +49,9 @@ main (int argc, char *argv[])
     ASSERT (fd >= 0);
     errno = 0;
     ASSERT (ftruncate (fd, 0) == -1);
-    ASSERT (errno == EBADF || errno == EINVAL);
+    ASSERT (errno == EBADF || errno == EINVAL
+            || errno == EACCES /* seen on mingw */
+           );
     close (fd);
   }