1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 // Unit Test
3
4 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 // Use, modification and distribution is subject to the Boost Software License,
6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8
9
10 #ifndef BOOST_GEOMETRY_TEST_UNIQUE_HPP
11 #define BOOST_GEOMETRY_TEST_UNIQUE_HPP
12
13 // Test-functionality, shared between single and multi tests
14
15 #include <geometry_test_common.hpp>
16 #include <boost/geometry/algorithms/unique.hpp>
17
18 #include <boost/geometry/io/wkt/wkt.hpp>
19
20
21 template <typename Geometry>
test_geometry(std::string const & wkt,std::string const & expected)22 void test_geometry(std::string const& wkt, std::string const& expected)
23 {
24 Geometry geometry;
25
26 bg::read_wkt(wkt, geometry);
27 bg::unique(geometry);
28
29 std::ostringstream out;
30 out << bg::wkt(geometry);
31
32 BOOST_CHECK_MESSAGE(out.str() == expected,
33 "unique: " << wkt
34 << " expected " << expected
35 << " got " << out.str());
36 }
37
38
39 #endif
40