On MSVC, I'm seeing these three test failures: FAIL: test-fstatat ==================
c:\testdir-posix-msvc\gltests\test-stat.h:35: assertion 'SAME_INODE (st1, st2)' failed FAIL test-fstatat.exe (exit status: 127) FAIL: test-stat =============== c:\testdir-posix-msvc\gltests\test-stat.h:35: assertion 'SAME_INODE (st1, st2)' failed FAIL test-stat.exe (exit status: 127) FAIL: test-statat ================= c:\testdir-posix-msvc\gltests\test-stat.h:35: assertion 'SAME_INODE (st1, st2)' failed FAIL test-statat.exe (exit status: 127) The cause is that the test makes assumptions about the value of the SAME_INODE macro. On native Windows, the cheap implementation of stat() cannot satisfy this, as it sets st_dev and st_ino to zero always. We have a module 'windows-stat-inodes' that fixes this (by making stat() more costly), but it is not enabled by default. 2019-07-02 Bruno Haible <br...@clisp.org> stat tests: Fix test failure on MSVC. * tests/test-stat.h (test_stat_func): Don't test SAME_INODE values on native Windows, unless _GL_WINDOWS_STAT_INODES is defined. diff --git a/tests/test-stat.h b/tests/test-stat.h index 7d2f989..7fa3073 100644 --- a/tests/test-stat.h +++ b/tests/test-stat.h @@ -32,12 +32,18 @@ test_stat_func (int (*func) (char const *, struct stat *), bool print) ASSERT (cwd); ASSERT (func (".", &st1) == 0); ASSERT (func ("./", &st2) == 0); +#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES) ASSERT (SAME_INODE (st1, st2)); +#endif ASSERT (func (cwd, &st2) == 0); +#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES) ASSERT (SAME_INODE (st1, st2)); +#endif ASSERT (func ("/", &st1) == 0); ASSERT (func ("///", &st2) == 0); +#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES) ASSERT (SAME_INODE (st1, st2)); +#endif errno = 0; ASSERT (func ("", &st1) == -1);