diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-03-07 22:02:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-03-07 22:02:59 +0300 |
commit | bbd71d4a8c95092deb9cbf4aef86722a1e9628db (patch) | |
tree | 59566c4baa2e32287fe5867e5616ca560d3f3bf5 /src/fs/virtfs/zip_unittest.cc | |
parent | 6f7f469430ea05946a11dd41f62010961be6285e (diff) | |
download | plus-bbd71d4a8c95092deb9cbf4aef86722a1e9628db.tar.gz plus-bbd71d4a8c95092deb9cbf4aef86722a1e9628db.tar.bz2 plus-bbd71d4a8c95092deb9cbf4aef86722a1e9628db.tar.xz plus-bbd71d4a8c95092deb9cbf4aef86722a1e9628db.zip |
Fix unit tests on windows.
Diffstat (limited to 'src/fs/virtfs/zip_unittest.cc')
-rw-r--r-- | src/fs/virtfs/zip_unittest.cc | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/fs/virtfs/zip_unittest.cc b/src/fs/virtfs/zip_unittest.cc index 4b9258ec5..27d4bc1f9 100644 --- a/src/fs/virtfs/zip_unittest.cc +++ b/src/fs/virtfs/zip_unittest.cc @@ -35,11 +35,14 @@ #include "debug.h" +extern const char *dirSeparator; + TEST_CASE("Zip readArchiveInfo") { logger = new Logger(); std::string name("data/test/test.zip"); std::string prefix; + const std::string sep = dirSeparator; if (Files::existsLocal(name) == false) prefix = "../"; @@ -54,10 +57,10 @@ TEST_CASE("Zip readArchiveInfo") REQUIRE(Zip::readArchiveInfo(entry)); REQUIRE(headers.size() == 2); REQUIRE(entry->root == name); - REQUIRE(headers[0]->fileName == "dir/hide.png"); + REQUIRE(headers[0]->fileName == "dir" + sep + "hide.png"); REQUIRE(headers[0]->compressSize == 365); REQUIRE(headers[0]->uncompressSize == 368); - REQUIRE(headers[1]->fileName == "dir/brimmedhat.png"); + REQUIRE(headers[1]->fileName == "dir" + sep + "brimmedhat.png"); REQUIRE(headers[1]->compressSize == 1959); REQUIRE(headers[1]->uncompressSize == 1959); @@ -79,39 +82,43 @@ TEST_CASE("Zip readArchiveInfo") REQUIRE(headers[0]->compressSize == 17); REQUIRE(headers[0]->uncompressSize == 23); - REQUIRE(headers[1]->fileName == "dir2/hide.png"); + REQUIRE(headers[1]->fileName == "dir2" + sep + "hide.png"); REQUIRE(headers[1]->compressSize == 365); REQUIRE(headers[1]->uncompressSize == 368); - REQUIRE(headers[2]->fileName == "dir2/test.txt"); + REQUIRE(headers[2]->fileName == "dir2" + sep + "test.txt"); REQUIRE(headers[2]->compressSize == 17); REQUIRE(headers[2]->uncompressSize == 23); - REQUIRE(headers[3]->fileName == "dir2/paths.xml"); + REQUIRE(headers[3]->fileName == "dir2" + sep + "paths.xml"); REQUIRE(headers[3]->compressSize == 154); REQUIRE(headers[3]->uncompressSize == 185); - REQUIRE(headers[4]->fileName == "dir2/units.xml"); + REQUIRE(headers[4]->fileName == "dir2" + sep + "units.xml"); REQUIRE(headers[4]->compressSize == 202); REQUIRE(headers[4]->uncompressSize == 306); - REQUIRE(headers[5]->fileName == "dir/hide.png"); + REQUIRE(headers[5]->fileName == "dir" + sep + "hide.png"); REQUIRE(headers[5]->compressSize == 365); REQUIRE(headers[5]->uncompressSize == 368); - REQUIRE(headers[6]->fileName == "dir/1/test.txt"); + REQUIRE(headers[6]->fileName == + "dir" + sep + "1" + sep + "test.txt"); REQUIRE(headers[6]->compressSize == 17); REQUIRE(headers[6]->uncompressSize == 23); - REQUIRE(headers[7]->fileName == "dir/1/file1.txt"); + REQUIRE(headers[7]->fileName == + "dir" + sep + "1" + sep + "file1.txt"); REQUIRE(headers[7]->compressSize == 17); REQUIRE(headers[7]->uncompressSize == 23); - REQUIRE(headers[8]->fileName == "dir/gpl/palette.gpl"); + REQUIRE(headers[8]->fileName == + "dir" + sep + "gpl" + sep + "palette.gpl"); REQUIRE(headers[8]->compressSize == 128); REQUIRE(headers[8]->uncompressSize == 213); - REQUIRE(headers[9]->fileName == "dir/dye.png"); + REQUIRE(headers[9]->fileName == + "dir" + sep + "dye.png"); REQUIRE(headers[9]->compressSize == 794); REQUIRE(headers[9]->uncompressSize == 794); |