1 // Boost.Polygon library polygon_90_data_test.cpp file
3 // Copyright Andrii Sydorchuk 2015.
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)
8 // See http://www.boost.org for updates, documentation, and revision history.
10 #define BOOST_TEST_MODULE POLYGON_90_DATA_TEST
13 #include <boost/mpl/list.hpp>
14 #include <boost/test/test_case_template.hpp>
16 #include "boost/polygon/polygon.hpp"
17 using namespace boost::polygon
;
21 typedef boost::mpl::list
<int> test_types
;
23 BOOST_AUTO_TEST_CASE_TEMPLATE(polygon_90_data_test
, T
, test_types
) {
24 typedef polygon_90_data
<int> polygon_type
;
25 typedef polygon_traits_90
<polygon_type
>::point_type point_type
;
26 typedef polygon_type::iterator_type iterator_type
;
28 std::vector
<point_type
> data
;
29 data
.push_back(point_type(0, 0)); // 1
30 data
.push_back(point_type(10, 0)); // 2
31 data
.push_back(point_type(10, 10)); // 3
32 data
.push_back(point_type(0, 10)); // 4
35 polygon
.set(data
.begin(), data
.end());
37 std::cout
<< "Interesting: " << std::endl
;
38 for (polygon_type::compact_iterator_type it
= polygon
.begin_compact(); it
!= polygon
.end_compact(); ++it
) {
39 std::cout
<< *it
<< " ";
41 std::cout
<< std::endl
;
43 iterator_type it
= polygon
.begin();
44 for (int i
= 0; i
< 2; i
++) {
48 iterator_type it_3rd
= it
;
50 BOOST_CHECK(it
!= it_3rd
);