diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-09-01 04:05:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-09-01 04:05:51 +0300 |
commit | 59d9b799fa5bf3c8ba99cc6f703b83751f1d3497 (patch) | |
tree | 16b29e2afda9f223f36e6a7d3f4659fb72d3d7e6 /src/unittests/utils | |
parent | b9ce7a70632f31a3a4b29841ab034dbb297b295d (diff) | |
download | plus-59d9b799fa5bf3c8ba99cc6f703b83751f1d3497.tar.gz plus-59d9b799fa5bf3c8ba99cc6f703b83751f1d3497.tar.bz2 plus-59d9b799fa5bf3c8ba99cc6f703b83751f1d3497.tar.xz plus-59d9b799fa5bf3c8ba99cc6f703b83751f1d3497.zip |
Fix unit tests after last changes in configuration.cpp
Diffstat (limited to 'src/unittests/utils')
-rw-r--r-- | src/unittests/utils/chatutils.cc | 5 | ||||
-rw-r--r-- | src/unittests/utils/translation/poparser.cc | 6 | ||||
-rw-r--r-- | src/unittests/utils/xmlutils.cc | 27 |
3 files changed, 26 insertions, 12 deletions
diff --git a/src/unittests/utils/chatutils.cc b/src/unittests/utils/chatutils.cc index 88e6bdf82..f0a72af26 100644 --- a/src/unittests/utils/chatutils.cc +++ b/src/unittests/utils/chatutils.cc @@ -63,8 +63,6 @@ TEST_CASE("chatutils replaceVars", "") logger = new Logger(); VirtFs::mountDirSilent("data", Append_false); VirtFs::mountDirSilent("../data", Append_false); - theme = new Theme; - Theme::selectSkin(); imageHelper = new SDLImageHelper(); mainGraphics = new SDLGraphics; @@ -84,6 +82,9 @@ TEST_CASE("chatutils replaceVars", "") setConfigDefaults2(config); setBrandingDefaults(branding); + theme = new Theme; + Theme::selectSkin(); + gui = new Gui(); gui->postInit(mainGraphics); diff --git a/src/unittests/utils/translation/poparser.cc b/src/unittests/utils/translation/poparser.cc index b7325b1de..84c993112 100644 --- a/src/unittests/utils/translation/poparser.cc +++ b/src/unittests/utils/translation/poparser.cc @@ -65,9 +65,6 @@ TEST_CASE("PoParser tests", "PoParser") graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 - theme = new Theme; - Theme::selectSkin(); - Dirs::initRootDir(); Dirs::initHomeDir(); @@ -75,6 +72,9 @@ TEST_CASE("PoParser tests", "PoParser") setConfigDefaults2(config); setBrandingDefaults(branding); + theme = new Theme; + Theme::selectSkin(); + ActorSprite::load(); gui = new Gui(); gui->postInit(mainGraphics); diff --git a/src/unittests/utils/xmlutils.cc b/src/unittests/utils/xmlutils.cc index 7a82a502c..bff998057 100644 --- a/src/unittests/utils/xmlutils.cc +++ b/src/unittests/utils/xmlutils.cc @@ -21,6 +21,8 @@ #include "unittests/unittests.h" #include "client.h" +#include "configmanager.h" +#include "configuration.h" #include "dirs.h" #include "graphicsmanager.h" @@ -28,7 +30,6 @@ #include "fs/virtfs/fs.h" -#include "gui/gui.h" #include "gui/userpalette.h" #include "gui/theme.h" @@ -66,12 +67,16 @@ TEST_CASE("xmlutils readXmlIntVector 1", "") #endif // USE_SDL2 userPalette = new UserPalette; - theme = new Theme; - Theme::selectSkin(); Dirs::initRootDir(); Dirs::initHomeDir(); + setBrandingDefaults(branding); + ConfigManager::initConfiguration(); + + theme = new Theme; + Theme::selectSkin(); + ActorSprite::load(); STD_VECTOR<int> arr; @@ -123,12 +128,16 @@ TEST_CASE("xmlutils readXmlStringMap 1", "") #endif // USE_SDL2 userPalette = new UserPalette; - theme = new Theme; - Theme::selectSkin(); Dirs::initRootDir(); Dirs::initHomeDir(); + setBrandingDefaults(branding); + ConfigManager::initConfiguration(); + + theme = new Theme; + Theme::selectSkin(); + ActorSprite::load(); std::map<std::string, std::string> arr; @@ -181,12 +190,16 @@ TEST_CASE("xmlutils readXmlIntMap 1", "") #endif // USE_SDL2 userPalette = new UserPalette; - theme = new Theme; - Theme::selectSkin(); Dirs::initRootDir(); Dirs::initHomeDir(); + setBrandingDefaults(branding); + ConfigManager::initConfiguration(); + + theme = new Theme; + Theme::selectSkin(); + ActorSprite::load(); std::map<int32_t, int32_t> arr; |