Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69612 - in trunk/libs/geometry/test/algorithms: . overlay
From: barend.gehrels_at_[hidden]
Date: 2011-03-06 16:20:51


Author: barendgehrels
Date: 2011-03-06 16:20:49 EST (Sun, 06 Mar 2011)
New Revision: 69612
URL: http://svn.boost.org/trac/boost/changeset/69612

Log:
Added test for fix of robustness problem for case called "ggl_list_20110306_javier"
Text files modified:
   trunk/libs/geometry/test/algorithms/overlay/get_turns.cpp | 5 ++++-
   trunk/libs/geometry/test/algorithms/overlay/overlay_cases.hpp | 7 +++++++
   trunk/libs/geometry/test/algorithms/overlay/traverse.cpp | 3 +--
   trunk/libs/geometry/test/algorithms/overlay/traverse.vcproj | 4 ++--
   trunk/libs/geometry/test/algorithms/test_union.hpp | 10 +++++++++-
   trunk/libs/geometry/test/algorithms/union.cpp | 4 ++++
   6 files changed, 27 insertions(+), 6 deletions(-)

Modified: trunk/libs/geometry/test/algorithms/overlay/get_turns.cpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/overlay/get_turns.cpp (original)
+++ trunk/libs/geometry/test/algorithms/overlay/get_turns.cpp 2011-03-06 16:20:49 EST (Sun, 06 Mar 2011)
@@ -233,6 +233,10 @@
     // ticket#17
     test_overlay<polygon, box, test_get_turns, Tuple>("ticket_17", boost::make_tuple(6), ticket_17[0], ticket_17[1]);
 
+ // GGL-mailing list
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("ggl_list_20110306_javier",
+ boost::make_tuple(4),
+ ggl_list_20110306_javier[0], ggl_list_20110306_javier[1]);
 
 
     // pies
@@ -296,7 +300,6 @@
     test_all<double>();
     test_ccw<double>();
     test_open<double>();
- //test_all<tt>();
 
 #if ! defined(_MSC_VER)
     test_all<long double>();

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 2011-03-06 16:20:49 EST (Sun, 06 Mar 2011)
@@ -484,6 +484,13 @@
     "POLYGON((43.644271850585938 0.96149998903274536,43.764598846435547 0.93951499462127686,49.071769542946825 0.61489892713413252,48.43512638981781 -0.81299959072453376,47.830955505371094 -0.69758313894271851,47.263670054709685 -1.784876824891044,46.695858001708984 -1.6093428134918213,45.389434814453125 -4.5143837928771973,47.604561877161387 -6.087697464505224,46.559533858616469 -8.435196445683264,42.699958801269531 -4.4278755187988281,42.577877044677734 -4.4900407791137695,42.577911376953125 -4.4901103973388672,40.758884429931641 -5.418975830078125,40.6978759765625 -5.4500408172607422,41.590042114257813 -7.2021245956420898,57.524304765518266 -37.807195733984784,41.988733475572282 -19.945838749437218,41.821544647216797 -19.211688995361328,40.800632476806641 -17.208097457885742,39.966808319091797 -17.625011444091797,38.823680877685547 -16.296066284179688,37.326129913330078 -17.190576553344727,35.963497161865234 -15.476018905639648,35.656356811523438 -15.66030216217041,34.931102752685547 -16.223842620849609,
34.634240447128811 -15.85007183479255,34.886280059814453 -14.120697975158691,34.658355712890625 -13.81736946105957,34.328716278076172 -13.992490768432617,33.598796844482422 -14.546377182006836,33.164891643669634 -14.000060288415174,33.566280364990234 -12.450697898864746,33.339523315429688 -12.147735595703125,32.998821258544922 -12.323249816894531,32.274600982666016 -12.879127502441406,31.682494778186321 -12.133624901803865,32.226280212402344 -10.790698051452637,32.000633239746094 -10.488097190856934,31.669155120849609 -10.653837203979492,30.947774887084961 -11.208560943603516,30.207040612748258 -10.275926149505661,30.896280288696289 -9.1206979751586914,30.670633316040039 -8.8180980682373047,30.339155197143555 -8.9838371276855469,29.619997024536133 -9.5368013381958008,29.135100397190627 -8.9262827849488211,32.718830108642578 -4.3281683921813965,32.708168029785156 -2.3611698150634766,32.708126068115234 -2.3611700534820557,32.708126068115234 -2.3611266613006592,30.501169204711914 -2.3718316555023193,27.06988934
4709196 -4.2926591211028242,26.472516656201325 -3.5380830513658776,36.954700469970703 1.2597870826721191,37.140213012695313 1.3446992635726929,37.000419616699219 1.664225697517395,37.29449462890625 1.7902572154998779,37.43402099609375 1.470055103302002,51.370888500897557 7.4163459734570729,51.20102152843122 7.1738039562841562,42.721500396728516 3.6584999561309814,42.721500396728516 2.2342472076416016,42.399410247802734 1.4956772327423096,43.644271850585938 0.96149998903274536))"
     };
 
