From 5c52401d5504ab4b84d1510042c6b97504c50933 Mon Sep 17 00:00:00 2001 From: Asheem Mamoowala Date: Tue, 2 May 2017 09:54:06 -0700 Subject: [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 --- test/util/image.test.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test') 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; -- cgit v1.2.1