[geos-commits] r3793 - in trunk/tests/unit: algorithm capi

svn_geos at osgeo.org svn_geos at osgeo.org
Fri Mar 15 11:48:17 PDT 2013


Author: strk
Date: 2013-03-15 11:48:16 -0700 (Fri, 15 Mar 2013)
New Revision: 3793

Modified:
   trunk/tests/unit/algorithm/RobustLineIntersectionTest.cpp
   trunk/tests/unit/capi/GEOSConvexHullTest.cpp
   trunk/tests/unit/capi/GEOSUnaryUnionTest.cpp
Log:
Fix memory leaks in unit tests

Modified: trunk/tests/unit/algorithm/RobustLineIntersectionTest.cpp
===================================================================
--- trunk/tests/unit/algorithm/RobustLineIntersectionTest.cpp	2013-03-15 18:05:58 UTC (rev 3792)
+++ trunk/tests/unit/algorithm/RobustLineIntersectionTest.cpp	2013-03-15 18:48:16 UTC (rev 3793)
@@ -229,7 +229,8 @@
     std::vector<Coordinate> savePt = pt;
 
 		geos::algorithm::LineIntersector li;
-    li.setPrecisionModel(new PrecisionModel(scaleFactor));
+    PrecisionModel lpm(scaleFactor);
+    li.setPrecisionModel(&lpm);
     li.computeIntersection(pt[0], pt[1], pt[2], pt[3]);
 
     // check that input points are unchanged

Modified: trunk/tests/unit/capi/GEOSConvexHullTest.cpp
===================================================================
--- trunk/tests/unit/capi/GEOSConvexHullTest.cpp	2013-03-15 18:05:58 UTC (rev 3792)
+++ trunk/tests/unit/capi/GEOSConvexHullTest.cpp	2013-03-15 18:48:16 UTC (rev 3793)
@@ -74,6 +74,7 @@
         ensure( 0 == GEOSisEmpty(output) );
         // TODO
         //ensure( 0 != GEOSEquals(output, expected_));
+        GEOSGeom_destroy(output);
     }
  
 } // namespace tut

Modified: trunk/tests/unit/capi/GEOSUnaryUnionTest.cpp
===================================================================
--- trunk/tests/unit/capi/GEOSUnaryUnionTest.cpp	2013-03-15 18:05:58 UTC (rev 3792)
+++ trunk/tests/unit/capi/GEOSUnaryUnionTest.cpp	2013-03-15 18:48:16 UTC (rev 3793)
@@ -198,12 +198,12 @@
     template<>
     void object::test<9>()
     {
-	const char* hexwkb = "010200000002000000000000000000F8FF000000000000F8FF0000000000000000000000000000F03F";
+        const char* hexwkb = "010200000002000000000000000000F8FF000000000000F8FF0000000000000000000000000000F03F";
         geom1_ = GEOSGeomFromHEX_buf((const unsigned char*)hexwkb, std::strlen(hexwkb));
         ensure( 0 != geom1_ );
 
         geom2_ = GEOSUnaryUnion(geom1_);
-	ensure( 0 == geom2_ );
+        ensure( 0 == geom2_ );
 
     }
 



More information about the geos-commits mailing list