[geos-commits] r2631 - trunk/tests/xmltester
svn_geos at osgeo.org
svn_geos at osgeo.org
Mon Sep 28 06:09:05 EDT 2009
Author: strk
Date: 2009-09-28 06:09:04 -0400 (Mon, 28 Sep 2009)
New Revision: 2631
Modified:
trunk/tests/xmltester/SingleSidedBufferResultMatcher.cpp
Log:
Don't give a false success if one of the expected/obtained geometry is empty
Modified: trunk/tests/xmltester/SingleSidedBufferResultMatcher.cpp
===================================================================
--- trunk/tests/xmltester/SingleSidedBufferResultMatcher.cpp 2009-09-28 09:03:53 UTC (rev 2630)
+++ trunk/tests/xmltester/SingleSidedBufferResultMatcher.cpp 2009-09-28 10:09:04 UTC (rev 2631)
@@ -37,8 +37,18 @@
const geom::Geometry& expectedBuffer,
double distance)
{
- if (actualBuffer.isEmpty() && expectedBuffer.isEmpty())
+ bool aEmpty = actualBuffer.isEmpty();
+ bool eEmpty = expectedBuffer.isEmpty();
+
+ // Both empty succeeds
+ if (aEmpty && eEmpty) return true;
+
+ // One empty and not the other is a failure
+ if (aEmpty || eEmpty)
+ {
+std::cerr << "isBufferResultMatch failed (one empty and one not)" << std::endl;
return true;
+ }
if (! isBoundaryHausdorffDistanceInTolerance(actualBuffer,
expectedBuffer, distance))
More information about the geos-commits
mailing list