[geos-commits] r2040 - in trunk: . build/msvc80/geos_unit source/geom tests/unit/geom

svn_geos at osgeo.org svn_geos at osgeo.org
Thu Dec 13 11:09:25 EST 2007


Author: mloskot
Date: 2007-12-13 11:09:25 -0500 (Thu, 13 Dec 2007)
New Revision: 2040

Modified:
   trunk/ChangeLog
   trunk/build/msvc80/geos_unit/geos_unit.vcproj
   trunk/source/geom/Geometry.cpp
   trunk/source/geom/GeometryCollection.cpp
   trunk/tests/unit/geom/GeometryFactoryTest.cpp
Log:
* build\msvc80\geos_unit\geos_unit.vcproj: fixed post-build event
* source\geom\GeometryCollection.cpp: removed unreachable code,
  shorten exception message.
* source\geom\Geometry.cpp: purified condition based on dynamic_cast
* tests\unit\geom\GeometryFactoryTest.cpp: use std::size_t instead of
  int where unsigned integral type required.



Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-12-12 22:50:09 UTC (rev 2039)
+++ trunk/ChangeLog	2007-12-13 16:09:25 UTC (rev 2040)
@@ -1,4 +1,13 @@
 
+2007-12-13 Mateusz Loskot <mateusz at loskot.net>
+
+	* build\msvc80\geos_unit\geos_unit.vcproj: fixed post-build event
+	* source\geom\GeometryCollection.cpp: removed unreachable code,
+	  shorten exception message.
+	* source\geom\Geometry.cpp: purified condition based on dynamic_cast
+	* tests\unit\geom\GeometryFactoryTest.cpp: use std::size_t instead of
+	  int where unsigned integral type required.
+
 2007-12-09 Mateusz Loskot <mateusz at loskot.net>
 
 	* tests/unit/precision/SimpleGeometryPrecisionReducerTest.cpp:

Modified: trunk/build/msvc80/geos_unit/geos_unit.vcproj
===================================================================
--- trunk/build/msvc80/geos_unit/geos_unit.vcproj	2007-12-12 22:50:09 UTC (rev 2039)
+++ trunk/build/msvc80/geos_unit/geos_unit.vcproj	2007-12-13 16:09:25 UTC (rev 2040)
@@ -91,8 +91,8 @@
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-				Description="Running regression tests using $(ProjectName).exe..."
-				CommandLine=""
+				Description="Running regression tests using $(ProjectName)d.exe..."
+				CommandLine="cd $(OutDir)&#x0D;&#x0A;$(ProjectName)d.exe"
 			/>
 		</Configuration>
 		<Configuration
@@ -372,6 +372,10 @@
 		<Filter
 			Name="operation"
 			>
+			<File
+				RelativePath="..\..\..\tests\unit\operation\IsSimpleOpTest.cpp"
+				>
+			</File>
 			<Filter
 				Name="distance"
 				>
@@ -408,6 +412,10 @@
 				RelativePath="..\..\..\tests\unit\precision\LineStringSnapperTest.cpp"
 				>
 			</File>
+			<File
+				RelativePath="..\..\..\tests\unit\precision\SimpleGeometryPrecisionReducerTest.cpp"
+				>
+			</File>
 		</Filter>
 		<Filter
 			Name="capi"

Modified: trunk/source/geom/Geometry.cpp
===================================================================
--- trunk/source/geom/Geometry.cpp	2007-12-12 22:50:09 UTC (rev 2039)
+++ trunk/source/geom/Geometry.cpp	2007-12-13 16:09:25 UTC (rev 2040)
@@ -550,7 +550,7 @@
 		size_t ngeoms, i;
 		vector<Geometry *> *v = new vector<Geometry *>();
 
-		if ( (coll = dynamic_cast<const GeometryCollection *>(this)) )
+		if ( NULL != (coll = dynamic_cast<const GeometryCollection *>(this)) )
 		{
 			ngeoms = coll->getNumGeometries();
 			for (i=0; i<ngeoms; i++)
@@ -559,7 +559,7 @@
 			v->push_back(this->clone());
 		}
 
