diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-05-11 21:29:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-05-11 21:31:10 +0300 |
commit | b9cb3b1e94a16425025dd251955f57ca7da5f637 (patch) | |
tree | 11ea79db51f96a2fe571e9c27aa178766a247302 /src/utils | |
parent | 84cdb48df045cae55356b3d6156794c9e0343f54 (diff) | |
download | mv-b9cb3b1e94a16425025dd251955f57ca7da5f637.tar.gz mv-b9cb3b1e94a16425025dd251955f57ca7da5f637.tar.bz2 mv-b9cb3b1e94a16425025dd251955f57ca7da5f637.tar.xz mv-b9cb3b1e94a16425025dd251955f57ca7da5f637.zip |
Fix issues in tests after adding some asserts.
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/chatutils_unittest.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/utils/chatutils_unittest.cc b/src/utils/chatutils_unittest.cc index 74a62c811..33c4ca286 100644 --- a/src/utils/chatutils_unittest.cc +++ b/src/utils/chatutils_unittest.cc @@ -19,19 +19,47 @@ */ #include "catch.hpp" +#include "client.h" #include "actormanager.h" +#include "graphicsmanager.h" #include "party.h" #include "being/localplayer.h" +#include "gui/theme.h" + #include "utils/chatutils.h" #include "utils/delete2.h" +#include "utils/physfstools.h" + +#include "resources/resourcemanager.h" +#include "resources/sdlimagehelper.h" #include "debug.h" TEST_CASE("chatutils replaceVars") { + client = new Client; + PHYSFS_init("manaplus"); + dirSeparator = "/"; + XML::initXML(); + SDL_Init(SDL_INIT_VIDEO); + logger = new Logger(); + ResourceManager::init(); + resourceManager->addToSearchPath("data", Append_false); + resourceManager->addToSearchPath("../data", Append_false); + theme = new Theme; + Theme::selectSkin(); + 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(); localPlayer = new LocalPlayer(static_cast<BeingId>(1), BeingTypeId_zero); actorManager = new ActorManager; @@ -198,6 +226,7 @@ TEST_CASE("chatutils replaceVars") } delete2(actorManager); + delete2(client); } TEST_CASE("chatutils textToMe") |