Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75565 - trunk/libs/geometry/test/algorithms
From: barend.gehrels_at_[hidden]
Date: 2011-11-20 06:56:59


Author: barendgehrels
Date: 2011-11-20 06:56:59 EST (Sun, 20 Nov 2011)
New Revision: 75565
URL: http://svn.boost.org/trac/boost/changeset/75565

Log:
Linestring/polygon overlay, unit tests for third phase
Text files modified:
   trunk/libs/geometry/test/algorithms/intersection.cpp | 10 +++++++---
   trunk/libs/geometry/test/algorithms/test_intersection.hpp | 1 +
   2 files changed, 8 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 2011-11-20 06:56:59 EST (Sun, 20 Nov 2011)
@@ -290,7 +290,6 @@
 void test_polygon_linestring()
 {
     std::string const poly_simplex = "POLYGON((1 1,1 3,3 3,3 1,1 1))";
- std::string const poly_9 = "POLYGON((1 1,1 4,4 4,4 1,1 1))";
 
     test_one_lp<LineString, Polygon, LineString>("simplex", poly_simplex, "LINESTRING(0 2,4 2)", 1, 2, 2.0);
     test_one_lp<LineString, Polygon, LineString>("case2", poly_simplex, "LINESTRING(0 1,4 3)", 1, 2, sqrt(5.0));
@@ -304,6 +303,7 @@
     test_one_lp<LineString, Polygon, LineString>("case7", poly_simplex, "LINESTRING(1.5 1.5,2.5 2.5)", 1, 2, sqrt(2.0));
     test_one_lp<LineString, Polygon, LineString>("case8", poly_simplex, "LINESTRING(1 0,2 0)", 0, 0, 0.0);
 
+ std::string const poly_9 = "POLYGON((1 1,1 4,4 4,4 1,1 1))";
     test_one_lp<LineString, Polygon, LineString>("case9", poly_9, "LINESTRING(0 1,1 2,2 2)", 1, 2, 1.0);
     test_one_lp<LineString, Polygon, LineString>("case10", poly_9, "LINESTRING(0 1,1 2,0 2)", 0, 0, 0.0);
     test_one_lp<LineString, Polygon, LineString>("case11", poly_9, "LINESTRING(2 2,4 2,3 3)", 1, 3, 2.0 + sqrt(2.0));
@@ -311,8 +311,12 @@
 
     test_one_lp<LineString, Polygon, LineString>("case13", poly_9, "LINESTRING(3 2,4 4,2 3)", 1, 3, 2.0 * sqrt(5.0));
     test_one_lp<LineString, Polygon, LineString>("case14", poly_9, "LINESTRING(5 6,4 4,6 5)", 0, 0, 0.0);
- //test_one_lp<LineString, Polygon, LineString>("case15", poly_9, "LINESTRING(0 2,1 2,1 3,0 3)", 1, 2, 1.0);
- //test_one_lp<LineString, Polygon, LineString>("case16", poly_9, "LINESTRING(2 2,1 2,1 3,2 3)", 1, 4, 3.0);
+ test_one_lp<LineString, Polygon, LineString>("case15", poly_9, "LINESTRING(0 2,1 2,1 3,0 3)", 1, 2, 1.0);
+ test_one_lp<LineString, Polygon, LineString>("case16", poly_9, "LINESTRING(2 2,1 2,1 3,2 3)", 1, 4, 3.0);
+
+ std::string const angly = "LINESTRING(2 2,2 1,4 1,4 2,5 2,5 3,4 3,4 4,5 4,3 6,3 5,2 5,2 6,0 4)";
+ test_one_lp<LineString, Polygon, LineString>("case17", "POLYGON((1 1,1 5,4 5,4 1,1 1))", angly, 3, 8, 6.0);
+ test_one_lp<LineString, Polygon, LineString>("case18", "POLYGON((1 1,1 5,5 5,5 1,1 1))", angly, 2, 12, 10.0 + sqrt(2.0));
 
     // Compile test - arguments in any order:
     test_one<LineString, Polygon, LineString>("simplex", poly_simplex, "LINESTRING(0 2,4 2)", 1, 2, 2.0);

Modified: trunk/libs/geometry/test/algorithms/test_intersection.hpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/test_intersection.hpp (original)
+++ trunk/libs/geometry/test/algorithms/test_intersection.hpp 2011-11-20 06:56:59 EST (Sun, 20 Nov 2011)
@@ -63,6 +63,7 @@
> strategy;
 
     // Check both normal behaviour, and _inserter behaviour
+ if (! debug)
     {
         std::vector<OutputType> out;
         bg::intersection(g1, g2, out);


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