From f38330a9f58ca3b2664168c7830811055870bc42 Mon Sep 17 00:00:00 2001 From: Mikhail Pozdnyakov Date: Tue, 11 Feb 2020 11:37:35 +0200 Subject: Add Style.AddRemoveImage unit test --- test/style/style.test.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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(); + Style::Impl style{fileSource, 1.0}; + style.addImage(std::make_unique("one", PremultipliedImage({16, 16}), 2)); + style.addImage(std::make_unique("two", PremultipliedImage({16, 16}), 2)); + style.addImage(std::make_unique("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 -- cgit v1.2.1