From dcae6395af5857d5ff077443d5e79058977de6f7 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 8 Dec 2014 18:13:23 -0500 Subject: [PATCH] start testing tiff read and image type returned --- tests/cxx/tiff_io.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/cxx/tiff_io.cpp b/tests/cxx/tiff_io.cpp index af5e9e81a..65926f3f9 100644 --- a/tests/cxx/tiff_io.cpp +++ b/tests/cxx/tiff_io.cpp @@ -39,6 +39,9 @@ SECTION("rgba8 striped") { REQUIRE( tiff_reader.is_tiled() == false ); REQUIRE( tiff_reader.tile_width() == 0 ); REQUIRE( tiff_reader.tile_height() == 0 ); + REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_RGB ); + mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_ALPHA } @@ -49,6 +52,8 @@ SECTION("rgba8 tiled") { REQUIRE( tiff_reader.tile_width() == 256 ); REQUIRE( tiff_reader.tile_height() == 256 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_RGB ); + mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_ALPHA } @@ -59,6 +64,8 @@ SECTION("rgb8 striped") { REQUIRE( tiff_reader.tile_width() == 0 ); REQUIRE( tiff_reader.tile_height() == 0 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_RGB ); + mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_NO_ALPHA } @@ -69,6 +76,8 @@ SECTION("rgb8 tiled") { REQUIRE( tiff_reader.tile_width() == 256 ); REQUIRE( tiff_reader.tile_height() == 256 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_RGB ); + mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_NO_ALPHA } @@ -79,6 +88,8 @@ SECTION("gray8 striped") { REQUIRE( tiff_reader.tile_width() == 0 ); REQUIRE( tiff_reader.tile_height() == 0 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); + mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_NO_ALPHA } @@ -89,6 +100,8 @@ SECTION("gray8 tiled") { REQUIRE( tiff_reader.tile_width() == 256 ); REQUIRE( tiff_reader.tile_height() == 256 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); + mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_NO_ALPHA } @@ -99,6 +112,8 @@ SECTION("gray16 striped") { REQUIRE( tiff_reader.tile_width() == 0 ); REQUIRE( tiff_reader.tile_height() == 0 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); + mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_NO_ALPHA } @@ -109,6 +124,8 @@ SECTION("gray16 tiled") { REQUIRE( tiff_reader.tile_width() == 256 ); REQUIRE( tiff_reader.tile_height() == 256 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); + mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_NO_ALPHA } @@ -119,6 +136,8 @@ SECTION("gray32f striped") { REQUIRE( tiff_reader.tile_width() == 0 ); REQUIRE( tiff_reader.tile_height() == 0 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); + mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_NO_ALPHA } @@ -129,6 +148,8 @@ SECTION("gray32f tiled") { REQUIRE( tiff_reader.tile_width() == 256 ); REQUIRE( tiff_reader.tile_height() == 256 ); REQUIRE( tiff_reader.photometric() == PHOTOMETRIC_MINISBLACK ); + mapnik::image_data_any data = reader->read(0, 0, reader->width(), reader->height()); + REQUIRE( data.is() == true ); TIFF_ASSERT_NO_ALPHA }