[geos-commits] [SCM] GEOS branch 3.12 updated. 60e59750f2476162bbbacafcb6b87a95b57a5e6d

git at osgeo.org git at osgeo.org
Mon Jul 31 16:55:24 PDT 2023


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, 3.12 has been updated
       via  60e59750f2476162bbbacafcb6b87a95b57a5e6d (commit)
      from  58886a6b57fc5ab99d0650ece066a5365f3c16df (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 60e59750f2476162bbbacafcb6b87a95b57a5e6d
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Mon Jul 31 16:54:54 2023 -0700

    Fix PolygonNodeTopology unit tests

diff --git a/tests/unit/algorithm/PolygonNodeTopologyTest.cpp b/tests/unit/algorithm/PolygonNodeTopologyTest.cpp
index 93b0f3b7d..720349164 100644
--- a/tests/unit/algorithm/PolygonNodeTopologyTest.cpp
+++ b/tests/unit/algorithm/PolygonNodeTopologyTest.cpp
@@ -31,13 +31,19 @@ struct test_polygonnodetopology_data {
         checkCrossing(wktA, wktB, true);
     }
 
+    void
+    checkNonCrossing(const std::string& wktA, const std::string& wktB)
+    {
+        checkCrossing(wktA, wktB, false);
+    }
+
     void
     checkCrossing(const std::string& wktA, const std::string& wktB, bool isExpected)
     {
         std::unique_ptr<CoordinateSequence> a = readPts(wktA);
         std::unique_ptr<CoordinateSequence> b = readPts(wktB);
         // assert: a[1] = b[1]
-        bool isCrossing = ! PolygonNodeTopology::isCrossing(
+        bool isCrossing = PolygonNodeTopology::isCrossing(
             &a->getAt(1), &a->getAt(0), &a->getAt(2), &b->getAt(0), &b->getAt(2));
         ensure(isCrossing == isExpected);
     }
@@ -60,7 +66,7 @@ struct test_polygonnodetopology_data {
         std::unique_ptr<CoordinateSequence> a = readPts(wktA);
         std::unique_ptr<CoordinateSequence> b = readPts(wktB);
         // assert: a[1] = b[1]
-        bool isInterior = ! PolygonNodeTopology::isInteriorSegment(
+        bool isInterior = PolygonNodeTopology::isInteriorSegment(
             &a->getAt(1), &a->getAt(0), &a->getAt(2), &b->getAt(1));
         ensure(isInterior == isExpected);
     }
@@ -94,30 +100,30 @@ void object::test<1> ()
 {
     checkCrossing(
         "LINESTRING (500 1000, 1000 1000, 1000 1500)",
-        "LINESTRING (1000 500, 1000 1000, 500 1500)", false);
+        "LINESTRING (1000 500, 1000 1000, 500 1500)");
 }
 
 
 //
-// testCrossingQuadrant2
+// testNonCrossingQuadrant2
 //
 template<>
 template<>
 void object::test<2> ()
 {
-    checkCrossing(
+    checkNonCrossing(
         "LINESTRING (500 1000, 1000 1000, 1000 1500)",
         "LINESTRING (300 1200, 1000 1000, 500 1500)");
 }
 
 //
-// testCrossingQuadrant4
+// testNonCrossingQuadrant4
 //
 template<>
 template<>
 void object::test<3> ()
 {
-    checkCrossing(
+    checkNonCrossing(
         "LINESTRING (500 1000, 1000 1000, 1000 1500)",
         "LINESTRING (1000 500, 1000 1000, 1500 1000)");
 }
@@ -131,7 +137,7 @@ void object::test<4> ()
 {
     checkInterior(
         "LINESTRING (5 9, 5 5, 9 5)",
-        "LINESTRING (5 5, 9 9)");
+        "LINESTRING (5 5, 0 0)");
 }
 
 //
@@ -143,7 +149,7 @@ void object::test<5> ()
 {
     checkExterior(
         "LINESTRING (5 9, 5 5, 9 5)",
-        "LINESTRING (5 5, 0 0)");
+        "LINESTRING (5 5, 9 9)");
 }
 
 } // namespace tut

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

Summary of changes:
 tests/unit/algorithm/PolygonNodeTopologyTest.cpp | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list