summaryrefslogtreecommitdiff
path: root/src/fs/virtfsdir_unittest.cc
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-27 18:16:39 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-27 18:16:39 +0300
commit6388446b85e1fa5deccc6d5c1683fba88ef53d99 (patch)
treedaaa6c764a34aece74de45dddc5b1e276d61774d /src/fs/virtfsdir_unittest.cc
parent757069bdedabbd904e56d153e2e858db2a2cf2f1 (diff)
downloadmanaplus-6388446b85e1fa5deccc6d5c1683fba88ef53d99.tar.gz
manaplus-6388446b85e1fa5deccc6d5c1683fba88ef53d99.tar.bz2
manaplus-6388446b85e1fa5deccc6d5c1683fba88ef53d99.tar.xz
manaplus-6388446b85e1fa5deccc6d5c1683fba88ef53d99.zip
Add functions pointers into VirtFile.
From VirtFs call if possible pointer from VirtFile.
Diffstat (limited to 'src/fs/virtfsdir_unittest.cc')
-rw-r--r--src/fs/virtfsdir_unittest.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/fs/virtfsdir_unittest.cc b/src/fs/virtfsdir_unittest.cc
index aa2b0542b..a005341de 100644
--- a/src/fs/virtfsdir_unittest.cc
+++ b/src/fs/virtfsdir_unittest.cc
@@ -32,12 +32,15 @@
TEST_CASE("VirtFsDir getEntries")
{
+ VirtFsDir::init();
REQUIRE(VirtFsDir::getEntries().empty());
REQUIRE(VirtFsDir::searchEntryByRoot("test") == nullptr);
+ VirtFsDir::deinit();
}
TEST_CASE("VirtFsDir addToSearchPath")
{
+ VirtFsDir::init();
logger = new Logger();
SECTION("simple 1")
{
@@ -153,6 +156,7 @@ TEST_CASE("VirtFsDir addToSearchPath")
TEST_CASE("VirtFsDir removeFromSearchPath")
{
+ VirtFsDir::init();
logger = new Logger();
SECTION("simple 1")
@@ -226,6 +230,7 @@ TEST_CASE("VirtFsDir removeFromSearchPath")
TEST_CASE("VirtFsDir exists")
{
+ VirtFsDir::init();
logger = new Logger();
VirtFsDir::addToSearchPathSilent("data",
Append_false,
@@ -293,6 +298,7 @@ static void removeTemp(StringVect &restrict list)
TEST_CASE("VirtFsDir getRealDir")
{
+ VirtFsDir::init();
logger = new Logger();
REQUIRE(VirtFsDir::getRealDir(".") == "");
REQUIRE(VirtFsDir::getRealDir("..") == "");
@@ -376,6 +382,7 @@ static bool inList(VirtList *list,
TEST_CASE("VirtFsDir enumerateFiles1")
{
+ VirtFsDir::init();
logger = new Logger;
VirtFsDir::addToSearchPathSilent("data",
@@ -417,6 +424,7 @@ TEST_CASE("VirtFsDir enumerateFiles1")
TEST_CASE("VirtFsDir enumerateFiles2")
{
+ VirtFsDir::init();
logger = new Logger;
VirtFsDir::addToSearchPathSilent("data/test/dir1",
@@ -440,6 +448,7 @@ TEST_CASE("VirtFsDir enumerateFiles2")
TEST_CASE("VirtFsDir enumerateFiles3")
{
+ VirtFsDir::init();
logger = new Logger;
VirtFsDir::addToSearchPathSilent("data/test/dir1",
@@ -469,6 +478,7 @@ TEST_CASE("VirtFsDir enumerateFiles3")
TEST_CASE("VirtFsDir isDirectory")
{
+ VirtFsDir::init();
logger = new Logger();
VirtFsDir::addToSearchPathSilent("data",
Append_false,
@@ -536,6 +546,7 @@ TEST_CASE("VirtFsDir isDirectory")
TEST_CASE("VirtFsDir openRead")
{
+ VirtFsDir::init();
logger = new Logger();
VirtFsDir::addToSearchPathSilent("data",
Append_false,
@@ -602,6 +613,7 @@ TEST_CASE("VirtFsDir openRead")
TEST_CASE("VirtFsDir permitLinks")
{
+ VirtFsDir::init();
logger = new Logger();
VirtFsDir::addToSearchPathSilent("data",
Append_false,
@@ -634,11 +646,13 @@ TEST_CASE("VirtFsDir permitLinks")
VirtFsDir::removeFromSearchPathSilent("data");
VirtFsDir::removeFromSearchPathSilent("../data");
+ VirtFsDir::deinit();
delete2(logger);
}
TEST_CASE("VirtFsDir read")
{
+ VirtFsDir::init();
logger = new Logger();
VirtFsDir::addToSearchPathSilent("data",
Append_false,
@@ -674,5 +688,6 @@ TEST_CASE("VirtFsDir read")
VirtFsDir::removeFromSearchPathSilent("data");
VirtFsDir::removeFromSearchPathSilent("../data");
+ VirtFsDir::deinit();
delete2(logger);
}