From ccf06839d6b655157574126e5f7320c86a946f09 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 23 May 2024 12:47:00 +0200 Subject: [PATCH] readlinkat, areadlinkat: Avoid test failures on Cygwin 3.4.6. * tests/test-readlink.h (test_readlink): For an empty file name, allow errno == EBADF. * tests/test-areadlink.h (test_areadlink): Likewise. --- ChangeLog | 7 +++++++ tests/test-areadlink.h | 5 +++-- tests/test-readlink.h | 5 +++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41109e1fac..508d67dccb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-05-23 Bruno Haible + + readlinkat, areadlinkat: Avoid test failures on Cygwin 3.4.6. + * tests/test-readlink.h (test_readlink): For an empty file name, allow + errno == EBADF. + * tests/test-areadlink.h (test_areadlink): Likewise. + 2024-05-22 Bruno Haible iconv: Reject the broken macOS 14.4 iconv implementation. diff --git a/tests/test-areadlink.h b/tests/test-areadlink.h index 32cae3f4d9..e4fc225d7c 100644 --- a/tests/test-areadlink.h +++ b/tests/test-areadlink.h @@ -1,5 +1,5 @@ /* Tests of areadlink and friends. - Copyright (C) 2009-2023 Free Software Foundation, Inc. + Copyright (C) 2009-2024 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -36,7 +36,8 @@ test_areadlink (char * (*func) (char const *, size_t), bool print) ASSERT (errno == ENOENT); errno = 0; ASSERT (func ("", 1) == NULL); - ASSERT (errno == ENOENT || errno == EINVAL); + ASSERT (errno == ENOENT || errno == EINVAL + || errno == EBADF /* Cygwin < 3.5 */); errno = 0; ASSERT (func (".", 1) == NULL); ASSERT (errno == EINVAL); diff --git a/tests/test-readlink.h b/tests/test-readlink.h index 2c10dff4e9..c04ae311e2 100644 --- a/tests/test-readlink.h +++ b/tests/test-readlink.h @@ -1,5 +1,5 @@ /* Tests of readlink. - Copyright (C) 2009-2023 Free Software Foundation, Inc. + Copyright (C) 2009-2024 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +38,8 @@ test_readlink (ssize_t (*func) (char const *, char *, size_t), bool print) ASSERT (errno == ENOENT); errno = 0; ASSERT (func ("", buf, sizeof buf) == -1); - ASSERT (errno == ENOENT || errno == EINVAL); + ASSERT (errno == ENOENT || errno == EINVAL + || errno == EBADF /* Cygwin < 3.5 */); errno = 0; ASSERT (func (".", buf, sizeof buf) == -1); ASSERT (errno == EINVAL); -- 2.39.5