Similarly, on MSVC, I'm seeing this test failure: FAIL: test-lstat ================
c:\testdir-posix-msvc\gltests\test-lstat.h:34: assertion 'SAME_INODE (st1, st2)' failed FAIL test-lstat.exe (exit status: 127) The cause is the same: SAME_INODE always returns false in this configuration. This patch fixes it. 2019-07-02 Bruno Haible <br...@clisp.org> lstat tests: Fix test failure on MSVC. * tests/test-lstat.h (test_lstat_func): Don't test SAME_INODE values on native Windows, unless _GL_WINDOWS_STAT_INODES is defined. diff --git a/tests/test-lstat.h b/tests/test-lstat.h index 97e9593..1573e80 100644 --- a/tests/test-lstat.h +++ b/tests/test-lstat.h @@ -31,12 +31,16 @@ test_lstat_func (int (*func) (char const *, struct stat *), bool print) /* Test for common directories. */ ASSERT (func (".", &st1) == 0); ASSERT (func ("./", &st2) == 0); +#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES) ASSERT (SAME_INODE (st1, st2)); +#endif ASSERT (S_ISDIR (st1.st_mode)); ASSERT (S_ISDIR (st2.st_mode)); ASSERT (func ("/", &st1) == 0); ASSERT (func ("///", &st2) == 0); +#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES) ASSERT (SAME_INODE (st1, st2)); +#endif ASSERT (S_ISDIR (st1.st_mode)); ASSERT (S_ISDIR (st2.st_mode)); ASSERT (func ("..", &st1) == 0); @@ -85,7 +89,9 @@ test_lstat_func (int (*func) (char const *, struct stat *), bool print) ASSERT (stat (BASE "link1", &st2) == 0); ASSERT (S_ISDIR (st1.st_mode)); ASSERT (S_ISDIR (st2.st_mode)); +#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES) ASSERT (SAME_INODE (st1, st2)); +#endif ASSERT (func (BASE "link2", &st1) == 0); ASSERT (S_ISLNK (st1.st_mode));