Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77305 - in trunk/libs/geometry/test/algorithms: . overlay
From: barend.gehrels_at_[hidden]
Date: 2012-03-11 14:12:47


Author: barendgehrels
Date: 2012-03-11 14:12:46 EDT (Sun, 11 Mar 2012)
New Revision: 77305
URL: http://svn.boost.org/trac/boost/changeset/77305

Log:
[geometry] updated test for robustness issue found
Text files modified:
   trunk/libs/geometry/test/algorithms/intersection.cpp | 2 +
   trunk/libs/geometry/test/algorithms/overlay/overlay_cases.hpp | 17 ++++++++++++
   trunk/libs/geometry/test/algorithms/overlay/traverse.cpp | 53 +++++++++++++++++++++++++++++++++++++--
   trunk/libs/geometry/test/algorithms/union.cpp | 11 ++++++++
   4 files changed, 80 insertions(+), 3 deletions(-)

Modified: trunk/libs/geometry/test/algorithms/intersection.cpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/intersection.cpp (original)
+++ trunk/libs/geometry/test/algorithms/intersection.cpp 2012-03-11 14:12:46 EDT (Sun, 11 Mar 2012)
@@ -209,6 +209,8 @@
     test_one<Polygon, Polygon, Polygon>("buffer_rt_f", buffer_rt_f[0], buffer_rt_f[1],
                 1, 4, 0.00029437899183903937, 0.01);
 
+ test_one<Polygon, Polygon, Polygon>("buffer_rt_g", buffer_rt_g[0], buffer_rt_g[1],
+ 1, 0, 2.914213562373);
 
     return;
 

Modified: trunk/libs/geometry/test/algorithms/overlay/overlay_cases.hpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/overlay/overlay_cases.hpp (original)
+++ trunk/libs/geometry/test/algorithms/overlay/overlay_cases.hpp 2012-03-11 14:12:46 EDT (Sun, 11 Mar 2012)
@@ -579,5 +579,22 @@
         "POLYGON((1.3000000000000000 9.0000000000000000,1.3000000000000000 8.0000000000000000,1.3000000000000007 7.7000000000000002,1.0000000000000000 7.7000000000000002,0.00000000000000000 7.7000000000000002,-0.29999999999999982 7.7000000000000002,-0.29999999999999999 8.0000000000000000,-0.29999999999999999 9.0000000000000000,-0.29999999999999982 9.3000000000000007,0.00000000000000000 9.3000000000000007,1.0000000000000000 9.3000000000000007,1.3000000000000007 9.3000000000000007,1.3000000000000000 9.0000000000000000))"
     };
 
+static std::string buffer_rt_g[2] =
+ {
+ "POLYGON((2.0 8.0,2.0 9.0,2.0 10.0,3.0 10.0,4.0 10.0,6.4142135623730958 10.0,4.7071067811865479 8.2928932188134521,3.7071067811865475 7.2928932188134521,2.0 5.5857864376269051,2.0 8.0))",
+ "POLYGON((0.0 6.0,0.0 7.0,0.0 8.0,1.0 8.0,2.0 8.0,4.4142135623730958 8.0,2.7071067811865475 6.2928932188134521,1.7071067811865475 5.2928932188134521,-0.0 3.5857864376269042,0.0 6.0))"
+ };
+
+static std::string buffer_rt_g_boxes[5] =
+ {
+ "POLYGON((0 0,0 4,4 4,4 0,0 0))",
+ "POLYGON((2 2,2 4,6 4,6 2,2 2))",
+ "POLYGON((2 2,2 4,6 4,8 4,8 2,2 2))",
+ "POLYGON((2 2,2 4,6 4,6 6,8 6,8 2,2 2))",
+
+ "POLYGON((0 0,0 4,4 4,4 5,5 5,5 1,4 1,4 0,0 0))"
+ };
+
+
 
 #endif // BOOST_GEOMETRY_TEST_OVERLAY_CASES_HPP

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-03-11 14:12:46 EDT (Sun, 11 Mar 2012)
@@ -7,6 +7,9 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
+#define BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE
+// #define BOOST_GEOMETRY_OVERLAY_NO_THROW
+// #define TEST_WITH_SVG
 
 #include <iostream>
 #include <iomanip>
@@ -832,13 +835,12 @@
             and STUnion
         */
 
- // Boost.List during Formal Review, isovists Brandon
         // For FP, they may deviate more.
         test_traverse<polygon, polygon, operation_intersection>::apply("isov",
- 1, 88.1920416352664, isovist[0], isovist[1],
+ 1, 88.2558788829, isovist[0], isovist[1],
                 float_might_deviate_more);
         test_traverse<polygon, polygon, operation_union>::apply("isov",
- 1, 313.360374193241, isovist[0], isovist[1],
+ 1, 313.29652252, isovist[0], isovist[1],
                 float_might_deviate_more);
     }
 
