From 855387d2d795c9471587cc7ddf2c66bb676d698e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 5 Jan 2017 17:00:02 +0300 Subject: Fix different issues in unit tests. Fix crash with some compilers flags. Clean window container to null after it was removed. Init and deinit physfs globally. --- src/gui/windowmanager_unittest.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/gui/windowmanager_unittest.cc') diff --git a/src/gui/windowmanager_unittest.cc b/src/gui/windowmanager_unittest.cc index 0f8c5bc15..048d23550 100644 --- a/src/gui/windowmanager_unittest.cc +++ b/src/gui/windowmanager_unittest.cc @@ -127,7 +127,6 @@ TEST_CASE("Windows tests", "windowmanager") setEnv("SDL_VIDEODRIVER", "dummy"); client = new Client; - PHYSFS_init("manaplus"); dirSeparator = "/"; XML::initXML(); SDL_Init(SDL_INIT_VIDEO); @@ -138,6 +137,9 @@ TEST_CASE("Windows tests", "windowmanager") resourceManager->cleanOrphans(true); resourceManager->addToSearchPath("data", Append_false); resourceManager->addToSearchPath("../data", Append_false); + resourceManager->addToSearchPath("data/test", Append_false); + resourceManager->addToSearchPath("../data/test", Append_false); + paths.setDefaultValues(getPathsDefaults()); branding.setValue("onlineServerFile", "test/serverlistplus.xml"); mainGraphics = new SDLGraphics; imageHelper = new SDLImageHelper; @@ -150,10 +152,11 @@ TEST_CASE("Windows tests", "windowmanager") graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 - ActorSprite::load(); userPalette = new UserPalette; - theme = new Theme; config.setValue("fontSize", 16); + theme = new Theme; + Theme::selectSkin(); + ActorSprite::load(); gui = new Gui(); gui->postInit(mainGraphics); touchManager.init(); -- cgit v1.2.3-60-g2f50