changeset 15732:bad19c8ddacb

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.
author Bruno Haible <bruno@clisp.org>
date Wed, 21 Sep 2011 12:21:47 +0200
parents 100f7d4f443d
children dc8a8ac8cdd8
files ChangeLog tests/test-getlogin.c tests/test-getlogin_r.c
diffstat 3 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- a/tests/test-getlogin.c
+++ b/tests/test-getlogin.c
@@ -40,7 +40,9 @@
   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
--- a/tests/test-getlogin_r.c
+++ b/tests/test-getlogin_r.c
@@ -41,7 +41,9 @@
   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