[geos-commits] r2230 - in branches/3.0: source/headers/geos/noding
tests/unit/noding
svn_geos at osgeo.org
svn_geos at osgeo.org
Wed Nov 26 14:47:22 EST 2008
Author: pramsey
Date: 2008-11-26 14:47:22 -0500 (Wed, 26 Nov 2008)
New Revision: 2230
Modified:
branches/3.0/source/headers/geos/noding/Octant.h
branches/3.0/tests/unit/noding/SegmentStringTest.cpp
Log:
Octant.h error (#185) from Denise Macleod.
Modified: branches/3.0/source/headers/geos/noding/Octant.h
===================================================================
--- branches/3.0/source/headers/geos/noding/Octant.h 2008-11-26 19:41:44 UTC (rev 2229)
+++ branches/3.0/source/headers/geos/noding/Octant.h 2008-11-26 19:47:22 UTC (rev 2230)
@@ -60,7 +60,7 @@
*/
static int octant(const geom::Coordinate& p0, const geom::Coordinate& p1);
static int octant(const geom::Coordinate* p0, const geom::Coordinate* p1) {
- return octant(*p1, *p1);
+ return octant(*p0, *p1);
}
};
Modified: branches/3.0/tests/unit/noding/SegmentStringTest.cpp
===================================================================
--- branches/3.0/tests/unit/noding/SegmentStringTest.cpp 2008-11-26 19:41:44 UTC (rev 2229)
+++ branches/3.0/tests/unit/noding/SegmentStringTest.cpp 2008-11-26 19:47:22 UTC (rev 2230)
@@ -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