summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-08-28 22:37:11 +0300
committerAndrei Karas <akaras@inbox.ru>2016-08-28 22:37:11 +0300
commit382defab18bf7e1dc35c243b661e7557b0dca1ac (patch)
treefb8de4597cdcd6c779de484bc5191ea3aef500a7 /src
parentbe8919dad706f4c4d30cfc307c18babd521dc73c (diff)
downloadplus-382defab18bf7e1dc35c243b661e7557b0dca1ac.tar.gz
plus-382defab18bf7e1dc35c243b661e7557b0dca1ac.tar.bz2
plus-382defab18bf7e1dc35c243b661e7557b0dca1ac.tar.xz
plus-382defab18bf7e1dc35c243b661e7557b0dca1ac.zip
Fix unit tests with SDL2.
Diffstat (limited to 'src')
-rw-r--r--src/gui/windowmanager_unittest.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/windowmanager_unittest.cc b/src/gui/windowmanager_unittest.cc
index 84e2b5e2f..37edeb1df 100644
--- a/src/gui/windowmanager_unittest.cc
+++ b/src/gui/windowmanager_unittest.cc
@@ -21,6 +21,7 @@
#include "catch.hpp"
#include "client.h"
#include "configuration.h"
+#include "graphicsmanager.h"
#include "settings.h"
#include "units.h"
#include "textcommand.h"
@@ -141,9 +142,16 @@ 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
+ graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE);
+#endif
+ ActorSprite::load();
userPalette = new UserPalette;
theme = new Theme;
- ActorSprite::load();
config.setValue("fontSize", 16);
gui = new Gui();
gui->postInit(mainGraphics);
@@ -154,6 +162,7 @@ TEST_CASE("Windows tests", "windowmanager")
inventoryHandler = new EAthena::InventoryHandler;
playerHandler = new EAthena::PlayerHandler;
paths.setValue("itemIcons", "");
+
TranslationManager::init();
mainGraphics->setVideoMode(640, 480, 1, 8, false, false, false, false);