]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/geometry/test/algorithms/unique_multi.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / geometry / test / algorithms / unique_multi.cpp
CommitLineData
7c673cae
FG
1// Boost.Geometry (aka GGL, Generic Geometry Library)
2//
3// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
4// Use, modification and distribution is subject to the Boost Software License,
5// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6// http://www.boost.org/LICENSE_1_0.txt)
7
8#include <geometry_test_common.hpp>
9
10#include <boost/geometry/algorithms/unique.hpp>
11
12#include <boost/geometry/geometries/geometries.hpp>
13#include <boost/geometry/geometries/point_xy.hpp>
14
15#include <algorithms/test_unique.hpp>
16
17
18template <typename P>
19void test_all()
20{
21 // Multi point, should happen nothing, even if there are duplicate points
22 test_geometry<bg::model::multi_point<P> >(
23 "MULTIPOINT((0 0),(0 0),(1 1))",
24 "MULTIPOINT((0 0),(0 0),(1 1))");
25
26 test_geometry<bg::model::multi_linestring<bg::model::linestring<P> > >(
27 "MULTILINESTRING((0 0,1 1,1 1),(3 3,3 3,4 4))",
28 "MULTILINESTRING((0 0,1 1),(3 3,4 4))");
29
30 typedef bg::model::multi_polygon<bg::model::polygon<P> > mp;
31 test_geometry<mp>(
32 "MULTIPOLYGON(((0 0,0 1,1 1,1 1,1 1,1 0,0 0,0 0)))",
33 "MULTIPOLYGON(((0 0,0 1,1 1,1 0,0 0)))");
34
35 // With holes
36 test_geometry<mp>(
37 "MULTIPOLYGON(((0 0,0 10,10 10,10 10,10 10,10 0,0 0,0 0)))",
38 "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))");
39
40}
41
42int test_main( int , char* [] )
43{
44 test_all<bg::model::d2::point_xy<int> >();
45 test_all<bg::model::d2::point_xy<double> >();
46
7c673cae
FG
47 return 0;
48}