From: Bruno Haible Date: Tue, 20 Sep 2011 20:39:51 +0000 (+0200) Subject: fdopendir tests: EBADF tests. X-Git-Tag: v0.1~1825 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=fdd665e8b13b8628a7a804c4b691b20baa9033e3;p=gnulib.git fdopendir tests: EBADF tests. * tests/test-fdopendir.c (main): Add more tests for EBADF. --- diff --git a/ChangeLog b/ChangeLog index 04668ed25..d0cfe909a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2011-09-20 Bruno Haible + fdopendir tests: EBADF tests. + * tests/test-fdopendir.c (main): Add more tests for EBADF. + openat tests: EBADF tests. * tests/test-fchownat.c (main): Add tests for EBADF. * tests/test-fstatat.c (main): Likewise. diff --git a/tests/test-fdopendir.c b/tests/test-fdopendir.c index 13653fe79..b578a5c5e 100644 --- a/tests/test-fdopendir.c +++ b/tests/test-fdopendir.c @@ -48,9 +48,16 @@ main (int argc _GL_UNUSED, char *argv[]) ASSERT (unlink ("test-fdopendir.tmp") == 0); /* A bad fd cannot be turned into a stream. */ - errno = 0; - ASSERT (fdopendir (-1) == NULL); - ASSERT (errno == EBADF); + { + errno = 0; + ASSERT (fdopendir (-1) == NULL); + ASSERT (errno == EBADF); + } + { + errno = 0; + ASSERT (fdopendir (99) == NULL); + ASSERT (errno == EBADF); + } /* This should work. */ fd = open (".", O_RDONLY);