summaryrefslogtreecommitdiff
path: root/src/fs/virtfs/virtfs1_unittest.cc
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-16 18:10:29 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-16 18:10:29 +0300
commit5844f83998040d4a79dc442151a21dc17de60feb (patch)
tree676268ac999c9009eca96a182f3de9571da24d67 /src/fs/virtfs/virtfs1_unittest.cc
parent3cf47056f239f1096590c27c1d401904a54f84fc (diff)
downloadmanaverse-5844f83998040d4a79dc442151a21dc17de60feb.tar.gz
manaverse-5844f83998040d4a79dc442151a21dc17de60feb.tar.bz2
manaverse-5844f83998040d4a79dc442151a21dc17de60feb.tar.xz
manaverse-5844f83998040d4a79dc442151a21dc17de60feb.zip
Add subdir support in VirtFs::getFiles.
Diffstat (limited to 'src/fs/virtfs/virtfs1_unittest.cc')
-rw-r--r--src/fs/virtfs/virtfs1_unittest.cc33
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(".");