]> Savannah Git Hosting - gnulib.git/commitdiff
readlinkat, areadlinkat: Avoid test failures on Cygwin 3.4.6.
authorBruno Haible <bruno@clisp.org>
Thu, 23 May 2024 10:47:00 +0000 (12:47 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 31 May 2024 21:43:13 +0000 (23:43 +0200)
* tests/test-readlink.h (test_readlink): For an empty file name, allow
errno == EBADF.
* tests/test-areadlink.h (test_areadlink): Likewise.

ChangeLog
tests/test-areadlink.h
tests/test-readlink.h

index 41109e1fac6cda5a585b606b614159fd70a24b4a..508d67dccb66d1ee24c0628dce702f0c4b41674e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-05-23  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        iconv: Reject the broken macOS 14.4 iconv implementation.
index 32cae3f4d96a34ff0a349604fab2a320fede54a5..e4fc225d7cbaed2d408f93a2a376bee92ef99ea7 100644 (file)
@@ -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);
index 2c10dff4e90d92e9acdf1b7c192a2f7228b4e2d1..c04ae311e2676da1ecb86b294538448e35ee8dd3 100644 (file)
@@ -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);