Mercurial > hg > octave-nkf > gnulib-hg
changeset 15298:9f6aa6c9dd0e
linkat test: Avoid test failure on AIX 7.1.
* tests/test-linkat.c (main): Allow EINVAL as alternate error value.
* tests/test-link.h (test_link): Likewise.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 19 Jun 2011 20:41:46 +0200 |
parents | d73db0fa5bff |
children | a2869570a656 |
files | ChangeLog tests/test-link.h tests/test-linkat.c |
diffstat | 3 files changed, 18 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-06-19 Bruno Haible <bruno@clisp.org> + + linkat test: Avoid test failure on AIX 7.1. + * tests/test-linkat.c (main): Allow EINVAL as alternate error value. + * tests/test-link.h (test_link): Likewise. + 2011-06-19 Bruno Haible <bruno@clisp.org> pread test: Avoid test failure on OpenBSD 4.9.
--- a/tests/test-link.h +++ b/tests/test-link.h @@ -115,10 +115,10 @@ ASSERT (errno == ENOENT); errno = 0; ASSERT (func (BASE "a/", BASE "c") == -1); - ASSERT (errno == ENOTDIR); + ASSERT (errno == ENOTDIR || errno == EINVAL); errno = 0; ASSERT (func (BASE "a", BASE "c/") == -1); - ASSERT (errno == ENOTDIR || errno == ENOENT); + ASSERT (errno == ENOTDIR || errno == ENOENT || errno == EINVAL); /* Most platforms reject hard links to directories, and even on those that do permit it, most users can't create them. We assume @@ -164,11 +164,12 @@ } errno = 0; ASSERT (func (BASE "b", BASE "link/") == -1); - ASSERT (errno == ENOTDIR || errno == ENOENT || errno == EEXIST); + ASSERT (errno == ENOTDIR || errno == ENOENT || errno == EEXIST + || errno == EINVAL); ASSERT (rename (BASE "b", BASE "a") == 0); errno = 0; ASSERT (func (BASE "link/", BASE "b") == -1); - ASSERT (errno == ENOTDIR || errno == EEXIST); + ASSERT (errno == ENOTDIR || errno == EEXIST || errno == EINVAL); /* Clean up. */ ASSERT (unlink (BASE "a") == 0);
--- a/tests/test-linkat.c +++ b/tests/test-linkat.c @@ -201,11 +201,13 @@ errno = 0; ASSERT (linkat (dfd, BASE "link1/", dfd, BASE "sub1", AT_SYMLINK_FOLLOW) == -1); - ASSERT (errno == EEXIST || errno == EPERM || errno == EACCES); + ASSERT (errno == EEXIST || errno == EPERM || errno == EACCES + || errno == EINVAL); errno = 0; ASSERT (linkat (dfd, BASE "link1", dfd, BASE "sub1/", AT_SYMLINK_FOLLOW) == -1); - ASSERT (errno == EEXIST || errno == EPERM || errno == EACCES); + ASSERT (errno == EEXIST || errno == EPERM || errno == EACCES + || errno == EINVAL); errno = 0; ASSERT (linkat (dfd, BASE "link1", dfd, BASE "link2", 0) == -1); ASSERT (errno == EEXIST); @@ -250,21 +252,21 @@ errno = 0; ASSERT (linkat (dfd, BASE "link2/", dfd, BASE "link5", AT_SYMLINK_FOLLOW) == -1); - ASSERT (errno == ENOTDIR); + ASSERT (errno == ENOTDIR || errno == EINVAL); errno = 0; ASSERT (linkat (dfd, BASE "link3/", dfd, BASE "link5", 0) == -1); ASSERT (errno == ELOOP); errno = 0; ASSERT (linkat (dfd, BASE "link3/", dfd, BASE "link5", AT_SYMLINK_FOLLOW) == -1); - ASSERT (errno == ELOOP); + ASSERT (errno == ELOOP || errno == EINVAL); errno = 0; ASSERT (linkat (dfd, BASE "link4/", dfd, BASE "link5", 0) == -1); ASSERT (errno == ENOENT); errno = 0; ASSERT (linkat (dfd, BASE "link4/", dfd, BASE "link5", AT_SYMLINK_FOLLOW) == -1); - ASSERT (errno == ENOENT); + ASSERT (errno == ENOENT || errno == EINVAL); /* Check for hard links to symlinks. */ ASSERT (linkat (dfd, BASE "link1", dfd, BASE "link5", 0) == 0);