diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-01-05 17:00:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-01-05 17:00:02 +0300 |
commit | 855387d2d795c9471587cc7ddf2c66bb676d698e (patch) | |
tree | 3dbb1260c219312f36893dfae52f5cd40760aeb5 /src/utils/chatutils_unittest.cc | |
parent | 9fefb2942865846ccb7dbdac4ebd4515b8c851a2 (diff) | |
download | plus-855387d2d795c9471587cc7ddf2c66bb676d698e.tar.gz plus-855387d2d795c9471587cc7ddf2c66bb676d698e.tar.bz2 plus-855387d2d795c9471587cc7ddf2c66bb676d698e.tar.xz plus-855387d2d795c9471587cc7ddf2c66bb676d698e.zip |
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.
Diffstat (limited to 'src/utils/chatutils_unittest.cc')
-rw-r--r-- | src/utils/chatutils_unittest.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/utils/chatutils_unittest.cc b/src/utils/chatutils_unittest.cc index 2077bfe5e..374bf3125 100644 --- a/src/utils/chatutils_unittest.cc +++ b/src/utils/chatutils_unittest.cc @@ -27,12 +27,15 @@ #include "being/localplayer.h" +#include "gui/gui.h" #include "gui/theme.h" #include "utils/chatutils.h" #include "utils/delete2.h" #include "utils/physfstools.h" +#include "render/sdlgraphics.h" + #include "resources/sdlimagehelper.h" #include "resources/resourcemanager/resourcemanager.h" @@ -46,7 +49,6 @@ TEST_CASE("chatutils replaceVars") { client = new Client; - PHYSFS_init("manaplus"); dirSeparator = "/"; XML::initXML(); SDL_Init(SDL_INIT_VIDEO); @@ -57,6 +59,10 @@ TEST_CASE("chatutils replaceVars") theme = new Theme; Theme::selectSkin(); imageHelper = new SDLImageHelper(); + mainGraphics = new SDLGraphics; + + gui = new Gui(); + gui->postInit(mainGraphics); #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( graphicsManager.createWindow(640, 480, 0, |