[test] Use test::checkImage in API.RepeatedRender
This commit is contained in:
@@ -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();
|
||||
|
||||
BIN
test/fixtures/api/repeated_render/expected.png
vendored
Normal file
BIN
test/fixtures/api/repeated_render/expected.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Reference in New Issue
Block a user