[geos-commits] r2622 - in trunk: source/headers/geos tests/unit tests/unit/algorithm tests/unit/geom

svn_geos at osgeo.org svn_geos at osgeo.org
Fri Aug 21 05:50:58 EDT 2009


Author: mloskot
Date: 2009-08-21 05:50:58 -0400 (Fri, 21 Aug 2009)
New Revision: 2622

Modified:
   trunk/source/headers/geos/export.h
   trunk/tests/unit/algorithm/RobustLineIntersectionTest.cpp
   trunk/tests/unit/geom/CoordinateArraySequenceTest.cpp
   trunk/tests/unit/geos_unit.cpp
Log:
Cleaned compilation warnings in unit tests.

Modified: trunk/source/headers/geos/export.h
===================================================================
--- trunk/source/headers/geos/export.h	2009-08-21 09:43:09 UTC (rev 2621)
+++ trunk/source/headers/geos/export.h	2009-08-21 09:50:58 UTC (rev 2622)
@@ -16,19 +16,19 @@
 #ifndef GEOS_EXPORT_H
 #define GEOS_EXPORT_H
 
-#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__)  || defined( __MWERKS__)
-    #  if defined( GEOS_DLL_EXPORT )
-    #    define GEOS_DLL   __declspec(dllexport)
-    #  elif defined( GEOS_DLL_IMPORT )
-    #    define GEOS_DLL   __declspec(dllimport)
-    #  else
-    #    define GEOS_DLL
-    #  endif 
+#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || \
+    defined( __BCPLUSPLUS__)  || defined( __MWERKS__)
+
+    #if defined(GEOS_DLL_EXPORT)
+        #define GEOS_DLL   __declspec(dllexport)
+    #elif defined(GEOS_DLL_IMPORT)
+        #define GEOS_DLL   __declspec(dllimport)
+    #else
+        #define GEOS_DLL
+    #endif
 #else
-    #  define GEOS_DLL
-#endif  
+    #define GEOS_DLL
+#endif
 
-
 #endif // ndef GEOS_EXPORT_H
 
-

Modified: trunk/tests/unit/algorithm/RobustLineIntersectionTest.cpp
===================================================================
--- trunk/tests/unit/algorithm/RobustLineIntersectionTest.cpp	2009-08-21 09:43:09 UTC (rev 2621)
+++ trunk/tests/unit/algorithm/RobustLineIntersectionTest.cpp	2009-08-21 09:50:58 UTC (rev 2622)
@@ -69,7 +69,7 @@
 
 		if ( intPt.empty() ) return;
 
-		ensure_equals(intPt.size(), intNum);
+		ensure_equals(intPt.size(), static_cast<std::vector<Coordinate>::size_type>(intNum));
 
 		// test that both points are represented here
 		//bool isIntPointsCorrect = true;

Modified: trunk/tests/unit/geom/CoordinateArraySequenceTest.cpp
===================================================================
--- trunk/tests/unit/geom/CoordinateArraySequenceTest.cpp	2009-08-21 09:43:09 UTC (rev 2621)
+++ trunk/tests/unit/geom/CoordinateArraySequenceTest.cpp	2009-08-21 09:50:58 UTC (rev 2622)
@@ -564,46 +564,45 @@
     void object::test<16>()
     {
 		using geos::geom::Coordinate;
+		using geos::geom::CoordinateArraySequence;
 
 		// Create empty sequence to fill with coordinates
-		const size_t size = 0;
-		geos::geom::CoordinateArraySequence sequence;
+		CoordinateArraySequence sequence;
 		
 		sequence.add(Coordinate(0,0)); 
 		sequence.add(Coordinate(1,1)); 
 		sequence.add(Coordinate(2,2)); 
 		
-		ensure_equals( sequence.size(), 3 );
+		ensure_equals( sequence.size(), std::size_t(3));
 
 		sequence.add(0, Coordinate(4,4), false); // don't alow repeated
-		ensure_equals( sequence.size(), 4 );
-		ensure_equals( sequence.getAt(0).x, 4 );
+		ensure_equals( sequence.size(), std::size_t(4) );
+		ensure_equals( sequence.getAt(0).x, std::size_t(4) );
 
 		// do not allow repeated
 		sequence.add(0, Coordinate(4,4), false); 
-		ensure_equals( sequence.size(), 4 );
+		ensure_equals( sequence.size(), std::size_t(4) );
 
 		// allow repeated
 		sequence.add(0, Coordinate(4,4), true); 
-		ensure_equals( sequence.size(), 5 );
+		ensure_equals( sequence.size(), std::size_t(5) );
 
 		// Now looks like this: 4,4,0,1,2
 		// we'll add at position 4 a 2 (equals to the one after)
 		sequence.add(4, Coordinate(2,2), false); 
-		ensure_equals( sequence.size(), 5 );
+		ensure_equals( sequence.size(), std::size_t(5) );
 
 		// we'll add at position 4 a 1 (equals to the one before)
 		sequence.add(4, Coordinate(1,1), false); 
-		ensure_equals( sequence.size(), 5 );
+		ensure_equals( sequence.size(), std::size_t(5) );
 
 		// we'll add at position 4 a 1 (equals to the one before)
 		// but allowing duplicates
 		sequence.add(4, Coordinate(1,1), true); 
-		ensure_equals( sequence.size(), 6 );
+		ensure_equals( sequence.size(), std::size_t(6) );
 		ensure_equals( sequence.getAt(3).x, 1 );
 		ensure_equals( sequence.getAt(4).x, 1 );
 		ensure_equals( sequence.getAt(5).x, 2 );
-
 	}
 
 } // namespace tut

Modified: trunk/tests/unit/geos_unit.cpp
===================================================================
--- trunk/tests/unit/geos_unit.cpp	2009-08-21 09:43:09 UTC (rev 2621)
+++ trunk/tests/unit/geos_unit.cpp	2009-08-21 09:50:58 UTC (rev 2622)
@@ -95,8 +95,12 @@
         {
             // TODO - mloskot - check if test group with given name exists
             // TODO - mloskot - check if test case with given number exists
+            std::string grpname(argv[1]);
+            if (grpname.empty())
+                throw std::runtime_error("missing test group name");
 
-            tut::runner.get().run_test(argv[1], std::atoi(argv[2]));
+            tut::test_result result;
+            tut::runner.get().run_test(grpname, std::atoi(argv[2]), result);
         }
     }
     catch( const std::exception& ex )



More information about the geos-commits mailing list