bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lstat tests: fix test failure on MSVC


From: Bruno Haible
Subject: lstat tests: fix test failure on MSVC
Date: Tue, 02 Jul 2019 19:48:58 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-151-generic; KDE/5.18.0; x86_64; ; )

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  <address@hidden>

        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));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]