summaryrefslogtreecommitdiff
path: root/src/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'src/unittests')
-rw-r--r--src/unittests/resources/map/maplayer/draw.cc12
-rw-r--r--src/unittests/resources/map/maplayer/getemptytiledrawwidth.cc14
-rw-r--r--src/unittests/resources/map/maplayer/gettiledrawwidth.cc14
-rw-r--r--src/unittests/resources/map/maplayer/updatecache.cc14
-rw-r--r--src/unittests/resources/map/maplayer/updateconditiontiles.cc14
5 files changed, 68 insertions, 0 deletions
diff --git a/src/unittests/resources/map/maplayer/draw.cc b/src/unittests/resources/map/maplayer/draw.cc
index e7410e22e..ac7fba9b7 100644
--- a/src/unittests/resources/map/maplayer/draw.cc
+++ b/src/unittests/resources/map/maplayer/draw.cc
@@ -20,8 +20,13 @@
#include "unittests/unittests.h"
+#include "configmanager.h"
+#include "dirs.h"
+
#include "unittests/render/mockgraphics.h"
+#include "utils/delete2.h"
+
#include "resources/image/image.h"
#include "resources/map/map.h"
@@ -31,6 +36,13 @@
TEST_CASE("MapLayer draw", "")
{
+ logger = new Logger;
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ ConfigManager::initConfiguration();
+
Image *const img1 = new Image(32, 32);
Image *const img2 = new Image(32, 32);
Image *const img3 = new Image(32, 32);
diff --git a/src/unittests/resources/map/maplayer/getemptytiledrawwidth.cc b/src/unittests/resources/map/maplayer/getemptytiledrawwidth.cc
index f4d65a0ab..679a09271 100644
--- a/src/unittests/resources/map/maplayer/getemptytiledrawwidth.cc
+++ b/src/unittests/resources/map/maplayer/getemptytiledrawwidth.cc
@@ -20,6 +20,12 @@
#include "unittests/unittests.h"
+#include "configmanager.h"
+#include "dirs.h"
+#include "logger.h"
+
+#include "utils/delete2.h"
+
#include "resources/image/image.h"
#include "resources/map/maplayer.h"
@@ -28,6 +34,13 @@
TEST_CASE("MapLayer getEmptyTileDrawWidth", "")
{
+ logger = new Logger;
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ ConfigManager::initConfiguration();
+
Image *const img1 = new Image(32, 32);
Image *const img2 = new Image(32, 32);
Image *const img3 = new Image(32, 32);
@@ -151,4 +164,5 @@ TEST_CASE("MapLayer getEmptyTileDrawWidth", "")
delete img1;
delete img2;
delete img3;
+ delete2(logger);
}
diff --git a/src/unittests/resources/map/maplayer/gettiledrawwidth.cc b/src/unittests/resources/map/maplayer/gettiledrawwidth.cc
index c7cbf2a8e..53fde8f49 100644
--- a/src/unittests/resources/map/maplayer/gettiledrawwidth.cc
+++ b/src/unittests/resources/map/maplayer/gettiledrawwidth.cc
@@ -20,6 +20,12 @@
#include "unittests/unittests.h"
+#include "configmanager.h"
+#include "dirs.h"
+#include "logger.h"
+
+#include "utils/delete2.h"
+
#include "resources/image/image.h"
#include "resources/map/maplayer.h"
@@ -28,6 +34,13 @@
TEST_CASE("MapLayer getTileDrawWidth", "")
{
+ logger = new Logger;
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ ConfigManager::initConfiguration();
+
Image *const img1 = new Image(32, 32);
Image *const img2 = new Image(32, 32);
Image *const img3 = new Image(32, 32);
@@ -388,4 +401,5 @@ TEST_CASE("MapLayer getTileDrawWidth", "")
delete img1;
delete img2;
delete img3;
+ delete2(logger);
}
diff --git a/src/unittests/resources/map/maplayer/updatecache.cc b/src/unittests/resources/map/maplayer/updatecache.cc
index 472291b48..3cf7e8981 100644
--- a/src/unittests/resources/map/maplayer/updatecache.cc
+++ b/src/unittests/resources/map/maplayer/updatecache.cc
@@ -20,6 +20,12 @@
#include "unittests/unittests.h"
+#include "configmanager.h"
+#include "dirs.h"
+#include "logger.h"
+
+#include "utils/delete2.h"
+
#include "resources/image/image.h"
#include "resources/map/maplayer.h"
@@ -28,6 +34,13 @@
TEST_CASE("MapLayer updateCache", "")
{
+ logger = new Logger;
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ ConfigManager::initConfiguration();
+
Image *const img1 = new Image(32, 32);
Image *const img2 = new Image(32, 32);
Image *const img3 = new Image(32, 32);
@@ -388,4 +401,5 @@ TEST_CASE("MapLayer updateCache", "")
delete img1;
delete img2;
delete img3;
+ delete2(logger);
}
diff --git a/src/unittests/resources/map/maplayer/updateconditiontiles.cc b/src/unittests/resources/map/maplayer/updateconditiontiles.cc
index 62535d351..73ed58108 100644
--- a/src/unittests/resources/map/maplayer/updateconditiontiles.cc
+++ b/src/unittests/resources/map/maplayer/updateconditiontiles.cc
@@ -20,8 +20,14 @@
#include "unittests/unittests.h"
+#include "configmanager.h"
+#include "dirs.h"
+#include "logger.h"
+
#include "enums/resources/map/blockmask.h"
+#include "utils/delete2.h"
+
#include "resources/image/image.h"
#include "resources/map/map.h"
@@ -31,6 +37,13 @@
TEST_CASE("MapLayer updateConditionTiles", "")
{
+ logger = new Logger;
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ ConfigManager::initConfiguration();
+
Image *const img1 = new Image(32, 32);
Map *map = nullptr;
MapLayer *layer = nullptr;
@@ -220,4 +233,5 @@ TEST_CASE("MapLayer updateConditionTiles", "")
delete map;
delete img1;
+ delete2(logger);
}