diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-02-20 15:51:27 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-02-20 15:51:27 +0300 |
commit | cf772ab6f9fdfe1647b9b7b79aab685ebc831f31 (patch) | |
tree | 25cdb35a8733efe3a4cb90e36cbb89e8e0c24c10 /src/resources/map/maplayer_unittest.cc | |
parent | 80ba4766d8ce9861f6d026e791abc741e3fed0f4 (diff) | |
download | manaverse-cf772ab6f9fdfe1647b9b7b79aab685ebc831f31.tar.gz manaverse-cf772ab6f9fdfe1647b9b7b79aab685ebc831f31.tar.bz2 manaverse-cf772ab6f9fdfe1647b9b7b79aab685ebc831f31.tar.xz manaverse-cf772ab6f9fdfe1647b9b7b79aab685ebc831f31.zip |
Fix some leaks in unit tests.
Add support for suppression some leaks in asan.
Diffstat (limited to 'src/resources/map/maplayer_unittest.cc')
-rw-r--r-- | src/resources/map/maplayer_unittest.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/resources/map/maplayer_unittest.cc b/src/resources/map/maplayer_unittest.cc index 75bd20219..5d7f5c258 100644 --- a/src/resources/map/maplayer_unittest.cc +++ b/src/resources/map/maplayer_unittest.cc @@ -28,6 +28,7 @@ #include "gui/theme.h" +#include "utils/delete2.h" #include "utils/virtfs.h" #include "render/mockgraphics.h" @@ -1646,6 +1647,7 @@ TEST_CASE("MapLayer draw") TEST_CASE("MapLayer drawSpecialLayer (specialLayer)") { + logger = new Logger; ResourceManager::init(); VirtFs::addDirToSearchPath("data", Append_false); VirtFs::addDirToSearchPath("../data", Append_false); @@ -1990,10 +1992,12 @@ TEST_CASE("MapLayer drawSpecialLayer (specialLayer)") delete map; delete mock; + delete2(logger); } TEST_CASE("MapLayer drawSpecialLayer (tempLayer)") { + logger = new Logger; ResourceManager::init(); VirtFs::addDirToSearchPath("data", Append_false); VirtFs::addDirToSearchPath("../data", Append_false); @@ -2344,14 +2348,15 @@ TEST_CASE("MapLayer drawSpecialLayer (tempLayer)") delete map; delete mock; + delete2(logger); } TEST_CASE("MapLayer drawFringe") { + logger = new Logger; ResourceManager::init(); VirtFs::addDirToSearchPath("data", Append_false); VirtFs::addDirToSearchPath("../data", Append_false); - logger = new Logger; imageHelper = new SDLImageHelper; #ifdef USE_SDL2 @@ -3220,9 +3225,11 @@ TEST_CASE("MapLayer drawFringe") REQUIRE(mock->mDraws[7].image == img1); } + delete2(localPlayer); delete map; delete img1; delete img2; delete img3; delete mock; + delete2(logger); } |