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

git at osgeo.org git at osgeo.org
Fri Nov 13 07:24:36 PST 2020


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  c19dbdb370f3f5fb535ef4c7515ae42e94c38f6d (commit)
      from  d1a55313b602b600d2e568336581b5d90fe8482e (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 c19dbdb370f3f5fb535ef4c7515ae42e94c38f6d
Author: Sandro Santilli <strk at kbt.io>
Date:   Fri Nov 13 16:23:42 2020 +0100

    Add another NearestPoints test, improve error output

diff --git a/tests/unit/capi/GEOSNearestPointsTest.cpp b/tests/unit/capi/GEOSNearestPointsTest.cpp
index 17cb706..a4780a8 100644
--- a/tests/unit/capi/GEOSNearestPointsTest.cpp
+++ b/tests/unit/capi/GEOSNearestPointsTest.cpp
@@ -60,21 +60,21 @@ struct test_capigeosnearestpoints_data {
 
         unsigned int size;
         GEOSCoordSeq_getSize(coords_, &size);
-        ensure_equals(size, 2u);
+        ensure_equals("CoordSeq size", size, 2u);
 
         double  ox, oy;
 
         /* Point in geom1_ */
         GEOSCoordSeq_getOrdinate(coords_, 0, 0, &ox);
         GEOSCoordSeq_getOrdinate(coords_, 0, 1, &oy);
-        ensure_equals(ox, x1);
-        ensure_equals(oy, y1);
+        ensure_equals("P1 x", ox, x1);
+        ensure_equals("P1 y", oy, y1);
 
         /* Point in geom2_ */
         GEOSCoordSeq_getOrdinate(coords_, 1, 0, &ox);
         GEOSCoordSeq_getOrdinate(coords_, 1, 1, &oy);
-        ensure_equals(ox, x2);
-        ensure_equals(oy, y2);
+        ensure_equals("P2 x", ox, x2);
+        ensure_equals("P2 y", oy, y2);
 
         GEOSCoordSeq_destroy(coords_);
     }
@@ -159,5 +159,18 @@ void object::test<5>
     );
 }
 
+template<>
+template<>
+void object::test<6>
+()
+{
+    checkNearestPoints(
+        "POLYGON((0 0,10 0,10 10,0 10,0 0))",
+        "LINESTRING(8 5,12 5)",
+        /* But could also be the intersection point... */
+        8, 5, 8, 5
+    );
+}
+
 } // namespace tut
 
diff --git a/tests/unit/capi/GEOSPreparedNearestPointsTest.cpp b/tests/unit/capi/GEOSPreparedNearestPointsTest.cpp
index ff18b75..6b6790b 100644
--- a/tests/unit/capi/GEOSPreparedNearestPointsTest.cpp
+++ b/tests/unit/capi/GEOSPreparedNearestPointsTest.cpp
@@ -65,21 +65,21 @@ struct test_capigeospreparednearestpoints_data {
 
         unsigned int size;
         GEOSCoordSeq_getSize(coords_, &size);
-        ensure_equals(size, 2u);
+        ensure_equals("CoordSeq size", size, 2u);
 
         double  ox, oy;
 
         /* Point in geom1_ */
         GEOSCoordSeq_getOrdinate(coords_, 0, 0, &ox);
         GEOSCoordSeq_getOrdinate(coords_, 0, 1, &oy);
-        ensure_equals(ox, x1);
-        ensure_equals(oy, y1);
+        ensure_equals("P1 x", ox, x1);
+        ensure_equals("P1 y", oy, y1);
 
         /* Point in geom2_ */
         GEOSCoordSeq_getOrdinate(coords_, 1, 0, &ox);
         GEOSCoordSeq_getOrdinate(coords_, 1, 1, &oy);
-        ensure_equals(ox, x2);
-        ensure_equals(oy, y2);
+        ensure_equals("P2 x", ox, x2);
+        ensure_equals("P2 y", oy, y2);
 
         GEOSCoordSeq_destroy(coords_);
     }
@@ -165,5 +165,18 @@ void object::test<5>
     );
 }
 
+template<>
+template<>
+void object::test<6>
+()
+{
+    checkNearestPoints(
+        "POLYGON((0 0,10 0,10 10,0 10,0 0))",
+        "LINESTRING(8 5,12 5)",
+        /* But could also be the intersection point... */
+        8, 5, 8, 5
+    );
+}
+
 } // namespace tut
 

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

Summary of changes:
 tests/unit/capi/GEOSNearestPointsTest.cpp         | 23 ++++++++++++++++++-----
 tests/unit/capi/GEOSPreparedNearestPointsTest.cpp | 23 ++++++++++++++++++-----
 2 files changed, 36 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list