summaryrefslogtreecommitdiff
path: root/tests/test-supersede-fopen.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-supersede-fopen.h')
-rw-r--r--tests/test-supersede-fopen.h8
1 files changed, 6 insertions, 2 deletions
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
}