diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-06-29 22:17:11 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-07-04 15:50:50 +0300 |
commit | 9a0c5b4dfa7fdb6f980d03bbfb93064e9f2ec81d (patch) | |
tree | 35a6324ec3145a285871c7fc97235aeece6673cb /test | |
parent | b5fed1172d77bac0ba122c73a9d30739a51e5028 (diff) | |
download | qtlocation-mapboxgl-9a0c5b4dfa7fdb6f980d03bbfb93064e9f2ec81d.tar.gz |
[test] Use test::checkImage in API.RepeatedRender
Diffstat (limited to 'test')
-rw-r--r-- | test/api/repeated_render.test.cpp | 14 | ||||
-rw-r--r-- | test/fixtures/api/repeated_render/expected.png | bin | 0 -> 31046 bytes |
2 files changed, 5 insertions, 9 deletions
diff --git a/test/api/repeated_render.test.cpp b/test/api/repeated_render.test.cpp index b6565dbf23..3da65939cc 100644 --- a/test/api/repeated_render.test.cpp +++ b/test/api/repeated_render.test.cpp @@ -25,7 +25,7 @@ TEST(API, RepeatedRender) { HeadlessBackend backend { test::sharedDisplay() }; BackendScope scope { backend }; - OffscreenView view { backend.getContext(), { 256, 512 } }; + OffscreenView view { backend.getContext(), { 512, 512 } }; DefaultFileSource fileSource(":memory:", "test/fixtures/api/assets"); ThreadPool threadPool(4); @@ -44,11 +44,9 @@ TEST(API, RepeatedRender) { loop.runOnce(); } - ASSERT_EQ(256u, result.size.width); + ASSERT_EQ(512u, result.size.width); ASSERT_EQ(512u, result.size.height); -#if !TEST_READ_ONLY - util::write_file("test/fixtures/api/1.png", encodePNG(result)); -#endif + test::checkImage("test/fixtures/api/repeated_render", result, 0.0003, 0.1); } { @@ -62,11 +60,9 @@ TEST(API, RepeatedRender) { loop.runOnce(); } - ASSERT_EQ(256u, result.size.width); + ASSERT_EQ(512u, result.size.width); ASSERT_EQ(512u, result.size.height); -#if !TEST_READ_ONLY - util::write_file("test/fixtures/api/2.png", encodePNG(result)); -#endif + test::checkImage("test/fixtures/api/repeated_render", result, 0.0003, 0.1); } auto observer = Log::removeObserver(); diff --git a/test/fixtures/api/repeated_render/expected.png b/test/fixtures/api/repeated_render/expected.png Binary files differnew file mode 100644 index 0000000000..927f6d4c82 --- /dev/null +++ b/test/fixtures/api/repeated_render/expected.png |