diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-02-13 12:44:43 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-02-14 12:29:01 -0600 |
commit | c6d5eaf47941162ee6166842d5434a0e3a6c33a0 (patch) | |
tree | 53f4b6a78f3c3db2eb76965189881021c9ebaa0c /test | |
parent | 43e81509fb0be54bea5912fb5a10bfa0e0667a44 (diff) | |
download | qtlocation-mapboxgl-c6d5eaf47941162ee6166842d5434a0e3a6c33a0.tar.gz |
[tests] Use test::checkImage
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/sprite_atlas/basic/expected.png (renamed from test/fixtures/annotations/result-spriteatlas.png) | bin | 1124 -> 1124 bytes | |||
-rw-r--r-- | test/fixtures/sprite_atlas/size/expected.png (renamed from test/fixtures/annotations/result-spriteatlassize.png) | bin | 1118 -> 1118 bytes | |||
-rw-r--r-- | test/fixtures/sprite_atlas/updates_after/expected.png (renamed from test/fixtures/annotations/result-spriteatlas-updated.png) | bin | 135 -> 135 bytes | |||
-rw-r--r-- | test/fixtures/sprite_atlas/updates_before/expected.png (renamed from test/fixtures/annotations/result-spriteatlas-empty.png) | bin | 110 -> 110 bytes | |||
-rw-r--r-- | test/sprite/sprite_atlas.test.cpp | 22 |
5 files changed, 5 insertions, 17 deletions
diff --git a/test/fixtures/annotations/result-spriteatlas.png b/test/fixtures/sprite_atlas/basic/expected.png Binary files differindex e886e060fe..e886e060fe 100644 --- a/test/fixtures/annotations/result-spriteatlas.png +++ b/test/fixtures/sprite_atlas/basic/expected.png diff --git a/test/fixtures/annotations/result-spriteatlassize.png b/test/fixtures/sprite_atlas/size/expected.png Binary files differindex d9ae7dab47..d9ae7dab47 100644 --- a/test/fixtures/annotations/result-spriteatlassize.png +++ b/test/fixtures/sprite_atlas/size/expected.png diff --git a/test/fixtures/annotations/result-spriteatlas-updated.png b/test/fixtures/sprite_atlas/updates_after/expected.png Binary files differindex 3c850c0a25..3c850c0a25 100644 --- a/test/fixtures/annotations/result-spriteatlas-updated.png +++ b/test/fixtures/sprite_atlas/updates_after/expected.png diff --git a/test/fixtures/annotations/result-spriteatlas-empty.png b/test/fixtures/sprite_atlas/updates_before/expected.png Binary files differindex effcd38f1e..effcd38f1e 100644 --- a/test/fixtures/annotations/result-spriteatlas-empty.png +++ b/test/fixtures/sprite_atlas/updates_before/expected.png 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) { |