[geos-commits] r3515 - trunk/tests/unit/capi

svn_geos at osgeo.org svn_geos at osgeo.org
Fri Nov 4 16:41:45 EDT 2011


Author: strk
Date: 2011-11-04 13:41:45 -0700 (Fri, 04 Nov 2011)
New Revision: 3515

Modified:
   trunk/tests/unit/capi/GEOSisValidDetailTest.cpp
Log:
Allow any case in NaN for testcase purposes (#486)

Modified: trunk/tests/unit/capi/GEOSisValidDetailTest.cpp
===================================================================
--- trunk/tests/unit/capi/GEOSisValidDetailTest.cpp	2011-11-04 17:59:22 UTC (rev 3514)
+++ trunk/tests/unit/capi/GEOSisValidDetailTest.cpp	2011-11-04 20:41:45 UTC (rev 3515)
@@ -53,6 +53,12 @@
           return ret;
         }
 
+	void strToUpper(std::string &str)
+        {
+          for(size_t i = 0, len = str.size(); i < len; ++i)
+            str[i] = std::toupper(str[i]);
+        }
+
         ~test_capiisvaliddetail_data()
         {
             GEOSGeom_destroy(geom_);
@@ -105,9 +111,11 @@
       geom_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0, NaN -5)");
       ensure(0 != geom_);
       int r = GEOSisValidDetail(geom_, 0, &reason_, &loc_);
+      std::string wkt = toWKT(loc_);
+      strToUpper(wkt);
       ensure_equals(r, 0); // invalid
       ensure_equals(std::string(reason_), std::string("Invalid Coordinate"));
-      ensure_equals(toWKT(loc_), "POINT (nan -5)");
+      ensure_equals(wkt, "POINT (NAN -5)");
 #endif
     }
 



More information about the geos-commits mailing list