Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76889 - in trunk/libs/geometry/test: . algorithms/overlay
From: barend.gehrels_at_[hidden]
Date: 2012-02-04 16:50:01


Author: barendgehrels
Date: 2012-02-04 16:50:01 EST (Sat, 04 Feb 2012)
New Revision: 76889
URL: http://svn.boost.org/trac/boost/changeset/76889

Log:
Adapted test Christoph to gcc which, for long double, also results in a polygon
Text files modified:
   trunk/libs/geometry/test/algorithms/overlay/traverse.cpp | 13 ++++++++++---
   trunk/libs/geometry/test/geometry_test_common.hpp | 6 +++---
   2 files changed, 13 insertions(+), 6 deletions(-)

Modified: trunk/libs/geometry/test/algorithms/overlay/traverse.cpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/overlay/traverse.cpp (original)
+++ trunk/libs/geometry/test/algorithms/overlay/traverse.cpp 2012-02-04 16:50:01 EST (Sat, 04 Feb 2012)
@@ -886,15 +886,22 @@
     test_traverse<polygon, polygon, operation_union>::apply("geos_4",
             1, 2304.41633605957,
             geos_4[0], geos_4[1]);
-
+
     if (! is_float)
     {
- // Calculate intersection/union of two triangles. Robustness case.
+
+#if defined(_MSC_VER)
+ T const expected = if_typed_tt<T>(3.63794e-17, 0.0);
+#else
+ T const expected = if_typed<T, long double>(2.77555756156289135106e-17, 0.0);
+#endif
+
+ // Calculate intersection/union of two triangles. Robustness case.
         // ttmath can form a very small intersection triangle
         // (which is even not accomplished by SQL Server/PostGIS)
         std::string const caseid = "ggl_list_20110820_christophe";
         test_traverse<polygon, polygon, operation_intersection>::apply(caseid,
- 1, if_typed_tt<T>(3.63794e-17, 0.0),
+ 1, expected,
             ggl_list_20110820_christophe[0], ggl_list_20110820_christophe[1]);
         test_traverse<polygon, polygon, operation_union>::apply(caseid,
             1, 67.3550722317627,

Modified: trunk/libs/geometry/test/geometry_test_common.hpp
==============================================================================
--- trunk/libs/geometry/test/geometry_test_common.hpp (original)
+++ trunk/libs/geometry/test/geometry_test_common.hpp 2012-02-04 16:50:01 EST (Sat, 04 Feb 2012)
@@ -111,11 +111,11 @@
 #endif
 
 
-template <typename CoordinateType, typename T>
-inline T if_typed_tt(T value_tt, T value)
+template <typename CoordinateType, typename T1, typename T2>
+inline CoordinateType if_typed_tt(T1 value_tt, T2 value)
 {
 #if defined(HAVE_TTMATH)
- return boost::is_same<CoordinateType, ttmath_big>::value ? value_tt : value;
+ return boost::is_same<CoordinateType, ttmath_big>::type::value ? value_tt : value;
 #else
     return value;
 #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