summaryrefslogtreecommitdiff
path: root/src/utils/chatutils_unittest.cc
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-11 21:29:26 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-11 21:31:10 +0300
commitb9cb3b1e94a16425025dd251955f57ca7da5f637 (patch)
tree11ea79db51f96a2fe571e9c27aa178766a247302 /src/utils/chatutils_unittest.cc
parent84cdb48df045cae55356b3d6156794c9e0343f54 (diff)
downloadplus-b9cb3b1e94a16425025dd251955f57ca7da5f637.tar.gz
plus-b9cb3b1e94a16425025dd251955f57ca7da5f637.tar.bz2
plus-b9cb3b1e94a16425025dd251955f57ca7da5f637.tar.xz
plus-b9cb3b1e94a16425025dd251955f57ca7da5f637.zip
Fix issues in tests after adding some asserts.
Diffstat (limited to 'src/utils/chatutils_unittest.cc')
-rw-r--r--src/utils/chatutils_unittest.cc29
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")