summaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-10-26 15:22:31 -0700
committerKonstantin Käfer <mail@kkaefer.com>2016-10-27 18:30:58 -0700
commit62b56b799a7d4fcd1a8f151eed878054b862da5b (patch)
tree34d510a69f9dd1bca30e9b137feffbd1eb6495d0 /test/src
parentef8017198ce8f0bd79ba5a5ed31e35a16e3433bb (diff)
downloadqtlocation-mapboxgl-62b56b799a7d4fcd1a8f151eed878054b862da5b.tar.gz
[core] change std::array<uint16_t, 2> to mbgl::Size
Diffstat (limited to 'test/src')
-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));