Permalink
Browse files

Allow any case in NaN for testcase purposes (#486)

git-svn-id: http://svn.osgeo.org/geos/trunk@3515 5242fede-7e19-0410-aef8-94bd7d2200fb
  • Loading branch information...
strk
strk committed Nov 4, 2011
1 parent f380c1f commit 5700e3f8260bd2ef9a7b28c2c7160a088ce22950
Showing with 9 additions and 1 deletion.
  1. +9 −1 tests/unit/capi/GEOSisValidDetailTest.cpp
@@ -53,6 +53,12 @@ namespace tut
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 @@ namespace tut
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
}

0 comments on commit 5700e3f

Please sign in to comment.