[geos-commits] [SCM] GEOS branch master updated. c8297015f0c50e36f00939152531e8e918b2f578

git at osgeo.org git at osgeo.org
Mon Dec 17 11:33:22 PST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, master has been updated
       via  c8297015f0c50e36f00939152531e8e918b2f578 (commit)
      from  6fa6d65247829c1ba120015d4a59bd648b536a18 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c8297015f0c50e36f00939152531e8e918b2f578
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Dec 17 11:33:08 2018 -0800

    Change buffer unit failures to more correct message

diff --git a/tests/unit/capi/GEOSBufferTest.cpp b/tests/unit/capi/GEOSBufferTest.cpp
index 2dd8e3c..26ab0e1 100644
--- a/tests/unit/capi/GEOSBufferTest.cpp
+++ b/tests/unit/capi/GEOSBufferTest.cpp
@@ -152,7 +152,7 @@ namespace tut
         ensure_equals(GEOSGetNumCoordinates(geom2_), 7);
 
         ensure(0 != GEOSArea(geom2_, &area_));
-        ensure_distance(area_, 161.803, 0.001);
+        ensure_area(area_, 161.803, 0.001);
 
     }
 
@@ -174,7 +174,7 @@ namespace tut
         ensure_equals(GEOSGetNumCoordinates(geom2_), 11);
 
         ensure(0 != GEOSArea(geom2_, &area_));
-        ensure_distance(area_, 182.514, 0.001);
+        ensure_area(area_, 182.514, 0.001);
     }
 
     // Buffer with square end caps on a 2-vertices line (no matter quadSegs)
@@ -196,7 +196,7 @@ namespace tut
         ensure_equals(GEOSGetNumCoordinates(geom2_), 7);
 
         ensure(0 != GEOSArea(geom2_, &area_));
-        ensure_distance(area_, 211.803, 0.001);
+        ensure_area(area_, 211.803, 0.001);
 
     }
 
@@ -219,7 +219,7 @@ namespace tut
         ensure_equals(GEOSGetNumCoordinates(geom2_), 5);
 
         ensure(0 != GEOSArea(geom2_, &area_));
-        ensure_distance(area_, 111.803, 0.001);
+        ensure_area(area_, 111.803, 0.001);
     }
 
     // Buffer with flat end cap on a 2-vertices horizontal line
@@ -241,7 +241,7 @@ namespace tut
         ensure_equals(GEOSGetNumCoordinates(geom2_), 5);
 
         ensure(0 != GEOSArea(geom2_, &area_));
