diff options
Diffstat (limited to 'src/fs/virtfs_unittest.cc')
-rw-r--r-- | src/fs/virtfs_unittest.cc | 20 |
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); } |