[geos-commits] r3911 - branches/3.4/tests/unit/capi

svn_geos at osgeo.org svn_geos at osgeo.org
Wed Aug 21 23:35:36 PDT 2013


Author: strk
Date: 2013-08-21 23:35:35 -0700 (Wed, 21 Aug 2013)
New Revision: 3911

Modified:
   branches/3.4/tests/unit/capi/GEOSisValidDetailTest.cpp
Log:
Accept multiple NaN representations (#656)

Modified: branches/3.4/tests/unit/capi/GEOSisValidDetailTest.cpp
===================================================================
--- branches/3.4/tests/unit/capi/GEOSisValidDetailTest.cpp	2013-08-22 06:19:06 UTC (rev 3910)
+++ branches/3.4/tests/unit/capi/GEOSisValidDetailTest.cpp	2013-08-22 06:35:35 UTC (rev 3911)
@@ -111,7 +111,6 @@
     template<>
     void object::test<3>()
     {
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
       geom_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0, NaN -5)");
       ensure(0 != geom_);
       int r = GEOSisValidDetail(geom_, 0, &reason_, &loc_);
@@ -119,8 +118,16 @@
       strToUpper(wkt);
       ensure_equals(r, 0); // invalid
       ensure_equals(std::string(reason_), std::string("Invalid Coordinate"));
-      ensure_equals(wkt, "POINT (NAN -5)");
-#endif
+      std::string exp1 = "POINT (NAN -5)";
+      std::string exp2 = "POINT (-1#IND -5)";
+      // http://trac.osgeo.org/geos/ticket/656
+      std::string exp3 = "POINT (1.#QNAN -5)";
+      std::stringstream ss;
+      ss << "Expected '" << exp1 << "' or '" << exp2 << "' or '" << exp3 << "', Obtained '" << wkt;
+      ensure(ss.str(),
+        wkt == exp1 ||
+        wkt == exp2 ||
+        wkt == exp3);
     }
 
     // Self intersecting ring forming hole



More information about the geos-commits mailing list