Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / gil / test / extension / io / tiff_tiled_test.cpp
1 //
2 // Copyright 2013 Christian Henning
3 //
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
7 //
8 //#define BOOST_TEST_MODULE tiff_tiled_test_module
9 #include <boost/test/unit_test.hpp>
10
11 #include <boost/gil/extension/io/tiff.hpp>
12 #include "paths.hpp"
13
14 using namespace std;
15 using namespace boost;
16 using namespace gil;
17
18 using tag_t = tiff_tag;
19
20 BOOST_AUTO_TEST_SUITE( gil_io_tiff_tests )
21
22 #ifdef BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES
23
24 BOOST_AUTO_TEST_CASE( read_tile_infos_test )
25 {
26     {
27         using backend_t = get_reader_backend<std::string const, tag_t>::type;
28
29         backend_t backend = read_image_info( tiff_in_GM + "tiger-minisblack-float-tile-16.tif"
30                                            , tag_t()
31                                            );
32
33         BOOST_CHECK_EQUAL( backend._info._tile_width , 16 );
34         BOOST_CHECK_EQUAL( backend._info._tile_length, 16 );
35     }
36
37     {
38         using backend_t = get_reader_backend<std::string const, tag_t>::type;
39
40         backend_t backend = read_image_info( tiff_in_GM + "tiger-minisblack-tile-08.tif"
41                                            , tag_t()
42                                            );
43
44         BOOST_CHECK_EQUAL( backend._info._tile_width , 16 );
45         BOOST_CHECK_EQUAL( backend._info._tile_length, 16 );
46     }
47
48     {
49         using backend_t = get_reader_backend<std::string const, tag_t>::type;
50
51         backend_t backend = read_image_info( tiff_in_GM + "tiger-palette-tile-08.tif"
52                                            , tag_t()
53                                            );
54
55         BOOST_CHECK_EQUAL( backend._info._tile_width , 16 );
56         BOOST_CHECK_EQUAL( backend._info._tile_length, 16 );
57     }
58
59     {
60         using backend_t = get_reader_backend<std::string const, tag_t>::type;
61
62         backend_t backend = read_image_info( tiff_in_GM + "tiger-rgb-tile-contig-08.tif"
63                                            , tag_t()
64                                            );
65
66         BOOST_CHECK_EQUAL( backend._info._tile_width , 16 );
67         BOOST_CHECK_EQUAL( backend._info._tile_length, 16 );
68     }
69
70     {
71         using backend_t = get_reader_backend<std::string const, tag_t>::type;
72
73         backend_t backend = read_image_info( tiff_in_GM + "tiger-rgb-tile-planar-08.tif"
74                                            , tag_t()
75                                            );
76
77         BOOST_CHECK_EQUAL( backend._info._tile_width , 16 );
78         BOOST_CHECK_EQUAL( backend._info._tile_length, 16 );
79     }
80 }
81
82 #endif // BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES
83
84 BOOST_AUTO_TEST_SUITE_END()