Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76732 - trunk/libs/geometry/test_extensions/algorithms/buffer
From: barend.gehrels_at_[hidden]
Date: 2012-01-28 06:58:17


Author: barendgehrels
Date: 2012-01-28 06:58:16 EST (Sat, 28 Jan 2012)
New Revision: 76732
URL: http://svn.boost.org/trac/boost/changeset/76732

Log:
Added test for buffer-unit-test
Text files modified:
   trunk/libs/geometry/test_extensions/algorithms/buffer/polygon_buffer.cpp | 12 ++++++++----
   trunk/libs/geometry/test_extensions/algorithms/buffer/test_buffer.hpp | 16 ++++++++++------
   2 files changed, 18 insertions(+), 10 deletions(-)

Modified: trunk/libs/geometry/test_extensions/algorithms/buffer/polygon_buffer.cpp
==============================================================================
--- trunk/libs/geometry/test_extensions/algorithms/buffer/polygon_buffer.cpp (original)
+++ trunk/libs/geometry/test_extensions/algorithms/buffer/polygon_buffer.cpp 2012-01-28 06:58:16 EST (Sat, 28 Jan 2012)
@@ -70,10 +70,14 @@
     // SQL Server gives 30.34479159164
     test_one<polygon_type, buf::join_round, polygon_type>(true, "indentation6", indentation, 'r', 30.3445, 0.6);
 
- test_one<polygon_type, buf::join_miter, polygon_type>("indentation8", indentation, 'm', 35.594305909533, 0.8);
- test_one<polygon_type, buf::join_round, polygon_type>("indentation8", indentation, 'r', 35.0012686715019, 0.8);
- test_one<polygon_type, buf::join_miter, polygon_type>("indentation12", indentation, 'm', 46.3541038841777, 1.2);
- test_one<polygon_type, buf::join_round, polygon_type>("indentation12", indentation, 'r', 45.0197700986076, 1.2);
+ test_one<polygon_type, buf::join_miter, polygon_type>(true, "indentation7", indentation, 'm', 33.0958, 0.7);
+ test_one<polygon_type, buf::join_round, polygon_type>(true, "indentation7", indentation, 'r', 32.6533, 0.7);
+
+ test_one<polygon_type, buf::join_miter, polygon_type>(true, "indentation8", indentation, 'm', 35.5943, 0.8);
+ test_one<polygon_type, buf::join_round, polygon_type>(true, "indentation8", indentation, 'r', 35.0164, 0.8);
+ test_one<polygon_type, buf::join_miter, polygon_type>(true, "indentation12", indentation, 'm', 46.3541, 1.2);
+ test_one<polygon_type, buf::join_round, polygon_type>(true, "indentation12", indentation, 'r', 45.0537, 1.2);
+
     test_one<polygon_type, buf::join_miter, polygon_type>("indentation4_neg", indentation, 'm', 6.99098413022335, -0.4);
     //test_one<polygon_type, buf::join_round, polygon_type>("indentation4_neg", indentation, 'r', 7.25523322189147, -0.4);
     test_one<polygon_type, buf::join_miter, polygon_type>("indentation8_neg", indentation, 'm', 1.36941992048731, -0.8);

Modified: trunk/libs/geometry/test_extensions/algorithms/buffer/test_buffer.hpp
==============================================================================
--- trunk/libs/geometry/test_extensions/algorithms/buffer/test_buffer.hpp (original)
+++ trunk/libs/geometry/test_extensions/algorithms/buffer/test_buffer.hpp 2012-01-28 06:58:16 EST (Sat, 28 Jan 2012)
@@ -127,7 +127,7 @@
             d += distance_right;
         }
 
- bg::buffer(box, box, d * 1.1);
+ bg::buffer(box, box, std::abs(d) * 1.1);
         mapper.add(box);
     }
 
@@ -181,12 +181,16 @@
     }
 #endif
 
- if (boost::contains(complete.str(), "indentation4")
- || boost::contains(complete.str(), "indentation5")
- || boost::contains(complete.str(), "indentation6"))
+ if (boost::contains(complete.str(), "indentation4_d")
+ || boost::contains(complete.str(), "indentation5_d")
+ || boost::contains(complete.str(), "indentation6_d")
+ || boost::contains(complete.str(), "indentation7_d")
+ || boost::contains(complete.str(), "indentation8_d")
+ || boost::contains(complete.str(), "indentation12_d")
+ )
     {
- // Some controlled cases are already dissolved,
- // such that we can detect regressions there
+ // We dissolve some controlled cases (already, later we will dissolve all),
+ // such that we can detect regressions
         bg::dissolve(buffered_step1, buffered);
     }
     else


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