From ece98b5c7baefc8fe0326bdfea8de4fe14ed0bf2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2016 17:24:19 +0300 Subject: Fix asserts in unit tests. --- src/gui/widgets/browserbox_unittest.cc | 3 +++ src/gui/windowmanager_unittest.cc | 3 +++ src/integrity_unittest.cc | 3 +++ src/resources/sprite/animatedsprite_unittest.cc | 3 +++ 4 files changed, 12 insertions(+) (limited to 'src') diff --git a/src/gui/widgets/browserbox_unittest.cc b/src/gui/widgets/browserbox_unittest.cc index 1bae1f294..9aadeac09 100644 --- a/src/gui/widgets/browserbox_unittest.cc +++ b/src/gui/widgets/browserbox_unittest.cc @@ -21,6 +21,8 @@ #include "catch.hpp" #include "client.h" +#include "being/actorsprite.h" + #include "gui/fonts/font.h" #include "gui/widgets/browserbox.h" @@ -41,6 +43,7 @@ TEST_CASE("BrowserBox tests", "browserbox") logger = new Logger(); imageHelper = new SDLImageHelper(); theme = new Theme; + ActorSprite::load(); Widget::setGlobalFont(new Font("/usr/share/fonts/truetype/" "ttf-dejavu/DejaVuSans-Oblique.ttf", 18)); BrowserBox *const box = new BrowserBox(nullptr, diff --git a/src/gui/windowmanager_unittest.cc b/src/gui/windowmanager_unittest.cc index f6de6f517..ffaa00d67 100644 --- a/src/gui/windowmanager_unittest.cc +++ b/src/gui/windowmanager_unittest.cc @@ -23,6 +23,8 @@ #include "graphicsmanager.h" #include "settings.h" +#include "being/actorsprite.h" + #include "gui/gui.h" #include "gui/userpalette.h" @@ -75,6 +77,7 @@ TEST_CASE("Windows tests", "windowmanager") imageHelper = new SDLImageHelper; userPalette = new UserPalette; theme = new Theme; + ActorSprite::load(); gui = new Gui(); gui->postInit(mainGraphics); diff --git a/src/integrity_unittest.cc b/src/integrity_unittest.cc index 432163214..45c36b0ce 100644 --- a/src/integrity_unittest.cc +++ b/src/integrity_unittest.cc @@ -25,6 +25,8 @@ #include "logger.h" #include "graphicsmanager.h" +#include "being/actorsprite.h" + #include "input/inputactionmap.h" #include "input/inputmanager.h" @@ -79,6 +81,7 @@ TEST_CASE("integrity tests", "integrity") #else graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif + ActorSprite::load(); SECTION("integrity test 1") { diff --git a/src/resources/sprite/animatedsprite_unittest.cc b/src/resources/sprite/animatedsprite_unittest.cc index c924580a6..917e53c10 100644 --- a/src/resources/sprite/animatedsprite_unittest.cc +++ b/src/resources/sprite/animatedsprite_unittest.cc @@ -26,6 +26,8 @@ #include "const/resources/spriteaction.h" +#include "being/actorsprite.h" + #include "gui/theme.h" #include "resources/resourcemanager.h" @@ -53,6 +55,7 @@ TEST_CASE("AnimatedSprite tests", "animatedsprite") ResourceManager::init(); resourceManager->addToSearchPath("data", Append_false); resourceManager->addToSearchPath("../data", Append_false); + ActorSprite::load(); imageHelper = new SDLImageHelper(); #ifdef USE_SDL2 -- cgit v1.2.3-70-g09d2