Mercurial > hg > octave-lyh > gnulib-hg
changeset 15804:be336f2b1e9b
mkfifoat tests: Fix a test failure on mingw.
* tests/test-mkfifoat.c (main): Allow mkfifoat or test_mknodat to fail
with error ENOSYS.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sat, 01 Oct 2011 10:50:57 +0200 |
parents | ec6332cd8838 |
children | 13800aa629b2 |
files | ChangeLog tests/test-mkfifoat.c |
diffstat | 2 files changed, 39 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-10-01 Bruno Haible <bruno@clisp.org> + + mkfifoat tests: Fix a test failure on mingw. + * tests/test-mkfifoat.c (main): Allow mkfifoat or test_mknodat to fail + with error ENOSYS. + 2011-09-30 Bruno Haible <bruno@clisp.org> float, math: Fix 'int' to 'long double' conversion on Linux/SPARC64.
--- a/tests/test-mkfifoat.c +++ b/tests/test-mkfifoat.c @@ -106,32 +106,41 @@ } /* Create fifo while cwd is '.', then stat it from '..'. */ - ASSERT (func (AT_FDCWD, BASE "fifo", 0600) == 0); - errno = 0; - ASSERT (func (dfd, BASE "fifo", 0600) == -1); - ASSERT (errno == EEXIST); - ASSERT (chdir ("..") == 0); - errno = 0; - ASSERT (fstatat (AT_FDCWD, BASE "fifo", &st, 0) == -1); - ASSERT (errno == ENOENT); - memset (&st, 0, sizeof st); - ASSERT (fstatat (dfd, BASE "fifo", &st, 0) == 0); - ASSERT (S_ISFIFO (st.st_mode)); - ASSERT (unlinkat (dfd, BASE "fifo", 0) == 0); + if (func (AT_FDCWD, BASE "fifo", 0600) != 0) + ASSERT (errno == ENOSYS); /* seen on native Windows */ + else + { + errno = 0; + ASSERT (func (dfd, BASE "fifo", 0600) == -1); + ASSERT (errno == EEXIST); + ASSERT (chdir ("..") == 0); + errno = 0; + ASSERT (fstatat (AT_FDCWD, BASE "fifo", &st, 0) == -1); + ASSERT (errno == ENOENT); + memset (&st, 0, sizeof st); + ASSERT (fstatat (dfd, BASE "fifo", &st, 0) == 0); + ASSERT (S_ISFIFO (st.st_mode)); + ASSERT (unlinkat (dfd, BASE "fifo", 0) == 0); + } /* Create fifo while cwd is '..', then stat it from '.'. */ - ASSERT (func (dfd, BASE "fifo", 0600) == 0); - ASSERT (fchdir (dfd) == 0); - errno = 0; - ASSERT (func (AT_FDCWD, BASE "fifo", 0600) == -1); - ASSERT (errno == EEXIST); - memset (&st, 0, sizeof st); - ASSERT (fstatat (AT_FDCWD, BASE "fifo", &st, AT_SYMLINK_NOFOLLOW) == 0); - ASSERT (S_ISFIFO (st.st_mode)); - memset (&st, 0, sizeof st); - ASSERT (fstatat (dfd, BASE "fifo", &st, AT_SYMLINK_NOFOLLOW) == 0); - ASSERT (S_ISFIFO (st.st_mode)); - ASSERT (unlink (BASE "fifo") == 0); + if (func (dfd, BASE "fifo", 0600) != 0) + ASSERT (errno == ENOSYS); /* seen on native Windows */ + else + { + ASSERT (fchdir (dfd) == 0); + errno = 0; + ASSERT (func (AT_FDCWD, BASE "fifo", 0600) == -1); + ASSERT (errno == EEXIST); + memset (&st, 0, sizeof st); + ASSERT (fstatat (AT_FDCWD, BASE "fifo", &st, AT_SYMLINK_NOFOLLOW) + == 0); + ASSERT (S_ISFIFO (st.st_mode)); + memset (&st, 0, sizeof st); + ASSERT (fstatat (dfd, BASE "fifo", &st, AT_SYMLINK_NOFOLLOW) == 0); + ASSERT (S_ISFIFO (st.st_mode)); + ASSERT (unlink (BASE "fifo") == 0); + } } ASSERT (close (dfd) == 0);