[geos-commits] r3325 - in trunk: src/geom/prep tests/unit/capi

svn_geos at osgeo.org svn_geos at osgeo.org
Wed May 4 13:45:05 EDT 2011


Author: strk
Date: 2011-05-04 10:45:05 -0700 (Wed, 04 May 2011)
New Revision: 3325

Modified:
   trunk/src/geom/prep/AbstractPreparedPolygonContains.cpp
   trunk/tests/unit/capi/GEOSPreparedGeometryTest.cpp
Log:
Fix regression accidentally introduced by commit r3322 (Sean's). Add automated test for it (was found trough PostGIS regression test)

Modified: trunk/src/geom/prep/AbstractPreparedPolygonContains.cpp
===================================================================
--- trunk/src/geom/prep/AbstractPreparedPolygonContains.cpp	2011-05-04 16:30:36 UTC (rev 3324)
+++ trunk/src/geom/prep/AbstractPreparedPolygonContains.cpp	2011-05-04 17:45:05 UTC (rev 3325)
@@ -93,11 +93,10 @@
 
 	intDetector->setFindAllIntersectionTypes( true);
 	prepPoly->getIntersectionFinder()->intersects(&lineSegStr, intDetector);
-  /*
+
 	hasSegmentIntersection = intDetector->hasIntersection();
 	hasProperIntersection = intDetector->hasProperIntersection();
 	hasNonProperIntersection = intDetector->hasNonProperIntersection();
-  */
 
 	delete intDetector;
 	delete li;

Modified: trunk/tests/unit/capi/GEOSPreparedGeometryTest.cpp
===================================================================
--- trunk/tests/unit/capi/GEOSPreparedGeometryTest.cpp	2011-05-04 16:30:36 UTC (rev 3324)
+++ trunk/tests/unit/capi/GEOSPreparedGeometryTest.cpp	2011-05-04 17:45:05 UTC (rev 3325)
@@ -139,6 +139,38 @@
 
     }
 
+    // Test PreparedCovers
+    template<>
+    template<>
+    void object::test<5>()
+    {
+    geom1_ = GEOSGeomFromWKT("POLYGON((0 0, 0 10, 10 11, 10 0, 0 0))");
+    geom2_ = GEOSGeomFromWKT("POLYGON((0 0, 2 0, 2 2, 0 2, 0 0))");
+    prepGeom1_ = GEOSPrepare(geom1_);
+
+    ensure(0 != prepGeom1_);
+
+    int ret = GEOSPreparedCovers(prepGeom1_, geom2_);
+    ensure_equals(ret, 1);
+
+    }
+
+    // Test PreparedContains
+    template<>
+    template<>
+    void object::test<6>()
+    {
+    geom1_ = GEOSGeomFromWKT("POLYGON((0 0, 0 10, 10 11, 10 0, 0 0))");
+    geom2_ = GEOSGeomFromWKT("POLYGON((0 0, 2 0, 2 2, 0 2, 0 0))");
+    prepGeom1_ = GEOSPrepare(geom1_);
+
+    ensure(0 != prepGeom1_);
+
+    int ret = GEOSPreparedContains(prepGeom1_, geom2_);
+    ensure_equals(ret, 1);
+
+    }
+
     // TODO: add lots of more tests
     
 } // namespace tut



More information about the geos-commits mailing list