summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2020-02-11 11:37:35 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2020-02-11 12:31:36 +0200
commit5fd70774ef970f60c7920f4f0e3455badd842267 (patch)
treed505211e698859f3cd18e5e841103bce9cc5b805
parent4c5f674377a2915e4d07ae4e417c8fd184d55e6c (diff)
downloadqtlocation-mapboxgl-5fd70774ef970f60c7920f4f0e3455badd842267.tar.gz
Add Style.AddRemoveImage unit test
-rw-r--r--test/style/style.test.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/style/style.test.cpp b/test/style/style.test.cpp
index c866431ac1..2c9cdb5792 100644
--- a/test/style/style.test.cpp
+++ b/test/style/style.test.cpp
@@ -125,3 +125,19 @@ TEST(Style, SourceImplsOrder) {
EXPECT_EQ("b", sourceImpls[1]->id);
EXPECT_EQ("c", sourceImpls[2]->id);
}
+
+TEST(Style, AddRemoveImage) {
+ 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");
+
+ EXPECT_TRUE(!!style.getImage("three"));
+ EXPECT_FALSE(!!style.getImage("two"));
+ EXPECT_FALSE(!!style.getImage("four"));
+} \ No newline at end of file