summaryrefslogtreecommitdiff
path: root/test/backupstorefix/testbackupstorefix.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2015-12-17 23:38:22 +0000
committerChris Wilson <chris+github@qwirx.com>2015-12-19 23:55:02 +0000
commit0b8d3214c7acdedd60754bbb81e06039435c0e27 (patch)
tree7d547618b3c0e47b1972e3f6089244b7b83f219b /test/backupstorefix/testbackupstorefix.cpp
parent3d26fcea33359da4f0e684255948d67cbecb5064 (diff)
Replace mv command with rename(), and replace rm -r with rmdir /s/q on Windows.
Fixes test/backupstorefix.
Diffstat (limited to 'test/backupstorefix/testbackupstorefix.cpp')
-rw-r--r--test/backupstorefix/testbackupstorefix.cpp35
1 files changed, 20 insertions, 15 deletions
diff --git a/test/backupstorefix/testbackupstorefix.cpp b/test/backupstorefix/testbackupstorefix.cpp
index a39ca60a..e92be1bd 100644
--- a/test/backupstorefix/testbackupstorefix.cpp
+++ b/test/backupstorefix/testbackupstorefix.cpp
@@ -700,27 +700,32 @@ int test(int argc, const char *argv[])
// structure.
// This will destroy or damage objects 18-1b and 58-5b,
// some repairably.
- #define RUN(x) TEST_THAT(system(x) == 0);
- RUN("mv testfiles/0_0/backup/01234567/02/01/o00.rf "
- "testfiles/0_0/backup/01234567/02/01/o00.rfw"); // 0x18
- RUN("mv testfiles/0_1/backup/01234567/02/01/o01.rf "
- "testfiles/0_1/backup/01234567/02/01/o01.rfw"); // 0x19
+ TEST_THAT(rename("testfiles/0_0/backup/01234567/02/01/o00.rf",
+ "testfiles/0_0/backup/01234567/02/01/o00.rfw") == 0); // 0x18
+ TEST_THAT(rename("testfiles/0_1/backup/01234567/02/01/o01.rf",
+ "testfiles/0_1/backup/01234567/02/01/o01.rfw") == 0); // 0x19
//RUN("mv testfiles/0_2/backup/01234567/02/01/o02.rf "
// "testfiles/0_0/backup/01234567/02/01/o02.rfw"); // 0x1a
- RUN("mv testfiles/0_0/backup/01234567/02/01/o03.rf "
- "testfiles/0_0/backup/01234567/02/01/o03.rfw"); // 0x1b
- RUN("mv testfiles/0_0/backup/01234567/02/01/01/o00.rf "
- "testfiles/0_0/backup/01234567/02/01/01/o00.rfw"); // 0x58
- RUN("mv testfiles/0_1/backup/01234567/02/01/01/o01.rf "
- "testfiles/0_1/backup/01234567/02/01/01/o01.rfw"); // 0x59
+ TEST_THAT(rename("testfiles/0_0/backup/01234567/02/01/o03.rf",
+ "testfiles/0_0/backup/01234567/02/01/o03.rfw") == 0); // 0x1b
+ TEST_THAT(rename("testfiles/0_0/backup/01234567/02/01/01/o00.rf",
+ "testfiles/0_0/backup/01234567/02/01/01/o00.rfw") == 0); // 0x58
+ TEST_THAT(rename("testfiles/0_1/backup/01234567/02/01/01/o01.rf",
+ "testfiles/0_1/backup/01234567/02/01/01/o01.rfw") == 0); // 0x59
//RUN("mv testfiles/0_2/backup/01234567/02/01/01/o02.rf "
// "testfiles/0_0/backup/01234567/02/01/01/o02.rfw"); // 0x5a
- RUN("mv testfiles/0_0/backup/01234567/02/01/01/o03.rf "
- "testfiles/0_0/backup/01234567/02/01/01/o03.rfw"); // 0x5b
+ TEST_THAT(rename("testfiles/0_0/backup/01234567/02/01/01/o03.rf",
+ "testfiles/0_0/backup/01234567/02/01/01/o03.rfw") == 0); // 0x5b
// RUN("rm -r testfiles/0_1/backup/01234567/02/01");
+
+# define RUN(x) TEST_THAT(system(x) == 0);
+# ifdef WIN32
+ RUN("rmdir /s/q testfiles\\0_2\\backup\\01234567\\02\\01");
+# else // !WIN32
RUN("rm -r testfiles/0_2/backup/01234567/02/01");
- #undef RUN
-#endif // BOX_RELEASE_BUILD
+# endif // WIN32
+# undef RUN
+#endif // !BOX_RELEASE_BUILD
// Fix it
// ERROR: Object 0x44 is unattached.