Mercurial > hg > octave-kai > gnulib-hg
changeset 15704:17eaeb48cbef
symlinkat tests: EBADF tests.
* tests/test-symlinkat.c (main): Add tests for EBADF.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Tue, 20 Sep 2011 22:44:41 +0200 |
parents | 97b70675b25e |
children | e5968810b2c4 |
files | ChangeLog tests/test-symlinkat.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> + symlinkat tests: EBADF tests. + * tests/test-symlinkat.c (main): Add tests for EBADF. + linkat tests: EBADF tests. * tests/test-linkat.c (main): Add tests for EBADF.
--- a/tests/test-symlinkat.c +++ b/tests/test-symlinkat.c @@ -58,6 +58,22 @@ /* Remove any leftovers from a previous partial run. */ ignore_value (system ("rm -rf " BASE "*")); + /* Test behaviour for invalid file descriptors. */ + { + errno = 0; + ASSERT (symlinkat ("foo", -1, "bar") == -1); + ASSERT (errno == EBADF + || errno == ENOSYS /* seen on mingw */ + ); + } + { + errno = 0; + ASSERT (symlinkat ("foo", 99, "bar") == -1); + ASSERT (errno == EBADF + || errno == ENOSYS /* seen on mingw */ + ); + } + /* Perform same checks as counterpart functions. */ result = test_symlink (do_symlink, false); dfd = openat (AT_FDCWD, ".", O_RDONLY);