]> Savannah Git Hosting - gnulib.git/commitdiff
access, euidaccess tests: Avoid test failures on Cygwin.
authorBruno Haible <bruno@clisp.org>
Thu, 23 May 2024 15:36:05 +0000 (17:36 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 31 May 2024 14:23:11 +0000 (16:23 +0200)
* tests/test-access.h (test_access): On Cygwin, don't test for the
absence of the W_OK permission.

ChangeLog
tests/test-access.h

index 4fe5454250dd56483e3bd4b98b470eb5d4b72f09..0d80833f451dd35c32910e943b75ab79b24342bf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-05-23  Bruno Haible  <bruno@clisp.org>
+
+       access, euidaccess tests: Avoid test failures on Cygwin.
+       * tests/test-access.h (test_access): On Cygwin, don't test for the
+       absence of the W_OK permission.
+
 2024-05-23  Bruno Haible  <bruno@clisp.org>
 
        c32is*, c32toupper tests: Avoid test failures on Cygwin.
index 42aee8b7e0ad964d9e461ebb18ce6978cb8fc96c..2bc98146fa449ff23abcd273fcbfe6433f6fa3b5 100644 (file)
@@ -77,12 +77,16 @@ test_access (int (*func) (const char * /*file*/, int /*mode*/))
 
     ASSERT (func (BASE "f2", R_OK) == 0);
 
+    /* On Cygwin, for users that are in the 'Administrators' group,
+       W_OK is allowed.  */
+#if !defined __CYGWIN__
     if (geteuid () != ROOT_UID)
       {
         errno = 0;
         ASSERT (func (BASE "f2", W_OK) == -1);
         ASSERT (errno == EACCES);
       }
+#endif
 
 #if defined _WIN32 && !defined __CYGWIN__
     /* X_OK works like R_OK.  */