[geos-commits] r2229 - in trunk: source/headers/geos/noding tests/unit/noding

svn_geos at osgeo.org svn_geos at osgeo.org
Wed Nov 26 14:41:44 EST 2008


Author: pramsey
Date: 2008-11-26 14:41:44 -0500 (Wed, 26 Nov 2008)
New Revision: 2229

Modified:
   trunk/source/headers/geos/noding/Octant.h
   trunk/tests/unit/noding/SegmentStringTest.cpp
Log:
Octant.h error (#185) from Denise Macleod.


Modified: trunk/source/headers/geos/noding/Octant.h
===================================================================
--- trunk/source/headers/geos/noding/Octant.h	2008-11-26 19:27:17 UTC (rev 2228)
+++ trunk/source/headers/geos/noding/Octant.h	2008-11-26 19:41:44 UTC (rev 2229)
@@ -64,7 +64,7 @@
     static int octant(const geom::Coordinate* p0, const geom::Coordinate* p1)
     {
         UNREFERENCED_PARAMETER(p0);
-		return octant(*p1, *p1);
+		return octant(*p0, *p1);
 	}
 };
 

Modified: trunk/tests/unit/noding/SegmentStringTest.cpp
===================================================================
--- trunk/tests/unit/noding/SegmentStringTest.cpp	2008-11-26 19:27:17 UTC (rev 2228)
+++ trunk/tests/unit/noding/SegmentStringTest.cpp	2008-11-26 19:41:44 UTC (rev 2229)
@@ -6,6 +6,7 @@
 #include <tut.h>
 // GEOS
 #include <geos/noding/SegmentString.h>
+#include <geos/noding/Octant.h>
 #include <geos/geom/Coordinate.h>
 #include <geos/geom/CoordinateSequence.h>
 #include <geos/geom/CoordinateArraySequenceFactory.h>
@@ -236,6 +237,27 @@
 
     }
 
+	// test Octant class
+	template<>
+	template<>
+	void object::test<5>()
+	{
+		geos::geom::Coordinate p0(0, 0);
+		geos::geom::Coordinate p1(5,-5);
+		int octant_rc1 = 0;
+		int octant_rc2 = 0;
+		int testPassed = true;
+		try {
+			octant_rc1 = geos::noding::Octant::octant(p0,p1);
+			octant_rc2 = geos::noding::Octant::octant(&p0,&p1);
+			testPassed = (octant_rc1 == octant_rc2);
+		}
+		catch (...) {
+			testPassed = false;
+		}
+		ensure(testPassed);
+	}
 
+
 } // namespace tut
 



More information about the geos-commits mailing list