+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.
/* 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
}
/* 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
}
/* 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
}
/* 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
}