[geos-commits] r3180 - trunk/tests/unit/geom

svn_geos at osgeo.org svn_geos at osgeo.org
Thu Feb 3 16:50:18 EST 2011


Author: strk
Date: 2011-02-03 13:50:17 -0800 (Thu, 03 Feb 2011)
New Revision: 3180

Modified:
   trunk/tests/unit/geom/MultiPointTest.cpp
   trunk/tests/unit/geom/PointTest.cpp
Log:
Don't downcast with static_cast

Modified: trunk/tests/unit/geom/MultiPointTest.cpp
===================================================================
--- trunk/tests/unit/geom/MultiPointTest.cpp	2011-02-03 19:59:23 UTC (rev 3179)
+++ trunk/tests/unit/geom/MultiPointTest.cpp	2011-02-03 21:50:17 UTC (rev 3180)
@@ -43,7 +43,7 @@
 			// Create non-empty MultiPoint
 			GeometryPtr geo = 0;
 			geo = reader_.read("MULTIPOINT(0 0, 5 5, 10 10, 15 15, 20 20)");
-			mp_ = static_cast<MultiPointPtr>(geo);
+			mp_ = dynamic_cast<MultiPointPtr>(geo);
 		}
 
 		~test_multipoint_data()
@@ -106,7 +106,7 @@
 	{
 		const size_t size0 = 0;
 		GeometryPtr geo = reader_.read("MULTIPOINT EMPTY");
-		MultiPointPtr mp = static_cast<MultiPointPtr>(geo);
+		MultiPointPtr mp = dynamic_cast<MultiPointPtr>(geo);
 
 		ensure( mp->isEmpty() );
 		ensure( mp->isSimple() );

Modified: trunk/tests/unit/geom/PointTest.cpp
===================================================================
--- trunk/tests/unit/geom/PointTest.cpp	2011-02-03 19:59:23 UTC (rev 3179)
+++ trunk/tests/unit/geom/PointTest.cpp	2011-02-03 21:50:17 UTC (rev 3180)
@@ -50,7 +50,7 @@
 	    // Create non-empty Point
 	    GeometryPtr geo = 0;
 	    geo = reader_.read("POINT(1.234 5.678)");
-	    point_ = static_cast<PointPtr>(geo);
+	    point_ = dynamic_cast<PointPtr>(geo);
 	}
 	
 	~test_point_data()



More information about the geos-commits mailing list