diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-02-27 19:15:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-02-27 19:15:04 +0300 |
commit | 36c6674db35445d6c72f0f520b4abf9ef15b4da9 (patch) | |
tree | f42ad8dd480c57c3f3e18116dce19da9611d1316 /src/fs/virtfsdir_unittest.cc | |
parent | 6388446b85e1fa5deccc6d5c1683fba88ef53d99 (diff) | |
download | manaverse-36c6674db35445d6c72f0f520b4abf9ef15b4da9.tar.gz manaverse-36c6674db35445d6c72f0f520b4abf9ef15b4da9.tar.bz2 manaverse-36c6674db35445d6c72f0f520b4abf9ef15b4da9.tar.xz manaverse-36c6674db35445d6c72f0f520b4abf9ef15b4da9.zip |
Add own base dir in VirtFsDir.
Diffstat (limited to 'src/fs/virtfsdir_unittest.cc')
-rw-r--r-- | src/fs/virtfsdir_unittest.cc | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/fs/virtfsdir_unittest.cc b/src/fs/virtfsdir_unittest.cc index a005341de..1f162a6e9 100644 --- a/src/fs/virtfsdir_unittest.cc +++ b/src/fs/virtfsdir_unittest.cc @@ -32,15 +32,22 @@ TEST_CASE("VirtFsDir getEntries") { - VirtFsDir::init(); + VirtFsDir::init("."); REQUIRE(VirtFsDir::getEntries().empty()); REQUIRE(VirtFsDir::searchEntryByRoot("test") == nullptr); VirtFsDir::deinit(); } +TEST_CASE("VirtFsDir getBaseDir") +{ + VirtFsDir::init("."); + REQUIRE(VirtFsDir::getBaseDir() != nullptr); + VirtFsDir::deinit(); +} + TEST_CASE("VirtFsDir addToSearchPath") { - VirtFsDir::init(); + VirtFsDir::init("."); logger = new Logger(); SECTION("simple 1") { @@ -156,7 +163,7 @@ TEST_CASE("VirtFsDir addToSearchPath") TEST_CASE("VirtFsDir removeFromSearchPath") { - VirtFsDir::init(); + VirtFsDir::init("."); logger = new Logger(); SECTION("simple 1") @@ -230,7 +237,7 @@ TEST_CASE("VirtFsDir removeFromSearchPath") TEST_CASE("VirtFsDir exists") { - VirtFsDir::init(); + VirtFsDir::init("."); logger = new Logger(); VirtFsDir::addToSearchPathSilent("data", Append_false, @@ -298,7 +305,7 @@ static void removeTemp(StringVect &restrict list) TEST_CASE("VirtFsDir getRealDir") { - VirtFsDir::init(); + VirtFsDir::init("."); logger = new Logger(); REQUIRE(VirtFsDir::getRealDir(".") == ""); REQUIRE(VirtFsDir::getRealDir("..") == ""); @@ -382,7 +389,7 @@ static bool inList(VirtList *list, TEST_CASE("VirtFsDir enumerateFiles1") { - VirtFsDir::init(); + VirtFsDir::init("."); logger = new Logger; VirtFsDir::addToSearchPathSilent("data", @@ -424,7 +431,7 @@ TEST_CASE("VirtFsDir enumerateFiles1") TEST_CASE("VirtFsDir enumerateFiles2") { - VirtFsDir::init(); + VirtFsDir::init("."); logger = new Logger; VirtFsDir::addToSearchPathSilent("data/test/dir1", @@ -448,7 +455,7 @@ TEST_CASE("VirtFsDir enumerateFiles2") TEST_CASE("VirtFsDir enumerateFiles3") { - VirtFsDir::init(); + VirtFsDir::init("."); logger = new Logger; VirtFsDir::addToSearchPathSilent("data/test/dir1", @@ -478,7 +485,7 @@ TEST_CASE("VirtFsDir enumerateFiles3") TEST_CASE("VirtFsDir isDirectory") { - VirtFsDir::init(); + VirtFsDir::init("."); logger = new Logger(); VirtFsDir::addToSearchPathSilent("data", Append_false, @@ -546,7 +553,7 @@ TEST_CASE("VirtFsDir isDirectory") TEST_CASE("VirtFsDir openRead") { - VirtFsDir::init(); + VirtFsDir::init("."); logger = new Logger(); VirtFsDir::addToSearchPathSilent("data", Append_false, @@ -613,7 +620,7 @@ TEST_CASE("VirtFsDir openRead") TEST_CASE("VirtFsDir permitLinks") { - VirtFsDir::init(); + VirtFsDir::init("."); logger = new Logger(); VirtFsDir::addToSearchPathSilent("data", Append_false, @@ -652,7 +659,7 @@ TEST_CASE("VirtFsDir permitLinks") TEST_CASE("VirtFsDir read") { - VirtFsDir::init(); + VirtFsDir::init("."); logger = new Logger(); VirtFsDir::addToSearchPathSilent("data", Append_false, |