1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 // Unit Test
3 
4 // Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 
6 // Use, modification and distribution is subject to the Boost Software License,
7 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
9 
10 
11 #include <algorithms/test_unique.hpp>
12 #include <boost/geometry/geometries/geometries.hpp>
13 #include <boost/geometry/geometries/point_xy.hpp>
14 
15 
16 
17 template <typename Point>
test_all()18 void test_all()
19 {
20     test_geometry<bg::model::linestring<Point> >(
21         "LINESTRING(0 0,1 1)",
22         "LINESTRING(0 0,1 1)");
23 
24     test_geometry<bg::model::linestring<Point> >(
25         "LINESTRING(0 0,1 1,1 1)",
26         "LINESTRING(0 0,1 1)");
27 
28     test_geometry<bg::model::linestring<Point> >(
29         "LINESTRING(0 0,0 0,1 1)",
30         "LINESTRING(0 0,1 1)");
31 
32     // Consecutive points
33     test_geometry<bg::model::linestring<Point> >(
34         "LINESTRING(0 0,0 0,0 0,0 0,1 1,1 1,1 1)",
35         "LINESTRING(0 0,1 1)");
36 
37     // Other types
38     test_geometry<bg::model::ring<Point> >(
39         "POLYGON((0 0,0 1,1 1,1 1,1 1,1 0,0 0,0 0))",
40         "POLYGON((0 0,0 1,1 1,1 0,0 0))");
41 
42     // With holes
43     test_geometry<bg::model::polygon<Point> >(
44         "POLYGON((0 0,0 10,10 10,10 10,10 10,10 0,0 0,0 0))",
45         "POLYGON((0 0,0 10,10 10,10 0,0 0))");
46 }
47 
48 
49 
test_main(int,char * [])50 int test_main(int, char* [])
51 {
52     test_all<bg::model::d2::point_xy<int> >();
53     test_all<bg::model::d2::point_xy<double> >();
54 
55     return 0;
56 }
57