diff options
author | Eric Blake <eblake@redhat.com> | 2011-06-07 15:41:20 -0600 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2011-06-07 16:48:54 -0600 |
commit | fd33cbeb2af00d79957ed51beeeadec715b0290a (patch) | |
tree | ae6aed7403316cb79f8da957474a4b98eb383b84 /tests/test-perror2.c | |
parent | b47aace9f7ed314b66850c0d39303f2cdd65ef5f (diff) | |
download | gnulib-fd33cbeb2af00d79957ed51beeeadec715b0290a.tar.gz |
test-perror: relax test to ignore cygwin bug
glibc was not the only platform where fprintf(fopen(,"r"))
fails to detect errors; cygwin 1.7.9 is another culprit
(although it will be fixed for 1.7.10), and I suspect that
several other platforms were failing perror2 for the same
reason.
At this point, there are so many functions affected, and
the way to avoid the bug is easy enough (don't pass bogus
streams to output-producing functions), that I'm not worried
about fixing things other than to document them.
* tests/test-perror2.c (main): Relax test on requiring detection
of stream errors, and use unbuffered stream.
* doc/posix-functions/dprintf.texi (dprintf): Document bug.
* doc/posix-functions/fprintf.texi (fprintf): Likewise.
* doc/posix-functions/fputc.texi (fputc): Likewise.
* doc/posix-functions/fputs.texi (fputs): Likewise.
* doc/posix-functions/fputws.texi (fputws): Likewise.
* doc/posix-functions/fwprintf.texi (fwprintf): Likewise.
* doc/posix-functions/fwrite.texi (fwrite): Likewise.
* doc/posix-functions/getopt.texi (getopt): Likewise.
* doc/posix-functions/perror.texi (perror): Likewise.
* doc/posix-functions/printf.texi (printf): Likewise.
* doc/posix-functions/psiginfo.texi (psiginfo): Likewise.
* doc/posix-functions/psignal.texi (psignal): Likewise.
* doc/posix-functions/putc.texi (putc): Likewise.
* doc/posix-functions/putc_unlocked.texi (putc_unlocked):
Likewise.
* doc/posix-functions/putchar.texi (putchar): Likewise.
* doc/posix-functions/putchar_unlocked.texi (putchar_unlocked):
Likewise.
* doc/posix-functions/puts.texi (puts): Likewise.
* doc/posix-functions/putwc.texi (putwc): Likewise.
* doc/posix-functions/putwchar.texi (putwchar): Likewise.
* doc/posix-functions/vdprintf.texi (vdprintf): Likewise.
* doc/posix-functions/vfprintf.texi (vfprintf): Likewise.
* doc/posix-functions/vfwprintf.texi (vfwprintf): Likewise.
* doc/posix-functions/vprintf.texi (vprintf): Likewise.
* doc/posix-functions/vwprintf.texi (vwprintf): Likewise.
* doc/posix-functions/wordexp.texi (wordexp): Likewise.
* doc/posix-functions/wprintf.texi (wprintf): Likewise.
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests/test-perror2.c')
-rw-r--r-- | tests/test-perror2.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test-perror2.c b/tests/test-perror2.c index 3aab640a48..e230f92320 100644 --- a/tests/test-perror2.c +++ b/tests/test-perror2.c @@ -116,12 +116,14 @@ main (void) /* Test that perror reports write failure. */ { ASSERT (freopen (BASE ".tmp", "r", stderr) == stderr); - ASSERT (setvbuf (stderr, NULL, _IOLBF, BUFSIZ) == 0); + ASSERT (setvbuf (stderr, NULL, _IONBF, BUFSIZ) == 0); errno = -1; ASSERT (!ferror (stderr)); perror (NULL); - ASSERT (errno > 0); #if 0 + /* Commented out until cygwin behaves: + http://sourceware.org/ml/newlib/2011/msg00228.html */ + ASSERT (errno > 0); /* Commented out until glibc behaves: http://sourceware.org/bugzilla/show_bug.cgi?id=12792 */ ASSERT (ferror (stderr)); |