// Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test // Copyright (c) 2007-2015 Barend Gehrels, 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 #define BOOST_GEOMETRY_TEST_RING #if defined(BOOST_GEOMETRY_TEST_RING) #include #include BOOST_GEOMETRY_REGISTER_RING_TEMPLATED(std::vector) BOOST_GEOMETRY_REGISTER_RING_TEMPLATED(std::deque) #elif defined(BOOST_GEOMETRY_TEST_MULTI_POINT) #include #include BOOST_GEOMETRY_REGISTER_MULTI_POINT_TEMPLATED(std::vector) BOOST_GEOMETRY_REGISTER_MULTI_POINT_TEMPLATED(std::deque) #else #include #include BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) #endif BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) // ---------------------------------------------------------------------------- template void test_geometry(G const& geometry, std::size_t expected_size = 0) { #if defined(BOOST_GEOMETRY_TEST_RING) BOOST_CONCEPT_ASSERT( (bg::concepts::ConstRing) ); #elif defined(BOOST_GEOMETRY_TEST_MULTI_POINT) BOOST_CONCEPT_ASSERT( (bg::concepts::ConstMultiPoint) ); #else BOOST_CONCEPT_ASSERT( (bg::concepts::ConstLinestring) ); #endif typedef typename bg::point_type::type P; typedef typename bg::coordinate_type

::type C; boost::ignore_unused(); // Check range-like behaviour BOOST_CHECK_EQUAL(boost::size(geometry), expected_size); } template void test_all() { test_geometry(std::vector

()); test_geometry(std::deque

()); //test_geometry(std::list

()); /*** double vertices[][3] = { {-1, -1, 1}, {1, -1, 1}, {1, 1, 1}, {-1, 1, 1}, {-1, -1, -1}, {1, -1, -1}, {1, 1, -1}, {-1, 1, -1} }; test_geometry(vertices, 8); ***/ } int test_main(int, char* []) { test_all(); test_all >(); test_all >(); test_all >(); test_all >(); test_all >(); test_all >(); test_all >(); test_all >(); test_all >(); return 0; }