[geos-commits] r3154 - trunk/tests/unit/operation/overlay/snap
svn_geos at osgeo.org
svn_geos at osgeo.org
Fri Dec 3 05:58:22 EST 2010
Author: strk
Date: 2010-12-03 02:58:22 -0800 (Fri, 03 Dec 2010)
New Revision: 3154
Modified:
trunk/tests/unit/operation/overlay/snap/LineStringSnapperTest.cpp
Log:
Another test for snapping (empty sequence vs. non-empty snaps)
Modified: trunk/tests/unit/operation/overlay/snap/LineStringSnapperTest.cpp
===================================================================
--- trunk/tests/unit/operation/overlay/snap/LineStringSnapperTest.cpp 2010-12-03 10:52:27 UTC (rev 3153)
+++ trunk/tests/unit/operation/overlay/snap/LineStringSnapperTest.cpp 2010-12-03 10:58:22 UTC (rev 3154)
@@ -202,13 +202,40 @@
// source coordinates
- Coordinate src_a(0, 0);
Coordinate::Vect srcCoords;
// snap coordinates
+ Coordinate::ConstVect snpCoords;
+
+ LineStringSnapper snapper(srcCoords, 0.4);
+
+ CoordsVectAptr ret(snapper.snapTo(snpCoords));
+
+ ensure_equals(ret->size(), 0u);
+
+ }
+
+ // Test snapping an empty sequence
+ template<>
+ template<>
+ void object::test<6>()
+ {
+ using geos::geom::Coordinate;
+ using geos::operation::overlay::snap::LineStringSnapper;
+
+ typedef std::auto_ptr<Coordinate::Vect> CoordsVectAptr;
+
+
+ // source coordinates
+
+ Coordinate::Vect srcCoords;
+
+ // snap coordinates
+
Coordinate snp_a(0.1, 0);
Coordinate::ConstVect snpCoords;
+ snpCoords.push_back( &snp_a );
LineStringSnapper snapper(srcCoords, 0.4);
More information about the geos-commits
mailing list