From 4133ef1e7821cae6205d4ee5a8e3277eec9fe540 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 14 Sep 2017 02:52:41 +0300 Subject: Fix unit tests error with undefined config variable. --- src/unittests/resources/map/maplayer/drawfringenormal.cc | 13 +++++++------ src/unittests/resources/map/maplayer/drawfringesimple.cc | 13 +++++++------ src/unittests/resources/map/maplayer/drawspeciallayer1.cc | 13 +++++++------ src/unittests/resources/map/maplayer/drawspeciallayer2.cc | 13 +++++++------ src/unittests/resources/map/speciallayer.cc | 13 +++++++------ 5 files changed, 35 insertions(+), 30 deletions(-) (limited to 'src/unittests/resources/map') 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(); -- cgit v1.2.3-70-g09d2