@@ -907,6 +909,51 @@
             1, 67.3550722317627,
             ggl_list_20110820_christophe[0], ggl_list_20110820_christophe[1]);
     }
+
+ test_traverse<polygon, polygon, operation_union>::apply("buffer_rt_f",
+ 1, 4.60853,
+ buffer_rt_f[0], buffer_rt_f[1]);
+ test_traverse<polygon, polygon, operation_intersection>::apply("buffer_rt_f",
+ 1, 0.0002943725152286,
+ buffer_rt_f[0], buffer_rt_f[1]);
+
+ test_traverse<polygon, polygon, operation_union>::apply("buffer_rt_g",
+ 1, 16.571,
+ buffer_rt_g[0], buffer_rt_g[1]);
+
+ test_traverse<polygon, polygon, operation_union>::apply("buffer_rt_g_boxes1",
+ 1, 20,
+ buffer_rt_g_boxes[0], buffer_rt_g_boxes[1]);
+ test_traverse<polygon, polygon, operation_union>::apply("buffer_rt_g_boxes2",
+ 1, 24,
+ buffer_rt_g_boxes[0], buffer_rt_g_boxes[2]);
+ test_traverse<polygon, polygon, operation_union>::apply("buffer_rt_g_boxes3",
+ 1, 28,
+ buffer_rt_g_boxes[0], buffer_rt_g_boxes[3]);
+
+ test_traverse<polygon, polygon, operation_union>::apply("buffer_rt_g_boxes43",
+ 1, 30,
+ buffer_rt_g_boxes[4], buffer_rt_g_boxes[3]);
+
+#ifdef BOOST_GEOMETRY_OVERLAY_NO_THROW
+ {
+ // NOTE: currently throws (normally)
+ std::string caseid = "ggl_list_20120229_volker";
+ test_traverse<polygon, polygon, operation_union>::apply(caseid,
+ 1, 99,
+ ggl_list_20120229_volker[0], ggl_list_20120229_volker[1]);
+ test_traverse<polygon, polygon, operation_intersection>::apply(caseid,
+ 1, 99,
+ ggl_list_20120229_volker[0], ggl_list_20120229_volker[1]);
+ caseid = "ggl_list_20120229_volker_2";
+ test_traverse<polygon, polygon, operation_union>::apply(caseid,
+ 1, 99,
+ ggl_list_20120229_volker[2], ggl_list_20120229_volker[1]);
+ test_traverse<polygon, polygon, operation_intersection>::apply(caseid,
+ 1, 99,
+ ggl_list_20120229_volker[2], ggl_list_20120229_volker[1]);
+ }
+#endif
 }
 
 template <typename T>

Modified: trunk/libs/geometry/test/algorithms/union.cpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/union.cpp (original)
+++ trunk/libs/geometry/test/algorithms/union.cpp 2012-03-11 14:12:46 EDT (Sun, 11 Mar 2012)
@@ -15,6 +15,7 @@
 #include <iostream>
 #include <string>
 
+#define BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE
 #define TEST_ISOVIST
 
 //#define BOOST_GEOMETRY_DEBUG_ASSEMBLE
@@ -271,8 +272,16 @@
     test_one<Polygon, Polygon, Polygon>("buffer_rt_a", buffer_rt_a[0], buffer_rt_a[1],
                 1, 0, 265, 19.280667);
 
+ // Robustness issues, followed out buffer-robustness-tests, test them also reverse
     test_one<Polygon, Polygon, Polygon>("buffer_rt_f", buffer_rt_f[0], buffer_rt_f[1],
                 1, 0, if_typed<ct, double>(22, 23), 4.60853);
+ test_one<Polygon, Polygon, Polygon>("buffer_rt_f_rev", buffer_rt_f[1], buffer_rt_f[0],
+ 1, 0, if_typed<ct, double>(22, 23), 4.60853);
+
+ test_one<Polygon, Polygon, Polygon>("buffer_rt_g", buffer_rt_g[0], buffer_rt_g[1],
+ 1, 0, 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);
 }
 
 template <typename P>
@@ -284,6 +293,7 @@
 
     test_areal<ring, polygon>();
 
+#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
     // Open
     test_areal<bg::model::ring<P, true, false>, bg::model::polygon<P, true, false> >();
 
@@ -292,6 +302,7 @@
 
     // Counter clockwise and open
     test_areal<bg::model::ring<P, false, false>, bg::model::polygon<P, false, false> >();
+#endif
 
     test_one<polygon, box, polygon>("box_ring", example_box, example_ring,
         1, 1, 15, 6.38875);


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