summaryrefslogtreecommitdiff
path: root/test/src/mbgl/test/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/mbgl/test/util.cpp')
-rw-r--r--test/src/mbgl/test/util.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/test/src/mbgl/test/util.cpp b/test/src/mbgl/test/util.cpp
index 7f98c43dc9..2a82e0059f 100644
--- a/test/src/mbgl/test/util.cpp
+++ b/test/src/mbgl/test/util.cpp
@@ -104,7 +104,7 @@ PremultipliedImage render(Map& map, OffscreenView& view) {
result = view.readStillImage();
});
- while (!result.size()) {
+ while (!result.valid()) {
util::RunLoop::Get()->runOnce();
}
@@ -132,24 +132,23 @@ void checkImage(const std::string& base,
}
PremultipliedImage expected = decodeImage(expected_image);
- PremultipliedImage diff { expected.width, expected.height };
+ PremultipliedImage diff { expected.size };
#if !TEST_READ_ONLY
util::write_file(base + "/actual.png", encodePNG(actual));
#endif
- ASSERT_EQ(expected.width, actual.width);
- ASSERT_EQ(expected.height, actual.height);
+ ASSERT_EQ(expected.size, actual.size);
double pixels = mapbox::pixelmatch(actual.data.get(),
expected.data.get(),
- expected.width,
- expected.height,
+ expected.size.width,
+ expected.size.height,
diff.data.get(),
pixelThreshold);
- EXPECT_LE(pixels / (expected.width * expected.height), imageThreshold);
+ EXPECT_LE(pixels / (expected.size.width * expected.size.height), imageThreshold);
#if !TEST_READ_ONLY
util::write_file(base + "/diff.png", encodePNG(diff));