Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82540 - sandbox-branches/geometry/index/test/rtree
From: adam.wulkiewicz_at_[hidden]
Date: 2013-01-18 16:50:29


Author: awulkiew
Date: 2013-01-18 16:50:28 EST (Fri, 18 Jan 2013)
New Revision: 82540
URL: http://svn.boost.org/trac/boost/changeset/82540

Log:
area and perimeter tested only for 2d
Text files modified:
   sandbox-branches/geometry/index/test/rtree/test_rtree.hpp | 21 +++++++++++++++++++--
   1 files changed, 19 insertions(+), 2 deletions(-)

Modified: sandbox-branches/geometry/index/test/rtree/test_rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/test_rtree.hpp (original)
+++ sandbox-branches/geometry/index/test/rtree/test_rtree.hpp 2013-01-18 16:50:28 EST (Fri, 18 Jan 2013)
@@ -1272,6 +1272,24 @@
 
 // test rtree box
 
+template <size_t Dimention>
+struct test_geometry_algorithms
+{
+ template <typename Rtree, typename Box>
+ static void apply(Rtree const& , Box const& ) {}
+};
+
+template <>
+struct test_geometry_algorithms<2>
+{
+ template <typename Rtree, typename Box>
+ 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 <typename Value, typename Parameters>
 void test_rtree_box(Parameters const& parameters)
 {
@@ -1296,9 +1314,8 @@
     BOOST_CHECK(bg::equals(t.box(), b));
 
     BOOST_CHECK(bg::equals(bg::return_envelope<B>(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<P>(t), bg::return_centroid<P>(b)));
+ test_geometry_algorithms<bg::traits::dimension<P>::value>::apply(t, b);
 
     size_t s = input.size();
     while ( s/2 < input.size() && !input.empty() )


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk