Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85775 - in trunk/libs/geometry/test: algorithms multi/algorithms
From: barend.gehrels_at_[hidden]
Date: 2013-09-18 08:20:12


Author: barendgehrels
Date: 2013-09-18 08:20:12 EDT (Wed, 18 Sep 2013)
New Revision: 85775
URL: http://svn.boost.org/trac/boost/changeset/85775

Log:
[geometry] Unit tests, updated float-versions due to differences in spikes in recent commit (August). This is not tested by default..

Text files modified:
   trunk/libs/geometry/test/algorithms/difference.cpp | 23 +++++++++++++++--------
   trunk/libs/geometry/test/algorithms/union.cpp | 16 ++++++++--------
   trunk/libs/geometry/test/multi/algorithms/multi_difference.cpp | 9 +++++++--
   trunk/libs/geometry/test/multi/algorithms/multi_intersection.cpp | 7 ++++++-
   trunk/libs/geometry/test/multi/algorithms/multi_union.cpp | 7 ++++++-
   5 files changed, 42 insertions(+), 20 deletions(-)

Modified: trunk/libs/geometry/test/algorithms/difference.cpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/difference.cpp Wed Sep 18 07:39:14 2013 (r85774)
+++ trunk/libs/geometry/test/algorithms/difference.cpp 2013-09-18 08:20:12 EDT (Wed, 18 Sep 2013) (r85775)
@@ -278,7 +278,7 @@
         
     test_one<polygon, polygon, polygon>("ggl_list_20110307_javier",
         ggl_list_20110307_javier[0], ggl_list_20110307_javier[1],
- 1, 13, 16815.6,
+ 1, if_typed<ct, float>(14, 13), 16815.6,
         1, 4, 3200.4,
         0.01);
 
@@ -309,13 +309,20 @@
     // Boost.Geometry gives results depending on FP-type, and compiler, and operating system.
     // For double, it is zero (skipped). On gcc/Linux, for float either.
     // Because we cannot predict this, we only test for MSVC
- test_one<polygon, polygon, polygon>("ggl_list_20110627_phillip",
- ggl_list_20110627_phillip[0], ggl_list_20110627_phillip[1],
- if_typed_tt<ct>(1, 0), -1,
- if_typed_tt<ct>(0.0000000000001105367, 0.0),
- 1, -1, 3577.40960816756,
- 0.01
- );
+ if (boost::is_same<ct, double>::value
+#if defined(HAVE_TTMATH)
+ || boost::is_same<ct, ttmath_big>::value
+#endif
+ )
+ {
+ test_one<polygon, polygon, polygon>("ggl_list_20110627_phillip",
+ ggl_list_20110627_phillip[0], ggl_list_20110627_phillip[1],
+ if_typed_tt<ct>(1, 0), -1,
+ if_typed_tt<ct>(0.0000000000001105367, 0.0),
+ 1, -1, 3577.40960816756,
+ 0.01
+ );
+ }
 #endif
 
     // Other combi's

Modified: trunk/libs/geometry/test/algorithms/union.cpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/union.cpp Wed Sep 18 07:39:14 2013 (r85774)
+++ trunk/libs/geometry/test/algorithms/union.cpp 2013-09-18 08:20:12 EDT (Wed, 18 Sep 2013) (r85775)
@@ -143,7 +143,7 @@
 
     test_one<Polygon, Polygon, Polygon>("distance_zero",
         distance_zero[0], distance_zero[1],
- 1, 0, 11, 9.0098387);
+ 1, 0, if_typed<ct, float>(9, 11), 9.0098387);
 
     test_one<Polygon, Polygon, Polygon>("wrapped_a",
         wrapped[0], wrapped[1],
@@ -224,7 +224,7 @@
     test_one<Polygon, Polygon, Polygon>("ggl_list_20110627_phillip",
         ggl_list_20110627_phillip[0], ggl_list_20110627_phillip[1],
         1, 0,
- if_typed<ct, double>(5, if_typed_tt<ct>(8, 7)),
+ if_typed<ct, double>(5, if_typed_tt<ct>(8, 8)),
         14729.07145);
         
 
@@ -249,7 +249,7 @@
         isovist1[0], isovist1[1],
         1,
         0,
- if_typed<ct, float>(71, if_typed<ct, double>(70, 73)),
+ if_typed<ct, float>(72, if_typed<ct, double>(70, 73)),
         313.36036462, 0.1);
 
     // SQL Server gives: 313.360374193241
@@ -282,12 +282,12 @@
                 1, 0, if_typed<ct, double>(21, 23), 4.60853);
 
     test_one<Polygon, Polygon, Polygon>("buffer_rt_g", buffer_rt_g[0], buffer_rt_g[1],
- 1, 0, 17, 16.571);
+ 1, 0, if_typed<ct, float>(18, 17), 16.571);
     test_one<Polygon, Polygon, Polygon>("buffer_rt_g_rev", buffer_rt_g[1], buffer_rt_g[0],
- 1, 0, 17, 16.571);
+ 1, 0, if_typed<ct, float>(18, 17), 16.571);
 
     test_one<Polygon, Polygon, Polygon>("buffer_rt_i", buffer_rt_i[0], buffer_rt_i[1],
- 1, 0, 13, 13.6569);
+ 1, 0, if_typed<ct, float>(14, 13), 13.6569);
 
     bool test_rt_i_rev = true;
 #ifndef _MSC_VER
@@ -337,10 +337,10 @@
     test_one<Polygon, Polygon, Polygon>("buffer_rt_t", buffer_rt_t[0], buffer_rt_t[1],
                 1, 0, if_typed_tt<ct>(16, 14), 15.6569);
     test_one<Polygon, Polygon, Polygon>("buffer_rt_t_ref", buffer_rt_t[1], buffer_rt_t[0],
- 1, 0, if_typed_tt<ct>(16, 14), 15.6569);
+ 1, 0, if_typed_tt<ct>(16, if_typed<ct, float>(15, 14)), 15.6569);
 
     test_one<Polygon, Polygon, Polygon>("buffer_mp1", buffer_mp1[0], buffer_mp1[1],
- 1, 0, 91, 22.815);
+ 1, 0, if_typed_tt<ct>(93, 91), 22.815);
 
     if (boost::is_same<ct, double>::type::value)
     {

Modified: trunk/libs/geometry/test/multi/algorithms/multi_difference.cpp
==============================================================================
--- trunk/libs/geometry/test/multi/algorithms/multi_difference.cpp Wed Sep 18 07:39:14 2013 (r85774)
+++ trunk/libs/geometry/test/multi/algorithms/multi_difference.cpp 2013-09-18 08:20:12 EDT (Wed, 18 Sep 2013) (r85775)
@@ -205,12 +205,17 @@
 
 int test_main(int, char* [])
 {
- test_all<bg::model::d2::point_xy<double> >();
+ test_all<bg::model::d2::point_xy<double > >();
 
-#ifdef HAVE_TTMATH
+#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
+ test_all<bg::model::d2::point_xy<float> >();
+
+#if defined(HAVE_TTMATH)
     std::cout << "Testing TTMATH" << std::endl;
     test_all<bg::model::d2::point_xy<ttmath_big> >();
 #endif
 
+#endif
+
     return 0;
 }

Modified: trunk/libs/geometry/test/multi/algorithms/multi_intersection.cpp
==============================================================================
--- trunk/libs/geometry/test/multi/algorithms/multi_intersection.cpp Wed Sep 18 07:39:14 2013 (r85774)
+++ trunk/libs/geometry/test/multi/algorithms/multi_intersection.cpp 2013-09-18 08:20:12 EDT (Wed, 18 Sep 2013) (r85775)
@@ -218,10 +218,15 @@
 {
     test_all<bg::model::d2::point_xy<double> >();
 
-#ifdef HAVE_TTMATH
+#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
+ test_all<bg::model::d2::point_xy<float> >();
+
+#if defined(HAVE_TTMATH)
     std::cout << "Testing TTMATH" << std::endl;
     test_all<bg::model::d2::point_xy<ttmath_big> >();
 #endif
 
+#endif
+
     return 0;
 }

Modified: trunk/libs/geometry/test/multi/algorithms/multi_union.cpp
==============================================================================
--- trunk/libs/geometry/test/multi/algorithms/multi_union.cpp Wed Sep 18 07:39:14 2013 (r85774)
+++ trunk/libs/geometry/test/multi/algorithms/multi_union.cpp 2013-09-18 08:20:12 EDT (Wed, 18 Sep 2013) (r85775)
@@ -140,10 +140,15 @@
 {
     test_all<bg::model::d2::point_xy<double> >();
 
-#ifdef HAVE_TTMATH
+#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
+ test_all<bg::model::d2::point_xy<float> >();
+
+#if defined(HAVE_TTMATH)
     std::cout << "Testing TTMATH" << std::endl;
     test_all<bg::model::d2::point_xy<ttmath_big> >();
 #endif
 
+#endif
+
     return 0;
 }


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