summaryrefslogtreecommitdiff
path: root/src/unittests/gui/windowmanager.cc
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/gui/windowmanager.cc
parentbb980aaf7a61f8d0fe03f7def03795d5f5d8d2a0 (diff)
downloadplus-4133ef1e7821cae6205d4ee5a8e3277eec9fe540.tar.gz
plus-4133ef1e7821cae6205d4ee5a8e3277eec9fe540.tar.bz2
plus-4133ef1e7821cae6205d4ee5a8e3277eec9fe540.tar.xz
plus-4133ef1e7821cae6205d4ee5a8e3277eec9fe540.zip
Fix unit tests error with undefined config variable.
Diffstat (limited to 'src/unittests/gui/windowmanager.cc')
-rw-r--r--src/unittests/gui/windowmanager.cc44
1 files changed, 23 insertions, 21 deletions
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();