summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-03-08 20:39:23 +0300
committerAndrei Karas <akaras@inbox.ru>2017-03-08 20:39:23 +0300
commitdb2c855bf9d54fe512fa695ee6bf6c314331fe7c (patch)
tree7610af0d516f9a52f1333dc0e3c9ad3db9b66e2a
parentff6ee78dda76f0cf778db1546c113bb83a0ed08e (diff)
downloadplus-db2c855bf9d54fe512fa695ee6bf6c314331fe7c.tar.gz
plus-db2c855bf9d54fe512fa695ee6bf6c314331fe7c.tar.bz2
plus-db2c855bf9d54fe512fa695ee6bf6c314331fe7c.tar.xz
plus-db2c855bf9d54fe512fa695ee6bf6c314331fe7c.zip
Add configuration path initialisation in tests where it need.
-rw-r--r--src/gui/widgets/browserbox_unittest.cc10
-rw-r--r--src/resources/dye/dyepalette_unittest.cc9
-rw-r--r--src/resources/sprite/animatedsprite_unittest.cc10
-rw-r--r--src/utils/chatutils_unittest.cc14
-rw-r--r--src/utils/translation/poparser_unittest.cc10
-rw-r--r--src/utils/xml_unittest.cc10
6 files changed, 61 insertions, 2 deletions
diff --git a/src/gui/widgets/browserbox_unittest.cc b/src/gui/widgets/browserbox_unittest.cc
index 8f4c04aa7..cf74186b6 100644
--- a/src/gui/widgets/browserbox_unittest.cc
+++ b/src/gui/widgets/browserbox_unittest.cc
@@ -20,6 +20,9 @@
#include "catch.hpp"
#include "client.h"
+#include "configuration.h"
+#include "configmanager.h"
+#include "dirs.h"
#include "graphicsmanager.h"
#include "being/actorsprite.h"
@@ -65,6 +68,13 @@ TEST_CASE("BrowserBox tests", "browserbox")
theme = new Theme;
Theme::selectSkin();
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ ConfigManager::initConfiguration();
+ getConfigDefaults2(config.getDefaultValues());
+
ActorSprite::load();
gui = new Gui();
gui->postInit(mainGraphics);
diff --git a/src/resources/dye/dyepalette_unittest.cc b/src/resources/dye/dyepalette_unittest.cc
index ba25ea4ab..f475e7dab 100644
--- a/src/resources/dye/dyepalette_unittest.cc
+++ b/src/resources/dye/dyepalette_unittest.cc
@@ -22,6 +22,8 @@
#include "client.h"
#include "configuration.h"
+#include "configmanager.h"
+#include "dirs.h"
#include "graphicsmanager.h"
#include "being/actorsprite.h"
@@ -77,6 +79,13 @@ TEST_CASE("DyePalette tests")
theme = new Theme;
Theme::selectSkin();
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ ConfigManager::initConfiguration();
+ getConfigDefaults2(config.getDefaultValues());
+
ActorSprite::load();
gui = new Gui();
gui->postInit(mainGraphics);
diff --git a/src/resources/sprite/animatedsprite_unittest.cc b/src/resources/sprite/animatedsprite_unittest.cc
index 0264fdbf6..2a05a40bf 100644
--- a/src/resources/sprite/animatedsprite_unittest.cc
+++ b/src/resources/sprite/animatedsprite_unittest.cc
@@ -21,7 +21,10 @@
#include "resources/sprite/animatedsprite.h"
#include "catch.hpp"
+#include "configuration.h"
+#include "configmanager.h"
#include "client.h"
+#include "dirs.h"
#include "graphicsmanager.h"
#include "const/resources/spriteaction.h"
@@ -76,6 +79,13 @@ TEST_CASE("AnimatedSprite tests", "animatedsprite")
theme = new Theme;
Theme::selectSkin();
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ ConfigManager::initConfiguration();
+ getConfigDefaults2(config.getDefaultValues());
+
ActorSprite::load();
gui = new Gui();
gui->postInit(mainGraphics);
diff --git a/src/utils/chatutils_unittest.cc b/src/utils/chatutils_unittest.cc
index a62cd57a4..7b3dd251e 100644
--- a/src/utils/chatutils_unittest.cc
+++ b/src/utils/chatutils_unittest.cc
@@ -20,6 +20,9 @@
#include "catch.hpp"
#include "client.h"
+#include "configuration.h"
+#include "configmanager.h"
+#include "dirs.h"
#include "actormanager.h"
#include "graphicsmanager.h"
@@ -61,8 +64,6 @@ TEST_CASE("chatutils replaceVars")
imageHelper = new SDLImageHelper();
mainGraphics = new SDLGraphics;
- gui = new Gui();
- gui->postInit(mainGraphics);
#ifdef USE_SDL2
SDLImageHelper::setRenderer(graphicsManager.createRenderer(
graphicsManager.createWindow(640, 480, 0,
@@ -72,6 +73,15 @@ TEST_CASE("chatutils replaceVars")
graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE);
#endif // USE_SDL2
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ ConfigManager::initConfiguration();
+ getConfigDefaults2(config.getDefaultValues());
+
+ gui = new Gui();
+ gui->postInit(mainGraphics);
+
ActorSprite::load();
localPlayer = new LocalPlayer(static_cast<BeingId>(1),
BeingTypeId_zero);
diff --git a/src/utils/translation/poparser_unittest.cc b/src/utils/translation/poparser_unittest.cc
index 510be11bb..ff8370344 100644
--- a/src/utils/translation/poparser_unittest.cc
+++ b/src/utils/translation/poparser_unittest.cc
@@ -20,6 +20,9 @@
#include "catch.hpp"
#include "client.h"
+#include "configuration.h"
+#include "configmanager.h"
+#include "dirs.h"
#include "graphicsmanager.h"
#include "being/actorsprite.h"
@@ -66,6 +69,13 @@ TEST_CASE("PoParser tests", "PoParser")
theme = new Theme;
Theme::selectSkin();
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ ConfigManager::initConfiguration();
+ getConfigDefaults2(config.getDefaultValues());
+
ActorSprite::load();
gui = new Gui();
gui->postInit(mainGraphics);
diff --git a/src/utils/xml_unittest.cc b/src/utils/xml_unittest.cc
index 64ee293b7..8cdebf86f 100644
--- a/src/utils/xml_unittest.cc
+++ b/src/utils/xml_unittest.cc
@@ -20,6 +20,9 @@
#include "catch.hpp"
#include "client.h"
+#include "configuration.h"
+#include "configmanager.h"
+#include "dirs.h"
#include "graphicsmanager.h"
#include "being/actorsprite.h"
@@ -66,6 +69,13 @@ TEST_CASE("xml doc")
theme = new Theme;
Theme::selectSkin();
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ ConfigManager::initConfiguration();
+ getConfigDefaults2(config.getDefaultValues());
+
const char *const tempXmlName = "tempxml.xml";
ActorSprite::load();
gui = new Gui();