]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/polygon/test/polygon_90_data_test.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / polygon / test / polygon_90_data_test.cpp
1 // Boost.Polygon library polygon_90_data_test.cpp file
2
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)
7
8 // See http://www.boost.org for updates, documentation, and revision history.
9
10 #define BOOST_TEST_MODULE POLYGON_90_DATA_TEST
11 #include <vector>
12
13 #include <boost/mpl/list.hpp>
14 #include <boost/test/test_case_template.hpp>
15
16 #include "boost/polygon/polygon.hpp"
17 using namespace boost::polygon;
18
19 #include <iostream>
20
21 typedef boost::mpl::list<int> test_types;
22
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;
27
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
33
34 polygon_type polygon;
35 polygon.set(data.begin(), data.end());
36
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 << " ";
40 }
41 std::cout << std::endl;
42
43 iterator_type it = polygon.begin();
44 for (int i = 0; i < 2; i++) {
45 it++;
46 }
47
48 iterator_type it_3rd = it;
49 it++;
50 BOOST_CHECK(it != it_3rd);
51 }