// Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test // Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2008-2011 Bruno Lalande, Paris, France. // Copyright (c) 2009-2011 Mateusz Loskot, London, UK. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include #include #include #include #include #include #include #include #include #include BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) template void test_geometry(bool check = true) { G geometry; typedef typename bg::point_type::type P; bg::append(geometry, bg::make_zero

()); if (check) { BOOST_CHECK_EQUAL(bg::num_points(geometry), 1u); } // Append a range std::vector

v; v.push_back(bg::make_zero

()); v.push_back(bg::make_zero

()); bg::append(geometry, v); if (check) { BOOST_CHECK_EQUAL(bg::num_points(geometry), 3u); } bg::clear(geometry); if (check) { BOOST_CHECK_EQUAL(bg::num_points(geometry), 0u); } //P p = boost::range::front(geometry); } template void test_all() { test_geometry

(false); test_geometry >(false); test_geometry >(false); test_geometry >(); test_geometry >(); test_geometry >(); test_geometry >(); test_geometry >(); //test_geometry >(); } int test_main(int, char* []) { test_all(); test_all >(); test_all >(); test_all >(); #ifdef HAVE_TTMATH test_all >(); #endif return 0; }