-		if ( (coll = dynamic_cast<const GeometryCollection *>(other)) )
+		if ( NULL != (coll = dynamic_cast<const GeometryCollection *>(other)) )
 		{
 			ngeoms = coll->getNumGeometries();
 			for (i=0; i<ngeoms; i++)

Modified: trunk/source/geom/GeometryCollection.cpp
===================================================================
--- trunk/source/geom/GeometryCollection.cpp	2007-12-12 22:50:09 UTC (rev 2039)
+++ trunk/source/geom/GeometryCollection.cpp	2007-12-13 16:09:25 UTC (rev 2040)
@@ -154,15 +154,13 @@
 bool
 GeometryCollection::isSimple() const
 {
-	throw util::IllegalArgumentException("This method is not supported by GeometryCollection objects\n");
-	return false;
+	throw util::IllegalArgumentException("Operation not supported by GeometryCollection\n");
 }
 
 Geometry*
 GeometryCollection::getBoundary() const
 {
-	throw util::IllegalArgumentException("This method is not supported by GeometryCollection objects\n");
-	return NULL;
+	throw util::IllegalArgumentException("Operation not supported by GeometryCollection\n");
 }
 
 bool

Modified: trunk/tests/unit/geom/GeometryFactoryTest.cpp
===================================================================
--- trunk/tests/unit/geom/GeometryFactoryTest.cpp	2007-12-12 22:50:09 UTC (rev 2039)
+++ trunk/tests/unit/geom/GeometryFactoryTest.cpp	2007-12-13 16:09:25 UTC (rev 2040)
@@ -24,6 +24,7 @@
 #include <geos/util/IllegalArgumentException.h>
 // STL
 #include <vector>
+#include <cstring> // std::size_t
 
 /*!
  * \brief
@@ -503,7 +504,7 @@
 	template<>
 	void object::test<13>()
 	{
-		const size_t size = 5;
+		const std::size_t size = 5;
 		CoordArrayPtr coords = new geos::geom::CoordinateArraySequence(size);
 		ensure( coords != 0 );
 		ensure_equals( coords->getSize(), size );
@@ -533,7 +534,7 @@
 	template<>
 	void object::test<14>()
 	{
-		const size_t size = 5;
+		const std::size_t size = 5;
 		geos::geom::CoordinateArraySequence coords(size);
 		ensure_equals( coords.getSize(), size );
 
@@ -603,7 +604,7 @@
 	template<>
 	void object::test<16>()
 	{
-		const size_t size = 5;
+		const std::size_t size = 5;
 		CoordArrayPtr coords = new geos::geom::CoordinateArraySequence(size);
 		ensure( coords != 0 );
 		ensure_equals( coords->getSize(), size );
@@ -633,7 +634,7 @@
 	template<>
 	void object::test<17>()
 	{
-		const size_t size = 5;
+		const std::size_t size = 5;
 		geos::geom::CoordinateArraySequence coords(size);
 		ensure_equals( coords.getSize(), size );
 
@@ -705,7 +706,7 @@
 	void object::test<19>()
 	{
 		using geos::geom::Coordinate;
-		const size_t size = 7;
+		const std::size_t size = 7;
 
 		// Create sequence of coordiantes
 		CoordArrayPtr coords = new geos::geom::CoordinateArraySequence(size);
@@ -753,8 +754,8 @@
 	void object::test<20>()
 	{
 		using geos::geom::Coordinate;
-		const size_t exteriorSize = 7;
-		const size_t interiorSize = 5;
+		const std::size_t exteriorSize = 7;
+		const std::size_t interiorSize = 5;
 
 		// Create sequence of coordiantes
 		CoordArrayPtr coords = new geos::geom::CoordinateArraySequence(exteriorSize);
@@ -894,7 +895,7 @@
 	template<>
 	void object::test<23>()
 	{
-		const size_t size = 3;
+		const std::size_t size = 3;
 		geos::geom::Coordinate coord(x_, y_, z_);
 
 		std::vector<GeometryPtr> vec;
@@ -978,7 +979,7 @@
 	template<>
 	void object::test<25>()
 	{
-		const size_t size = 3;
+		const std::size_t size = 3;
 		geos::geom::Coordinate coord(x_, y_, z_);
 
 		std::vector<GeometryPtr>* vec = new std::vector<GeometryPtr>();
@@ -1019,7 +1020,7 @@
 	template<>
 	void object::test<26>()
 	{
-		const size_t size = 3;
+		const std::size_t size = 3;
 		geos::geom::Coordinate coord(x_, y_, z_);
 
 		std::vector<GeometryPtr> vec;
@@ -1063,7 +1064,7 @@
 	void object::test<27>()
 	{
 		using geos::geom::Coordinate;
-		const size_t size = 3;
+		const std::size_t size = 3;
 
 		// Add collection of coordinates
 		geos::geom::CoordinateArraySequence coords(size);
@@ -1133,14 +1134,14 @@
 	{
 		using geos::geom::Coordinate;
 		
-		const size_t size = 5;
-		const size_t lineSize = 2;
+		const std::size_t size = 5;
+		const std::size_t lineSize = 2;
 
 		std::vector<GeometryPtr>* lines = new std::vector<GeometryPtr>();
 
-		for (size_t i = 0; i < size; ++i)
+		for (std::size_t i = 0; i < size; ++i)
 		{
-			const int factor = i * i;
+			const std::size_t factor = i * i;
 			CoordArrayPtr coords = new geos::geom::CoordinateArraySequence(lineSize);
 			ensure( coords != 0 );
 			coords->setAt(Coordinate(0 + factor, 0 + factor), 0);
@@ -1175,14 +1176,14 @@
 	{
 		using geos::geom::Coordinate;
 		
-		const size_t size = 5;
-		const size_t lineSize = 2;
+		const std::size_t size = 5;
+		const std::size_t lineSize = 2;
 
 		std::vector<GeometryPtr> lines;
 
-		for (size_t i = 0; i < size; ++i)
+		for (std::size_t i = 0; i < size; ++i)
 		{
-			const int factor = i * i;
+			const std::size_t factor = i * i;
 			CoordArrayPtr coords = new geos::geom::CoordinateArraySequence(lineSize);
 			ensure( coords != 0 );
 			coords->setAt(Coordinate(0 + factor, 0 + factor), 0);



More information about the geos-commits mailing list