From 60c79d66148874ba122eb2381b85232ef9b4032d Mon Sep 17 00:00:00 2001 From: artemp Date: Wed, 16 Sep 2015 11:47:36 +0100 Subject: [PATCH] image unit test - make test image 16x16 + add more checks --- test/unit/imaging/image.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/unit/imaging/image.cpp b/test/unit/imaging/image.cpp index f89429d2d..b0b3a03b6 100644 --- a/test/unit/imaging/image.cpp +++ b/test/unit/imaging/image.cpp @@ -292,9 +292,9 @@ SECTION("Image Buffer") SECTION("Image copy/move") { - mapnik::detail::buffer buf(256 * 256 * 4); // large enough to hold 256*256 RGBA image - CHECK(buf.size() == 256 * 256 * 4); - mapnik::image_rgba8 im(256, 256, buf.data()); // shallow copy + mapnik::detail::buffer buf(16 * 16 * 4); // large enough to hold 16*16 RGBA image + CHECK(buf.size() == 16 * 16 * 4); + mapnik::image_rgba8 im(16, 16, buf.data()); // shallow copy // fill buffer with 0xff std::fill(buf.data(), buf.data() + buf.size(), 0xff); std::size_t count = 0; @@ -306,6 +306,7 @@ SECTION("Image copy/move") ++count; } CHECK( count == im.width() * im.height()); + CHECK( buf.size() == im.width() * im.height() * sizeof( mapnik::image_rgba8::pixel_type)); // mutate buffer // fill buffer with 0x7f - semi-transparent grey