[geos-commits] r3213 - trunk/tests/unit/operation/distance

svn_geos at osgeo.org svn_geos at osgeo.org
Sun Feb 13 15:14:07 EST 2011


Author: mloskot
Date: 2011-02-13 12:14:07 -0800 (Sun, 13 Feb 2011)
New Revision: 3213

Modified:
   trunk/tests/unit/operation/distance/DistanceOpTest.cpp
Log:
Added test case submitted with Ticket #367. No segmentation fault in distance() method observed under Visual C++ 10.0

Modified: trunk/tests/unit/operation/distance/DistanceOpTest.cpp
===================================================================
--- trunk/tests/unit/operation/distance/DistanceOpTest.cpp	2011-02-13 20:03:26 UTC (rev 3212)
+++ trunk/tests/unit/operation/distance/DistanceOpTest.cpp	2011-02-13 20:14:07 UTC (rev 3213)
@@ -10,8 +10,10 @@
 #include <geos/geom/Coordinate.h>
 #include <geos/geom/GeometryFactory.h>
 #include <geos/geom/Geometry.h>
+#include <geos/geom/PrecisionModel.h>
 #include <geos/algorithm/PointLocator.h>
 #include <geos/io/WKTReader.h>
+#include <geos/io/WKBReader.h>
 #include <geos/geom/CoordinateSequence.h>
 // std
 #include <memory>
@@ -455,6 +457,26 @@
 		// TODO: test closestPoints
 	}
 
+    // Test case submitted to Ticket #367
+    // http://trac.osgeo.org/geos/ticket/367/
+	template<>
+	template<>
+	void object::test<19>()
+	{
+        const char* wkb_geom1 = "01060000000100000001030000000100000000000000";
+        const char* wkb_geom2 = "010100000000000000000000000000000000000000";
+
+        geos::geom::PrecisionModel precision(geos::geom::PrecisionModel::FLOATING);
+        geos::geom::GeometryFactory f(&precision);
+        std::istringstream istr1(wkb_geom1);
+        std::istringstream istr2(wkb_geom2);
+        geos::io::WKBReader wkb(f);
+        GeomPtr g1(wkb.readHEX(istr1));
+        GeomPtr g2(wkb.readHEX(istr2));
+        ensure(g1->isValid());
+        ensure(g2->isValid());
+    }
+
 	// TODO: finish the tests by adding:
 	// 	LINESTRING - *all*
 	// 	MULTILINESTRING - *all*



More information about the geos-commits mailing list