-        ensure_distance(area_, 50.0, 0.001);
+        ensure_area(area_, 50.0, 0.001);
 
         ensure_equals(std::string(wkt_), std::string(
 "POLYGON ((10.0000000000000000 15.0000000000000000, 10.0000000000000000 5.0000000000000000, 5.0000000000000000 5.0000000000000000, 5.0000000000000000 15.0000000000000000, 10.0000000000000000 15.0000000000000000))"
@@ -267,7 +267,7 @@ namespace tut
         ensure_equals(GEOSGetNumCoordinates(geom2_), 7);
 
         ensure(0 != GEOSArea(geom2_, &area_));
-        ensure_distance(area_, 150.0, 0.001);
+        ensure_area(area_, 150.0, 0.001);
 
         ensure_equals(std::string(wkt_), std::string(
 "POLYGON ((10.0000000000000000 15.0000000000000000, 15.0000000000000000 15.0000000000000000, 15.0000000000000000 5.0000000000000000, 5.0000000000000000 5.0000000000000000, 0.0000000000000000 5.0000000000000009, 0.0000000000000000 15.0000000000000000, 10.0000000000000000 15.0000000000000000))"
@@ -294,7 +294,7 @@ namespace tut
         ensure_equals(GEOSGetNumCoordinates(geom2_), 29);
 
         ensure(0 != GEOSArea(geom2_, &area_));
-        ensure_distance(area_, 244.615, 0.001);
+        ensure_area(area_, 244.615, 0.001);
 
     }
 
@@ -318,7 +318,7 @@ namespace tut
         ensure_equals(GEOSGetNumCoordinates(geom2_), 9);
 
         ensure(0 != GEOSArea(geom2_, &area_));
-        ensure_distance(area_, 250.0, 0.001);
+        ensure_area(area_, 250.0, 0.001);
 
         ensure_equals(std::string(wkt_), std::string(
 "POLYGON ((5.0000000000000000 15.0000000000000000, 5.0000000000000000 20.0000000000000000, 5.0000000000000000 25.0000000000000000, 15.0000000000000000 25.0000000000000000, 15.0000000000000000 5.0000000000000000, 5.0000000000000000 5.0000000000000000, 0.0000000000000000 5.0000000000000009, 0.0000000000000000 15.0000000000000000, 5.0000000000000000 15.0000000000000000))"
@@ -345,7 +345,7 @@ namespace tut
         ensure_equals(GEOSGetNumCoordinates(geom2_), 10);
 
         ensure(0 != GEOSArea(geom2_, &area_));
-        ensure_distance(area_, 237.5, 0.001);
+        ensure_area(area_, 237.5, 0.001);
 
         ensure_equals(std::string(wkt_), std::string(
 "POLYGON ((5.0000000000000000 15.0000000000000000, 5.0000000000000000 20.0000000000000000, 5.0000000000000000 25.0000000000000000, 15.0000000000000000 25.0000000000000000, 15.0000000000000000 10.0000000000000000, 10.0000000000000000 5.0000000000000000, 5.0000000000000000 5.0000000000000000, 0.0000000000000000 5.0000000000000009, 0.0000000000000000 15.0000000000000000, 5.0000000000000000 15.0000000000000000))"
@@ -373,7 +373,7 @@ namespace tut
         ensure_equals(GEOSGetNumCoordinates(geom2_), 10);
 
         ensure(0 != GEOSArea(geom2_, &area_));
-        ensure_distance(area_, 237.5, 0.001);
+        ensure_area(area_, 237.5, 0.001);
 
         ensure_equals(std::string(wkt_), std::string(
 "POLYGON ((5.0000000000000000 15.0000000000000000, 5.0000000000000000 20.0000000000000000, 5.0000000000000000 25.0000000000000000, 15.0000000000000000 25.0000000000000000, 15.0000000000000000 10.0000000000000000, 10.0000000000000000 5.0000000000000000, 5.0000000000000000 5.0000000000000000, 0.0000000000000000 5.0000000000000009, 0.0000000000000000 15.0000000000000000, 5.0000000000000000 15.0000000000000000))"
@@ -399,7 +399,7 @@ namespace tut
         ensure_equals(GEOSGetNumCoordinates(geom2_), 7);
 
         ensure(0 != GEOSArea(geom2_, &area_));
-        ensure_distance(area_, 127.452, 0.001);
+        ensure_area(area_, 127.452, 0.001);
 
     }
 
@@ -422,7 +422,7 @@ namespace tut
         ensure_equals(GEOSGetNumCoordinates(geom2_), 6);
 
         ensure(0 != GEOSArea(geom2_, &area_));
-        ensure_distance(area_, 139.043, 0.001);
+        ensure_area(area_, 139.043, 0.001);
 
     }
 
@@ -445,7 +445,7 @@ namespace tut
         ensure_equals(GEOSGetNumCoordinates(geom2_), 4);
 
         ensure(0 != GEOSArea(geom2_, &area_));
-        ensure_distance(area_, 141.598, 0.001);
+        ensure_area(area_, 141.598, 0.001);
 
     }
 
diff --git a/tests/unit/tut/tut_assert.hpp b/tests/unit/tut/tut_assert.hpp
index eb8b2db..faf10b8 100644
--- a/tests/unit/tut/tut_assert.hpp
+++ b/tests/unit/tut/tut_assert.hpp
@@ -230,7 +230,7 @@ void ensure_equals(const LhsType *lhs_begin, const LhsType *lhs_end,
  * TODO: domains are wrong, T - T might not yield T, but Q
  */
 template <typename M, class T>
-void ensure_distance(const M& msg, const T& actual, const T& expected, const T& distance)
+void ensure_measurement(const M& msg, const T& actual, const T& expected, const T& distance)
 {
     if (expected-distance >= actual || expected+distance <= actual)
     {
@@ -250,7 +250,13 @@ void ensure_distance(const M& msg, const T& actual, const T& expected, const T&
 template <class T>
 void ensure_distance(const T& actual, const T& expected, const T& distance)
 {
-    ensure_distance<>("Distance is wrong", actual, expected, distance);
+    ensure_measurement<>("Distance is wrong", actual, expected, distance);
+}
+
+template <class T>
+void ensure_area(const T& actual, const T& expected, const T& distance)
+{
+    ensure_measurement<>("Area is wrong", actual, expected, distance);
 }
 
 template<typename M>

-----------------------------------------------------------------------

Summary of changes:
 tests/unit/capi/GEOSBufferTest.cpp | 26 +++++++++++++-------------
 tests/unit/tut/tut_assert.hpp      | 10 ++++++++--
 2 files changed, 21 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list