summaryrefslogtreecommitdiff
path: root/src/fs/virtfszip_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/virtfszip_unittest.cc')
-rw-r--r--src/fs/virtfszip_unittest.cc51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/fs/virtfszip_unittest.cc b/src/fs/virtfszip_unittest.cc
index 3eb8a2357..4840a23a9 100644
--- a/src/fs/virtfszip_unittest.cc
+++ b/src/fs/virtfszip_unittest.cc
@@ -397,6 +397,57 @@ TEST_CASE("VirtFsZip enumerateFiles2")
delete2(logger);
}
+TEST_CASE("VirtFsZip enumerateFiles3")
+{
+ VirtFsZip::init();
+ logger = new Logger;
+ std::string name("data/test/test.zip");
+ std::string prefix("data\\test/");
+ if (Files::existsLocal(name) == false)
+ prefix = "../" + prefix;
+
+ VirtFsZip::addToSearchPathSilent(prefix + "test.zip",
+ Append_false);
+
+ VirtList *list = nullptr;
+
+ list = VirtFsZip::enumerateFiles("/");
+ REQUIRE(list->names.size() == 1);
+ REQUIRE(inList(list, "dir"));
+ VirtFsZip::freeList(list);
+
+ VirtFsZip::removeFromSearchPathSilent(prefix + "test.zip");
+ VirtFsZip::deinit();
+ delete2(logger);
+}
+
+TEST_CASE("VirtFsZip enumerateFiles4")
+{
+ VirtFsZip::init();
+ logger = new Logger;
+ std::string name("data/test/test.zip");
+ std::string prefix("data\\test/");
+ if (Files::existsLocal(name) == false)
+ prefix = "../" + prefix;
+
+ VirtFsZip::addToSearchPathSilent(prefix + "test2.zip",
+ Append_false);
+
+ VirtList *list = nullptr;
+
+ list = VirtFsZip::enumerateFiles("/");
+ REQUIRE(list->names.size() == 4);
+ REQUIRE(inList(list, "dir"));
+ REQUIRE(inList(list, "dir2"));
+ REQUIRE(inList(list, "test.txt"));
+ REQUIRE(inList(list, "units.xml"));
+ VirtFsZip::freeList(list);
+
+ VirtFsZip::removeFromSearchPathSilent(prefix + "test2.zip");
+ VirtFsZip::deinit();
+ delete2(logger);
+}
+
TEST_CASE("VirtFsZip isDirectory")
{
VirtFsZip::init();