From: Bruno Haible Date: Thu, 23 May 2024 15:36:05 +0000 (+0200) Subject: access, euidaccess tests: Avoid test failures on Cygwin. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=d3d9a00fa5d390ece4b5b411ab4c90a707d5d92e;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 4fe5454250..0d80833f45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-05-23 Bruno Haible + + 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 c32is*, c32toupper tests: Avoid test failures on Cygwin. diff --git a/tests/test-access.h b/tests/test-access.h index 42aee8b7e0..2bc98146fa 100644 --- a/tests/test-access.h +++ b/tests/test-access.h @@ -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. */