From c9ea4b50ed5e2384dcfa28c8d7b239fae7dfbfd0 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 29 Nov 2017 14:39:20 +0100 Subject: [PATCH] [test] Add validity check to robustness test of buffer --- .../overlay/buffer/recursive_polygons_buffer.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/test/robustness/overlay/buffer/recursive_polygons_buffer.cpp b/test/robustness/overlay/buffer/recursive_polygons_buffer.cpp index 8816e2b59..6a6d431a9 100644 --- a/test/robustness/overlay/buffer/recursive_polygons_buffer.cpp +++ b/test/robustness/overlay/buffer/recursive_polygons_buffer.cpp @@ -87,8 +87,8 @@ bool verify(std::string const& caseid, MultiPolygon const& mp, MultiPolygon cons bool result = true; // Area of buffer must be larger than of original polygon - BOOST_AUTO(area_mp, bg::area(mp)); - BOOST_AUTO(area_buf, bg::area(buffer)); + double area_mp = bg::area(mp); + double area_buf = bg::area(buffer); if (area_buf < area_mp) { @@ -109,6 +109,16 @@ bool verify(std::string const& caseid, MultiPolygon const& mp, MultiPolygon cons } } + if (result) + { + std::string message; + if (! bg::is_valid(buffer, message)) + { + std::cout << "Buffer is not valid: " << message << std::endl; + result = false; + } + } + bool svg = settings.svg; bool wkt = settings.wkt; if (! result) @@ -204,7 +214,7 @@ bool test_buffer(MultiPolygon& result, int& index, bg::strategy::buffer::end_round end_strategy; bg::strategy::buffer::point_circle point_strategy; bg::strategy::buffer::side_straight side_strategy; - bg::strategy::buffer::join_round join_round_strategy(100); // Compatible with unit tests + bg::strategy::buffer::join_round join_round_strategy(32); // Compatible with MySQL bg::strategy::buffer::join_miter join_miter_strategy; try