summaryrefslogtreecommitdiff
path: root/src/unittests/utils
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/utils
parentbb980aaf7a61f8d0fe03f7def03795d5f5d8d2a0 (diff)
downloadmv-4133ef1e7821cae6205d4ee5a8e3277eec9fe540.tar.gz
mv-4133ef1e7821cae6205d4ee5a8e3277eec9fe540.tar.bz2
mv-4133ef1e7821cae6205d4ee5a8e3277eec9fe540.tar.xz
mv-4133ef1e7821cae6205d4ee5a8e3277eec9fe540.zip
Fix unit tests error with undefined config variable.
Diffstat (limited to 'src/unittests/utils')
-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
4 files changed, 43 insertions, 38 deletions
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();