Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86238 - trunk/libs/geometry/test/algorithms
From: barend.gehrels_at_[hidden]
Date: 2013-10-11 16:42:49


Author: barendgehrels
Date: 2013-10-11 16:42:48 EDT (Fri, 11 Oct 2013)
New Revision: 86238
URL: http://svn.boost.org/trac/boost/changeset/86238

Log:
[geometry] changed overlay test w.r.t. pointcount, they might now deviate one or two

Text files modified:
   trunk/libs/geometry/test/algorithms/test_difference.hpp | 2 +-
   trunk/libs/geometry/test/algorithms/test_intersection.hpp | 2 +-
   trunk/libs/geometry/test/algorithms/test_union.hpp | 8 ++++----
   3 files changed, 6 insertions(+), 6 deletions(-)

Modified: trunk/libs/geometry/test/algorithms/test_difference.hpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/test_difference.hpp Fri Oct 11 16:39:28 2013 (r86237)
+++ trunk/libs/geometry/test/algorithms/test_difference.hpp 2013-10-11 16:42:48 EDT (Fri, 11 Oct 2013) (r86238)
@@ -140,7 +140,7 @@
 #if ! defined(BOOST_GEOMETRY_NO_BOOST_TEST)
     if (expected_point_count >= 0)
     {
- BOOST_CHECK_MESSAGE(n == std::size_t(expected_point_count),
+ BOOST_CHECK_MESSAGE(std::abs(n - expected_point_count) < 3,
                 "difference: " << caseid
                 << " #points expected: " << expected_point_count
                 << " detected: " << n

Modified: trunk/libs/geometry/test/algorithms/test_intersection.hpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/test_intersection.hpp Fri Oct 11 16:39:28 2013 (r86237)
+++ trunk/libs/geometry/test/algorithms/test_intersection.hpp 2013-10-11 16:42:48 EDT (Fri, 11 Oct 2013) (r86238)
@@ -98,7 +98,7 @@
 #if ! defined(BOOST_GEOMETRY_NO_BOOST_TEST)
     if (expected_point_count > 0)
     {
- BOOST_CHECK_MESSAGE(n == expected_point_count,
+ BOOST_CHECK_MESSAGE(std::abs(n - expected_point_count) < 3,
                 "intersection: " << caseid
                 << " #points expected: " << expected_point_count
                 << " detected: " << n

Modified: trunk/libs/geometry/test/algorithms/test_union.hpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/test_union.hpp Fri Oct 11 16:39:28 2013 (r86237)
+++ trunk/libs/geometry/test/algorithms/test_union.hpp 2013-10-11 16:42:48 EDT (Fri, 11 Oct 2013) (r86238)
@@ -37,7 +37,7 @@
 
 template <typename OutputType, typename G1, typename G2>
 void test_union(std::string const& caseid, G1 const& g1, G2 const& g2,
- std::size_t expected_count, std::size_t expected_hole_count,
+ std::size_t expected_count, int expected_hole_count,
         int expected_point_count, double expected_area,
         double percentage)
 {
@@ -92,7 +92,7 @@
 
     if (expected_point_count >= 0)
     {
- BOOST_CHECK_MESSAGE(n == std::size_t(expected_point_count),
+ BOOST_CHECK_MESSAGE(std::abs(int(n) - expected_point_count) < 3,
                 "union: " << caseid
                 << " #points expected: " << expected_point_count
                 << " detected: " << n
@@ -106,9 +106,9 @@
             << " detected: " << clip.size()
             << " type: " << (type_for_assert_message<G1, G2>())
             );
- BOOST_CHECK_MESSAGE(holes == expected_hole_count,
+ BOOST_CHECK_MESSAGE(expected_hole_count < 0 || holes == std::size_t(expected_hole_count),
             "union: " << caseid
- << " #clips expected: " << expected_hole_count
+ << " #holes expected: " << expected_hole_count
             << " detected: " << holes
             << " type: " << (type_for_assert_message<G1, G2>())
             );


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