Skip to content

Commit 37f7600

Browse files
committed
Improve GEOSTopologyPreserveSimplifyStableTest logging
1 parent 72c76d0 commit 37f7600

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

benchmarks/capi/GEOSTopologyPreserveSimplifyStableTest.cpp

+11-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ GEOSGeometry* readGeom(std::string& fname) {
3838
return geom;
3939
}
4040

41+
void write(GEOSGeometry* g)
42+
{
43+
GEOSWKTWriter* writer = GEOSWKTWriter_create();
44+
char* wkt = GEOSWKTWriter_write(writer, g);
45+
GEOSWKTWriter_destroy(writer);
46+
std::cout << wkt << std::endl;
47+
GEOSFree(wkt);
48+
}
49+
4150
//---------- Run test ---------------
4251
void run(std::string& fname, int nRuns, double tolerance)
4352
{
@@ -57,8 +66,8 @@ void run(std::string& fname, int nRuns, double tolerance)
5766
//std::cout << "Run " << i << std::endl;
5867
if (! isEqualExact || ! isDiffEmpty) {
5968
nErrors++;
60-
std::cout << "simplified results are not identical" << std::endl;
61-
std::cout << diff << std::endl;
69+
std::cout << "Run " << i << " - simplified results not identical: equals=" << isEqualExact << ", empty=" << isDiffEmpty << std::endl;
70+
write(diff);
6271
}
6372

6473
GEOSGeom_destroy(simp1);

0 commit comments

Comments
 (0)