Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69840 - trunk/libs/geometry/test/algorithms
From: barend.gehrels_at_[hidden]
Date: 2011-03-11 06:43:43


Author: barendgehrels
Date: 2011-03-11 06:43:42 EST (Fri, 11 Mar 2011)
New Revision: 69840
URL: http://svn.boost.org/trac/boost/changeset/69840

Log:
Updated difference for float, now small zero-area triangle discarded
Text files modified:
   trunk/libs/geometry/test/algorithms/difference.cpp | 7 ++++++-
   1 files changed, 6 insertions(+), 1 deletions(-)

Modified: trunk/libs/geometry/test/algorithms/difference.cpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/difference.cpp (original)
+++ trunk/libs/geometry/test/algorithms/difference.cpp 2011-03-11 06:43:42 EST (Fri, 11 Mar 2011)
@@ -38,6 +38,9 @@
     typedef bg::model::polygon<P> polygon;
     typedef bg::model::ring<P> ring;
 
+ bool const is_float =
+ boost::is_same<typename bg::coordinate_type<P>::type, float>::value;
+
     test_one<polygon, polygon, polygon>("simplex_normal",
         simplex_normal[0], simplex_normal[1],
         3, 3, 2.52636706856656,
@@ -82,7 +85,9 @@
     test_one<polygon, polygon, polygon>("distance_zero",
         distance_zero[0], distance_zero[1],
         2, 0, 8.7048386,
- 2, 0, 0.0098387);
+ is_float ? 1 : 2, // The too small one is discarded for floating point
+ 0, 0.0098387);
+
 
     test_one<polygon, polygon, polygon>("equal_holes_disjoint",
         equal_holes_disjoint[0], equal_holes_disjoint[1],


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