summaryrefslogtreecommitdiff
path: root/src/unittests/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-14 02:52:41 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-14 02:52:41 +0300
commit4133ef1e7821cae6205d4ee5a8e3277eec9fe540 (patch)
tree3666e5d95da67dbe7ef739b41f78170885be97d4 /src/unittests/resources
parentbb980aaf7a61f8d0fe03f7def03795d5f5d8d2a0 (diff)
downloadplus-4133ef1e7821cae6205d4ee5a8e3277eec9fe540.tar.gz
plus-4133ef1e7821cae6205d4ee5a8e3277eec9fe540.tar.bz2
plus-4133ef1e7821cae6205d4ee5a8e3277eec9fe540.tar.xz
plus-4133ef1e7821cae6205d4ee5a8e3277eec9fe540.zip
Fix unit tests error with undefined config variable.
Diffstat (limited to 'src/unittests/resources')
-rw-r--r--src/unittests/resources/dye/dye.cc12
-rw-r--r--src/unittests/resources/dye/dyepalette.cc15
-rw-r--r--src/unittests/resources/map/maplayer/drawfringenormal.cc13
-rw-r--r--src/unittests/resources/map/maplayer/drawfringesimple.cc13
-rw-r--r--src/unittests/resources/map/maplayer/drawspeciallayer1.cc13
-rw-r--r--src/unittests/resources/map/maplayer/drawspeciallayer2.cc13
-rw-r--r--src/unittests/resources/map/speciallayer.cc13
-rw-r--r--src/unittests/resources/resourcemanager/resourcemanager.cc13
-rw-r--r--src/unittests/resources/sdlimagehelper.cc13
-rw-r--r--src/unittests/resources/sprite/animatedsprite.cc15
10 files changed, 71 insertions, 62 deletions
diff --git a/src/unittests/resources/dye/dye.cc b/src/unittests/resources/dye/dye.cc
index ada0f5d40..a0294a84f 100644
--- a/src/unittests/resources/dye/dye.cc
+++ b/src/unittests/resources/dye/dye.cc
@@ -1963,6 +1963,12 @@ TEST_CASE("Dye real dye", "")
VirtFs::mountDirSilent("data/test", Append_false);
VirtFs::mountDirSilent("../data/test", Append_false);
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ setBrandingDefaults(branding);
+ ConfigManager::initConfiguration();
+
#ifdef USE_SDL2
imageHelper = new SurfaceImageHelper;
@@ -1978,12 +1984,6 @@ TEST_CASE("Dye real dye", "")
userPalette = new UserPalette;
- Dirs::initRootDir();
- Dirs::initHomeDir();
-
- setBrandingDefaults(branding);
- ConfigManager::initConfiguration();
-
theme = new Theme;
Theme::selectSkin();
diff --git a/src/unittests/resources/dye/dyepalette.cc b/src/unittests/resources/dye/dyepalette.cc
index 47f7266a4..e2632003a 100644
--- a/src/unittests/resources/dye/dyepalette.cc
+++ b/src/unittests/resources/dye/dyepalette.cc
@@ -67,6 +67,14 @@ TEST_CASE("DyePalette tests", "")
mainGraphics = new SDLGraphics;
imageHelper = new SDLImageHelper();
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ ConfigManager::initConfiguration();
+ setConfigDefaults2(config);
+ setBrandingDefaults(branding);
+
#ifdef USE_SDL2
SDLImageHelper::setRenderer(graphicsManager.createRenderer(
graphicsManager.createWindow(640, 480, 0,
@@ -76,13 +84,6 @@ TEST_CASE("DyePalette tests", "")
graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE);
#endif // USE_SDL2
- Dirs::initRootDir();
- Dirs::initHomeDir();
-
- ConfigManager::initConfiguration();
- setConfigDefaults2(config);
- setBrandingDefaults(branding);
-
theme = new Theme;
Theme::selectSkin();
diff --git a/src/unittests/resources/map/maplayer/drawfringenormal.cc b/src/unittests/resources/map/maplayer/drawfringenormal.cc
index 15990d5f6..372f602b0 100644
--- a/src/unittests/resources/map/maplayer/drawfringenormal.cc
+++ b/src/unittests/resources/map/maplayer/drawfringenormal.cc
@@ -58,6 +58,13 @@ TEST_CASE("MapLayer drawFringe normal", "")
VirtFs::mountDirSilent("../data", Append_false);
imageHelper = new SDLImageHelper;
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ setBrandingDefaults(branding);
+ ConfigManager::initConfiguration();
+
#ifdef USE_SDL2
SDLImageHelper::setRenderer(graphicsManager.createRenderer(
graphicsManager.createWindow(640, 480, 0,
@@ -67,12 +74,6 @@ TEST_CASE("MapLayer drawFringe normal", "")
graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE);
#endif // USE_SDL2
- Dirs::initRootDir();
- Dirs::initHomeDir();
-
- setBrandingDefaults(branding);
- ConfigManager::initConfiguration();
-
theme = new Theme;
Theme::selectSkin();
diff --git a/src/unittests/resources/map/maplayer/drawfringesimple.cc b/src/unittests/resources/map/maplayer/drawfringesimple.cc
index e910a5702..8773790c7 100644
--- a/src/unittests/resources/map/maplayer/drawfringesimple.cc
+++ b/src/unittests/resources/map/maplayer/drawfringesimple.cc
@@ -55,6 +55,13 @@ TEST_CASE("MapLayer drawFringe simple", "")
VirtFs::mountDirSilent("../data", Append_false);
imageHelper = new SDLImageHelper;
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ setBrandingDefaults(branding);
+ ConfigManager::initConfiguration();
+
#ifdef USE_SDL2
SDLImageHelper::setRenderer(graphicsManager.createRenderer(
graphicsManager.createWindow(640, 480, 0,
@@ -64,12 +71,6 @@ TEST_CASE("MapLayer drawFringe simple", "")
graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE);
#endif // USE_SDL2
- Dirs::initRootDir();
- Dirs::initHomeDir();
-
- setBrandingDefaults(branding);
- ConfigManager::initConfiguration();
-
theme = new Theme;
Theme::selectSkin();
diff --git a/src/unittests/resources/map/maplayer/drawspeciallayer1.cc b/src/unittests/resources/map/maplayer/drawspeciallayer1.cc
index 0940e4279..c9dd51f1d 100644
--- a/src/unittests/resources/map/maplayer/drawspeciallayer1.cc
+++ b/src/unittests/resources/map/maplayer/drawspeciallayer1.cc
@@ -51,6 +51,13 @@ TEST_CASE("MapLayer drawSpecialLayer (specialLayer)", "")
VirtFs::mountDirSilent("../data", Append_false);
imageHelper = new SDLImageHelper;
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ setBrandingDefaults(branding);
+ ConfigManager::initConfiguration();
+
#ifdef USE_SDL2
SDLImageHelper::setRenderer(graphicsManager.createRenderer(
graphicsManager.createWindow(640, 480, 0,
@@ -60,12 +67,6 @@ TEST_CASE("MapLayer drawSpecialLayer (specialLayer)", "")
graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE);
#endif // USE_SDL2
- Dirs::initRootDir();
- Dirs::initHomeDir();
-
- setBrandingDefaults(branding);
- ConfigManager::initConfiguration();
-
Map *map = nullptr;
MapLayer *layer = nullptr;
SpecialLayer *specialLayer = nullptr;
diff --git a/src/unittests/resources/map/maplayer/drawspeciallayer2.cc b/src/unittests/resources/map/maplayer/drawspeciallayer2.cc
index 8aa0ccf8b..e4e414a0d 100644
--- a/src/unittests/resources/map/maplayer/drawspeciallayer2.cc
+++ b/src/unittests/resources/map/maplayer/drawspeciallayer2.cc
@@ -51,6 +51,13 @@ TEST_CASE("MapLayer drawSpecialLayer (tempLayer)", "")
VirtFs::mountDirSilent("../data", Append_false);
imageHelper = new SDLImageHelper;
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ setBrandingDefaults(branding);
+ ConfigManager::initConfiguration();
+
#ifdef USE_SDL2
SDLImageHelper::setRenderer(graphicsManager.createRenderer(
graphicsManager.createWindow(640, 480, 0,
@@ -60,12 +67,6 @@ TEST_CASE("MapLayer drawSpecialLayer (tempLayer)", "")
graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE);
#endif // USE_SDL2
- Dirs::initRootDir();
- Dirs::initHomeDir();
-
- setBrandingDefaults(branding);
- ConfigManager::initConfiguration();
-
Map *map = nullptr;
MapLayer *layer = nullptr;
SpecialLayer *specialLayer = nullptr;
diff --git a/src/unittests/resources/map/speciallayer.cc b/src/unittests/resources/map/speciallayer.cc
index f2de1db43..2e72d6e19 100644
--- a/src/unittests/resources/map/speciallayer.cc
+++ b/src/unittests/resources/map/speciallayer.cc
@@ -56,6 +56,13 @@ TEST_CASE("SpecialLayer updateCache", "")
VirtFs::mountDirSilent("../data", Append_false);
imageHelper = new SDLImageHelper;
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ setBrandingDefaults(branding);
+ ConfigManager::initConfiguration();
+
#ifdef USE_SDL2
SDLImageHelper::setRenderer(graphicsManager.createRenderer(
graphicsManager.createWindow(640, 480, 0,
@@ -67,12 +74,6 @@ TEST_CASE("SpecialLayer updateCache", "")
userPalette = new UserPalette;
- Dirs::initRootDir();
- Dirs::initHomeDir();
-
- setBrandingDefaults(branding);
- ConfigManager::initConfiguration();
-
theme = new Theme;
Theme::selectSkin();
diff --git a/src/unittests/resources/resourcemanager/resourcemanager.cc b/src/unittests/resources/resourcemanager/resourcemanager.cc
index 9552089fd..4b67af82e 100644
--- a/src/unittests/resources/resourcemanager/resourcemanager.cc
+++ b/src/unittests/resources/resourcemanager/resourcemanager.cc
@@ -101,6 +101,13 @@ TEST_CASE("resourcemanager", "resourcemanager")
VirtFs::mountDirSilent("../data", Append_false);
imageHelper = new SDLImageHelper();
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ setBrandingDefaults(branding);
+ ConfigManager::initConfiguration();
+
#ifdef USE_SDL2
SDLImageHelper::setRenderer(graphicsManager.createRenderer(
graphicsManager.createWindow(640, 480, 0,
@@ -112,12 +119,6 @@ TEST_CASE("resourcemanager", "resourcemanager")
userPalette = new UserPalette;
- Dirs::initRootDir();
- Dirs::initHomeDir();
-
- setBrandingDefaults(branding);
- ConfigManager::initConfiguration();
-
theme = new Theme;
Theme::selectSkin();
diff --git a/src/unittests/resources/sdlimagehelper.cc b/src/unittests/resources/sdlimagehelper.cc
index 1208a5ef2..931acbb88 100644
--- a/src/unittests/resources/sdlimagehelper.cc
+++ b/src/unittests/resources/sdlimagehelper.cc
@@ -80,6 +80,13 @@ TEST_CASE("sdlimagehelper combineSurface", "")
mainGraphics = new SDLGraphics;
imageHelper = new SDLImageHelper;
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ setBrandingDefaults(branding);
+ ConfigManager::initConfiguration();
+
#ifdef USE_SDL2
SDLImageHelper::setRenderer(graphicsManager.createRenderer(
graphicsManager.createWindow(640, 480, 0,
@@ -91,12 +98,6 @@ TEST_CASE("sdlimagehelper combineSurface", "")
userPalette = new UserPalette;
- Dirs::initRootDir();
- Dirs::initHomeDir();
-
- setBrandingDefaults(branding);
- ConfigManager::initConfiguration();
-
theme = new Theme;
Theme::selectSkin();
diff --git a/src/unittests/resources/sprite/animatedsprite.cc b/src/unittests/resources/sprite/animatedsprite.cc
index 3d778b403..c97afeeda 100644
--- a/src/unittests/resources/sprite/animatedsprite.cc
+++ b/src/unittests/resources/sprite/animatedsprite.cc
@@ -68,6 +68,14 @@ TEST_CASE("AnimatedSprite tests", "animatedsprite")
VirtFs::mountDirSilent("../data", Append_false);
mainGraphics = new SDLGraphics;
imageHelper = new SDLImageHelper();
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ ConfigManager::initConfiguration();
+ setConfigDefaults2(config);
+ setBrandingDefaults(branding);
+
#ifdef USE_SDL2
SDLImageHelper::setRenderer(graphicsManager.createRenderer(
graphicsManager.createWindow(640, 480, 0,
@@ -77,13 +85,6 @@ TEST_CASE("AnimatedSprite tests", "animatedsprite")
graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE);
#endif // USE_SDL2
- Dirs::initRootDir();
- Dirs::initHomeDir();
-
- ConfigManager::initConfiguration();
- setConfigDefaults2(config);
- setBrandingDefaults(branding);
-
theme = new Theme;
Theme::selectSkin();