summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Paczos <lukasz.paczos@mapbox.com>2020-04-10 17:47:42 +0200
committerŁukasz Paczos <lukasz.paczos@mapbox.com>2020-04-14 17:32:00 +0200
commit08ad74216442a8c306a3d7ca4696f5ddb780557f (patch)
treee6a5f66486b68fdc3c11db156083c5332b251ae3
parentf79334c12440f5a8a52bcbe4e5978a4f13381aec (diff)
downloadqtlocation-mapboxgl-08ad74216442a8c306a3d7ca4696f5ddb780557f.tar.gz
[core] add regression test for #16391
-rw-r--r--test/style/style.test.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/style/style.test.cpp b/test/style/style.test.cpp
index 2c9cdb5792..e47ae542bb 100644
--- a/test/style/style.test.cpp
+++ b/test/style/style.test.cpp
@@ -140,4 +140,22 @@ TEST(Style, AddRemoveImage) {
EXPECT_TRUE(!!style.getImage("three"));
EXPECT_FALSE(!!style.getImage("two"));
EXPECT_FALSE(!!style.getImage("four"));
+}
+
+TEST(Style, AddRemoveRemoveImage) {
+ // regression test for https://github.com/mapbox/mapbox-gl-native/pull/16391
+ util::RunLoop loop;
+ auto fileSource = std::make_shared<StubFileSource>();
+ Style::Impl style{fileSource, 1.0};
+ style.addImage(std::make_unique<style::Image>("one", PremultipliedImage({16, 16}), 2));
+ style.addImage(std::make_unique<style::Image>("two", PremultipliedImage({16, 16}), 2));
+ style.addImage(std::make_unique<style::Image>("three", PremultipliedImage({16, 16}), 2));
+
+ style.removeImage("one");
+ style.removeImage("two");
+ style.removeImage("two");
+
+ EXPECT_TRUE(!!style.getImage("three"));
+ EXPECT_FALSE(!!style.getImage("two"));
+ EXPECT_FALSE(!!style.getImage("four"));
} \ No newline at end of file