[geos-commits] r3740 - trunk/tests/unit/io

svn_geos at osgeo.org svn_geos at osgeo.org
Fri Jan 11 06:35:38 PST 2013


Author: mloskot
Date: 2013-01-11 06:35:38 -0800 (Fri, 11 Jan 2013)
New Revision: 3740

Modified:
   trunk/tests/unit/io/WKTReaderTest.cpp
Log:
Added test<7>() for the poorly reported bug ticket #610 - bug not reproducible.

Modified: trunk/tests/unit/io/WKTReaderTest.cpp
===================================================================
--- trunk/tests/unit/io/WKTReaderTest.cpp	2013-01-11 14:25:46 UTC (rev 3739)
+++ trunk/tests/unit/io/WKTReaderTest.cpp	2013-01-11 14:35:38 UTC (rev 3740)
@@ -134,8 +134,43 @@
             ex.what();
         } catch (...) {
             ensure( !"Got unexpected exception" );
-	}
+        }
     }
+
+    // POINT(0 0) http://trac.osgeo.org/geos/ticket/610
+    template<>
+    template<>
+    void object::test<7>()
+    {         
+        GeomPtr geom;
+
+        try
+        {
+            // use FLOATING model
+            namespace ggm = geos::geom;
+            namespace gio = geos::io;
+            ggm::PrecisionModel pm(ggm::PrecisionModel::FLOATING);
+            ggm::GeometryFactory gf(&pm);
+            gio::WKTReader wktReader(&gf);
+            const std::string str = " POINT (0 0) ";
+            geom.reset(wktReader.read(str)); //HERE IT FAILS
+
+            geos::geom::CoordinateSequence *coords = geom->getCoordinates();
+            ensure_equals(coords->getDimension(), 2U);
+            ensure_distance(coords->getX(0), 0.0, 1e-12);
+            ensure_distance( coords->getY(0), 0.0, 1e-12);
+            delete coords;
+        }
+        catch (const geos::util::IllegalArgumentException& ex)
+        {
+            ensure( "Did get expected exception" );
+            ex.what();
+        }
+        catch (...)
+        {
+            ensure( !"Got unexpected exception" );
+        }
+    }
 } // namespace tut
 
 



More information about the geos-commits mailing list