diff options
Diffstat (limited to 'src/fs/virtfs/virtfs1_unittest.cc')
-rw-r--r-- | src/fs/virtfs/virtfs1_unittest.cc | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/fs/virtfs/virtfs1_unittest.cc b/src/fs/virtfs/virtfs1_unittest.cc index 4c046b621..43834d87e 100644 --- a/src/fs/virtfs/virtfs1_unittest.cc +++ b/src/fs/virtfs/virtfs1_unittest.cc @@ -3103,7 +3103,7 @@ TEST_CASE("VirtFs1 rwops_read3") delete2(logger); } -TEST_CASE("VirtFs1 getFiles zip") +TEST_CASE("VirtFs1 getFiles zip1") { VirtFs::init("."); logger = new Logger(); @@ -3134,6 +3134,37 @@ TEST_CASE("VirtFs1 getFiles zip") delete2(logger); } +TEST_CASE("VirtFs1 getFiles zip2") +{ + VirtFs::init("."); + logger = new Logger(); + std::string name("data/test/test.zip"); + std::string prefix; + if (Files::existsLocal(name) == false) + prefix = "../" + prefix; + + VirtFs::mountZip2(prefix + "data/test/test2.zip", + "dir", + Append_false); + + StringVect list; + VirtFs::getFiles(dirSeparator, list); + REQUIRE(list.size() == 2); + REQUIRE(inList(list, "dye.png")); + REQUIRE(inList(list, "hide.png")); + + list.clear(); + VirtFs::getFiles("1", list); + REQUIRE(list.size() == 2); + REQUIRE(inList(list, "file1.txt")); + REQUIRE(inList(list, "test.txt")); + + VirtFs::unmountZip2(prefix + "data/test/test2.zip", + "dir"); + VirtFs::deinit(); + delete2(logger); +} + TEST_CASE("VirtFs1 getDirs1") { VirtFs::init("."); |