summaryrefslogtreecommitdiff
path: root/src/resources/map/maplayer_unittest.cc
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-02 19:22:45 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-02 19:22:45 +0300
commitfc28eefaed2c71a824677b613f87dc4ceaea243b (patch)
treeaf0905e94205ac3e18cf130041980c8f675b658f /src/resources/map/maplayer_unittest.cc
parent59559081b9477a14a748ca66a5ede1b7457c1a46 (diff)
downloadManaVerse-fc28eefaed2c71a824677b613f87dc4ceaea243b.tar.gz
ManaVerse-fc28eefaed2c71a824677b613f87dc4ceaea243b.tar.bz2
ManaVerse-fc28eefaed2c71a824677b613f87dc4ceaea243b.tar.xz
ManaVerse-fc28eefaed2c71a824677b613f87dc4ceaea243b.zip
Fix nullpointer access in special layer draw function.
Diffstat (limited to 'src/resources/map/maplayer_unittest.cc')
-rw-r--r--src/resources/map/maplayer_unittest.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/resources/map/maplayer_unittest.cc b/src/resources/map/maplayer_unittest.cc
index 103d019cd..bd58d998c 100644
--- a/src/resources/map/maplayer_unittest.cc
+++ b/src/resources/map/maplayer_unittest.cc
@@ -2117,8 +2117,14 @@ TEST_CASE("MapLayer drawSpecialLayer (tempLayer)")
layer->setTempLayer(map->getTempLayer());
TileInfo *const tiles = layer->getTiles();
specialLayer = map->getTempLayer();
+ const int *const cache = specialLayer->getCache();
+ REQUIRE(cache[0] == 10000);
+ REQUIRE(cache[1] == 10000);
+
specialLayer->setTile(1, 0, MapItemType::ARROW_UP);
specialLayer->updateCache();
+ REQUIRE(cache[0] == 0);
+ REQUIRE(cache[1] == 10000);
layer->drawSpecialLayer(mock,
0,