mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-09 23:24:02 +00:00
[test] Add validity check to robustness test of buffer
This commit is contained in:
parent
99da88ac26
commit
c9ea4b50ed
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user