diff --git a/test/rtree/test_rtree.hpp b/test/rtree/test_rtree.hpp index 85443ebea..91e18b77e 100644 --- a/test/rtree/test_rtree.hpp +++ b/test/rtree/test_rtree.hpp @@ -1272,6 +1272,24 @@ void test_rtree_count(Parameters const& parameters) // test rtree box +template +struct test_geometry_algorithms +{ + template + static void apply(Rtree const& , Box const& ) {} +}; + +template <> +struct test_geometry_algorithms<2> +{ + template + static void apply(Rtree const& t, Box const& b) + { + BOOST_CHECK(bg::area(t) == bg::area(b)); + BOOST_CHECK(bg::perimeter(t) == bg::perimeter(b)); + } +}; + template void test_rtree_box(Parameters const& parameters) { @@ -1296,9 +1314,8 @@ void test_rtree_box(Parameters const& parameters) BOOST_CHECK(bg::equals(t.box(), b)); BOOST_CHECK(bg::equals(bg::return_envelope(t), b)); - BOOST_CHECK(bg::area(t) == bg::area(b)); - BOOST_CHECK(bg::perimeter(t) == bg::perimeter(b)); BOOST_CHECK(bg::equals(bg::return_centroid

(t), bg::return_centroid

(b))); + test_geometry_algorithms::value>::apply(t, b); size_t s = input.size(); while ( s/2 < input.size() && !input.empty() )