Mercurial > hg > octave-lojdl > gnulib-hg
changeset 15701:892fd4630714
fdopendir tests: EBADF tests.
* tests/test-fdopendir.c (main): Add more tests for EBADF.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Tue, 20 Sep 2011 22:39:51 +0200 |
parents | bbc06c8e298f |
children | e52fd8710d18 |
files | ChangeLog tests/test-fdopendir.c |
diffstat | 2 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2011-09-20 Bruno Haible <bruno@clisp.org> + 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.
--- a/tests/test-fdopendir.c +++ b/tests/test-fdopendir.c @@ -48,9 +48,16 @@ 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);