[geos-commits] [SCM] GEOS branch main-relate-ng updated. 1ef8669c6de05af62be0bf99fd31530599739b37

git at osgeo.org git at osgeo.org
Fri Aug 2 07:35:29 PDT 2024


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, main-relate-ng has been updated
       via  1ef8669c6de05af62be0bf99fd31530599739b37 (commit)
      from  929c5f20e9e50f25bf63e86e7c88723479769560 (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 1ef8669c6de05af62be0bf99fd31530599739b37
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Fri Aug 2 07:35:02 2024 -0700

    Fix some unit test errors

diff --git a/src/operation/relateng/RelateNG.cpp b/src/operation/relateng/RelateNG.cpp
index 6b7a83f67..d4b8baea5 100644
--- a/src/operation/relateng/RelateNG.cpp
+++ b/src/operation/relateng/RelateNG.cpp
@@ -146,6 +146,9 @@ RelateNG::evaluate(const Geometry* b, TopologyPredicate& predicate)
         return false;
     }
 
+    util::ensureNoCurvedComponents(geomA.getGeometry());
+    util::ensureNoCurvedComponents(b);
+    
     RelateGeometry geomB(b, boundaryNodeRule);
 
     if (geomA.isEmpty() && geomB.isEmpty()) {
diff --git a/tests/unit/capi/GEOSPreparedGeometryTest.cpp b/tests/unit/capi/GEOSPreparedGeometryTest.cpp
index 4ee90cea5..56d852ccc 100644
--- a/tests/unit/capi/GEOSPreparedGeometryTest.cpp
+++ b/tests/unit/capi/GEOSPreparedGeometryTest.cpp
@@ -406,6 +406,7 @@ void object::test<13>
 }
 
 // Verify no memory leak on exception (https://github.com/libgeos/geos/issues/505)
+// RelateNG does not throw for this case
 template<>
 template<>
 void object::test<14>
@@ -419,7 +420,7 @@ void object::test<14>
     ensure(nullptr != geom2_);
 
     int ret = GEOSPreparedTouches(prepGeom1_, geom2_);
-    ensure_equals(ret, 2);
+    ensure_equals(ret, 1);
 }
 
 // Test XY variants
diff --git a/tests/unit/capi/GEOSRelatePatternTest.cpp b/tests/unit/capi/GEOSRelatePatternTest.cpp
index 819e6ad79..cfd1bfe19 100644
--- a/tests/unit/capi/GEOSRelatePatternTest.cpp
+++ b/tests/unit/capi/GEOSRelatePatternTest.cpp
@@ -27,8 +27,8 @@ void object::test<1>()
     geom3_ =  GEOSBuffer(geom2_, 2, 8);
     ensure(nullptr != geom3_);
 
-    ensure_equals(1, GEOSRelatePattern(geom1_, geom3_, "0FFFFF212"));
-    ensure_equals(1, GEOSRelatePattern(geom1_, geom3_, "*FF*FF212"));
+    ensure_equals(GEOSRelatePattern(geom1_, geom3_, "0FFFFF212"), 1);
+    ensure_equals(GEOSRelatePattern(geom1_, geom3_, "*FF*FF212"), 1);
 }
 
 template<>
@@ -57,13 +57,13 @@ void object::test<3>()
     ensure(geom2_);
 
     // pattern too long
-    ensure_equals(2, GEOSRelatePattern(geom1_, geom2_, "0FFFFF2120000000000000000000"));
+    ensure_equals(GEOSRelatePattern(geom1_, geom2_, "0FFFFF2120000000000000000000"), 2);
 
     // pattern too short
-    ensure_equals(2, GEOSRelatePattern(geom1_, geom2_, "0F"));
+    ensure_equals(GEOSRelatePattern(geom1_, geom2_, "0F"), 2);
 
     // pattern has invalid characters
-    ensure_equals(0, GEOSRelatePattern(geom1_, geom2_, "123456789"));
+    ensure_equals(GEOSRelatePattern(geom1_, geom2_, "123456789"), 2);
 }
 
 } // namespace tut

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

Summary of changes:
 src/operation/relateng/RelateNG.cpp          |  3 +++
 tests/unit/capi/GEOSPreparedGeometryTest.cpp |  3 ++-
 tests/unit/capi/GEOSRelatePatternTest.cpp    | 10 +++++-----
 3 files changed, 10 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list