* tests/test-getlogin.c (main): Don't fail if getlogin() returns NULL
with no errno.
* tests/test-getlogin_r.c (main): Don't fail if getlogin_r() returns
EINVAL.
+2020-12-30 Bruno Haible <bruno@clisp.org>
+
+ getlogin tests, getlogin_r tests: Avoid failure on Solaris OpenIndiana.
+ * tests/test-getlogin.c (main): Don't fail if getlogin() returns NULL
+ with no errno.
+ * tests/test-getlogin_r.c (main): Don't fail if getlogin_r() returns
+ EINVAL.
+
2020-12-29 Jim Meyering <meyering@fb.com>
regex-tests: tweak to avoid a clang-10 warning
/* Test value. */
char *buf = getlogin ();
int err = buf ? 0 : errno;
- ASSERT (buf || err);
+#if defined __sun
+ if (buf == NULL && err == 0)
+ {
+ /* This can happen on Solaris 11 OpenIndiana in the MATE desktop. */
+ fprintf (stderr, "Skipping test: no entry in /var/adm/utmpx.\n");
+ exit (77);
+ }
+#endif
test_getlogin_result (buf, err);
return 0;
/* Test with a large enough buffer. */
char buf[1024];
int err = getlogin_r (buf, sizeof buf);
+#if defined __sun
+ if (err == EINVAL)
+ {
+ /* This can happen on Solaris 11 OpenIndiana in the MATE desktop. */
+ fprintf (stderr, "Skipping test: no entry in /var/adm/utmpx.\n");
+ exit (77);
+ }
+#endif
test_getlogin_result (buf, err);
/* Test with a small buffer. */