From 017e910bbeca77e1124cadf6c7aa5aca29c9f3cb Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Fri, 18 Jan 2013 21:50:28 +0000 Subject: [PATCH] area and perimeter tested only for 2d [SVN r82540] --- test/rtree/test_rtree.hpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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() )