X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-readlink.h;h=7247fc4c91640541d760f105439dd4a36a90ece9;hb=135351c549050196b5c1322b3ab1e956565ab3d8;hp=5f5e9108d31044d2a4cb7d680e779a07c627b4ed;hpb=dfd4d11c50dd4729bf46c26a3bbdda0c6031409d;p=gnulib.git diff --git a/tests/test-readlink.h b/tests/test-readlink.h index 5f5e9108d..7247fc4c9 100644 --- a/tests/test-readlink.h +++ b/tests/test-readlink.h @@ -1,5 +1,5 @@ /* Tests of readlink. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ test_readlink (ssize_t (*func) (char const *, char *, size_t), bool print) ASSERT (errno == ENOENT); errno = 0; ASSERT (func ("", buf, sizeof buf) == -1); - ASSERT (errno == ENOENT); + ASSERT (errno == ENOENT || errno == EINVAL); errno = 0; ASSERT (func (".", buf, sizeof buf) == -1); ASSERT (errno == EINVAL); @@ -51,7 +51,7 @@ test_readlink (ssize_t (*func) (char const *, char *, size_t), bool print) ASSERT (errno == EINVAL); errno = 0; ASSERT (func (BASE "file/", buf, sizeof buf) == -1); - ASSERT (errno == ENOTDIR); + ASSERT (errno == ENOTDIR || errno == EINVAL); /* AIX yields EINVAL */ /* Now test actual symlinks. */ if (symlink (BASE "dir", BASE "link")) @@ -74,7 +74,7 @@ test_readlink (ssize_t (*func) (char const *, char *, size_t), bool print) ASSERT (symlink (BASE "file", BASE "link2") == 0); errno = 0; ASSERT (func (BASE "link2/", buf, sizeof buf) == -1); - ASSERT (errno == ENOTDIR); + ASSERT (errno == ENOTDIR || errno == EINVAL); /* AIX yields EINVAL */ ASSERT (unlink (BASE "file") == 0); ASSERT (unlink (BASE "link2") == 0); { @@ -94,13 +94,13 @@ test_readlink (ssize_t (*func) (char const *, char *, size_t), bool print) result = readlink (BASE "link", buf, 1); if (result == -1) { - ASSERT (errno == ERANGE); - ASSERT (buf[0] == (char) 0xff); + ASSERT (errno == ERANGE); + ASSERT (buf[0] == (char) 0xff); } else { - ASSERT (result == 1); - ASSERT (buf[0] == BASE[0]); + ASSERT (result == 1); + ASSERT (buf[0] == BASE[0]); } ASSERT (buf[1] == (char) 0xff); ASSERT (func (BASE "link", buf, len) == len);