summaryrefslogtreecommitdiff
path: root/src/unittests/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/unittests/gui')
-rw-r--r--src/unittests/gui/widgets/browserbox.cc15
-rw-r--r--src/unittests/gui/windowmanager.cc44
2 files changed, 31 insertions, 28 deletions
diff --git a/src/unittests/gui/widgets/browserbox.cc b/src/unittests/gui/widgets/browserbox.cc
index 88f2f8b92..a6ad9773d 100644
--- a/src/unittests/gui/widgets/browserbox.cc
+++ b/src/unittests/gui/widgets/browserbox.cc
@@ -55,6 +55,14 @@ TEST_CASE("BrowserBox tests", "browserbox")
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("BrowserBox tests", "browserbox")
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/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();