Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] add regression test for #16391
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasPaczos committed Apr 10, 2020
1 parent f79334c commit 7eb8025
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/style/style.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,23 @@ TEST(Style, AddRemoveImage) {
style.removeImage("one");
style.removeImage("two");

EXPECT_TRUE(!!style.getImage("three"));
EXPECT_FALSE(!!style.getImage("two"));
EXPECT_FALSE(!!style.getImage("four"));
}

TEST(Style, AddRemoveRemoveImage) {
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"));
Expand Down

0 comments on commit 7eb8025

Please sign in to comment.