summaryrefslogtreecommitdiff
path: root/test/raidfile
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2018-02-24 08:47:40 +0000
committerChris Wilson <chris+github@qwirx.com>2018-03-08 22:18:49 +0000
commitc08932c6e5e1609835219e9f42efe46bb6624a7d (patch)
tree24b8b33b8c2f83bd1fb8abe8328fef1949b45106 /test/raidfile
parent6d7e9562e8485591a4888f1fc2d3c6c657dc7a01 (diff)
Fix raidfile tests on 32-bit Linux
A recent fix for Solaris (commit 81e9aa6545f7f19124c9f5e88982b867d8732965) broke support for 32-bit Linux (which wasn't spotted because we didn't have any 32-bit builders). Try a different approach: detect whether the lseek syscall takes a 64-bit integer offset, and use that if possible. CMake: reimplement autoconf tests for 64-bit lseek (cherry picked from commit 138ea5d174f146f14d91a16bf5d1ce8e479d2024)
Diffstat (limited to 'test/raidfile')
-rw-r--r--test/raidfile/testraidfile.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/raidfile/testraidfile.cpp b/test/raidfile/testraidfile.cpp
index d771f23d..2314d376 100644
--- a/test/raidfile/testraidfile.cpp
+++ b/test/raidfile/testraidfile.cpp
@@ -653,12 +653,21 @@ int test(int argc, const char *argv[])
IOStream &write1stream = write1; // use the stream interface where possible
write1.Open();
write1stream.Write(data, sizeof(data));
+ TEST_EQUAL(sizeof(data), write1stream.GetPosition());
write1stream.Seek(1024, IOStream::SeekType_Absolute);
+ TEST_EQUAL(1024, write1stream.GetPosition());
write1stream.Write(data2, sizeof(data2));
+ TEST_EQUAL(1024 + sizeof(data2), write1stream.GetPosition());
write1stream.Seek(1024, IOStream::SeekType_Relative);
+ TEST_EQUAL(2048 + sizeof(data2), write1stream.GetPosition());
write1stream.Write(data2, sizeof(data2));
+ TEST_EQUAL(2048 + sizeof(data2) * 2, write1stream.GetPosition());
write1stream.Seek(0, IOStream::SeekType_End);
+ TEST_EQUAL(sizeof(data), write1stream.GetPosition());
write1stream.Write(data, sizeof(data));
+ TEST_EQUAL(sizeof(data) * 2, write1stream.GetPosition());
+ write1stream.Seek(-1, IOStream::SeekType_Relative);
+ TEST_EQUAL(sizeof(data) * 2 - 1, write1stream.GetPosition());
// Before it's deleted, check to see the contents are as expected
int f;