Mercurial > hg > octave-kai > gnulib-hg
changeset 15706:3f289df7b6a1
mkfifoat tests: EBADF tests.
* tests/test-mkfifoat.c (main): Add tests for EBADF.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Tue, 20 Sep 2011 22:47:20 +0200 |
parents | e5968810b2c4 |
children | b9ce5dc1f411 |
files | ChangeLog tests/test-mkfifoat.c |
diffstat | 2 files changed, 19 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2011-09-20 Bruno Haible <bruno@clisp.org> + mkfifoat tests: EBADF tests. + * tests/test-mkfifoat.c (main): Add tests for EBADF. + readlinkat tests: EBADF tests. * tests/test-readlinkat.c (main): Add tests for EBADF.
--- a/tests/test-mkfifoat.c +++ b/tests/test-mkfifoat.c @@ -89,6 +89,22 @@ struct stat st; test_func func = funcs[i]; + /* Test behaviour for invalid file descriptors. */ + { + errno = 0; + ASSERT (func (-1, "foo", 0600) == -1); + ASSERT (errno == EBADF + || errno == ENOSYS /* seen on mingw */ + ); + } + { + errno = 0; + ASSERT (func (99, "foo", 0600) == -1); + ASSERT (errno == EBADF + || errno == ENOSYS /* seen on mingw */ + ); + } + /* Create fifo while cwd is '.', then stat it from '..'. */ ASSERT (func (AT_FDCWD, BASE "fifo", 0600) == 0); errno = 0;