getlogin, getlogin_r tests: Avoid test failure on Linux/SPARC.
authorBruno Haible <bruno@clisp.org>
Wed, 21 Sep 2011 10:21:47 +0000 (12:21 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 21 Sep 2011 10:21:47 +0000 (12:21 +0200)
* tests/test-getlogin.c (main): Allow a failure with EINVAL.
* tests/test-getlogin_r.c (main): Likewise.

ChangeLog
tests/test-getlogin.c
tests/test-getlogin_r.c

index 4050de5..f038985 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-09-21  Bruno Haible  <bruno@clisp.org>
+
+       getlogin, getlogin_r tests: Avoid test failure on Linux/SPARC.
+       * tests/test-getlogin.c (main): Allow a failure with EINVAL.
+       * tests/test-getlogin_r.c (main): Likewise.
+
 2011-09-20  Bruno Haible  <bruno@clisp.org>
 
        time tests: Don't require pid_t.
index 294a88e..2033702 100644 (file)
@@ -40,7 +40,9 @@ main (void)
   if (buf == NULL)
     {
       /* getlogin() fails when stdin is not connected to a tty.  */
-      ASSERT (errno == ENOTTY);
+      ASSERT (errno == ENOTTY
+              || errno == EINVAL /* seen on Linux/SPARC */
+             );
 #if !defined __hpux /* On HP-UX 11.11 it fails anyway.  */
       ASSERT (! isatty (0));
 #endif
index 2a20fd9..bbb58a3 100644 (file)
@@ -41,7 +41,9 @@ main (void)
   if (err != 0)
     {
       /* getlogin_r() fails when stdin is not connected to a tty.  */
-      ASSERT (err == ENOTTY);
+      ASSERT (err == ENOTTY
+              || errno == EINVAL /* seen on Linux/SPARC */
+             );
 #if !defined __hpux /* On HP-UX 11.11 it fails anyway.  */
       ASSERT (! isatty (0));
 #endif