[geos-commits] r2163 - trunk/tests/bigtest

svn_geos at osgeo.org svn_geos at osgeo.org
Mon Aug 18 12:32:50 EDT 2008


Author: mloskot
Date: 2008-08-18 12:32:50 -0400 (Mon, 18 Aug 2008)
New Revision: 2163

Modified:
   trunk/tests/bigtest/GeometryTestFactory.cpp
   trunk/tests/bigtest/TestSweepLineSpeed.cpp
Log:
tests/bigtest: Pointed out number of memory leaks but not fixing them, waiting for comments.

Modified: trunk/tests/bigtest/GeometryTestFactory.cpp
===================================================================
--- trunk/tests/bigtest/GeometryTestFactory.cpp	2008-08-18 16:30:56 UTC (rev 2162)
+++ trunk/tests/bigtest/GeometryTestFactory.cpp	2008-08-18 16:32:50 UTC (rev 2163)
@@ -113,10 +113,16 @@
 			double len=armLen*(1-cos(ang)/2)+armBaseLen;
 			double x=len*cos(starAng+iArmPt*angInc/nArmPt)+basex;
 			double y=len*sin(starAng+iArmPt*angInc/nArmPt)+basey;
+
+            // FIXME - mloskot: Number of problems here:
+            // - new'd Coordinate definitely leaks
+            // - add() method makes a copy
+            // - why temporarily used Coordinate is allocated on the heap?!?
 			pts->add(*(new Coordinate(x,y)));
 		}
 		starAng+=angInc;
 	}
+    // FIXME - mloskot: The same problems as above
 	pts->add(*(new Coordinate(pts->getAt(0))));
 	return pts;
 }

Modified: trunk/tests/bigtest/TestSweepLineSpeed.cpp
===================================================================
--- trunk/tests/bigtest/TestSweepLineSpeed.cpp	2008-08-18 16:30:56 UTC (rev 2162)
+++ trunk/tests/bigtest/TestSweepLineSpeed.cpp	2008-08-18 16:32:50 UTC (rev 2163)
@@ -78,14 +78,16 @@
 	int nArms=10;
 	Polygon *poly=GeometryTestFactory::createSineStar(fact,0.0,0.0,size,armLen,nArms,nPts);
 	Polygon *box=GeometryTestFactory::createSineStar(fact,0.0,size/2,size,armLen,nArms,nPts); 
-//	Polygon *box=GeometryTestFactory::createBox(fact,0,0,1,100.0);
+    //Polygon *box=GeometryTestFactory::createBox(fact,0,0,1,100.0);
 
 	startTime=clock();
     poly->intersects(box);
     endTime=clock();
 	double totalTime=(double)(endTime-startTime);
 	printf( "n Pts: %i  Executed in %6.0f ms.\n",nPts,totalTime);
-//	cout << "n Pts: " << nPts << "   Executed in " << totalTime << endl;
+    //cout << "n Pts: " << nPts << "   Executed in " << totalTime << endl;
+    
+    // FIXME - mloskot: Why generated test geometries are not destroyed?"
 }
 
 int main(int /* argc */, char** /* argv[] */) {
@@ -108,5 +110,7 @@
 
 	cout << "Done" << endl;
 
+    // FIXME - mloskot: Who's gonna to eat the 'fact'? Mr. Leak!
+
 	return 0;
 }



More information about the geos-commits mailing list