Commit 39757254 authored by Sandro Santilli's avatar Sandro Santilli

Use overlay specific result checker

The check just supports some snap-distance based tolerance
for exact match (in addition to topology equality which is
needed for some JTS tests to pass)

Closes #837 (backport of tolerant test checker to 3.6 branch)
parent 8e6d642e
Pipeline #9890383 passed with stage
in 24 minutes and 42 seconds
......@@ -34,6 +34,7 @@
#include <geos/geom/PrecisionModel.h>
#include <geos/geom/BinaryOp.h>
#include <geos/operation/overlay/OverlayOp.h>
#include <geos/operation/overlay/snap/GeometrySnapper.h>
#include <geos/operation/buffer/BufferBuilder.h>
#include <geos/operation/buffer/BufferParameters.h>
#include <geos/operation/buffer/BufferOp.h>
......@@ -202,6 +203,16 @@ normalize_filename(const std::string& str)
return newstring;
}
static int
checkOverlaySuccess(geom::Geometry const& gRes, geom::Geometry const& gRealRes)
{
double tol = operation::overlay::snap::GeometrySnapper::computeSizeBasedSnapTolerance(gRes);
if ( gRes.equals(&gRealRes) ) return 1;
std::cerr << "Using an overlay tolerance of " << tol << std::endl;
if ( gRes.equalsExact(&gRealRes, tol) ) return 1;
return 0;
}
/* Could be an XMLTester class private but oh well.. */
static int
checkBufferSuccess(geom::Geometry const& gRes, geom::Geometry const& gRealRes, double dist)
......@@ -862,7 +873,7 @@ XMLTester::parseTest(const TiXmlNode* node)
gRealRes = gA->Union();
}
if (gRes->equals(gRealRes.get())) success=1;
success = checkOverlaySuccess(*gRes, *gRealRes);
actual_result=printGeom(gRealRes.get());
expected_result=printGeom(gRes.get());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment