diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2020-02-11 11:37:35 +0200 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2020-02-11 14:34:46 +0200 |
commit | f38330a9f58ca3b2664168c7830811055870bc42 (patch) | |
tree | d505211e698859f3cd18e5e841103bce9cc5b805 | |
parent | 64e2bcdf4395a1c65cd9faca81f98c4c5d974bd6 (diff) | |
download | qtlocation-mapboxgl-f38330a9f58ca3b2664168c7830811055870bc42.tar.gz |
Add Style.AddRemoveImage unit test
-rw-r--r-- | test/style/style.test.cpp | 16 |
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 |