]> Savannah Git Hosting - gnulib.git/commitdiff
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 4050de53921b000e82c6c4461cbb8aba52795b97..f03898566ea01d06159531fce022d193c7cebfbe 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 294a88ef70313e8e64b79b02e912646ee6504b31..2033702fcb64f0f8a29ff15fff7d9909723316c2 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 2a20fd920a08adab5da95f0f520d8d93e0e28095..bbb58a3222158fba219771a17d4976347168692f 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