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

git at osgeo.org git at osgeo.org
Mon Aug 12 13:05:13 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  fe530fab013ab5c4bb8e955a99c98e88b8a4191b (commit)
       via  d9fe7aeacc347c2c661694100a13f2d889b91667 (commit)
      from  68cbc6b01ed0192b8ec622b9c89cc0ed1e61f95d (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 fe530fab013ab5c4bb8e955a99c98e88b8a4191b
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Aug 12 13:04:41 2024 -0700

    add commentary on capi relate test

diff --git a/tests/unit/capi/GEOSPreparedGeometryTest.cpp b/tests/unit/capi/GEOSPreparedGeometryTest.cpp
index 94da91cbb..b720214b2 100644
--- a/tests/unit/capi/GEOSPreparedGeometryTest.cpp
+++ b/tests/unit/capi/GEOSPreparedGeometryTest.cpp
@@ -467,6 +467,8 @@ void object::test<17>()
 
     prepGeom1_ = GEOSPrepare(geom1_);
 
+    // Run each test twice to make sure the "accelerated" second call
+    // is the same as the first one.
     ensure_equals("prepTouches1", GEOSPreparedTouches(prepGeom1_, geom2_), GEOSTouches(geom1_, geom2_));
     ensure_equals("prepTouches2", GEOSPreparedTouches(prepGeom1_, geom2_), GEOSTouches(geom1_, geom2_));
     ensure_equals("prepOverlaps1", GEOSPreparedOverlaps(prepGeom1_, geom2_), GEOSOverlaps(geom1_, geom2_));

commit d9fe7aeacc347c2c661694100a13f2d889b91667
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Aug 12 13:00:03 2024 -0700

    merge

diff --git a/tests/unit/operation/relateng/RelateNGTest.cpp b/tests/unit/operation/relateng/RelateNGTest.cpp
index 295e7edd0..44196301e 100644
--- a/tests/unit/operation/relateng/RelateNGTest.cpp
+++ b/tests/unit/operation/relateng/RelateNGTest.cpp
@@ -874,7 +874,7 @@ void object::test<62> ()
 {
     std::string a = "POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))";
     std::string b = "POLYGON((0.5 0.5, 1.5 0.5, 1.5 1.5, 0.5 1.5, 0.5 0.5))";
-    checkPrepared(a, b);
+    checkRelate(a, b, "212101212");
 }
 
 
diff --git a/tests/unit/operation/relateng/RelateNGTest.h b/tests/unit/operation/relateng/RelateNGTest.h
index 69939cc81..82a39b80f 100644
--- a/tests/unit/operation/relateng/RelateNGTest.h
+++ b/tests/unit/operation/relateng/RelateNGTest.h
@@ -27,22 +27,20 @@ struct test_relateng_support {
     WKTReader r;
     WKTWriter w;
 
-    void checkPrepared(const std::string& wkta, const std::string& wktb)
+    void checkPrepared(const Geometry* a, const Geometry* b)
     {
-        std::unique_ptr<Geometry> a = r.read(wkta);
-        std::unique_ptr<Geometry> b = r.read(wktb);
-        auto prep_a = RelateNG::prepare(a.get());
-
-        ensure_equals("equalsTopo", prep_a->equalsTopo(b.get()), a->equals(b.get()));
-        ensure_equals("intersects", prep_a->intersects(b.get()), a->intersects(b.get()));
-        ensure_equals("disjoint",   prep_a->disjoint(b.get()),   a->disjoint(b.get()));
-        ensure_equals("covers",     prep_a->covers(b.get()),     a->covers(b.get()));
-        ensure_equals("coveredby",  prep_a->coveredBy(b.get()),  a->coveredBy(b.get()));
-        ensure_equals("within",     prep_a->within(b.get()),     a->within(b.get()));
-        ensure_equals("contains",   prep_a->contains(b.get()),   a->contains(b.get()));
-        ensure_equals("crosses",    prep_a->crosses(b.get()),    a->crosses(b.get()));
-        ensure_equals("touches",    prep_a->touches(b.get()),    a->touches(b.get()));
-        ensure_equals("relate",     prep_a->relate(b.get()),   a->relate(b.get())->toString());
+        auto prep_a = RelateNG::prepare(a);
+        auto prep_b = RelateNG::prepare(b);
+        ensure_equals("preparedEqualsTopo", prep_a->equalsTopo(b), a->equals(b));
+        ensure_equals("preparedIntersects", prep_a->intersects(b), a->intersects(b));
+        ensure_equals("preparedDisjoint",   prep_a->disjoint(b),   a->disjoint(b));
+        ensure_equals("preparedCovers",     prep_a->covers(b),     a->covers(b));
+        ensure_equals("preparedCoveredby",  prep_a->coveredBy(b),  a->coveredBy(b));
+        ensure_equals("preparedWithin",     prep_a->within(b),     a->within(b));
+        ensure_equals("preparedContains",   prep_a->contains(b),   a->contains(b));
+        ensure_equals("preparedCrosses",    prep_a->crosses(b),    a->crosses(b));
+        ensure_equals("preparedTouches",    prep_a->touches(b),    a->touches(b));
+        ensure_equals("preparedRelate",     prep_a->relate(b),     a->relate(b)->toString());
     }
 
     void checkIntersectsDisjoint(const std::string& wkta, const std::string& wktb, bool expectedValue)
@@ -101,6 +99,7 @@ struct test_relateng_support {
             std::cerr << std::endl << w.write(*a) << " relate " << w.write(*b) << " = " << actualVal << std::endl;
         }
         ensure_equals("checkRelate", actualVal, expectedValue);
+        checkPrepared(a.get(), b.get());
     }
 
     void checkRelateMatches(const std::string& wkta, const std::string& wktb, const std::string pattern, bool expectedValue)
@@ -119,6 +118,7 @@ struct test_relateng_support {
             std::cerr << std::endl << w.write(*a) << " " << pred << " " << w.write(*b) << " = " << actualVal << std::endl;
         }
         ensure_equals("checkPredicate", actualVal, expectedValue);
+        checkPrepared(a.get(), b.get());
     }
 
 };

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

Summary of changes:
 tests/unit/capi/GEOSPreparedGeometryTest.cpp   |  2 ++
 tests/unit/operation/relateng/RelateNGTest.cpp |  2 +-
 tests/unit/operation/relateng/RelateNGTest.h   | 30 +++++++++++++-------------
 3 files changed, 18 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list