From 8d32becc5b0fe645d1b8dc4245310ff35ebd8777 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 17 Feb 2016 02:48:17 +0300 Subject: Fix unit tests if build with SDL2 support. --- src/integrity_unittest.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/integrity_unittest.cc') diff --git a/src/integrity_unittest.cc b/src/integrity_unittest.cc index 0fbc14efb..c24452ae2 100644 --- a/src/integrity_unittest.cc +++ b/src/integrity_unittest.cc @@ -23,6 +23,9 @@ #include "catch.hpp" #include "client.h" #include "logger.h" +#ifdef USE_SDL2 +#include "graphicsmanager.h" +#endif #include "input/inputactionmap.h" #include "input/inputmanager.h" @@ -73,7 +76,13 @@ TEST_CASE("integrity tests", "integrity") resourceManager->addToSearchPath("../data", Append_false); imageHelper = new SDLImageHelper(); - SDL_SetVideoMode(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); +#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 SECTION("integrity test 1") { -- cgit v1.2.3-60-g2f50