[geos-commits] [SCM] GEOS branch main updated. 6043951eef998c8174e5d618bf9e0418601f1e06

git at osgeo.org git at osgeo.org
Tue May 21 11:25:46 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 has been updated
       via  6043951eef998c8174e5d618bf9e0418601f1e06 (commit)
      from  55ac2f51a02132ac05c5b78e153a94872c1b599e (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 6043951eef998c8174e5d618bf9e0418601f1e06
Author: Sandro Santilli <strk at kbt.io>
Date:   Tue May 21 20:25:17 2024 +0200

    Reduce code duplication in GEOSCoverageUnionTest
    
    References GA-1098

diff --git a/tests/unit/capi/GEOSCoverageUnionTest.cpp b/tests/unit/capi/GEOSCoverageUnionTest.cpp
index a9808c104..2d7fccc32 100644
--- a/tests/unit/capi/GEOSCoverageUnionTest.cpp
+++ b/tests/unit/capi/GEOSCoverageUnionTest.cpp
@@ -19,29 +19,15 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capicoverageunion_data : public capitest::utility {
-    static void
-    notice(const char *fmt, ...) {
-        std::fprintf(stdout, "NOTICE: ");
-
-        va_list ap;
-        va_start(ap, fmt);
-        std::vfprintf(stdout, fmt, ap);
-        va_end(ap);
-
-        std::fprintf(stdout, "\n");
-    }
 
     test_capicoverageunion_data() {
-        m_context = initGEOS_r(notice, notice);
-        m_reader = GEOSWKTReader_create_r(m_context);
+        m_reader = GEOSWKTReader_create();
     }
 
     ~test_capicoverageunion_data() {
-        GEOSWKTReader_destroy_r(m_context, m_reader);
-        finishGEOS_r(m_context);
+        GEOSWKTReader_destroy(m_reader);
     }
 
-    GEOSContextHandle_t m_context;
     GEOSWKTReader* m_reader;
 };
 
@@ -66,19 +52,19 @@ template<> void object::test<1>
             "POLYGON ((1 0, 1 1, 2 1, 2 0, 1 0))"
     };
 
-    auto g1 = GEOSWKTReader_read_r(m_context, m_reader, wkt[0].c_str());
-    auto g2 = GEOSWKTReader_read_r(m_context, m_reader, wkt[1].c_str());
+    auto g1 = GEOSWKTReader_read(m_reader, wkt[0].c_str());
+    auto g2 = GEOSWKTReader_read(m_reader, wkt[1].c_str());
 
     GEOSGeometry* geoms[2] = { g1, g2 };
 
-    auto input = GEOSGeom_createCollection_r(m_context, GEOS_GEOMETRYCOLLECTION, geoms, 2);
-    auto result = GEOSCoverageUnion_r(m_context, input);
+    auto input = GEOSGeom_createCollection(GEOS_GEOMETRYCOLLECTION, geoms, 2);
+    auto result = GEOSCoverageUnion(input);
 
     ensure( result != nullptr );
-    ensure( GEOSGeomTypeId_r(m_context, result) == GEOS_POLYGON );
+    ensure( GEOSGeomTypeId(result) == GEOS_POLYGON );
 
-    GEOSGeom_destroy_r(m_context, input);
-    GEOSGeom_destroy_r(m_context, result);
+    GEOSGeom_destroy(input);
+    GEOSGeom_destroy(result);
 }
 
 template<>
@@ -91,18 +77,18 @@ void object::test<2>
             "POLYGON ((1 0, 0.9 1, 2 1, 2 0, 1 0))"
     };
 
-    auto g1 = GEOSWKTReader_read_r(m_context, m_reader, wkt[0].c_str());
-    auto g2 = GEOSWKTReader_read_r(m_context, m_reader, wkt[1].c_str());
+    auto g1 = GEOSWKTReader_read(m_reader, wkt[0].c_str());
+    auto g2 = GEOSWKTReader_read(m_reader, wkt[1].c_str());
 
     GEOSGeometry* geoms[2] = { g1, g2 };
 
-    auto input = GEOSGeom_createCollection_r(m_context, GEOS_GEOMETRYCOLLECTION, geoms, 2);
-    auto result = GEOSCoverageUnion_r(m_context, input);
+    auto input = GEOSGeom_createCollection(GEOS_GEOMETRYCOLLECTION, geoms, 2);
+    auto result = GEOSCoverageUnion(input);
     ensure( result != nullptr );
-    ensure( GEOSEquals_r(m_context, input, result) );
+    ensure( GEOSEquals(input, result) );
 
-    GEOSGeom_destroy_r(m_context, input);
-    GEOSGeom_destroy_r(m_context, result);
+    GEOSGeom_destroy(input);
+    GEOSGeom_destroy(result);
 }
 
 template<>

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

Summary of changes:
 tests/unit/capi/GEOSCoverageUnionTest.cpp | 46 +++++++++++--------------------
 1 file changed, 16 insertions(+), 30 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list