Skip to content

Commit

Permalink
Improve GEOSTopologyPreserveSimplifyStableTest logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-jts committed Jun 13, 2024
1 parent 72c76d0 commit 37f7600
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions benchmarks/capi/GEOSTopologyPreserveSimplifyStableTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ GEOSGeometry* readGeom(std::string& fname) {
return geom;
}

void write(GEOSGeometry* g)
{
GEOSWKTWriter* writer = GEOSWKTWriter_create();
char* wkt = GEOSWKTWriter_write(writer, g);
GEOSWKTWriter_destroy(writer);
std::cout << wkt << std::endl;
GEOSFree(wkt);
}

//---------- Run test ---------------
void run(std::string& fname, int nRuns, double tolerance)
{
Expand All @@ -57,8 +66,8 @@ void run(std::string& fname, int nRuns, double tolerance)
//std::cout << "Run " << i << std::endl;
if (! isEqualExact || ! isDiffEmpty) {
nErrors++;
std::cout << "simplified results are not identical" << std::endl;
std::cout << diff << std::endl;
std::cout << "Run " << i << " - simplified results not identical: equals=" << isEqualExact << ", empty=" << isDiffEmpty << std::endl;
write(diff);
}

GEOSGeom_destroy(simp1);
Expand Down

0 comments on commit 37f7600

Please # to comment.