summaryrefslogtreecommitdiff
path: root/test/sprite
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-02-13 12:44:43 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-02-14 12:29:01 -0600
commitc6d5eaf47941162ee6166842d5434a0e3a6c33a0 (patch)
tree53f4b6a78f3c3db2eb76965189881021c9ebaa0c /test/sprite
parent43e81509fb0be54bea5912fb5a10bfa0e0667a44 (diff)
downloadqtlocation-mapboxgl-c6d5eaf47941162ee6166842d5434a0e3a6c33a0.tar.gz
[tests] Use test::checkImage
Diffstat (limited to 'test/sprite')
-rw-r--r--test/sprite/sprite_atlas.test.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/test/sprite/sprite_atlas.test.cpp b/test/sprite/sprite_atlas.test.cpp
index c9576013d4..67db917602 100644
--- a/test/sprite/sprite_atlas.test.cpp
+++ b/test/sprite/sprite_atlas.test.cpp
@@ -15,14 +15,6 @@
using namespace mbgl;
-namespace {
-
-auto readImage(const std::string& name) {
- return decodeImage(util::read_file(name));
-}
-
-} // namespace
-
TEST(SpriteAtlas, Basic) {
FixtureLog log;
@@ -75,7 +67,7 @@ TEST(SpriteAtlas, Basic) {
EXPECT_EQ(20, metro2.pos.w);
EXPECT_EQ(20, metro2.pos.h);
- EXPECT_EQ(readImage("test/fixtures/annotations/result-spriteatlas.png"), atlas.getAtlasImage());
+ test::checkImage("test/fixtures/sprite_atlas/basic", atlas.getAtlasImage());
}
TEST(SpriteAtlas, Size) {
@@ -104,8 +96,7 @@ TEST(SpriteAtlas, Size) {
EXPECT_EQ(89u, atlas.getAtlasImage().size.width);
EXPECT_EQ(157u, atlas.getAtlasImage().size.height);
- EXPECT_EQ(readImage("test/fixtures/annotations/result-spriteatlassize.png"),
- atlas.getAtlasImage());
+ test::checkImage("test/fixtures/sprite_atlas/size", atlas.getAtlasImage());
}
TEST(SpriteAtlas, Updates) {
@@ -131,8 +122,7 @@ TEST(SpriteAtlas, Updates) {
EXPECT_EQ(32u, atlas.getAtlasImage().size.width);
EXPECT_EQ(32u, atlas.getAtlasImage().size.height);
- EXPECT_EQ(readImage("test/fixtures/annotations/result-spriteatlas-empty.png"),
- atlas.getAtlasImage());
+ test::checkImage("test/fixtures/sprite_atlas/updates_before", atlas.getAtlasImage());
// Update sprite
PremultipliedImage image2({ 16, 12 });
@@ -144,14 +134,12 @@ TEST(SpriteAtlas, Updates) {
ASSERT_EQ(newSprite, atlas.getSprite("one"));
// Atlas texture hasn't changed yet.
- EXPECT_EQ(readImage("test/fixtures/annotations/result-spriteatlas-empty.png"),
- atlas.getAtlasImage());
+ test::checkImage("test/fixtures/sprite_atlas/updates_before", atlas.getAtlasImage());
atlas.updateDirty();
// Now the atlas texture has changed.
- EXPECT_EQ(readImage("test/fixtures/annotations/result-spriteatlas-updated.png"),
- atlas.getAtlasImage());
+ test::checkImage("test/fixtures/sprite_atlas/updates_after", atlas.getAtlasImage());
}
TEST(SpriteAtlas, AddRemove) {