diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | tests/test-supersede-fopen.h | 8 | ||||
-rw-r--r-- | tests/test-supersede-open.h | 8 |
3 files changed, 19 insertions, 4 deletions
@@ -1,5 +1,12 @@ 2021-08-29 Bruno Haible <bruno@clisp.org> + supersede: Fix test failure under QEMU user-mode for Linux/mips. + * tests/test-supersede-open.h (test_open_supersede): Copy statbuf.st_dev + into a local variable of type dev_t. + * tests/test-supersede-fopen.h (test_fopen_supersede): Likewise. + +2021-08-29 Bruno Haible <bruno@clisp.org> + spawn-pipe: Fix test failure when running under QEMU user-mode. * tests/test-spawn-pipe-child.c: Include <stdbool.h>, <string.h>, qemu.h. diff --git a/tests/test-supersede-fopen.h b/tests/test-supersede-fopen.h index 1cf231bd93..62d5e0e407 100644 --- a/tests/test-supersede-fopen.h +++ b/tests/test-supersede-fopen.h @@ -92,7 +92,9 @@ test_fopen_supersede (bool supersede_if_exists, bool supersede_if_does_not_exist /* Verify that the file now has a different inode number, on the same device. */ #if !(defined _WIN32 && !defined __CYGWIN__) - ASSERT (memcmp (&orig_dev, &statbuf.st_dev, sizeof (dev_t)) == 0); + /* Note: On Linux/mips, statbuf.st_dev is smaller than a dev_t! */ + dev_t new_dev = statbuf.st_dev; + ASSERT (memcmp (&orig_dev, &new_dev, sizeof (dev_t)) == 0); ASSERT (memcmp (&orig_ino, &statbuf.st_ino, sizeof (ino_t)) != 0); #endif } @@ -162,7 +164,9 @@ test_fopen_supersede (bool supersede_if_exists, bool supersede_if_does_not_exist /* Verify that the file now has a different inode number, on the same device. */ #if !(defined _WIN32 && !defined __CYGWIN__) - ASSERT (memcmp (&orig_dev, &statbuf.st_dev, sizeof (dev_t)) == 0); + /* Note: On Linux/mips, statbuf.st_dev is smaller than a dev_t! */ + dev_t new_dev = statbuf.st_dev; + ASSERT (memcmp (&orig_dev, &new_dev, sizeof (dev_t)) == 0); ASSERT (memcmp (&orig_ino, &statbuf.st_ino, sizeof (ino_t)) != 0); #endif } diff --git a/tests/test-supersede-open.h b/tests/test-supersede-open.h index c05effa56b..0814eea0da 100644 --- a/tests/test-supersede-open.h +++ b/tests/test-supersede-open.h @@ -90,7 +90,9 @@ test_open_supersede (bool supersede_if_exists, bool supersede_if_does_not_exist) /* Verify that the file now has a different inode number, on the same device. */ #if !(defined _WIN32 && !defined __CYGWIN__) - ASSERT (memcmp (&orig_dev, &statbuf.st_dev, sizeof (dev_t)) == 0); + /* Note: On Linux/mips, statbuf.st_dev is smaller than a dev_t! */ + dev_t new_dev = statbuf.st_dev; + ASSERT (memcmp (&orig_dev, &new_dev, sizeof (dev_t)) == 0); ASSERT (memcmp (&orig_ino, &statbuf.st_ino, sizeof (ino_t)) != 0); #endif } @@ -159,7 +161,9 @@ test_open_supersede (bool supersede_if_exists, bool supersede_if_does_not_exist) /* Verify that the file now has a different inode number, on the same device. */ #if !(defined _WIN32 && !defined __CYGWIN__) - ASSERT (memcmp (&orig_dev, &statbuf.st_dev, sizeof (dev_t)) == 0); + /* Note: On Linux/mips, statbuf.st_dev is smaller than a dev_t! */ + dev_t new_dev = statbuf.st_dev; + ASSERT (memcmp (&orig_dev, &new_dev, sizeof (dev_t)) == 0); ASSERT (memcmp (&orig_ino, &statbuf.st_ino, sizeof (ino_t)) != 0); #endif } |