summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAsheem Mamoowala <asheem.mamoowala@mapbox.com>2017-05-02 09:54:06 -0700
committerGitHub <noreply@github.com>2017-05-02 09:54:06 -0700
commit5c52401d5504ab4b84d1510042c6b97504c50933 (patch)
tree3bd2feb4e985f5402ec0fc112aab6717426d46aa /test
parent3f0c89d633a5056006557ad5f4b9e446807d00ee (diff)
downloadqtlocation-mapboxgl-5c52401d5504ab4b84d1510042c6b97504c50933.tar.gz
[core] Make Map.addImage tests pass (#8843)
Fix Node tests suite implementation to parse pixelRatio from style json Premultiply images in the node binding before sending to mbgl core
Diffstat (limited to 'test')
-rw-r--r--test/util/image.test.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/util/image.test.cpp b/test/util/image.test.cpp
index 0cd4a7d8af..4cacf89253 100644
--- a/test/util/image.test.cpp
+++ b/test/util/image.test.cpp
@@ -115,6 +115,21 @@ TEST(Image, Copy) {
EXPECT_THROW(PremultipliedImage::copy(src10, dst10, {0, 0}, {0, 1}, {0, max}), std::out_of_range);
}
+TEST(Image, Move) {
+ UnassociatedImage rgba({ 1, 1 });
+ rgba.data[0] = 255;
+ rgba.data[1] = 254;
+ rgba.data[2] = 253;
+ rgba.data[3] = 128;
+
+ auto moved = std::move(rgba);
+
+ EXPECT_EQ(0u, rgba.size.width);
+ EXPECT_EQ(nullptr, rgba.data.get());
+ EXPECT_EQ(254, moved.data[1]);
+ EXPECT_EQ(1u, moved.size.width);
+}
+
TEST(Image, Premultiply) {
UnassociatedImage rgba({ 1, 1 });
rgba.data[0] = 255;