diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-02-02 19:22:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-02-02 19:22:45 +0300 |
commit | fc28eefaed2c71a824677b613f87dc4ceaea243b (patch) | |
tree | af0905e94205ac3e18cf130041980c8f675b658f /src/resources/map/maplayer_unittest.cc | |
parent | 59559081b9477a14a748ca66a5ede1b7457c1a46 (diff) | |
download | mv-fc28eefaed2c71a824677b613f87dc4ceaea243b.tar.gz mv-fc28eefaed2c71a824677b613f87dc4ceaea243b.tar.bz2 mv-fc28eefaed2c71a824677b613f87dc4ceaea243b.tar.xz mv-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.cc | 6 |
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, |