summaryrefslogtreecommitdiff
path: root/src/fs/virtfsphys_unittest.cc
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-28 21:29:33 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-28 21:29:33 +0300
commit6583c1a039a28a41a865b02598e6da9521046325 (patch)
tree6f1f51085f5b8f8e513dbf39ce24529e6de0474a /src/fs/virtfsphys_unittest.cc
parent993e6f9b9606a71ad35302f0767017fd426c1d0e (diff)
downloadplus-6583c1a039a28a41a865b02598e6da9521046325.tar.gz
plus-6583c1a039a28a41a865b02598e6da9521046325.tar.bz2
plus-6583c1a039a28a41a865b02598e6da9521046325.tar.xz
plus-6583c1a039a28a41a865b02598e6da9521046325.zip
Add test with zip archives into VirtFs.
Diffstat (limited to 'src/fs/virtfsphys_unittest.cc')
-rw-r--r--src/fs/virtfsphys_unittest.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/fs/virtfsphys_unittest.cc b/src/fs/virtfsphys_unittest.cc
index d9821d350..cb7013248 100644
--- a/src/fs/virtfsphys_unittest.cc
+++ b/src/fs/virtfsphys_unittest.cc
@@ -89,6 +89,24 @@ TEST_CASE("VirtFsPhys exists")
delete2(logger);
}
+TEST_CASE("VirtFsPhys exists2")
+{
+ VirtFsPhys::initFuncs();
+ logger = new Logger();
+ VirtFsPhys::addZipToSearchPath("data/test/test2.zip", Append_false);
+ VirtFsPhys::addZipToSearchPath("../data/test/test2.zip", Append_false);
+
+ REQUIRE(VirtFsPhys::exists("test/units.xml") == false);
+ REQUIRE(VirtFsPhys::exists("test.txt") == true);
+ REQUIRE(VirtFsPhys::exists("units123.xml") == false);
+ REQUIRE(VirtFsPhys::exists("tesQ/units.xml") == false);
+ REQUIRE(VirtFsPhys::exists("units.xml") == true);
+
+ VirtFsPhys::removeZipFromSearchPath("data/test/test2.zip");
+ VirtFsPhys::removeZipFromSearchPath("../data/test/test2.zip");
+ delete2(logger);
+}
+
static void removeTemp(StringVect &restrict list)
{
int cnt = 0;