summaryrefslogtreecommitdiff
path: root/src/unittests
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
parentbb980aaf7a61f8d0fe03f7def03795d5f5d8d2a0 (diff)
downloadmanaverse-4133ef1e7821cae6205d4ee5a8e3277eec9fe540.tar.gz
manaverse-4133ef1e7821cae6205d4ee5a8e3277eec9fe540.tar.bz2
manaverse-4133ef1e7821cae6205d4ee5a8e3277eec9fe540.tar.xz
manaverse-4133ef1e7821cae6205d4ee5a8e3277eec9fe540.zip
Fix unit tests error with undefined config variable.
Diffstat (limited to 'src/unittests')
-rw-r--r--src/unittests/gui/widgets/browserbox.cc15
-rw-r--r--src/unittests/gui/windowmanager.cc44
-rw-r--r--src/unittests/integrity.cc12
-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
-rw-r--r--src/unittests/sdl.cc12
-rw-r--r--src/unittests/utils/chatutils.cc14
-rw-r--r--src/unittests/utils/translation/poparser.cc15
-rw-r--r--src/unittests/utils/xml.cc15
-rw-r--r--src/unittests/utils/xmlutils.cc37
18 files changed, 157 insertions, 140 deletions
diff --git a/src/unittests/gui/widgets/browserbox.cc b/src/unittests/gui/widgets/browserbox.cc
index 88f2f8b92..a6ad9773d 100644
--- a/src/unittests/gui/widgets/browserbox.cc
+++ b/src/unittests/gui/widgets/browserbox.cc
@@ -55,6 +55,14 @@ TEST_CASE("BrowserBox tests", "browserbox")
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,
@@ -64,13 +72,6 @@ TEST_CASE("BrowserBox tests", "browserbox")
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/gui/windowmanager.cc b/src/unittests/gui/windowmanager.cc
index c83f47480..b7f1eee43 100644
--- a/src/unittests/gui/windowmanager.cc
+++ b/src/unittests/gui/windowmanager.cc
@@ -156,17 +156,6 @@ TEST_CASE("Windows tests", "windowmanager")
branding.setValue("onlineServerFile", "test/serverlistplus.xml");
mainGraphics = new SDLGraphics;
imageHelper = new SDLImageHelper;
-#ifdef USE_SDL2
- SDLImageHelper::setRenderer(graphicsManager.createRenderer(
- graphicsManager.createWindow(640, 480, 0,
- SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE));
-#else // USE_SDL2
-
- graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE);
-#endif // USE_SDL2
-
- userPalette = new UserPalette;
- config.setValue("fontSize", 16);
Dirs::initRootDir();
Dirs::initHomeDir();
@@ -181,6 +170,18 @@ TEST_CASE("Windows tests", "windowmanager")
setFeaturesDefaults(features);
ConfigManager::initServerConfig("nonexistserver");
+#ifdef USE_SDL2
+ SDLImageHelper::setRenderer(graphicsManager.createRenderer(
+ graphicsManager.createWindow(640, 480, 0,
+ SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE));
+#else // USE_SDL2
+
+ graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE);
+#endif // USE_SDL2
+
+ userPalette = new UserPalette;
+ config.setValue("fontSize", 16);
+
theme = new Theme;
Theme::selectSkin();
@@ -844,16 +845,6 @@ TEST_CASE("WindowManager", "create windows")
branding.setValue("onlineServerFile", "test/serverlistplus.xml");
mainGraphics = new SDLGraphics;
imageHelper = new SDLImageHelper;
-#ifdef USE_SDL2
- SDLImageHelper::setRenderer(graphicsManager.createRenderer(
- graphicsManager.createWindow(640, 480, 0,
- SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE));
-#else // USE_SDL2
-
- graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE);
-#endif // USE_SDL2
-
- config.setValue("fontSize", 16);
Dirs::initRootDir();
Dirs::initHomeDir();
@@ -867,6 +858,17 @@ TEST_CASE("WindowManager", "create windows")
setBrandingDefaults(branding);
ConfigManager::initServerConfig("nonexistserver");
+#ifdef USE_SDL2
+ SDLImageHelper::setRenderer(graphicsManager.createRenderer(
+ graphicsManager.createWindow(640, 480, 0,
+ SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE));
+#else // USE_SDL2
+
+ graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE);
+#endif // USE_SDL2
+
+ config.setValue("fontSize", 16);
+
theme = new Theme;
Theme::selectSkin();
diff --git a/src/unittests/integrity.cc b/src/unittests/integrity.cc
index e45eb9f4e..3cb4f3dc5 100644
--- a/src/unittests/integrity.cc
+++ b/src/unittests/integrity.cc
@@ -122,6 +122,12 @@ TEST_CASE("integrity tests", "integrity")
VirtFs::mountDirSilent("data", Append_false);
VirtFs::mountDirSilent("../data", Append_false);
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ setBrandingDefaults(branding);
+ ConfigManager::initConfiguration();
+
#ifdef USE_SDL2
imageHelper = new SurfaceImageHelper;
@@ -137,12 +143,6 @@ TEST_CASE("integrity tests", "integrity")
userPalette = new UserPalette;
- Dirs::initRootDir();
- Dirs::initHomeDir();
-
- setBrandingDefaults(branding);
- ConfigManager::initConfiguration();
-
config.setValue("fontSize", 16);
theme = new Theme;
Theme::selectSkin();
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();
diff --git a/src/unittests/sdl.cc b/src/unittests/sdl.cc
index 3994ea7f4..8502eeed6 100644
--- a/src/unittests/sdl.cc
+++ b/src/unittests/sdl.cc
@@ -69,6 +69,12 @@ TEST_CASE("sdl tests", "sdl")
VirtFs::mountDirSilent("data", Append_false);
VirtFs::mountDirSilent("../data", Append_false);
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ setBrandingDefaults(branding);
+ ConfigManager::initConfiguration();
+
#ifdef USE_SDL2
imageHelper = new SurfaceImageHelper;
@@ -85,12 +91,6 @@ TEST_CASE("sdl tests", "sdl")
userPalette = new UserPalette;
config.setValue("fontSize", 16);
- Dirs::initRootDir();
- Dirs::initHomeDir();
-
- setBrandingDefaults(branding);
- ConfigManager::initConfiguration();
-
theme = new Theme;
Theme::selectSkin();
diff --git a/src/unittests/utils/chatutils.cc b/src/unittests/utils/chatutils.cc
index 56e08a8ce..82e8379be 100644
--- a/src/unittests/utils/chatutils.cc
+++ b/src/unittests/utils/chatutils.cc
@@ -65,6 +65,13 @@ TEST_CASE("chatutils replaceVars", "")
imageHelper = new SDLImageHelper();
mainGraphics = new SDLGraphics;
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ ConfigManager::initConfiguration();
+ setConfigDefaults2(config);
+ setBrandingDefaults(branding);
+
#ifdef USE_SDL2
SDLImageHelper::setRenderer(graphicsManager.createRenderer(
graphicsManager.createWindow(640, 480, 0,
@@ -74,13 +81,6 @@ TEST_CASE("chatutils replaceVars", "")
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/utils/translation/poparser.cc b/src/unittests/utils/translation/poparser.cc
index cfa0cbb30..3e697582b 100644
--- a/src/unittests/utils/translation/poparser.cc
+++ b/src/unittests/utils/translation/poparser.cc
@@ -55,6 +55,14 @@ TEST_CASE("PoParser tests", "PoParser")
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,
@@ -64,13 +72,6 @@ TEST_CASE("PoParser tests", "PoParser")
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/utils/xml.cc b/src/unittests/utils/xml.cc
index 6f380cfaf..8605e0640 100644
--- a/src/unittests/utils/xml.cc
+++ b/src/unittests/utils/xml.cc
@@ -65,6 +65,14 @@ TEST_CASE("xml doc", "")
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,
@@ -74,13 +82,6 @@ TEST_CASE("xml doc", "")
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/utils/xmlutils.cc b/src/unittests/utils/xmlutils.cc
index e665cb6e5..23df65a10 100644
--- a/src/unittests/utils/xmlutils.cc
+++ b/src/unittests/utils/xmlutils.cc
@@ -56,6 +56,12 @@ TEST_CASE("xmlutils readXmlIntVector 1", "")
mainGraphics = new SDLGraphics;
imageHelper = new SDLImageHelper();
+
+ Dirs::initHomeDir();
+
+ setBrandingDefaults(branding);
+ ConfigManager::initConfiguration();
+
#ifdef USE_SDL2
SDLImageHelper::setRenderer(graphicsManager.createRenderer(
graphicsManager.createWindow(640, 480, 0,
@@ -68,11 +74,6 @@ TEST_CASE("xmlutils readXmlIntVector 1", "")
userPalette = new UserPalette;
Dirs::initRootDir();
- Dirs::initHomeDir();
-
- setBrandingDefaults(branding);
- ConfigManager::initConfiguration();
-
theme = new Theme;
Theme::selectSkin();
@@ -114,6 +115,13 @@ TEST_CASE("xmlutils readXmlStringMap 1", "")
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,
@@ -125,12 +133,6 @@ TEST_CASE("xmlutils readXmlStringMap 1", "")
userPalette = new UserPalette;
- Dirs::initRootDir();
- Dirs::initHomeDir();
-
- setBrandingDefaults(branding);
- ConfigManager::initConfiguration();
-
theme = new Theme;
Theme::selectSkin();
@@ -173,6 +175,13 @@ TEST_CASE("xmlutils readXmlIntMap 1", "")
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,
@@ -184,12 +193,6 @@ TEST_CASE("xmlutils readXmlIntMap 1", "")
userPalette = new UserPalette;
- Dirs::initRootDir();
- Dirs::initHomeDir();
-
- setBrandingDefaults(branding);
- ConfigManager::initConfiguration();
-
theme = new Theme;
Theme::selectSkin();