Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74149 - trunk/libs/geometry/test/algorithms
From: barend.gehrels_at_[hidden]
Date: 2011-08-30 07:01:18


Author: barendgehrels
Date: 2011-08-30 07:01:17 EDT (Tue, 30 Aug 2011)
New Revision: 74149
URL: http://svn.boost.org/trac/boost/changeset/74149

Log:
Support for Boost.Rational in intersection test (part 2)
Text files modified:
   trunk/libs/geometry/test/algorithms/intersection.cpp | 9 +++++----
   trunk/libs/geometry/test/algorithms/test_intersection.hpp | 8 ++++----
   2 files changed, 9 insertions(+), 8 deletions(-)

Modified: trunk/libs/geometry/test/algorithms/intersection.cpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/intersection.cpp (original)
+++ trunk/libs/geometry/test/algorithms/intersection.cpp 2011-08-30 07:01:17 EDT (Tue, 30 Aug 2011)
@@ -20,15 +20,16 @@
 //#define BOOST_GEOMETRY_DEBUG_IDENTIFIER
 
 
-#include <algorithms/test_intersection.hpp>
-#include <algorithms/test_overlay.hpp>
-
-#include <algorithms/overlay/overlay_cases.hpp>
 #include <boost/geometry/geometries/point_xy.hpp>
 #include <boost/geometry/geometries/register/linestring.hpp>
 
 #include <boost/geometry/util/rational.hpp>
 
+#include <algorithms/test_intersection.hpp>
+#include <algorithms/test_overlay.hpp>
+
+#include <algorithms/overlay/overlay_cases.hpp>
+
 #include <test_common/test_point.hpp>
 #include <test_common/with_pointer.hpp>
 #include <test_geometries/custom_segment.hpp>

Modified: trunk/libs/geometry/test/algorithms/test_intersection.hpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/test_intersection.hpp (original)
+++ trunk/libs/geometry/test/algorithms/test_intersection.hpp 2011-08-30 07:01:17 EDT (Tue, 30 Aug 2011)
@@ -13,7 +13,6 @@
 #include <iomanip>
 
 #include <boost/foreach.hpp>
-#include <geometry_test_common.hpp>
 
 #include <boost/geometry/algorithms/intersection.hpp>
 #include <boost/geometry/algorithms/area.hpp>
@@ -32,7 +31,7 @@
 # include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
 #endif
 
-
+#include <geometry_test_common.hpp>
 
 
 template <typename OutputType, typename CalculationType, typename G1, typename G2>
@@ -80,7 +79,7 @@
         }
 
         // instead of specialization we check it run-time here
- length_or_area += is_line
+ length_or_area += is_line
             ? bg::length(*it)
             : bg::area(*it);
 
@@ -114,7 +113,8 @@
                 );
     }
 
- BOOST_CHECK_CLOSE(length_or_area, expected_length_or_area, percentage);
+ double const detected_length_or_area = boost::numeric_cast<double>(length_or_area);
+ BOOST_CHECK_CLOSE(detected_length_or_area, expected_length_or_area, percentage);
 #endif
 
 


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