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

Commit

Permalink
Add Style.AddRemoveImage unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
pozdnyakov committed Feb 11, 2020
1 parent 7758ff0 commit 43cc398
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/style/style.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

0 comments on commit 43cc398

Please sign in to comment.