summaryrefslogtreecommitdiff
path: root/src/fs/virtfs_unittest.cc
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-25 19:10:51 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-25 19:11:57 +0300
commite6198149823ee18e4167b0e6dd34cfb7f2e2f496 (patch)
tree013181d9d8e4f06433838cffaabf6159aa2f775b /src/fs/virtfs_unittest.cc
parent0bb68a88e6dc6a04685825e80b4e3dca1dc097d2 (diff)
downloadplus-e6198149823ee18e4167b0e6dd34cfb7f2e2f496.tar.gz
plus-e6198149823ee18e4167b0e6dd34cfb7f2e2f496.tar.bz2
plus-e6198149823ee18e4167b0e6dd34cfb7f2e2f496.tar.xz
plus-e6198149823ee18e4167b0e6dd34cfb7f2e2f496.zip
Implement basic VirtFsZip for virtual fs based on zip archives.
Api similar to VirtFs. For now unused.
Diffstat (limited to 'src/fs/virtfs_unittest.cc')
-rw-r--r--src/fs/virtfs_unittest.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/fs/virtfs_unittest.cc b/src/fs/virtfs_unittest.cc
index a79f01aee..5b9da2394 100644
--- a/src/fs/virtfs_unittest.cc
+++ b/src/fs/virtfs_unittest.cc
@@ -335,6 +335,21 @@ TEST_CASE("VirtFs getRealDir")
}
REQUIRE(VirtFs::getRealDir("zzz") == "");
+ if (dir1 == true)
+ {
+ VirtFs::addZipToSearchPath("data/test/test.zip", Append_false);
+ REQUIRE(VirtFs::getRealDir("dir/brimmedhat.png") ==
+ "data/test/test.zip");
+ REQUIRE(VirtFs::getRealDir("hide.png") == "data/test");
+ }
+ else
+ {
+ VirtFs::addZipToSearchPath("../data/test/test.zip", Append_false);
+ REQUIRE(VirtFs::getRealDir("dir/brimmedhat.png") ==
+ "../data/test/test.zip");
+ REQUIRE(VirtFs::getRealDir("hide.png") == "../data/test");
+ }
+
VirtFs::removeDirFromSearchPath("data/test");
VirtFs::removeDirFromSearchPath("../data/test");
@@ -343,17 +358,22 @@ TEST_CASE("VirtFs getRealDir")
REQUIRE(VirtFs::getRealDir("test") == "data");
REQUIRE(VirtFs::getRealDir("test/test.txt") ==
"data");
+ REQUIRE(VirtFs::getRealDir("dir/hide.png") == "data/test/test.zip");
}
else
{
REQUIRE(VirtFs::getRealDir("test") == "../data");
REQUIRE(VirtFs::getRealDir("test/test.txt") ==
"../data");
+ REQUIRE(VirtFs::getRealDir("dir/hide.png") == "../data/test/test.zip");
}
+ REQUIRE(VirtFs::exists("dir/hide.png"));
REQUIRE(VirtFs::getRealDir("zzz") == "");
VirtFs::removeDirFromSearchPath("data");
VirtFs::removeDirFromSearchPath("../data");
+ VirtFs::removeZipFromSearchPath("data/test/test.zip");
+ VirtFs::removeZipFromSearchPath("../data/test/test.zip");
delete2(logger);
}