summaryrefslogtreecommitdiff
path: root/src/utils/xml_unittest.cc
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-08-29 20:26:16 +0300
committerAndrei Karas <akaras@inbox.ru>2016-08-29 20:26:16 +0300
commit9ff7894ef1eeff001f3ddc1a1caec18176428fa1 (patch)
treed6c8dc8dc37d752ac046552ff5e8226fa73a9ed6 /src/utils/xml_unittest.cc
parent7e0e97ee7ec31512731cbcef625a040266655062 (diff)
downloadplus-9ff7894ef1eeff001f3ddc1a1caec18176428fa1.tar.gz
plus-9ff7894ef1eeff001f3ddc1a1caec18176428fa1.tar.bz2
plus-9ff7894ef1eeff001f3ddc1a1caec18176428fa1.tar.xz
plus-9ff7894ef1eeff001f3ddc1a1caec18176428fa1.zip
Add some cleanup calls in unit tests.
Diffstat (limited to 'src/utils/xml_unittest.cc')
-rw-r--r--src/utils/xml_unittest.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/utils/xml_unittest.cc b/src/utils/xml_unittest.cc
index e2f68181e..d90bfb37d 100644
--- a/src/utils/xml_unittest.cc
+++ b/src/utils/xml_unittest.cc
@@ -21,16 +21,27 @@
#include "catch.hpp"
#include "client.h"
#include "logger.h"
+#include "graphicsmanager.h"
+#include "being/actorsprite.h"
+
+#include "gui/theme.h"
+
+#include "utils/delete2.h"
+#include "utils/env.h"
#include "utils/physfstools.h"
#include "utils/xml.h"
+#include "resources/sdlimagehelper.h"
+
#include "resources/resourcemanager/resourcemanager.h"
#include "debug.h"
TEST_CASE("xml doc")
{
+ setEnv("SDL_VIDEODRIVER", "dummy");
+
client = new Client;
PHYSFS_init("manaplus");
dirSeparator = "/";
@@ -39,7 +50,19 @@ TEST_CASE("xml doc")
ResourceManager::init();
resourceManager->addToSearchPath("data", Append_false);
resourceManager->addToSearchPath("../data", Append_false);
+ 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
+
+ theme = new Theme;
+ Theme::selectSkin();
const char *const tempXmlName = "tempxml.xml";
+ ActorSprite::load();
SECTION("load1")
{
@@ -326,4 +349,5 @@ TEST_CASE("xml doc")
// clean again
::remove(tempXmlName);
}
+ delete2(client);
}