+static std::string ggl_list_20110306_javier[2] =
+ {
+ "POLYGON((-2 2,2002 2,2002 -2002,-2 -2002,-2 2),(0 -147.00000000000003,0 -2000,2000 -2000,2000 0,104 0,440 -240,400 -280,0 -147.00000000000003))",
+ "POLYGON((359.99000000000001 -280,0 -182,0 -147,400.00999999999999 -280,359.99000000000001 -280))"
+ };
+
+
 // GEOS "TestOverlay" test.
 // Note that the first one WAS invalid and is made valid using SQL Server 2008 Spatial MakeValid() function
 static std::string geos_1_test_overlay[2] =

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 2011-03-06 16:20:49 EST (Sun, 06 Mar 2011)
@@ -830,7 +830,6 @@
             boost::make_tuple(1, 2304.41633605957),
             geos_4[0], geos_4[1]);
 
-
     return;
 
     // Cases below still have errors
@@ -876,7 +875,7 @@
 
 int test_main(int, char* [])
 {
- //test_all<float>();
+ test_all<float>();
     test_all<double>();
     test_open<double>();
     test_ccw<double>();

Modified: trunk/libs/geometry/test/algorithms/overlay/traverse.vcproj
==============================================================================
--- trunk/libs/geometry/test/algorithms/overlay/traverse.vcproj (original)
+++ trunk/libs/geometry/test/algorithms/overlay/traverse.vcproj 2011-03-06 16:20:49 EST (Sun, 06 Mar 2011)
@@ -20,7 +20,7 @@
                         OutputDirectory="$(SolutionDir)$(ConfigurationName)"
                         IntermediateDirectory="$(ConfigurationName)\traverse"
                         ConfigurationType="1"
- InheritedPropertySheets="..\..\boost.vsprops"
+ InheritedPropertySheets="..\..\boost.vsprops;..\..\ttmath.vsprops"
                         CharacterSet="1"
>
                         <Tool
@@ -93,7 +93,7 @@
                         OutputDirectory="$(SolutionDir)$(ConfigurationName)"
                         IntermediateDirectory="$(ConfigurationName)\traverse"
                         ConfigurationType="1"
- InheritedPropertySheets="..\..\boost.vsprops"
+ InheritedPropertySheets="..\..\boost.vsprops;..\..\ttmath.vsprops"
                         CharacterSet="1"
                         WholeProgramOptimization="1"
>

Modified: trunk/libs/geometry/test/algorithms/test_union.hpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/test_union.hpp (original)
+++ trunk/libs/geometry/test/algorithms/test_union.hpp 2011-03-06 16:20:49 EST (Sun, 06 Mar 2011)
@@ -26,7 +26,7 @@
 
 #include <boost/geometry/strategies/strategies.hpp>
 
-#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
 
 
 #if defined(TEST_WITH_SVG)
@@ -67,7 +67,15 @@
         std::vector<OutputType> inserted, array_with_one_empty_geometry;
         array_with_one_empty_geometry.push_back(OutputType());
         boost::copy(array_with_one_empty_geometry, bg::union_inserter<OutputType>(g1, g2, std::back_inserter(inserted)));
+
+ typename bg::area_result<G1>::type area_inserted = 0;
+ for (typename std::vector<OutputType>::iterator it = inserted.begin();
+ it != inserted.end(); ++it)
+ {
+ area_inserted += bg::area(*it);
+ }
         BOOST_CHECK_EQUAL(boost::size(clip), boost::size(inserted) - 1);
+ BOOST_CHECK_CLOSE(area_inserted, expected_area, percentage);
     }
 
 

Modified: trunk/libs/geometry/test/algorithms/union.cpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/union.cpp (original)
+++ trunk/libs/geometry/test/algorithms/union.cpp 2011-03-06 16:20:49 EST (Sun, 06 Mar 2011)
@@ -209,6 +209,10 @@
     // "new hole", tested with Ring -> the newly formed hole will be omitted
     test_one<Ring, Ring, Ring>("new_hole_discarded", new_hole[0], new_hole[1], 1, 0, 9, 24.0);
 
+ test_one<Polygon, Polygon, Polygon>("ggl_list_20110306_javier",
+ ggl_list_20110306_javier[0], ggl_list_20110306_javier[1],
+ 1, 1, 16, 80456.4904910401);
+
 #ifdef _MSC_VER
     {
         // Isovist (submitted by Brandon during Formal Review)


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