summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-03-04 00:27:54 +0300
committerAndrei Karas <akaras@inbox.ru>2017-03-04 01:12:19 +0300
commit79bb654b80d5eb7a65814f80b9ca7ca1ccd62a00 (patch)
treef9669ee10e2ea3f2c41abaa84830da9efe7f9411 /src/resources
parenta6c70dd1f32c38cc81cfd4b28f929d7c13d86db1 (diff)
downloadmanaplus-79bb654b80d5eb7a65814f80b9ca7ca1ccd62a00.tar.gz
manaplus-79bb654b80d5eb7a65814f80b9ca7ca1ccd62a00.tar.bz2
manaplus-79bb654b80d5eb7a65814f80b9ca7ca1ccd62a00.tar.xz
manaplus-79bb654b80d5eb7a65814f80b9ca7ca1ccd62a00.zip
Reimplement VirtFs in correct way. Now all tests should pass.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/dye/dye_unittest.cc16
-rw-r--r--src/resources/dye/dyepalette_unittest.cc16
-rw-r--r--src/resources/map/maplayer_unittest.cc24
-rw-r--r--src/resources/map/speciallayer_unittest.cc8
-rw-r--r--src/resources/resourcemanager/resourcemanager_unittest.cc8
-rw-r--r--src/resources/sprite/animatedsprite_unittest.cc8
6 files changed, 40 insertions, 40 deletions
diff --git a/src/resources/dye/dye_unittest.cc b/src/resources/dye/dye_unittest.cc
index cc368d865..ff1aa8995 100644
--- a/src/resources/dye/dye_unittest.cc
+++ b/src/resources/dye/dye_unittest.cc
@@ -2359,10 +2359,10 @@ TEST_CASE("Dye real dye")
SDL_Init(SDL_INIT_VIDEO);
logger = new Logger();
ResourceManager::init();
- VirtFs::addDirToSearchPath("data", Append_false);
- VirtFs::addDirToSearchPath("../data", Append_false);
- VirtFs::addDirToSearchPath("data/test", Append_false);
- VirtFs::addDirToSearchPath("../data/test", Append_false);
+ VirtFs::addDirToSearchPathSilent("data", Append_false);
+ VirtFs::addDirToSearchPathSilent("../data", Append_false);
+ VirtFs::addDirToSearchPathSilent("data/test", Append_false);
+ VirtFs::addDirToSearchPathSilent("../data/test", Append_false);
#ifdef USE_SDL2
imageHelper = new SurfaceImageHelper;
@@ -2394,10 +2394,10 @@ TEST_CASE("Dye real dye")
dyeCheck("|A:#0000FFFF,FF000050", "arrow_up_A.png");
}
delete2(client);
- VirtFs::removeDirFromSearchPath("data");
- VirtFs::removeDirFromSearchPath("../data");
- VirtFs::removeDirFromSearchPath("data/test");
- VirtFs::removeDirFromSearchPath("../data/test");
+ VirtFs::removeDirFromSearchPathSilent("data");
+ VirtFs::removeDirFromSearchPathSilent("../data");
+ VirtFs::removeDirFromSearchPathSilent("data/test");
+ VirtFs::removeDirFromSearchPathSilent("../data/test");
delete2(logger);
// VirtFs::deinit();
}
diff --git a/src/resources/dye/dyepalette_unittest.cc b/src/resources/dye/dyepalette_unittest.cc
index 7df69e952..4f9d26bb6 100644
--- a/src/resources/dye/dyepalette_unittest.cc
+++ b/src/resources/dye/dyepalette_unittest.cc
@@ -60,10 +60,10 @@ TEST_CASE("DyePalette tests")
SDL_Init(SDL_INIT_VIDEO);
logger = new Logger();
ResourceManager::init();
- VirtFs::addDirToSearchPath("data", Append_false);
- VirtFs::addDirToSearchPath("../data", Append_false);
- VirtFs::addDirToSearchPath("data/test", Append_false);
- VirtFs::addDirToSearchPath("../data/test", Append_false);
+ VirtFs::addDirToSearchPathSilent("data", Append_false);
+ VirtFs::addDirToSearchPathSilent("../data", Append_false);
+ VirtFs::addDirToSearchPathSilent("data/test", Append_false);
+ VirtFs::addDirToSearchPathSilent("../data/test", Append_false);
mainGraphics = new SDLGraphics;
imageHelper = new SDLImageHelper();
@@ -384,10 +384,10 @@ TEST_CASE("DyePalette tests")
REQUIRE(palette.mColors[0].value[3] == 0x77);
}
delete2(client);
- VirtFs::removeDirFromSearchPath("data");
- VirtFs::removeDirFromSearchPath("../data");
- VirtFs::removeDirFromSearchPath("data/test");
- VirtFs::removeDirFromSearchPath("../data/test");
+ VirtFs::removeDirFromSearchPathSilent("data");
+ VirtFs::removeDirFromSearchPathSilent("../data");
+ VirtFs::removeDirFromSearchPathSilent("data/test");
+ VirtFs::removeDirFromSearchPathSilent("../data/test");
delete2(logger);
// VirtFs::deinit();
}
diff --git a/src/resources/map/maplayer_unittest.cc b/src/resources/map/maplayer_unittest.cc
index a3978b1e2..58821682c 100644
--- a/src/resources/map/maplayer_unittest.cc
+++ b/src/resources/map/maplayer_unittest.cc
@@ -1650,8 +1650,8 @@ TEST_CASE("MapLayer drawSpecialLayer (specialLayer)")
{
logger = new Logger;
ResourceManager::init();
- VirtFs::addDirToSearchPath("data", Append_false);
- VirtFs::addDirToSearchPath("../data", Append_false);
+ VirtFs::addDirToSearchPathSilent("data", Append_false);
+ VirtFs::addDirToSearchPathSilent("../data", Append_false);
imageHelper = new SDLImageHelper;
#ifdef USE_SDL2
@@ -1994,8 +1994,8 @@ TEST_CASE("MapLayer drawSpecialLayer (specialLayer)")
delete map;
delete mock;
GraphicsManager::deleteRenderers();
- VirtFs::removeDirFromSearchPath("data");
- VirtFs::removeDirFromSearchPath("../data");
+ VirtFs::removeDirFromSearchPathSilent("data");
+ VirtFs::removeDirFromSearchPathSilent("../data");
delete2(logger);
}
@@ -2003,8 +2003,8 @@ TEST_CASE("MapLayer drawSpecialLayer (tempLayer)")
{
logger = new Logger;
ResourceManager::init();
- VirtFs::addDirToSearchPath("data", Append_false);
- VirtFs::addDirToSearchPath("../data", Append_false);
+ VirtFs::addDirToSearchPathSilent("data", Append_false);
+ VirtFs::addDirToSearchPathSilent("../data", Append_false);
imageHelper = new SDLImageHelper;
#ifdef USE_SDL2
@@ -2353,8 +2353,8 @@ TEST_CASE("MapLayer drawSpecialLayer (tempLayer)")
delete map;
delete mock;
GraphicsManager::deleteRenderers();
- VirtFs::removeDirFromSearchPath("data");
- VirtFs::removeDirFromSearchPath("../data");
+ VirtFs::removeDirFromSearchPathSilent("data");
+ VirtFs::removeDirFromSearchPathSilent("../data");
delete2(logger);
}
@@ -2362,8 +2362,8 @@ TEST_CASE("MapLayer drawFringe")
{
logger = new Logger;
ResourceManager::init();
- VirtFs::addDirToSearchPath("data", Append_false);
- VirtFs::addDirToSearchPath("../data", Append_false);
+ VirtFs::addDirToSearchPathSilent("data", Append_false);
+ VirtFs::addDirToSearchPathSilent("../data", Append_false);
imageHelper = new SDLImageHelper;
#ifdef USE_SDL2
@@ -3240,7 +3240,7 @@ TEST_CASE("MapLayer drawFringe")
delete mock;
delete2(theme);
GraphicsManager::deleteRenderers();
- VirtFs::removeDirFromSearchPath("data");
- VirtFs::removeDirFromSearchPath("../data");
+ VirtFs::removeDirFromSearchPathSilent("data");
+ VirtFs::removeDirFromSearchPathSilent("../data");
delete2(logger);
}
diff --git a/src/resources/map/speciallayer_unittest.cc b/src/resources/map/speciallayer_unittest.cc
index 223d05b4e..cda761896 100644
--- a/src/resources/map/speciallayer_unittest.cc
+++ b/src/resources/map/speciallayer_unittest.cc
@@ -45,8 +45,8 @@ TEST_CASE("SpecialLayer updateCache")
logger = new Logger;
client = new Client;
ResourceManager::init();
- VirtFs::addDirToSearchPath("data", Append_false);
- VirtFs::addDirToSearchPath("../data", Append_false);
+ VirtFs::addDirToSearchPathSilent("data", Append_false);
+ VirtFs::addDirToSearchPathSilent("../data", Append_false);
imageHelper = new SDLImageHelper;
#ifdef USE_SDL2
@@ -262,7 +262,7 @@ TEST_CASE("SpecialLayer updateCache")
delete layer;
resourceManager->cleanOrphans();
delete2(client);
- VirtFs::removeDirFromSearchPath("data");
- VirtFs::removeDirFromSearchPath("../data");
+ VirtFs::removeDirFromSearchPathSilent("data");
+ VirtFs::removeDirFromSearchPathSilent("../data");
delete2(logger);
}
diff --git a/src/resources/resourcemanager/resourcemanager_unittest.cc b/src/resources/resourcemanager/resourcemanager_unittest.cc
index fa0a07b76..52da99571 100644
--- a/src/resources/resourcemanager/resourcemanager_unittest.cc
+++ b/src/resources/resourcemanager/resourcemanager_unittest.cc
@@ -96,8 +96,8 @@ TEST_CASE("resourcemanager", "resourcemanager")
logger = new Logger();
ResourceManager::init();
ResourceManager *safeResman = resourceManager;
- VirtFs::addDirToSearchPath("data", Append_false);
- VirtFs::addDirToSearchPath("../data", Append_false);
+ VirtFs::addDirToSearchPathSilent("data", Append_false);
+ VirtFs::addDirToSearchPathSilent("../data", Append_false);
imageHelper = new SDLImageHelper();
#ifdef USE_SDL2
@@ -660,8 +660,8 @@ TEST_CASE("resourcemanager", "resourcemanager")
delete resourceManager;
resourceManager = safeResman;
delete2(client);
- VirtFs::removeDirFromSearchPath("data");
- VirtFs::removeDirFromSearchPath("../data");
+ VirtFs::removeDirFromSearchPathSilent("data");
+ VirtFs::removeDirFromSearchPathSilent("../data");
delete2(logger);
// VirtFs::deinit();
}
diff --git a/src/resources/sprite/animatedsprite_unittest.cc b/src/resources/sprite/animatedsprite_unittest.cc
index 85a1c3e87..b0e1fe78a 100644
--- a/src/resources/sprite/animatedsprite_unittest.cc
+++ b/src/resources/sprite/animatedsprite_unittest.cc
@@ -62,8 +62,8 @@ TEST_CASE("AnimatedSprite tests", "animatedsprite")
SDL_Init(SDL_INIT_VIDEO);
logger = new Logger();
ResourceManager::init();
- VirtFs::addDirToSearchPath("data", Append_false);
- VirtFs::addDirToSearchPath("../data", Append_false);
+ VirtFs::addDirToSearchPathSilent("data", Append_false);
+ VirtFs::addDirToSearchPathSilent("../data", Append_false);
mainGraphics = new SDLGraphics;
imageHelper = new SDLImageHelper();
#ifdef USE_SDL2
@@ -182,8 +182,8 @@ TEST_CASE("AnimatedSprite tests", "animatedsprite")
}
delete2(client);
- VirtFs::removeDirFromSearchPath("data");
- VirtFs::removeDirFromSearchPath("../data");
+ VirtFs::removeDirFromSearchPathSilent("data");
+ VirtFs::removeDirFromSearchPathSilent("../data");
delete2(logger);
// VirtFs::deinit();
}