bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unlockpt tests: Avoid test failure on Haiku


From: Bruno Haible
Subject: unlockpt tests: Avoid test failure on Haiku
Date: Tue, 03 Sep 2024 13:34:53 +0200

On Haiku, I see this test failure:

FAIL: test-unlockpt
===================

../../gltests/test-unlockpt.c:36: assertion 'unlockpt (-1) == -1' failed
Abort
FAIL test-unlockpt (exit status: 149)

Since POSIX does not require failure here (see
<https://pubs.opengroup.org/onlinepubs/9799919799/functions/unlockpt.html>:
"may fail", not "shall fail"), we need to adapt the unit test. Done through
this patch:


2024-09-03  Bruno Haible  <bruno@clisp.org>

        unlockpt tests: Avoid test failure on Haiku.
        * tests/test-unlockpt.c (main): Skip the test on Haiku.
        * doc/posix-functions/unlockpt.texi: Update platforms list.

diff --git a/doc/posix-functions/unlockpt.texi 
b/doc/posix-functions/unlockpt.texi
index b4afbdf638..57d5b8481b 100644
--- a/doc/posix-functions/unlockpt.texi
+++ b/doc/posix-functions/unlockpt.texi
@@ -17,5 +17,5 @@
 @itemize
 @item
 This function reports success for invalid file descriptors on some platforms:
-NetBSD 5.1, Cygwin 1.7.9.
+NetBSD 5.1, Cygwin 1.7.9, Haiku.
 @end itemize
diff --git a/tests/test-unlockpt.c b/tests/test-unlockpt.c
index 3a07006892..e69f72db97 100644
--- a/tests/test-unlockpt.c
+++ b/tests/test-unlockpt.c
@@ -30,7 +30,7 @@ int
 main (void)
 {
   /* Test behaviour for invalid file descriptors.  */
-#if !defined __NetBSD__ /* known bug on NetBSD 5.1 */
+#if !(defined __NetBSD__ || defined __HAIKU__) /* known bug on NetBSD 5.1, 
Haiku */
   {
     errno = 0;
     ASSERT (unlockpt (-1) == -1);






reply via email to

[Prev in Thread] Current Thread [Next in Thread]