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

git at osgeo.org git at osgeo.org
Sun Jan 31 10:06:43 PST 2021


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  e78f5232d5d1283506e4bed242b22350f3442c47 (commit)
       via  a27b1f58d39a308cae5614ae3113e604a7f469c7 (commit)
       via  fa1244de4b24beebb5c4b5a8b37c992ffed44e62 (commit)
       via  1d110bf278253692659c6ac40e3cec6273539ba7 (commit)
       via  b8e60bb2d84cc8ceab47ea3a2d93e6a3e4e8997a (commit)
       via  fa9cd1fa5a3d950c7324ab3e69af09195a07c310 (commit)
       via  aa52b3cab65291f3eb2fc69fcd100d9b42d4e59a (commit)
       via  0e4e0db82bb4ab331139b32876dbb72e1ed4ea56 (commit)
       via  d3e7be57885620ef6eb87315aaba56e5455d40f8 (commit)
      from  a01c678f25f3da061ecefa7623444c61d6a24c89 (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 e78f5232d5d1283506e4bed242b22350f3442c47
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sun Jan 31 12:56:11 2021 -0500

    Remove more duplicated code in CAPI tests

diff --git a/tests/unit/capi/GEOSBufferTest.cpp b/tests/unit/capi/GEOSBufferTest.cpp
index 8dc2555..45555b0 100644
--- a/tests/unit/capi/GEOSBufferTest.cpp
+++ b/tests/unit/capi/GEOSBufferTest.cpp
@@ -19,30 +19,18 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeosbuffer_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    char* wkt_;
     GEOSBufferParams* bp_;
-    GEOSWKTWriter* wktw_;
     double area_;
 
     test_capigeosbuffer_data()
-        : geom1_(nullptr), geom2_(nullptr), wkt_(nullptr), bp_(nullptr)
+        : bp_(nullptr)
     {
-        wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
     }
 
     ~test_capigeosbuffer_data()
     {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSWKTWriter_destroy(wktw_);
         GEOSBufferParams_destroy(bp_);
-        GEOSFree(wkt_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        wkt_ = nullptr;
     }
 
 };
diff --git a/tests/unit/capi/GEOSBuildAreaTest.cpp b/tests/unit/capi/GEOSBuildAreaTest.cpp
index 254d833..1ac7e31 100644
--- a/tests/unit/capi/GEOSBuildAreaTest.cpp
+++ b/tests/unit/capi/GEOSBuildAreaTest.cpp
@@ -18,33 +18,11 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capi_buildarea_data : public capitest::utility {
-    GEOSWKTWriter* wktw_;
-    GEOSGeometry* geom1_ = nullptr;
-    GEOSGeometry* geom2_ = nullptr;
-
-    std::string
-    toWKT(GEOSGeometry* g)
-    {
-        char* wkt = GEOSWKTWriter_write(wktw_, g);
-        std::string ret(wkt);
-        GEOSFree(wkt);
-        return ret;
-    }
-
     test_capi_buildarea_data()
     {
-        wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setOutputDimension(wktw_, 3);
     }
-
-    ~test_capi_buildarea_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSWKTWriter_destroy(wktw_);
-    }
-
 };
 
 typedef test_group<test_capi_buildarea_data> group;
diff --git a/tests/unit/capi/GEOSClipByRectTest.cpp b/tests/unit/capi/GEOSClipByRectTest.cpp
index c79c428..92c6ba3 100644
--- a/tests/unit/capi/GEOSClipByRectTest.cpp
+++ b/tests/unit/capi/GEOSClipByRectTest.cpp
@@ -19,11 +19,6 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeosclipbyrect_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    GEOSGeometry* geom3_;
-    GEOSWKTWriter* w_;
-
     void
     isEqual(GEOSGeom g, const char* exp_wkt)
     {
@@ -31,7 +26,7 @@ struct test_capigeosclipbyrect_data : public capitest::utility {
         bool eq = GEOSEquals(geom3_, g) != 0;
         if(! eq) {
             std::printf("EXP: %s\n", exp_wkt);
-            char* obt_wkt = GEOSWKTWriter_write(w_, g);
+            char* obt_wkt = GEOSWKTWriter_write(wktw_, g);
             std::printf("OBT: %s\n", obt_wkt);
             free(obt_wkt);
         }
@@ -39,24 +34,10 @@ struct test_capigeosclipbyrect_data : public capitest::utility {
     }
 
     test_capigeosclipbyrect_data()
-        : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
     {
-        w_ = GEOSWKTWriter_create();
-        GEOSWKTWriter_setTrim(w_, 1);
-        GEOSWKTWriter_setRoundingPrecision(w_, 8);
+        GEOSWKTWriter_setTrim(wktw_, 1);
+        GEOSWKTWriter_setRoundingPrecision(wktw_, 8);
     }
-
-    ~test_capigeosclipbyrect_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSGeom_destroy(geom3_);
-        GEOSWKTWriter_destroy(w_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        geom3_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capigeosclipbyrect_data> group;
diff --git a/tests/unit/capi/GEOSContainsTest.cpp b/tests/unit/capi/GEOSContainsTest.cpp
index ba6aa05..03a59c3 100644
--- a/tests/unit/capi/GEOSContainsTest.cpp
+++ b/tests/unit/capi/GEOSContainsTest.cpp
@@ -21,22 +21,6 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeoscontains_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-
-    test_capigeoscontains_data()
-        : geom1_(nullptr), geom2_(nullptr)
-    {
-    }
-
-    ~test_capigeoscontains_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capigeoscontains_data> group;
diff --git a/tests/unit/capi/GEOSConvexHullTest.cpp b/tests/unit/capi/GEOSConvexHullTest.cpp
index 17ba631..224a39e 100644
--- a/tests/unit/capi/GEOSConvexHullTest.cpp
+++ b/tests/unit/capi/GEOSConvexHullTest.cpp
@@ -18,22 +18,6 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeosconvexhull_data : public capitest::utility {
-    GEOSGeometry* input_;
-    GEOSGeometry* expected_;
-
-    test_capigeosconvexhull_data()
-        : input_(nullptr), expected_(nullptr)
-    {
-    }
-
-    ~test_capigeosconvexhull_data()
-    {
-        GEOSGeom_destroy(input_);
-        GEOSGeom_destroy(expected_);
-        input_ = nullptr;
-        expected_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capigeosconvexhull_data> group;
diff --git a/tests/unit/capi/GEOSDelaunayTriangulationTest.cpp b/tests/unit/capi/GEOSDelaunayTriangulationTest.cpp
index e454b75..317cb1a 100644
--- a/tests/unit/capi/GEOSDelaunayTriangulationTest.cpp
+++ b/tests/unit/capi/GEOSDelaunayTriangulationTest.cpp
@@ -19,36 +19,9 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeosdelaunaytriangulation_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    GEOSWKTWriter* w_;
-
-    test_capigeosdelaunaytriangulation_data()
-        : geom1_(nullptr), geom2_(nullptr)
-    {
-        w_ = GEOSWKTWriter_create();
-        GEOSWKTWriter_setTrim(w_, 1);
+    test_capigeosdelaunaytriangulation_data() {
+        GEOSWKTWriter_setTrim(wktw_, 1);
     }
-
-    void
-    ensure_equals_wkt(GEOSGeometry* g, const std::string& exp)
-    {
-        GEOSNormalize(g);
-        char* wkt_c = GEOSWKTWriter_write(w_, g);
-        std::string out(wkt_c);
-        free(wkt_c);
-        ensure_equals(out, exp);
-    }
-
-    ~test_capigeosdelaunaytriangulation_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSWKTWriter_destroy(w_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capigeosdelaunaytriangulation_data> group;
@@ -114,7 +87,7 @@ void object::test<3>
 
     GEOSGeom_destroy(geom2_);
     geom2_ = GEOSDelaunayTriangulation(geom1_, 0, 1);
-    char* wkt_c = GEOSWKTWriter_write(w_, geom2_);
+    char* wkt_c = GEOSWKTWriter_write(wktw_, geom2_);
     std::string out(wkt_c);
     free(wkt_c);
     ensure_equals(out, "MULTILINESTRING ((5 0, 10 0), (0 0, 5 0))");
@@ -130,15 +103,13 @@ void object::test<4>
 
     geom2_ = GEOSDelaunayTriangulation(geom1_, 0, 0);
     ensure(geom2_ != nullptr);
-    ensure_equals_wkt(geom2_,
-                      "GEOMETRYCOLLECTION (POLYGON ((0 0, 10 10, 5 0, 0 0)))"
-                     );
+    ensure_geometry_equals(geom2_,
+                      "GEOMETRYCOLLECTION (POLYGON ((0 0, 10 10, 5 0, 0 0)))");
 
     GEOSGeom_destroy(geom2_);
     geom2_ = GEOSDelaunayTriangulation(geom1_, 0, 1);
-    ensure_equals_wkt(geom2_,
-                      "MULTILINESTRING ((5 0, 10 10), (0 0, 10 10), (0 0, 5 0))"
-                     );
+    ensure_geometry_equals(geom2_,
+                      "MULTILINESTRING ((5 0, 10 10), (0 0, 10 10), (0 0, 5 0))");
 }
 
 // A polygon with an hole
@@ -151,15 +122,13 @@ void object::test<5>
 
     geom2_ = GEOSDelaunayTriangulation(geom1_, 0, 0);
     ensure(geom2_ != nullptr);
-    ensure_equals_wkt(geom2_,
-                      "GEOMETRYCOLLECTION (POLYGON ((8 2, 10 10, 8.5 1, 8 2)), POLYGON ((7 8, 10 10, 8 2, 7 8)), POLYGON ((3 8, 10 10, 7 8, 3 8)), POLYGON ((2 2, 8 2, 8.5 1, 2 2)), POLYGON ((2 2, 7 8, 8 2, 2 2)), POLYGON ((2 2, 3 8, 7 8, 2 2)), POLYGON ((0.5 9, 10 10, 3 8, 0.5 9)), POLYGON ((0.5 9, 3 8, 2 2, 0.5 9)), POLYGON ((0 0, 2 2, 8.5 1, 0 0)), POLYGON ((0 0, 0.5 9, 2 2, 0 0)))"
-                     );
+    ensure_geometry_equals(geom2_,
+                      "GEOMETRYCOLLECTION (POLYGON ((8 2, 10 10, 8.5 1, 8 2)), POLYGON ((7 8, 10 10, 8 2, 7 8)), POLYGON ((3 8, 10 10, 7 8, 3 8)), POLYGON ((2 2, 8 2, 8.5 1, 2 2)), POLYGON ((2 2, 7 8, 8 2, 2 2)), POLYGON ((2 2, 3 8, 7 8, 2 2)), POLYGON ((0.5 9, 10 10, 3 8, 0.5 9)), POLYGON ((0.5 9, 3 8, 2 2, 0.5 9)), POLYGON ((0 0, 2 2, 8.5 1, 0 0)), POLYGON ((0 0, 0.5 9, 2 2, 0 0)))");
 
     GEOSGeom_destroy(geom2_);
     geom2_ = GEOSDelaunayTriangulation(geom1_, 0, 1);
-    ensure_equals_wkt(geom2_,
-                      "MULTILINESTRING ((8.5 1, 10 10), (8 2, 10 10), (8 2, 8.5 1), (7 8, 10 10), (7 8, 8 2), (3 8, 10 10), (3 8, 7 8), (2 2, 8.5 1), (2 2, 8 2), (2 2, 7 8), (2 2, 3 8), (0.5 9, 10 10), (0.5 9, 3 8), (0.5 9, 2 2), (0 0, 8.5 1), (0 0, 2 2), (0 0, 0.5 9))"
-                     );
+    ensure_geometry_equals(geom2_,
+                      "MULTILINESTRING ((8.5 1, 10 10), (8 2, 10 10), (8 2, 8.5 1), (7 8, 10 10), (7 8, 8 2), (3 8, 10 10), (3 8, 7 8), (2 2, 8.5 1), (2 2, 8 2), (2 2, 7 8), (2 2, 3 8), (0.5 9, 10 10), (0.5 9, 3 8), (0.5 9, 2 2), (0 0, 8.5 1), (0 0, 2 2), (0 0, 0.5 9))");
 }
 
 // Four points with a tolerance making one collapse
@@ -172,9 +141,8 @@ void object::test<6>
 
     GEOSGeom_destroy(geom2_);
     geom2_ = GEOSDelaunayTriangulation(geom1_, 2, 1);
-    ensure_equals_wkt(geom2_,
-                      "MULTILINESTRING ((10 0, 10 10), (0 0, 10 10), (0 0, 10 0))"
-                     );
+    ensure_geometry_equals(geom2_,
+                      "MULTILINESTRING ((10 0, 10 10), (0 0, 10 10), (0 0, 10 0))");
 }
 
 } // namespace tut
diff --git a/tests/unit/capi/GEOSDistanceTest.cpp b/tests/unit/capi/GEOSDistanceTest.cpp
index 84332de..8c9dcae 100644
--- a/tests/unit/capi/GEOSDistanceTest.cpp
+++ b/tests/unit/capi/GEOSDistanceTest.cpp
@@ -21,29 +21,9 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeosdistance_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    GEOSGeometry* geom3_;
-    GEOSWKTWriter* w_;
-
-    test_capigeosdistance_data()
-        : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
-    {
-        w_ = GEOSWKTWriter_create();
-        GEOSWKTWriter_setTrim(w_, 1);
+    test_capigeosdistance_data() {
+        GEOSWKTWriter_setTrim(wktw_, 1);
     }
-
-    ~test_capigeosdistance_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSGeom_destroy(geom3_);
-        GEOSWKTWriter_destroy(w_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        geom3_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capigeosdistance_data> group;
diff --git a/tests/unit/capi/GEOSEqualsTest.cpp b/tests/unit/capi/GEOSEqualsTest.cpp
index cf837cb..a686424 100644
--- a/tests/unit/capi/GEOSEqualsTest.cpp
+++ b/tests/unit/capi/GEOSEqualsTest.cpp
@@ -18,24 +18,7 @@ namespace tut {
 //
 
 // Common data used in test cases.
-struct test_capigeosequals_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-
-    test_capigeosequals_data()
-        : geom1_(nullptr), geom2_(nullptr)
-    {
-    }
-
-    ~test_capigeosequals_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-    }
-
-};
+struct test_capigeosequals_data : public capitest::utility {};
 
 typedef test_group<test_capigeosequals_data> group;
 typedef group::object object;
diff --git a/tests/unit/capi/GEOSFrechetDistanceTest.cpp b/tests/unit/capi/GEOSFrechetDistanceTest.cpp
index 57581e1..b40b18c 100644
--- a/tests/unit/capi/GEOSFrechetDistanceTest.cpp
+++ b/tests/unit/capi/GEOSFrechetDistanceTest.cpp
@@ -20,29 +20,9 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeosfrechetdistance_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    GEOSGeometry* geom3_;
-    GEOSWKTWriter* w_;
-
-    test_capigeosfrechetdistance_data()
-        : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
-    {
-        w_ = GEOSWKTWriter_create();
-        GEOSWKTWriter_setTrim(w_, 1);
-    }
-
-    ~test_capigeosfrechetdistance_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSGeom_destroy(geom3_);
-        GEOSWKTWriter_destroy(w_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        geom3_ = nullptr;
+    test_capigeosfrechetdistance_data() {
+        GEOSWKTWriter_setTrim(wktw_, 1);
     }
-
 };
 
 typedef test_group<test_capigeosfrechetdistance_data> group;
diff --git a/tests/unit/capi/GEOSGeomFromWKBTest.cpp b/tests/unit/capi/GEOSGeomFromWKBTest.cpp
index e74f080..a1f155f 100644
--- a/tests/unit/capi/GEOSGeomFromWKBTest.cpp
+++ b/tests/unit/capi/GEOSGeomFromWKBTest.cpp
@@ -13,26 +13,17 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeosgeomfromwkb_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
     GEOSWKTReader* reader_;
 
-    test_capigeosgeomfromwkb_data()
-        : geom1_(nullptr), geom2_(nullptr), reader_(nullptr)
+    test_capigeosgeomfromwkb_data() : reader_(nullptr)
     {
-        initGEOS(notice, notice);
         reader_ = GEOSWKTReader_create();
     }
 
     ~test_capigeosgeomfromwkb_data()
     {
-        GEOSGeom_destroy(geom2_);
-        geom2_ = nullptr;
-        GEOSGeom_destroy(geom1_);
-        geom1_ = nullptr;
         GEOSWKTReader_destroy(reader_);
         reader_ = nullptr;
-        finishGEOS();
     }
 
     void
diff --git a/tests/unit/capi/GEOSGeomToWKTTest.cpp b/tests/unit/capi/GEOSGeomToWKTTest.cpp
index 7e2b56e..3559d37 100644
--- a/tests/unit/capi/GEOSGeomToWKTTest.cpp
+++ b/tests/unit/capi/GEOSGeomToWKTTest.cpp
@@ -20,18 +20,6 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeosgeomtowkt_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-
-    test_capigeosgeomtowkt_data()
-        : geom1_(nullptr)
-    {}
-
-    ~test_capigeosgeomtowkt_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        geom1_ = nullptr;
-    }
-
     void
     test_wkt(std::string const& wkt)
     {
diff --git a/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp b/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp
index 13000d3..25016c5 100644
--- a/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp
+++ b/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp
@@ -7,52 +7,7 @@ namespace tut {
 //
 
 // Common data used in test cases.
-struct test_capigeosgeomsetprecision_data : public capitest::utility {
-
-    GEOSWKTWriter* wktw_ = nullptr;
-    GEOSGeometry* geom1_ = nullptr;
-    GEOSGeometry* geom2_ = nullptr;
-    GEOSGeometry* geom3_ = nullptr;
-
-    GEOSGeometry*
-    fromWKT(const char* wkt)
-    {
-        GEOSGeometry* g = GEOSGeomFromWKT(wkt);
-        ensure(g != 0);
-        return g;
-    }
-
-    std::string
-    toWKT(GEOSGeometry* g)
-    {
-        char* wkt = GEOSWKTWriter_write(wktw_, g);
-        std::string ret(wkt);
-        GEOSFree(wkt);
-        return ret;
-    }
-
-    test_capigeosgeomsetprecision_data()
-    {
-        wktw_ = GEOSWKTWriter_create();
-        GEOSWKTWriter_setTrim(wktw_, 1);
-        GEOSWKTWriter_setRoundingPrecision(wktw_, 10);
-        //GEOSWKTWriter_setOutputDimension(wktw_, 3);
-    }
-
-    ~test_capigeosgeomsetprecision_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        if(geom3_)
-            GEOSGeom_destroy(geom3_);
-        if (wktw_)
-            GEOSWKTWriter_destroy(wktw_);
-
-        geom1_ = geom2_ = geom3_ = 0;
-        wktw_ = 0;
-    }
-
-};
+struct test_capigeosgeomsetprecision_data : public capitest::utility {};
 
 typedef test_group<test_capigeosgeomsetprecision_data> group;
 typedef group::object object;
diff --git a/tests/unit/capi/GEOSGetCentroidTest.cpp b/tests/unit/capi/GEOSGetCentroidTest.cpp
index 0871780..3ea672c 100644
--- a/tests/unit/capi/GEOSGetCentroidTest.cpp
+++ b/tests/unit/capi/GEOSGetCentroidTest.cpp
@@ -20,31 +20,10 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capicentroid_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    GEOSWKTWriter* wktw_;
-    char* wkt_;
-    double area_;
-
-    test_capicentroid_data()
-        : geom1_(nullptr), geom2_(nullptr), wkt_(nullptr)
-    {
-        wktw_ = GEOSWKTWriter_create();
+    test_capicentroid_data() {
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setRoundingPrecision(wktw_, 6);
     }
-
-    ~test_capicentroid_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSWKTWriter_destroy(wktw_);
-        GEOSFree(wkt_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        wkt_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capicentroid_data> group;
diff --git a/tests/unit/capi/GEOSHausdorffDistanceTest.cpp b/tests/unit/capi/GEOSHausdorffDistanceTest.cpp
index 8b573e0..8a53081 100644
--- a/tests/unit/capi/GEOSHausdorffDistanceTest.cpp
+++ b/tests/unit/capi/GEOSHausdorffDistanceTest.cpp
@@ -20,29 +20,9 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeoshausdorffdistance_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    GEOSGeometry* geom3_;
-    GEOSWKTWriter* w_;
-
-    test_capigeoshausdorffdistance_data()
-        : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
-    {
-        w_ = GEOSWKTWriter_create();
-        GEOSWKTWriter_setTrim(w_, 1);
-    }
-
-    ~test_capigeoshausdorffdistance_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSGeom_destroy(geom3_);
-        GEOSWKTWriter_destroy(w_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        geom3_ = nullptr;
+    test_capigeoshausdorffdistance_data() {
+        GEOSWKTWriter_setTrim(wktw_, 1);
     }
-
 };
 
 typedef test_group<test_capigeoshausdorffdistance_data> group;
diff --git a/tests/unit/capi/GEOSInterpolateTest.cpp b/tests/unit/capi/GEOSInterpolateTest.cpp
index c49014f..95290ac 100644
--- a/tests/unit/capi/GEOSInterpolateTest.cpp
+++ b/tests/unit/capi/GEOSInterpolateTest.cpp
@@ -17,20 +17,7 @@ namespace tut {
 //
 
 // Common data used in test cases.
-struct test_capiinterpolate_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-
-    test_capiinterpolate_data()
-        : geom1_(nullptr)
-    {}
-
-    ~test_capiinterpolate_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        geom1_ = nullptr;
-    }
-
-};
+struct test_capiinterpolate_data : public capitest::utility {};
 
 typedef test_group<test_capiinterpolate_data> group;
 typedef group::object object;
diff --git a/tests/unit/capi/GEOSIntersectionPrecTest.cpp b/tests/unit/capi/GEOSIntersectionPrecTest.cpp
index 74e8264..6b1d243 100644
--- a/tests/unit/capi/GEOSIntersectionPrecTest.cpp
+++ b/tests/unit/capi/GEOSIntersectionPrecTest.cpp
@@ -19,54 +19,18 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeosintersectionprec_data : public capitest::utility {
-    GEOSWKTWriter* wktw_;
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    GEOSGeometry* geom3_;
-    GEOSGeometry* expected_;
-
-    test_capigeosintersectionprec_data()
-        : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr)
-    {
-        wktw_ = GEOSWKTWriter_create();
+    test_capigeosintersectionprec_data() {
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setOutputDimension(wktw_, 3);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        geom3_ = nullptr;
-        expected_ = nullptr;
-    }
-
-    std::string
-    toWKT(GEOSGeometry* g)
-    {
-        char* wkt = GEOSWKTWriter_write(wktw_, g);
-        std::string ret(wkt);
-        GEOSFree(wkt);
-        return ret;
     }
 
-    int
+    static int
     same(GEOSGeometry* g1, GEOSGeometry* g2, double tolerance)
     {
         GEOSNormalize(g1);
         GEOSNormalize(g2);
         return GEOSEqualsExact(g1, g2, tolerance);
     }
-
-    ~test_capigeosintersectionprec_data()
-    {
-        GEOSWKTWriter_destroy(wktw_);
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSGeom_destroy(geom3_);
-        if (expected_) GEOSGeom_destroy(expected_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        geom3_ = nullptr;
-        expected_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capigeosintersectionprec_data> group;
diff --git a/tests/unit/capi/GEOSIntersectionTest.cpp b/tests/unit/capi/GEOSIntersectionTest.cpp
index a919533..627f4a8 100644
--- a/tests/unit/capi/GEOSIntersectionTest.cpp
+++ b/tests/unit/capi/GEOSIntersectionTest.cpp
@@ -12,38 +12,10 @@ namespace tut {
 // Common data used in test cases.
 struct test_capigeosintersection_data : public capitest::utility
 {
-
-    GEOSWKTWriter* wktw_;
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    GEOSGeometry* geom3_;
-    GEOSGeometry* expected_;
-
-    test_capigeosintersection_data()
-        : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr)
-    {
-        wktw_ = GEOSWKTWriter_create();
+    test_capigeosintersection_data() {
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setOutputDimension(wktw_, 3);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        geom3_ = nullptr;
-        expected_ = nullptr;
     }
-
-    ~test_capigeosintersection_data()
-    {
-        GEOSWKTWriter_destroy(wktw_);
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSGeom_destroy(geom3_);
-        if (expected_) GEOSGeom_destroy(expected_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        geom3_ = nullptr;
-        expected_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capigeosintersection_data> group;
diff --git a/tests/unit/capi/GEOSIntersectsTest.cpp b/tests/unit/capi/GEOSIntersectsTest.cpp
index 7f85a94..6344858 100644
--- a/tests/unit/capi/GEOSIntersectsTest.cpp
+++ b/tests/unit/capi/GEOSIntersectsTest.cpp
@@ -18,23 +18,7 @@ namespace tut {
 //
 
 // Common data used in test cases.
-struct test_capigeosintersects_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-
-    test_capigeosintersects_data()
-        : geom1_(nullptr), geom2_(nullptr)
-    {}
-
-    ~test_capigeosintersects_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-    }
-
-};
+struct test_capigeosintersects_data : public capitest::utility {};
 
 typedef test_group<test_capigeosintersects_data> group;
 typedef group::object object;
diff --git a/tests/unit/capi/GEOSLineString_PointTest.cpp b/tests/unit/capi/GEOSLineString_PointTest.cpp
index 15e929b..694b885 100644
--- a/tests/unit/capi/GEOSLineString_PointTest.cpp
+++ b/tests/unit/capi/GEOSLineString_PointTest.cpp
@@ -17,20 +17,7 @@ namespace tut {
 //
 
 // Common data used in test cases.
-struct test_capilinestringpoint_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-
-    test_capilinestringpoint_data()
-        : geom1_(nullptr)
-    {}
-
-    ~test_capilinestringpoint_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        geom1_ = nullptr;
-    }
-
-};
+struct test_capilinestringpoint_data : public capitest::utility {};
 
 typedef test_group<test_capilinestringpoint_data> group;
 typedef group::object object;
diff --git a/tests/unit/capi/GEOSMakeValidTest.cpp b/tests/unit/capi/GEOSMakeValidTest.cpp
index 3f890ed..b77638d 100644
--- a/tests/unit/capi/GEOSMakeValidTest.cpp
+++ b/tests/unit/capi/GEOSMakeValidTest.cpp
@@ -19,35 +19,10 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capimakevalid_data : public capitest::utility {
-    GEOSWKTWriter* wktw_;
-    GEOSGeometry* geom1_ = nullptr;
-    GEOSGeometry* geom2_ = nullptr;
-    GEOSGeometry* expect_ = nullptr;
-
-    std::string
-    toWKT(GEOSGeometry* g)
-    {
-        char* wkt = GEOSWKTWriter_write(wktw_, g);
-        std::string ret(wkt);
-        GEOSFree(wkt);
-        return ret;
-    }
-
-    test_capimakevalid_data()
-    {
-        wktw_ = GEOSWKTWriter_create();
+    test_capimakevalid_data() {
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setOutputDimension(wktw_, 3);
     }
-
-    ~test_capimakevalid_data()
-    {
-        if (geom1_) GEOSGeom_destroy(geom1_);
-        if (geom2_) GEOSGeom_destroy(geom2_);
-        if (expect_) GEOSGeom_destroy(expect_);
-        GEOSWKTWriter_destroy(wktw_);
-    }
-
 };
 
 typedef test_group<test_capimakevalid_data> group;
@@ -66,10 +41,10 @@ void object::test<1>
 {
     geom1_ = GEOSGeomFromWKT("POLYGON((0 0,1 1,0 1,1 0,0 0))");
     geom2_ = GEOSMakeValid(geom1_);
-    expect_ = GEOSGeomFromWKT("MULTIPOLYGON (((0 0, 0.5 0.5, 1 0, 0 0)), ((0.5 0.5, 0 1, 1 1, 0.5 0.5)))");
+    expected_ = GEOSGeomFromWKT("MULTIPOLYGON (((0 0, 0.5 0.5, 1 0, 0 0)), ((0.5 0.5, 0 1, 1 1, 0.5 0.5)))");
     GEOSNormalize(geom2_);
-    GEOSNormalize(expect_);
-    ensure(GEOSEqualsExact(geom2_, expect_, 0.01));
+    GEOSNormalize(expected_);
+    ensure(GEOSEqualsExact(geom2_, expected_, 0.01));
 }
 
 template<>
@@ -81,10 +56,10 @@ void object::test<2>
     geom1_ = GEOSGeomFromHEX_buf((uint8_t*)hex, std::strlen(hex));
     geom2_ = GEOSMakeValid(geom1_);
     // std::cout << toWKT(geom2_) << std::endl;
-    expect_ = GEOSGeomFromWKT("POLYGON ((92127.546 463452.075, 92117.173 463439.755, 92133.675 463425.942, 92122.136 463412.826, 92092.37699999999 463437.77, 92114.014 463463.469, 92115.512 463462.207, 92115.51207431706 463462.2069374289, 92127.546 463452.075))");
+    expected_ = GEOSGeomFromWKT("POLYGON ((92127.546 463452.075, 92117.173 463439.755, 92133.675 463425.942, 92122.136 463412.826, 92092.37699999999 463437.77, 92114.014 463463.469, 92115.512 463462.207, 92115.51207431706 463462.2069374289, 92127.546 463452.075))");
     GEOSNormalize(geom2_);
-    GEOSNormalize(expect_);
-    ensure(GEOSEqualsExact(geom2_, expect_, 0.01));
+    GEOSNormalize(expected_);
+    ensure(GEOSEqualsExact(geom2_, expected_, 0.01));
 }
 
 
diff --git a/tests/unit/capi/GEOSMaximumInscribedCircleTest.cpp b/tests/unit/capi/GEOSMaximumInscribedCircleTest.cpp
index 9a81e5b..35358d7 100644
--- a/tests/unit/capi/GEOSMaximumInscribedCircleTest.cpp
+++ b/tests/unit/capi/GEOSMaximumInscribedCircleTest.cpp
@@ -20,29 +20,18 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capimaximuminscribedcircle_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    GEOSWKTWriter* wktw_;
     char* wkt_;
-    double area_;
 
     test_capimaximuminscribedcircle_data()
-        : geom1_(nullptr), geom2_(nullptr), wkt_(nullptr)
+        : wkt_(nullptr)
     {
-        wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setRoundingPrecision(wktw_, 8);
     }
 
     ~test_capimaximuminscribedcircle_data()
     {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSWKTWriter_destroy(wktw_);
         GEOSFree(wkt_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        wkt_ = nullptr;
     }
 
 };
diff --git a/tests/unit/capi/GEOSMinimumBoundingCircleTest.cpp b/tests/unit/capi/GEOSMinimumBoundingCircleTest.cpp
index 309b9d9..6061c6f 100644
--- a/tests/unit/capi/GEOSMinimumBoundingCircleTest.cpp
+++ b/tests/unit/capi/GEOSMinimumBoundingCircleTest.cpp
@@ -20,34 +20,11 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capiminimumboundingcircle_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    GEOSGeometry* geom3_;
-    GEOSWKTWriter* wktw_;
-    char* wkt_;
-    double area_;
-
     test_capiminimumboundingcircle_data()
-        : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), wkt_(nullptr)
     {
-        wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setRoundingPrecision(wktw_, 8);
     }
-
-    ~test_capiminimumboundingcircle_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSGeom_destroy(geom3_);
-        GEOSWKTWriter_destroy(wktw_);
-        GEOSFree(wkt_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        geom3_ = nullptr;
-        wkt_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capiminimumboundingcircle_data> group;
diff --git a/tests/unit/capi/GEOSMinimumRectangleTest.cpp b/tests/unit/capi/GEOSMinimumRectangleTest.cpp
index 2704ff0..b2bc40b 100644
--- a/tests/unit/capi/GEOSMinimumRectangleTest.cpp
+++ b/tests/unit/capi/GEOSMinimumRectangleTest.cpp
@@ -18,27 +18,10 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeosminimumrectangle_data : public capitest::utility {
-    GEOSGeometry* input_;
-    GEOSWKTWriter* wktw_;
-    char* wkt_;
-
-    test_capigeosminimumrectangle_data()
-        : input_(nullptr), wkt_(nullptr)
-    {
-        wktw_ = GEOSWKTWriter_create();
+    test_capigeosminimumrectangle_data() {
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setRoundingPrecision(wktw_, 8);
     }
-
-    ~test_capigeosminimumrectangle_data()
-    {
-        GEOSGeom_destroy(input_);
-        input_ = nullptr;
-        GEOSWKTWriter_destroy(wktw_);
-        GEOSFree(wkt_);
-        wkt_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capigeosminimumrectangle_data> group;
diff --git a/tests/unit/capi/GEOSMinimumWidthTest.cpp b/tests/unit/capi/GEOSMinimumWidthTest.cpp
index 3a69b6e..3d27c3b 100644
--- a/tests/unit/capi/GEOSMinimumWidthTest.cpp
+++ b/tests/unit/capi/GEOSMinimumWidthTest.cpp
@@ -17,27 +17,11 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeosminimumwidth_data : public capitest::utility {
-    GEOSGeometry* input_;
-    GEOSWKTWriter* wktw_;
-    char* wkt_;
-
     test_capigeosminimumwidth_data()
-        : input_(nullptr), wkt_(nullptr)
     {
-        wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setRoundingPrecision(wktw_, 8);
     }
-
-    ~test_capigeosminimumwidth_data()
-    {
-        GEOSGeom_destroy(input_);
-        input_ = nullptr;
-        GEOSWKTWriter_destroy(wktw_);
-        GEOSFree(wkt_);
-        wkt_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capigeosminimumwidth_data> group;
diff --git a/tests/unit/capi/GEOSNearestPointsTest.cpp b/tests/unit/capi/GEOSNearestPointsTest.cpp
index e618d5b..d5e7ced 100644
--- a/tests/unit/capi/GEOSNearestPointsTest.cpp
+++ b/tests/unit/capi/GEOSNearestPointsTest.cpp
@@ -19,21 +19,6 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeosnearestpoints_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-
-    test_capigeosnearestpoints_data()
-        : geom1_(nullptr), geom2_(nullptr)
-    {}
-
-    ~test_capigeosnearestpoints_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-    }
-
     void checkNearestPoints(const char* wkt1, const char* wkt2,
                             double x1, double y1,
                             double x2, double y2)
diff --git a/tests/unit/capi/GEOSNodeTest.cpp b/tests/unit/capi/GEOSNodeTest.cpp
index 27a53e6..aac1f16 100644
--- a/tests/unit/capi/GEOSNodeTest.cpp
+++ b/tests/unit/capi/GEOSNodeTest.cpp
@@ -19,26 +19,10 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeosnode_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    GEOSWKTWriter* w_;
-
     test_capigeosnode_data()
-        : geom1_(nullptr), geom2_(nullptr), w_(nullptr)
     {
-        w_ = GEOSWKTWriter_create();
-        GEOSWKTWriter_setTrim(w_, 1);
+        GEOSWKTWriter_setTrim(wktw_, 1);
     }
-
-    ~test_capigeosnode_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSWKTWriter_destroy(w_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capigeosnode_data> group;
@@ -61,7 +45,7 @@ void object::test<1>
     ensure(nullptr != geom2_);
 
     GEOSNormalize(geom2_);
-    char* wkt_c = GEOSWKTWriter_write(w_, geom2_);
+    char* wkt_c = GEOSWKTWriter_write(wktw_, geom2_);
     std::string out(wkt_c);
     free(wkt_c);
 
@@ -81,7 +65,7 @@ void object::test<2>
     ensure(nullptr != geom2_);
 
     GEOSNormalize(geom2_);
-    char* wkt_c = GEOSWKTWriter_write(w_, geom2_);
+    char* wkt_c = GEOSWKTWriter_write(wktw_, geom2_);
     std::string out(wkt_c);
     free(wkt_c);
 
@@ -101,7 +85,7 @@ void object::test<3>
     ensure(nullptr != geom2_);
 
     GEOSNormalize(geom2_);
-    char* wkt_c = GEOSWKTWriter_write(w_, geom2_);
+    char* wkt_c = GEOSWKTWriter_write(wktw_, geom2_);
     std::string out(wkt_c);
     free(wkt_c);
 
diff --git a/tests/unit/capi/GEOSOffsetCurveTest.cpp b/tests/unit/capi/GEOSOffsetCurveTest.cpp
index 2500a24..6603221 100644
--- a/tests/unit/capi/GEOSOffsetCurveTest.cpp
+++ b/tests/unit/capi/GEOSOffsetCurveTest.cpp
@@ -19,30 +19,9 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capioffsetcurve_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    GEOSWKTWriter* wktw_;
-    char* wkt_;
-    double area_;
-
-    test_capioffsetcurve_data()
-        : geom1_(nullptr), geom2_(nullptr), wkt_(nullptr)
-    {
-        wktw_ = GEOSWKTWriter_create();
+    test_capioffsetcurve_data() {
         GEOSWKTWriter_setTrim(wktw_, 1);
     }
-
-    ~test_capioffsetcurve_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSWKTWriter_destroy(wktw_);
-        GEOSFree(wkt_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        wkt_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capioffsetcurve_data> group;
diff --git a/tests/unit/capi/GEOSPointOnSurfaceTest.cpp b/tests/unit/capi/GEOSPointOnSurfaceTest.cpp
index 006206a..14d834e 100644
--- a/tests/unit/capi/GEOSPointOnSurfaceTest.cpp
+++ b/tests/unit/capi/GEOSPointOnSurfaceTest.cpp
@@ -20,31 +20,11 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capipointonsurface_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    GEOSWKTWriter* wktw_;
-    char* wkt_;
-    double area_;
-
     test_capipointonsurface_data()
-        : geom1_(nullptr), geom2_(nullptr), wkt_(nullptr)
     {
-        wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setRoundingPrecision(wktw_, 4);
     }
-
-    ~test_capipointonsurface_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSWKTWriter_destroy(wktw_);
-        GEOSFree(wkt_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        wkt_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capipointonsurface_data> group;
diff --git a/tests/unit/capi/GEOSPreparedDistanceTest.cpp b/tests/unit/capi/GEOSPreparedDistanceTest.cpp
index b7f550e..3335b02 100644
--- a/tests/unit/capi/GEOSPreparedDistanceTest.cpp
+++ b/tests/unit/capi/GEOSPreparedDistanceTest.cpp
@@ -18,22 +18,15 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeosprepareddistance_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
     const GEOSPreparedGeometry* pgeom1_;
 
     test_capigeosprepareddistance_data()
-        : geom1_(nullptr), geom2_(nullptr), pgeom1_(nullptr)
+        : pgeom1_(nullptr)
     {}
 
     ~test_capigeosprepareddistance_data()
     {
-        GEOSGeom_destroy(geom2_);
         GEOSPreparedGeom_destroy(pgeom1_);
-        GEOSGeom_destroy(geom1_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        geom1_ = nullptr;
     }
 
     void checkDistance(const char* wkt1, const char* wkt2,
diff --git a/tests/unit/capi/GEOSPreparedGeometryTest.cpp b/tests/unit/capi/GEOSPreparedGeometryTest.cpp
index 3c427c0..fa5f961 100644
--- a/tests/unit/capi/GEOSPreparedGeometryTest.cpp
+++ b/tests/unit/capi/GEOSPreparedGeometryTest.cpp
@@ -22,24 +22,17 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeospreparedgeometry_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-
     const GEOSPreparedGeometry* prepGeom1_;
     const GEOSPreparedGeometry* prepGeom2_;
 
     test_capigeospreparedgeometry_data()
-        : geom1_(nullptr), geom2_(nullptr), prepGeom1_(nullptr), prepGeom2_(nullptr)
+        : prepGeom1_(nullptr), prepGeom2_(nullptr)
     {}
 
     ~test_capigeospreparedgeometry_data()
     {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
         GEOSPreparedGeom_destroy(prepGeom1_);
         GEOSPreparedGeom_destroy(prepGeom2_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
         prepGeom1_ = nullptr;
         prepGeom2_ = nullptr;
     }
diff --git a/tests/unit/capi/GEOSPreparedNearestPointsTest.cpp b/tests/unit/capi/GEOSPreparedNearestPointsTest.cpp
index 9e2fbb5..6ac0000 100644
--- a/tests/unit/capi/GEOSPreparedNearestPointsTest.cpp
+++ b/tests/unit/capi/GEOSPreparedNearestPointsTest.cpp
@@ -19,22 +19,15 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeospreparednearestpoints_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
     const GEOSPreparedGeometry* pgeom1_;
 
     test_capigeospreparednearestpoints_data()
-        : geom1_(nullptr), geom2_(nullptr), pgeom1_(nullptr)
+        : pgeom1_(nullptr)
     {}
 
     ~test_capigeospreparednearestpoints_data()
     {
-        GEOSGeom_destroy(geom2_);
         GEOSPreparedGeom_destroy(pgeom1_);
-        GEOSGeom_destroy(geom1_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        geom1_ = nullptr;
     }
 
     void checkNearestPoints(const char* wkt1, const char* wkt2,
diff --git a/tests/unit/capi/GEOSProjectTest.cpp b/tests/unit/capi/GEOSProjectTest.cpp
index cf023c2..7f2077c 100644
--- a/tests/unit/capi/GEOSProjectTest.cpp
+++ b/tests/unit/capi/GEOSProjectTest.cpp
@@ -17,23 +17,7 @@ namespace tut {
 //
 
 // Common data used in test cases.
-struct test_capiproject_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-
-    test_capiproject_data()
-        : geom1_(nullptr), geom2_(nullptr)
-    {}
-
-    ~test_capiproject_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-    }
-
-};
+struct test_capiproject_data : public capitest::utility {};
 
 typedef test_group<test_capiproject_data> group;
 typedef group::object object;
diff --git a/tests/unit/capi/GEOSRelateBoundaryNodeRuleTest.cpp b/tests/unit/capi/GEOSRelateBoundaryNodeRuleTest.cpp
index 66f48b1..986e134 100644
--- a/tests/unit/capi/GEOSRelateBoundaryNodeRuleTest.cpp
+++ b/tests/unit/capi/GEOSRelateBoundaryNodeRuleTest.cpp
@@ -18,21 +18,15 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeosrelateboundarynoderule_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
     char* pat_;
 
-    test_capigeosrelateboundarynoderule_data()
-        : geom1_(nullptr), geom2_(nullptr), pat_(nullptr)
+    test_capigeosrelateboundarynoderule_data() : pat_(nullptr)
     {}
 
     ~test_capigeosrelateboundarynoderule_data()
     {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
         GEOSFree(pat_);
     }
-
 };
 
 typedef test_group<test_capigeosrelateboundarynoderule_data> group;
diff --git a/tests/unit/capi/GEOSRelatePatternMatchTest.cpp b/tests/unit/capi/GEOSRelatePatternMatchTest.cpp
index 5c89c3d..c5f34a4 100644
--- a/tests/unit/capi/GEOSRelatePatternMatchTest.cpp
+++ b/tests/unit/capi/GEOSRelatePatternMatchTest.cpp
@@ -17,8 +17,7 @@ namespace tut {
 //
 
 // Common data used in test cases.
-struct test_capigeosrelatepatternmatch_data : public capitest::utility {
-};
+struct test_capigeosrelatepatternmatch_data : public capitest::utility {};
 
 typedef test_group<test_capigeosrelatepatternmatch_data> group;
 typedef group::object object;
diff --git a/tests/unit/capi/GEOSSharedPathsTest.cpp b/tests/unit/capi/GEOSSharedPathsTest.cpp
index 31aac47..98f013b 100644
--- a/tests/unit/capi/GEOSSharedPathsTest.cpp
+++ b/tests/unit/capi/GEOSSharedPathsTest.cpp
@@ -19,29 +19,10 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeossharedpaths_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    GEOSGeometry* geom3_;
-    GEOSWKTWriter* w_;
-
     test_capigeossharedpaths_data()
-        : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
     {
-        w_ = GEOSWKTWriter_create();
-        GEOSWKTWriter_setTrim(w_, 1);
+        GEOSWKTWriter_setTrim(wktw_, 1);
     }
-
-    ~test_capigeossharedpaths_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSGeom_destroy(geom3_);
-        GEOSWKTWriter_destroy(w_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        geom3_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capigeossharedpaths_data> group;
@@ -76,7 +57,7 @@ void object::test<2>
     geom2_ = GEOSGeomFromWKT("LINESTRING (-29 -20, 50 60, 50 70, 51 0)");
     geom3_ = GEOSSharedPaths(geom1_, geom2_);
 
-    char* wkt_c = GEOSWKTWriter_write(w_, geom3_);
+    char* wkt_c = GEOSWKTWriter_write(wktw_, geom3_);
     std::string out(wkt_c);
     free(wkt_c);
 
diff --git a/tests/unit/capi/GEOSSimplifyTest.cpp b/tests/unit/capi/GEOSSimplifyTest.cpp
index f875b23..1067bbb 100644
--- a/tests/unit/capi/GEOSSimplifyTest.cpp
+++ b/tests/unit/capi/GEOSSimplifyTest.cpp
@@ -18,23 +18,7 @@ namespace tut {
 //
 
 // Common data used in test cases.
-struct test_capigeossimplify_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-
-    test_capigeossimplify_data()
-        : geom1_(nullptr), geom2_(nullptr)
-    {}
-
-    ~test_capigeossimplify_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-    }
-
-};
+struct test_capigeossimplify_data : public capitest::utility {};
 
 typedef test_group<test_capigeossimplify_data> group;
 typedef group::object object;
diff --git a/tests/unit/capi/GEOSSnapTest.cpp b/tests/unit/capi/GEOSSnapTest.cpp
index bba70ff..89a4a4f 100644
--- a/tests/unit/capi/GEOSSnapTest.cpp
+++ b/tests/unit/capi/GEOSSnapTest.cpp
@@ -19,30 +19,11 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeossnap_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    GEOSGeometry* geom3_;
-    GEOSWKTWriter* w_;
-
     test_capigeossnap_data()
-        : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
     {
-        w_ = GEOSWKTWriter_create();
-        GEOSWKTWriter_setTrim(w_, 1);
-        GEOSWKTWriter_setRoundingPrecision(w_, 8);
+        GEOSWKTWriter_setTrim(wktw_, 1);
+        GEOSWKTWriter_setRoundingPrecision(wktw_, 8);
     }
-
-    ~test_capigeossnap_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSGeom_destroy(geom3_);
-        GEOSWKTWriter_destroy(w_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-        geom3_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capigeossnap_data> group;
@@ -64,7 +45,7 @@ void object::test<1>
     geom2_ = GEOSGeomFromWKT("POINT(0.5 0)");
     geom3_ = GEOSSnap(geom1_, geom2_, 1);
 
-    char* wkt_c = GEOSWKTWriter_write(w_, geom3_);
+    char* wkt_c = GEOSWKTWriter_write(wktw_, geom3_);
     std::string out(wkt_c);
     free(wkt_c);
 
@@ -81,7 +62,7 @@ void object::test<2>
     geom2_ = GEOSGeomFromWKT("LINESTRING (-29 -20, 40 60, 51 0)");
     geom3_ = GEOSSnap(geom1_, geom2_, 2);
 
-    char* wkt_c = GEOSWKTWriter_write(w_, geom3_);
+    char* wkt_c = GEOSWKTWriter_write(wktw_, geom3_);
     std::string out(wkt_c);
     free(wkt_c);
 
@@ -98,7 +79,7 @@ void object::test<3>
     geom2_ = GEOSGeomFromWKT("LINESTRING (-10 -9, 40 20, 80 79)");
     geom3_ = GEOSSnap(geom1_, geom2_, 2);
 
-    char* wkt_c = GEOSWKTWriter_write(w_, geom3_);
+    char* wkt_c = GEOSWKTWriter_write(wktw_, geom3_);
     std::string out(wkt_c);
     free(wkt_c);
 
@@ -117,7 +98,7 @@ void object::test<4>
     geom2_ = GEOSGeomFromWKT("LINESTRING(0 0, 9 0)");
     geom3_ = GEOSSnap(geom1_, geom2_, 2);
 
-    char* wkt_c = GEOSWKTWriter_write(w_, geom3_);
+    char* wkt_c = GEOSWKTWriter_write(wktw_, geom3_);
     std::string out(wkt_c);
     free(wkt_c);
 
@@ -134,7 +115,7 @@ void object::test<5>
     geom2_ = GEOSGeomFromWKT("LINESTRING(0 0, 9 0, 10 0, 11 0)");
     geom3_ = GEOSSnap(geom1_, geom2_, 2);
 
-    char* wkt_c = GEOSWKTWriter_write(w_, geom3_);
+    char* wkt_c = GEOSWKTWriter_write(wktw_, geom3_);
     std::string out(wkt_c);
     free(wkt_c);
 
@@ -152,7 +133,7 @@ void object::test<6>
     geom2_ = GEOSGeomFromWKT("MULTIPOINT(5 0,4 1)");
     geom3_ = GEOSSnap(geom1_, geom2_, 2);
 
-    char* wkt_c = GEOSWKTWriter_write(w_, geom3_);
+    char* wkt_c = GEOSWKTWriter_write(wktw_, geom3_);
     std::string out(wkt_c);
     free(wkt_c);
 
@@ -171,7 +152,7 @@ void object::test<7>
     geom2_ = GEOSGeomFromWKT("MULTIPOINT(4 1,5 0)");
     geom3_ = GEOSSnap(geom1_, geom2_, 2);
 
-    char* wkt_c = GEOSWKTWriter_write(w_, geom3_);
+    char* wkt_c = GEOSWKTWriter_write(wktw_, geom3_);
     std::string out(wkt_c);
     free(wkt_c);
 
@@ -189,7 +170,7 @@ void object::test<8>
     geom2_ = GEOSGeomFromWKT("MULTIPOINT(0 0,-1 0)");
     geom3_ = GEOSSnap(geom1_, geom2_, 3);
 
-    char* wkt_c = GEOSWKTWriter_write(w_, geom3_);
+    char* wkt_c = GEOSWKTWriter_write(wktw_, geom3_);
     std::string out(wkt_c);
     free(wkt_c);
 
@@ -205,7 +186,7 @@ void object::test<9>
     geom2_ = GEOSGeomFromWKT("POINT(5 0)");
     geom3_ = GEOSSnap(geom1_, geom2_, 3);
 
-    char* wkt_c = GEOSWKTWriter_write(w_, geom3_);
+    char* wkt_c = GEOSWKTWriter_write(wktw_, geom3_);
     std::string out(wkt_c);
     free(wkt_c);
 
@@ -222,7 +203,7 @@ void object::test<10>
     geom2_ = GEOSGeomFromWKT("MULTIPOINT(-71.1261 42.2703,-71.1257 42.2703,-71.1261 42.2702)");
     geom3_ = GEOSSnap(geom1_, geom2_, 0.5);
 
-    char* wkt_c = GEOSWKTWriter_write(w_, geom3_);
+    char* wkt_c = GEOSWKTWriter_write(wktw_, geom3_);
     std::string out(wkt_c);
     free(wkt_c);
 
diff --git a/tests/unit/capi/GEOSUnaryUnionTest.cpp b/tests/unit/capi/GEOSUnaryUnionTest.cpp
index fcd1965..36dc1f3 100644
--- a/tests/unit/capi/GEOSUnaryUnionTest.cpp
+++ b/tests/unit/capi/GEOSUnaryUnionTest.cpp
@@ -19,36 +19,12 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capiunaryunion_data : public capitest::utility {
-    GEOSWKTWriter* wktw_;
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-
-    test_capiunaryunion_data()
-        : geom1_(nullptr), geom2_(nullptr)
-    {
-        wktw_ = GEOSWKTWriter_create();
+
+    test_capiunaryunion_data() {
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setOutputDimension(wktw_, 3);
     }
 
-    std::string
-    toWKT(GEOSGeometry* g)
-    {
-        char* wkt = GEOSWKTWriter_write(wktw_, g);
-        std::string ret(wkt);
-        GEOSFree(wkt);
-        return ret;
-    }
-
-    ~test_capiunaryunion_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSWKTWriter_destroy(wktw_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capiunaryunion_data> group;
diff --git a/tests/unit/capi/GEOSUserDataTest.cpp b/tests/unit/capi/GEOSUserDataTest.cpp
index b1b65a4..18345f7 100644
--- a/tests/unit/capi/GEOSUserDataTest.cpp
+++ b/tests/unit/capi/GEOSUserDataTest.cpp
@@ -18,20 +18,7 @@ namespace tut {
 //
 
 // Common data used in test cases.
-struct test_capigeouserdata_data : public capitest::utility {
-    GEOSGeometry* geom_;
-
-    test_capigeouserdata_data()
-        : geom_(nullptr)
-    {}
-
-    ~test_capigeouserdata_data()
-    {
-        GEOSGeom_destroy(geom_);
-        geom_ = nullptr;
-    }
-
-};
+struct test_capigeouserdata_data : public capitest::utility {};
 
 typedef test_group<test_capigeouserdata_data> group;
 typedef group::object object;
@@ -48,14 +35,14 @@ template<>
 void object::test<1>
 ()
 {
-    geom_ = GEOSGeomFromWKT("POLYGON EMPTY");
+    geom1_ = GEOSGeomFromWKT("POLYGON EMPTY");
 
-    ensure(0 != GEOSisEmpty(geom_));
+    ensure(0 != GEOSisEmpty(geom1_));
 
     int in = 1;
-    GEOSGeom_setUserData(geom_, &in);
+    GEOSGeom_setUserData(geom1_, &in);
 
-    int* out = (int*)GEOSGeom_getUserData(geom_);
+    int* out = (int*)GEOSGeom_getUserData(geom1_);
 
     ensure_equals(*out, 1);
 }
@@ -70,17 +57,17 @@ template<>
 void object::test<2>
 ()
 {
-    geom_ = GEOSGeomFromWKT("POLYGON EMPTY");
+    geom1_ = GEOSGeomFromWKT("POLYGON EMPTY");
 
-    ensure(0 != GEOSisEmpty(geom_));
+    ensure(0 != GEOSisEmpty(geom1_));
 
     UserData in;
     in.a = 1;
     in.b = 2;
 
-    GEOSGeom_setUserData(geom_, &in);
+    GEOSGeom_setUserData(geom1_, &in);
 
-    struct UserData* out = (struct UserData*)GEOSGeom_getUserData(geom_);
+    struct UserData* out = (struct UserData*)GEOSGeom_getUserData(geom1_);
 
     ensure_equals(in.a, out->a);
     ensure_equals(in.b, out->b);
diff --git a/tests/unit/capi/GEOSVoronoiDiagramTest.cpp b/tests/unit/capi/GEOSVoronoiDiagramTest.cpp
index 2d2a21f..fbdfd53 100644
--- a/tests/unit/capi/GEOSVoronoiDiagramTest.cpp
+++ b/tests/unit/capi/GEOSVoronoiDiagramTest.cpp
@@ -19,48 +19,9 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capigeosvoronoidiagram_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-    GEOSWKTWriter* w_;
-
-    test_capigeosvoronoidiagram_data()
-        : geom1_(nullptr), geom2_(nullptr)
-    {
-        w_ = GEOSWKTWriter_create();
-        GEOSWKTWriter_setTrim(w_, 1);
+    test_capigeosvoronoidiagram_data() {
+        GEOSWKTWriter_setTrim(wktw_, 1);
     }
-
-    void
-    ensure_equals_wkt(GEOSGeometry* g, const char* exp)
-    {
-        GEOSGeometry* exp_g = GEOSGeomFromWKT(exp);
-
-        GEOSNormalize(g);
-        GEOSNormalize(exp_g);
-        bool eq = GEOSEqualsExact(g, exp_g, 1e-10) != 0;
-        if(! eq) {
-            using namespace std;
-            char* wkt_exp = GEOSWKTWriter_write(w_, exp_g);
-            char* wkt_obt = GEOSWKTWriter_write(w_, g);
-            cout << "Expected: " << wkt_exp << endl;
-            cout << "Obtained: " << wkt_obt << endl;
-            free(wkt_exp);
-            free(wkt_obt);
-        }
-
-        ensure(eq);
-        GEOSGeom_destroy(exp_g);
-    }
-
-    ~test_capigeosvoronoidiagram_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        GEOSWKTWriter_destroy(w_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-    }
-
 };
 
 typedef test_group<test_capigeosvoronoidiagram_data> group;
@@ -86,7 +47,7 @@ void object::test<1>
 
     GEOSGeom_destroy(geom2_);
     geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 0, 1);
-    ensure_equals_wkt(geom2_, "MULTILINESTRING EMPTY");
+    ensure_geometry_equals(geom2_, "MULTILINESTRING EMPTY");
 }
 
 //More points:
@@ -98,13 +59,13 @@ void object::test<2>
     geom1_ = GEOSGeomFromWKT("MULTIPOINT ((280 300), (420 330), (380 230), (320 160))");
 
     geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 0, 0);
-    ensure_equals_wkt(geom2_,
+    ensure_geometry_equals(geom2_,
                       "GEOMETRYCOLLECTION (POLYGON ((110 175.71428571428572, 110 500, 310.35714285714283 500, 353.515625 298.59375, 306.875 231.96428571428572, 110 175.71428571428572)), POLYGON ((590 204, 590 -10, 589.1666666666666 -10, 306.875 231.96428571428572, 353.515625 298.59375, 590 204)), POLYGON ((110 -10, 110 175.71428571428572, 306.875 231.96428571428572, 589.1666666666666 -10, 110 -10)), POLYGON ((310.35714285714283 500, 590 500, 590 204, 353.515625 298.59375, 310.35714285714283 500)))");
 
     GEOSGeom_destroy(geom2_);
     geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 0, 1);
-    ensure_equals_wkt(geom2_,
-                      "MULTILINESTRING ((310.3571428571428 500, 353.515625 298.59375), (353.515625 298.59375, 306.875 231.9642857142857), (306.875 231.9642857142857, 110 175.7142857142857), (589.1666666666666 -10, 306.875 231.9642857142857), (353.515625 298.59375, 590 204))");
+    ensure_geometry_equals(geom2_,
+                           "MULTILINESTRING ((310.3571428571428 500, 353.515625 298.59375), (353.515625 298.59375, 306.875 231.9642857142857), (306.875 231.9642857142857, 110 175.7142857142857), (589.1666666666666 -10, 306.875 231.9642857142857), (353.515625 298.59375, 590 204))");
 }
 //Larger number of points:
 template<>
@@ -115,14 +76,13 @@ void object::test<3>
     geom1_ = GEOSGeomFromWKT("MULTIPOINT ((170 270), (270 270), (230 310), (180 330), (250 340), (315 318), (330 260), (240 170), (220 220), (270 220))");
 
     geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 0, 0);
-    ensure_equals_wkt(geom2_,
-                      "GEOMETRYCOLLECTION (POLYGON ((0 329.1666666666667, 0 510, 190 510, 213.94736842105263 342.36842105263156, 195.625 296.5625, 0 329.1666666666667)), POLYGON ((0 76.50000000000001, 0 329.1666666666667, 195.625 296.5625, 216 266, 88.33333333333333 138.33333333333334, 0 76.50000000000001)), POLYGON ((216 266, 195.625 296.5625, 213.94736842105263 342.36842105263156, 267 307, 225 265, 216 266)), POLYGON ((245 245, 225 265, 267 307, 275.9160583941606 309.54744525547443, 303.1666666666667 284, 296.6666666666667 245, 245 245)), POLYGON ((225 265, 245 245, 245 201, 88.33333333333333 138.33333333333334, 216 266, 225 265)), POLYGON ((0 0, 0 76.50000000000001, 88.33333333333333 138.33333333333334, 245 201, 380 120, 500 0, 0 0)), POLYGON ((190 510, 343.76153846153846 510, 275.9160583941606 309.54744525547443, 267 307, 213.94736842105263 342.36842105263156, 190 510)), POLYGON ((245 201, 245 245, 296.6666666666667 245, 380 120, 245 201)), POLYGON ((343.76153846153846 510, 500 
 510, 500 334.9051724137931, 303.1666666666667 284, 275.9160583941606 309.54744525547443, 343.76153846153846 510)), POLYGON ((500 334.9051724137931, 500 0, 380 120, 296.6666666666667 245, 303.1666666666667 284, 500 334.9051724137931)))");
+    ensure_geometry_equals(geom2_,
+                           "GEOMETRYCOLLECTION (POLYGON ((0 329.1666666666667, 0 510, 190 510, 213.94736842105263 342.36842105263156, 195.625 296.5625, 0 329.1666666666667)), POLYGON ((0 76.50000000000001, 0 329.1666666666667, 195.625 296.5625, 216 266, 88.33333333333333 138.33333333333334, 0 76.50000000000001)), POLYGON ((216 266, 195.625 296.5625, 213.94736842105263 342.36842105263156, 267 307, 225 265, 216 266)), POLYGON ((245 245, 225 265, 267 307, 275.9160583941606 309.54744525547443, 303.1666666666667 284, 296.6666666666667 245, 245 245)), POLYGON ((225 265, 245 245, 245 201, 88.33333333333333 138.33333333333334, 216 266, 225 265)), POLYGON ((0 0, 0 76.50000000000001, 88.33333333333333 138.33333333333334, 245 201, 380 120, 500 0, 0 0)), POLYGON ((190 510, 343.76153846153846 510, 275.9160583941606 309.54744525547443, 267 307, 213.94736842105263 342.36842105263156, 190 510)), POLYGON ((245 201, 245 245, 296.6666666666667 245, 380 120, 245 201)), POLYGON ((343.76153846153846 510,
  500 510, 500 334.9051724137931, 303.1666666666667 284, 275.9160583941606 309.54744525547443, 343.76153846153846 510)), POLYGON ((500 334.9051724137931, 500 0, 380 120, 296.6666666666667 245, 303.1666666666667 284, 500 334.9051724137931)))");
 
     GEOSGeom_destroy(geom2_);
     geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 0, 1);
-    ensure_equals_wkt(geom2_,
-                      "MULTILINESTRING ((190 510, 213.9473684210526 342.3684210526316), (213.9473684210526 342.3684210526316, 195.625 296.5625), (195.625 296.5625, 0 329.1666666666667), (195.625 296.5625, 216 266), (216 266, 88.33333333333333 138.3333333333333), (88.33333333333333 138.3333333333333, 0 76.50000000000001), (213.9473684210526 342.3684210526316, 267 307), (267 307, 225 265), (225 265, 216 266), (245 245, 225 265), (267 307, 275.9160583941606 309.5474452554744), (275.9160583941606 309.5474452554744, 303.1666666666667 284), (303.1666666666667 284, 296.6666666666667 245), (296.6666666666667 245, 245 245), (245 245, 245 201), (245 201, 88.33333333333333 138.3333333333333), (245 201, 380 120), (380 120, 500 0), (343.7615384615385 510, 275.9160583941606 309.5474452554744), (296.6666666666667 245, 380 120), (500 334.9051724137931, 303.1666666666667 284))"
-                     );
+    ensure_geometry_equals(geom2_,
+                           "MULTILINESTRING ((190 510, 213.9473684210526 342.3684210526316), (213.9473684210526 342.3684210526316, 195.625 296.5625), (195.625 296.5625, 0 329.1666666666667), (195.625 296.5625, 216 266), (216 266, 88.33333333333333 138.3333333333333), (88.33333333333333 138.3333333333333, 0 76.50000000000001), (213.9473684210526 342.3684210526316, 267 307), (267 307, 225 265), (225 265, 216 266), (245 245, 225 265), (267 307, 275.9160583941606 309.5474452554744), (275.9160583941606 309.5474452554744, 303.1666666666667 284), (303.1666666666667 284, 296.6666666666667 245), (296.6666666666667 245, 245 245), (245 245, 245 201), (245 201, 88.33333333333333 138.3333333333333), (245 201, 380 120), (380 120, 500 0), (343.7615384615385 510, 275.9160583941606 309.5474452554744), (296.6666666666667 245, 380 120), (500 334.9051724137931, 303.1666666666667 284))");
 }
 //Test with non-zero Tolerance value
 template<>
@@ -133,14 +93,13 @@ void object::test<4>
     geom1_ = GEOSGeomFromWKT("MULTIPOINT ((150 210), (210 270), (150 220), (220 210), (215 269))");
 
     geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 10, 0);
-    ensure_equals_wkt(geom2_,
-                      "GEOMETRYCOLLECTION (POLYGON ((290 252.5, 290 140, 185 140, 185 215, 187.9268292682927 235.4878048780488, 290 252.5)), POLYGON ((80 215, 80 340, 100.83333333333336 340, 187.9268292682927 235.4878048780488, 185 215, 80 215)), POLYGON ((80 140, 80 215, 185 215, 185 140, 80 140)), POLYGON ((100.83333333333336 340, 290 340, 290 252.5, 187.9268292682927 235.4878048780488, 100.83333333333336 340)))");
+    ensure_geometry_equals(geom2_,
+                           "GEOMETRYCOLLECTION (POLYGON ((290 252.5, 290 140, 185 140, 185 215, 187.9268292682927 235.4878048780488, 290 252.5)), POLYGON ((80 215, 80 340, 100.83333333333336 340, 187.9268292682927 235.4878048780488, 185 215, 80 215)), POLYGON ((80 140, 80 215, 185 215, 185 140, 80 140)), POLYGON ((100.83333333333336 340, 290 340, 290 252.5, 187.9268292682927 235.4878048780488, 100.83333333333336 340)))");
 
     GEOSGeom_destroy(geom2_);
     geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 10, 1);
-    ensure_equals_wkt(geom2_,
-                      "MULTILINESTRING ((185 215, 187.9268292682927 235.4878048780488), (187.9268292682927 235.4878048780488, 290 252.5), (185 140, 185 215), (185 215, 80 215), (100.8333333333334 340, 187.9268292682927 235.4878048780488))"
-                     );
+    ensure_geometry_equals(geom2_,
+                           "MULTILINESTRING ((185 215, 187.9268292682927 235.4878048780488), (187.9268292682927 235.4878048780488, 290 252.5), (185 140, 185 215), (185 215, 80 215), (100.8333333333334 340, 187.9268292682927 235.4878048780488))");
 }
 template<>
 template<>
@@ -150,14 +109,13 @@ void object::test<5>
     geom1_ = GEOSGeomFromWKT("MULTIPOINT ((40 420), (50 420), (210 290), (300 360), (350 150), (170 70), (134 135) ,(305 359), (351 145), (175 71))");
 
     geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 10, 0);
-    ensure_equals_wkt(geom2_,
-                      "GEOMETRYCOLLECTION (POLYGON ((-310 146.559649122807, -310 770, 45 770, 45 263.64736842105265, -310 146.559649122807)), POLYGON ((-310 -153.37692307692305, -310 146.559649122807, 45 263.64736842105265, 59.16911764705881 267.8235294117647, 239.43506493506493 179.43506493506493, 241.34156378600824 151.98148148148147, -310 -153.37692307692305)), POLYGON ((45 770, 266.20000000000005 770, 181.94323144104806 418.9301310043668, 59.16911764705881 267.8235294117647, 45 263.64736842105265, 45 770)), POLYGON ((59.16911764705881 267.8235294117647, 181.94323144104806 418.9301310043668, 311.875 251.875, 239.43506493506493 179.43506493506493, 59.16911764705881 267.8235294117647)), POLYGON ((-310 -280, -310 -153.37692307692305, 241.34156378600824 151.98148148148147, 433.3333333333333 -280, -310 -280)), POLYGON ((266.20000000000005 770, 701 770, 701 344.5238095238096, 311.875 251.875, 181.94323144104806 418.9301310043668, 266.20000000000005 770)), POLYGON ((701 344.523809523809
 6, 701 -280, 433.3333333333333 -280, 241.34156378600824 151.98148148148147, 239.43506493506493 179.43506493506493, 311.875 251.875, 701 344.5238095238096)))");
+    ensure_geometry_equals(geom2_,
+                           "GEOMETRYCOLLECTION (POLYGON ((-310 146.559649122807, -310 770, 45 770, 45 263.64736842105265, -310 146.559649122807)), POLYGON ((-310 -153.37692307692305, -310 146.559649122807, 45 263.64736842105265, 59.16911764705881 267.8235294117647, 239.43506493506493 179.43506493506493, 241.34156378600824 151.98148148148147, -310 -153.37692307692305)), POLYGON ((45 770, 266.20000000000005 770, 181.94323144104806 418.9301310043668, 59.16911764705881 267.8235294117647, 45 263.64736842105265, 45 770)), POLYGON ((59.16911764705881 267.8235294117647, 181.94323144104806 418.9301310043668, 311.875 251.875, 239.43506493506493 179.43506493506493, 59.16911764705881 267.8235294117647)), POLYGON ((-310 -280, -310 -153.37692307692305, 241.34156378600824 151.98148148148147, 433.3333333333333 -280, -310 -280)), POLYGON ((266.20000000000005 770, 701 770, 701 344.5238095238096, 311.875 251.875, 181.94323144104806 418.9301310043668, 266.20000000000005 770)), POLYGON ((701 344.5238095
 238096, 701 -280, 433.3333333333333 -280, 241.34156378600824 151.98148148148147, 239.43506493506493 179.43506493506493, 311.875 251.875, 701 344.5238095238096)))");
 
     GEOSGeom_destroy(geom2_);
     geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 10, 1);
-    ensure_equals_wkt(geom2_,
-                      "MULTILINESTRING ((45 770, 45 263.6473684210526), (45 263.6473684210526, -310 146.559649122807), (45 263.6473684210526, 59.16911764705881 267.8235294117647), (59.16911764705881 267.8235294117647, 239.4350649350649 179.4350649350649), (239.4350649350649 179.4350649350649, 241.3415637860082 151.9814814814815), (241.3415637860082 151.9814814814815, -310 -153.376923076923), (266.2 770, 181.9432314410481 418.9301310043668), (181.9432314410481 418.9301310043668, 59.16911764705881 267.8235294117647), (181.9432314410481 418.9301310043668, 311.875 251.875), (311.875 251.875, 239.4350649350649 179.4350649350649), (241.3415637860082 151.9814814814815, 433.3333333333333 -280), (701 344.5238095238096, 311.875 251.875))"
-                     );
+    ensure_geometry_equals(geom2_,
+                           "MULTILINESTRING ((45 770, 45 263.6473684210526), (45 263.6473684210526, -310 146.559649122807), (45 263.6473684210526, 59.16911764705881 267.8235294117647), (59.16911764705881 267.8235294117647, 239.4350649350649 179.4350649350649), (239.4350649350649 179.4350649350649, 241.3415637860082 151.9814814814815), (241.3415637860082 151.9814814814815, -310 -153.376923076923), (266.2 770, 181.9432314410481 418.9301310043668), (181.9432314410481 418.9301310043668, 59.16911764705881 267.8235294117647), (181.9432314410481 418.9301310043668, 311.875 251.875), (311.875 251.875, 239.4350649350649 179.4350649350649), (241.3415637860082 151.9814814814815, 433.3333333333333 -280), (701 344.5238095238096, 311.875 251.875))");
 }
 template<>
 template<>
@@ -166,9 +124,8 @@ void object::test<6>
 {
     geom1_ = GEOSGeomFromWKT("MULTIPOINT ((123 245), (165 313), (240 310), (260 260), (180 210), (240 210))");
     geom2_ = GEOSVoronoiDiagram(geom1_, nullptr, 0, 1);
-    ensure_equals_wkt(geom2_,
-                      "MULTILINESTRING ((-14 376.5882352941176, 172.3651328095773 261.4803591470258), (172.3651328095773 261.4803591470258, 56.63157894736844 73), (172.3651328095773 261.4803591470258, 200.6640625 265.6015625), (200.6640625 265.6015625, 201 265.4), (201 265.4, 210 251), (210 251, 210 73), (208.04 450, 200.6640625 265.6015625), (397 343.8, 201 265.4), (210 251, 397 176.2))"
-                     );
+    ensure_geometry_equals(geom2_,
+                           "MULTILINESTRING ((-14 376.5882352941176, 172.3651328095773 261.4803591470258), (172.3651328095773 261.4803591470258, 56.63157894736844 73), (172.3651328095773 261.4803591470258, 200.6640625 265.6015625), (200.6640625 265.6015625, 201 265.4), (201 265.4, 210 251), (210 251, 210 73), (208.04 450, 200.6640625 265.6015625), (397 343.8, 201 265.4), (210 251, 397 176.2))");
 }
 
 template<>
diff --git a/tests/unit/capi/GEOSWithinTest.cpp b/tests/unit/capi/GEOSWithinTest.cpp
index 8807ff6..c6ee8ed 100644
--- a/tests/unit/capi/GEOSWithinTest.cpp
+++ b/tests/unit/capi/GEOSWithinTest.cpp
@@ -17,23 +17,7 @@ namespace tut {
 //
 
 // Common data used in test cases.
-struct test_capigeoswithin_data : public capitest::utility {
-    GEOSGeometry* geom1_;
-    GEOSGeometry* geom2_;
-
-    test_capigeoswithin_data()
-        : geom1_(nullptr), geom2_(nullptr)
-    {}
-
-    ~test_capigeoswithin_data()
-    {
-        GEOSGeom_destroy(geom1_);
-        GEOSGeom_destroy(geom2_);
-        geom1_ = nullptr;
-        geom2_ = nullptr;
-    }
-
-};
+struct test_capigeoswithin_data : public capitest::utility {};
 
 typedef test_group<test_capigeoswithin_data> group;
 typedef group::object object;
diff --git a/tests/unit/capi/GEOSisClosedTest.cpp b/tests/unit/capi/GEOSisClosedTest.cpp
index 6cd944e..8b56eb9 100644
--- a/tests/unit/capi/GEOSisClosedTest.cpp
+++ b/tests/unit/capi/GEOSisClosedTest.cpp
@@ -19,18 +19,7 @@ namespace tut {
 //
 
 // Common data used in test cases.
-struct test_capiisclosed_data : public capitest::utility {
-    GEOSGeometry* geom_;
-
-    test_capiisclosed_data() : geom_(nullptr)
-    {}
-
-    ~test_capiisclosed_data()
-    {
-        GEOSGeom_destroy(geom_);
-    }
-
-};
+struct test_capiisclosed_data : public capitest::utility {};
 
 typedef test_group<test_capiisclosed_data> group;
 typedef group::object object;
@@ -46,8 +35,8 @@ template<>
 void object::test<1>
 ()
 {
-    geom_ = GEOSGeomFromWKT("LINESTRING(0 0, 1 0, 1 1)");
-    int r = GEOSisClosed(geom_);
+    geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 1 0, 1 1)");
+    int r = GEOSisClosed(geom1_);
     ensure_equals(r, 0);
 }
 
@@ -56,8 +45,8 @@ template<>
 void object::test<2>
 ()
 {
-    geom_ = GEOSGeomFromWKT("LINESTRING(0 0, 0 1, 1 1, 0 0)");
-    int r = GEOSisClosed(geom_);
+    geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 0 1, 1 1, 0 0)");
+    int r = GEOSisClosed(geom1_);
     ensure_equals(r, 1);
 }
 
@@ -66,8 +55,8 @@ template<>
 void object::test<3>
 ()
 {
-    geom_ = GEOSGeomFromWKT("MULTILINESTRING ((1 1, 1 2, 2 2, 1 1), (0 0, 0 1, 1 1))");
-    int r = GEOSisClosed(geom_);
+    geom1_ = GEOSGeomFromWKT("MULTILINESTRING ((1 1, 1 2, 2 2, 1 1), (0 0, 0 1, 1 1))");
+    int r = GEOSisClosed(geom1_);
     ensure_equals(r, 0);
 }
 
@@ -76,8 +65,8 @@ template<>
 void object::test<4>
 ()
 {
-    geom_ = GEOSGeomFromWKT("MULTILINESTRING ((1 1, 1 2, 2 2, 1 1), (0 0, 0 1, 1 1, 0 0))");
-    int r = GEOSisClosed(geom_);
+    geom1_ = GEOSGeomFromWKT("MULTILINESTRING ((1 1, 1 2, 2 2, 1 1), (0 0, 0 1, 1 1, 0 0))");
+    int r = GEOSisClosed(geom1_);
     ensure_equals(r, 1);
 }
 
diff --git a/tests/unit/capi/GEOSisValidDetailTest.cpp b/tests/unit/capi/GEOSisValidDetailTest.cpp
index 67a1681..20092ba 100644
--- a/tests/unit/capi/GEOSisValidDetailTest.cpp
+++ b/tests/unit/capi/GEOSisValidDetailTest.cpp
@@ -20,28 +20,15 @@ namespace tut {
 
 // Common data used in test cases.
 struct test_capiisvaliddetail_data : public capitest::utility {
-    GEOSWKTWriter* wktw_;
-    GEOSGeometry* geom_;
     GEOSGeometry* loc_;
     char* reason_;
 
-    test_capiisvaliddetail_data()
-        : geom_(nullptr), loc_(nullptr), reason_(nullptr)
+    test_capiisvaliddetail_data() : loc_(nullptr), reason_(nullptr)
     {
-        wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setOutputDimension(wktw_, 3);
     }
 
-    std::string
-    toWKT(GEOSGeometry* g)
-    {
-        char* wkt = GEOSWKTWriter_write(wktw_, g);
-        std::string ret(wkt);
-        GEOSFree(wkt);
-        return ret;
-    }
-
     void
     strToUpper(std::string& str)
     {
@@ -55,10 +42,8 @@ struct test_capiisvaliddetail_data : public capitest::utility {
 
     ~test_capiisvaliddetail_data()
     {
-        GEOSGeom_destroy(geom_);
         GEOSGeom_destroy(loc_);
         GEOSFree(reason_);
-        GEOSWKTWriter_destroy(wktw_);
     }
 
 };
@@ -90,8 +75,8 @@ void object::test<2>
 {
     // Looks invalid (self-intersecting) but isn't
     // (is non-simple though)
-    geom_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0, 5 -5, 5 5)");
-    int r = GEOSisValidDetail(geom_, 0, &reason_, &loc_);
+    geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0, 5 -5, 5 5)");
+    int r = GEOSisValidDetail(geom1_, 0, &reason_, &loc_);
     ensure_equals(r, 1); // valid
     ensure_equals(reason_, (void*)nullptr);
     ensure_equals(loc_, (void*)nullptr);
@@ -103,9 +88,9 @@ template<>
 void object::test<3>
 ()
 {
-    geom_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0, NaN -5)");
-    ensure(nullptr != geom_);
-    int r = GEOSisValidDetail(geom_, 0, &reason_, &loc_);
+    geom1_ = GEOSGeomFromWKT("LINESTRING(0 0, 10 0, NaN -5)");
+    ensure(nullptr != geom1_);
+    int r = GEOSisValidDetail(geom1_, 0, &reason_, &loc_);
     std::string wkt = toWKT(loc_);
     strToUpper(wkt);
     ensure_equals(r, 0); // invalid
@@ -128,8 +113,8 @@ template<>
 void object::test<4>
 ()
 {
-    geom_ = GEOSGeomFromWKT("POLYGON((0 1, -10 10, 10 10, 0 1, 4 6, -4 6, 0 1))");
-    int r = GEOSisValidDetail(geom_, 0, &reason_, &loc_);
+    geom1_ = GEOSGeomFromWKT("POLYGON((0 1, -10 10, 10 10, 0 1, 4 6, -4 6, 0 1))");
+    int r = GEOSisValidDetail(geom1_, 0, &reason_, &loc_);
     ensure_equals(r, 0); // invalid
     ensure_equals(std::string(reason_), std::string("Ring Self-intersection"));
     ensure_equals(toWKT(loc_), "POINT (0 1)");
@@ -141,10 +126,10 @@ template<>
 void object::test<5>
 ()
 {
-    geom_ = GEOSGeomFromWKT("POLYGON((0 1, -10 10, 10 10, 0 1, 4 6, -4 6, 0 1))");
+    geom1_ = GEOSGeomFromWKT("POLYGON((0 1, -10 10, 10 10, 0 1, 4 6, -4 6, 0 1))");
     int flags = GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE;
 
-    int r = GEOSisValidDetail(geom_, flags, &reason_, &loc_);
+    int r = GEOSisValidDetail(geom1_, flags, &reason_, &loc_);
     ensure_equals(r, 1); // valid
     ensure_equals(reason_, (void*)nullptr);
     ensure_equals(loc_, (void*)nullptr);
@@ -156,8 +141,8 @@ template<>
 void object::test<6>
 ()
 {
-    geom_ = GEOSGeomFromWKT("POLYGON((0 1, -10 10, 10 10, 0 1, 4 6, -4 6, 0 1))");
-    int r = GEOSisValidDetail(geom_, 0, nullptr, nullptr);
+    geom1_ = GEOSGeomFromWKT("POLYGON((0 1, -10 10, 10 10, 0 1, 4 6, -4 6, 0 1))");
+    int r = GEOSisValidDetail(geom1_, 0, nullptr, nullptr);
     ensure_equals(r, 0); // invalid
 }
 
diff --git a/tests/unit/capi/capi_test_utils.h b/tests/unit/capi/capi_test_utils.h
index a528c8c..160df0c 100644
--- a/tests/unit/capi/capi_test_utils.h
+++ b/tests/unit/capi/capi_test_utils.h
@@ -14,14 +14,44 @@
 namespace capitest {
 
     struct utility {
+        GEOSWKTWriter* wktw_ = nullptr;
+        GEOSGeometry* geom1_ = nullptr;
+        GEOSGeometry* geom2_ = nullptr;
+        GEOSGeometry* geom3_ = nullptr;
+        GEOSGeometry* input_ = nullptr;
+        GEOSGeometry* expected_ = nullptr;
+        char* wkt_ = nullptr;
 
         utility()
         {
             initGEOS(notice, notice);
+            wktw_ = GEOSWKTWriter_create();
+            GEOSWKTWriter_setTrim(wktw_, 1);
+            GEOSWKTWriter_setRoundingPrecision(wktw_, 10);
         }
 
         ~utility()
         {
+            if (wktw_)
+                GEOSWKTWriter_destroy(wktw_);
+            if (geom1_) {
+                GEOSGeom_destroy(geom1_);
+            }
+            if (geom2_) {
+                GEOSGeom_destroy(geom2_);
+            }
+            if (geom3_) {
+                GEOSGeom_destroy(geom3_);
+            }
+            if (input_) {
+                GEOSGeom_destroy(input_);
+            }
+            if (expected_) {
+                GEOSGeom_destroy(expected_);
+            }
+            if (wkt_) {
+                GEOSFree(wkt_);
+            }
             finishGEOS();
         }
 
@@ -37,7 +67,24 @@ namespace capitest {
             std::fprintf(stdout, "\n");
         }
 
-        static void
+        GEOSGeometry*
+        fromWKT(const char* wkt)
+        {
+            GEOSGeometry* g = GEOSGeomFromWKT(wkt);
+            tut::ensure(g != nullptr);
+            return g;
+        }
+
+        std::string
+        toWKT(GEOSGeometry* g)
+        {
+            char* wkt = GEOSWKTWriter_write(wktw_, g);
+            std::string ret(wkt);
+            GEOSFree(wkt);
+            return ret;
+        }
+
+        void
         ensure_geometry_equals(GEOSGeometry* g1, GEOSGeometry* g2, double tolerance)
         {
             GEOSNormalize(g1);
@@ -45,7 +92,7 @@ namespace capitest {
             char rslt = GEOSEqualsExact(g1, g2, tolerance);
             if (rslt != 1)
             {
-                char* wkt1 = GEOSGeomToWKT(g1);
+                char* wkt1 = GEOSWKTWriter_write(wktw_, g1);
                 char* wkt2 = GEOSGeomToWKT(g2);
                 std::fprintf(stdout, "\n%s != %s\n", wkt1, wkt2);
                 GEOSFree(wkt1);
@@ -54,13 +101,13 @@ namespace capitest {
             tut::ensure_equals("GEOSEqualsExact(g1, g2, tolerance)", rslt, 1);
         }
 
-        static void
+        void
         ensure_geometry_equals(GEOSGeometry* g1, GEOSGeometry* g2)
         {
             return ensure_geometry_equals(g1, g2, 1e-12);
         }
 
-        static void
+        void
         ensure_geometry_equals(GEOSGeometry* g1, const char* g2str)
         {
             GEOSGeometry* g2 = GEOSGeomFromWKT(g2str);
@@ -70,8 +117,8 @@ namespace capitest {
             char rslt = GEOSEqualsExact(g1, g2, 1e-12);
             if (rslt != 1)
             {
-                char* wkt1 = GEOSGeomToWKT(g1);
-                char* wkt2 = GEOSGeomToWKT(g2);
+                char* wkt1 = GEOSWKTWriter_write(wktw_, g1);
+                char* wkt2 = GEOSWKTWriter_write(wktw_, g2);
                 std::fprintf(stdout, "\n%s != %s\n", wkt1, wkt2);
                 GEOSFree(wkt1);
                 GEOSFree(wkt2);
@@ -80,6 +127,8 @@ namespace capitest {
             tut::ensure_equals("GEOSEqualsExact(g1, g2, 1e-12)", rslt, 1);
         }
 
+
+
     };
 
 }

commit a27b1f58d39a308cae5614ae3113e604a7f469c7
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sun Jan 31 12:07:05 2021 -0500

    Remove some duplicated code in CAPI tests

diff --git a/tests/unit/capi/GEOSBufferTest.cpp b/tests/unit/capi/GEOSBufferTest.cpp
index 38b9624..8dc2555 100644
--- a/tests/unit/capi/GEOSBufferTest.cpp
+++ b/tests/unit/capi/GEOSBufferTest.cpp
@@ -10,13 +10,15 @@
 #include <cstdlib>
 #include <cstring>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosbuffer_data {
+struct test_capigeosbuffer_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     char* wkt_;
@@ -24,23 +26,9 @@ struct test_capigeosbuffer_data {
     GEOSWKTWriter* wktw_;
     double area_;
 
-    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_capigeosbuffer_data()
         : geom1_(nullptr), geom2_(nullptr), wkt_(nullptr), bp_(nullptr)
     {
-        initGEOS(notice, notice);
         wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
     }
@@ -55,7 +43,6 @@ struct test_capigeosbuffer_data {
         geom1_ = nullptr;
         geom2_ = nullptr;
         wkt_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSBuildAreaTest.cpp b/tests/unit/capi/GEOSBuildAreaTest.cpp
index c1350d9..254d833 100644
--- a/tests/unit/capi/GEOSBuildAreaTest.cpp
+++ b/tests/unit/capi/GEOSBuildAreaTest.cpp
@@ -9,30 +9,19 @@
 #include <cstdlib>
 #include <cmath>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capi_buildarea_data {
+struct test_capi_buildarea_data : public capitest::utility {
     GEOSWKTWriter* wktw_;
     GEOSGeometry* geom1_ = nullptr;
     GEOSGeometry* geom2_ = nullptr;
 
-    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");
-    }
-
     std::string
     toWKT(GEOSGeometry* g)
     {
@@ -44,7 +33,6 @@ struct test_capi_buildarea_data {
 
     test_capi_buildarea_data()
     {
-        initGEOS(notice, notice);
         wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setOutputDimension(wktw_, 3);
@@ -55,7 +43,6 @@ struct test_capi_buildarea_data {
         GEOSGeom_destroy(geom1_);
         GEOSGeom_destroy(geom2_);
         GEOSWKTWriter_destroy(wktw_);
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSClipByRectTest.cpp b/tests/unit/capi/GEOSClipByRectTest.cpp
index e535843..c79c428 100644
--- a/tests/unit/capi/GEOSClipByRectTest.cpp
+++ b/tests/unit/capi/GEOSClipByRectTest.cpp
@@ -10,31 +10,20 @@
 #include <cstdlib>
 #include <memory>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosclipbyrect_data {
+struct test_capigeosclipbyrect_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     GEOSGeometry* geom3_;
     GEOSWKTWriter* w_;
 
-    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");
-    }
-
     void
     isEqual(GEOSGeom g, const char* exp_wkt)
     {
@@ -52,7 +41,6 @@ struct test_capigeosclipbyrect_data {
     test_capigeosclipbyrect_data()
         : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
     {
-        initGEOS(notice, notice);
         w_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(w_, 1);
         GEOSWKTWriter_setRoundingPrecision(w_, 8);
@@ -67,7 +55,6 @@ struct test_capigeosclipbyrect_data {
         geom1_ = nullptr;
         geom2_ = nullptr;
         geom3_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSContainsTest.cpp b/tests/unit/capi/GEOSContainsTest.cpp
index e557c6f..ba6aa05 100644
--- a/tests/unit/capi/GEOSContainsTest.cpp
+++ b/tests/unit/capi/GEOSContainsTest.cpp
@@ -12,33 +12,21 @@
 #include <cstdio>
 #include <cstdlib>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeoscontains_data {
+struct test_capigeoscontains_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
 
-    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_capigeoscontains_data()
         : geom1_(nullptr), geom2_(nullptr)
     {
-        initGEOS(notice, notice);
     }
 
     ~test_capigeoscontains_data()
@@ -47,7 +35,6 @@ struct test_capigeoscontains_data {
         GEOSGeom_destroy(geom2_);
         geom1_ = nullptr;
         geom2_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSConvexHullTest.cpp b/tests/unit/capi/GEOSConvexHullTest.cpp
index 417694c..17ba631 100644
--- a/tests/unit/capi/GEOSConvexHullTest.cpp
+++ b/tests/unit/capi/GEOSConvexHullTest.cpp
@@ -9,33 +9,21 @@
 #include <cstdio>
 #include <cstdlib>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosconvexhull_data {
+struct test_capigeosconvexhull_data : public capitest::utility {
     GEOSGeometry* input_;
     GEOSGeometry* expected_;
 
-    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_capigeosconvexhull_data()
         : input_(nullptr), expected_(nullptr)
     {
-        initGEOS(notice, notice);
     }
 
     ~test_capigeosconvexhull_data()
@@ -44,7 +32,6 @@ struct test_capigeosconvexhull_data {
         GEOSGeom_destroy(expected_);
         input_ = nullptr;
         expected_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSCoordSeqTest.cpp b/tests/unit/capi/GEOSCoordSeqTest.cpp
index b7da46c..ed4251a 100644
--- a/tests/unit/capi/GEOSCoordSeqTest.cpp
+++ b/tests/unit/capi/GEOSCoordSeqTest.cpp
@@ -10,39 +10,26 @@
 #include <cstdlib>
 #include <memory>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeoscoordseq_data {
+struct test_capigeoscoordseq_data : public capitest::utility {
 
     GEOSCoordSequence* cs_;
 
-    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_capigeoscoordseq_data() : cs_(nullptr)
     {
-        initGEOS(notice, notice);
     }
 
     ~test_capigeoscoordseq_data()
     {
         GEOSCoordSeq_destroy(cs_);
         cs_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSDelaunayTriangulationTest.cpp b/tests/unit/capi/GEOSDelaunayTriangulationTest.cpp
index 50c931e..e454b75 100644
--- a/tests/unit/capi/GEOSDelaunayTriangulationTest.cpp
+++ b/tests/unit/capi/GEOSDelaunayTriangulationTest.cpp
@@ -10,34 +10,22 @@
 #include <cstdlib>
 #include <memory>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosdelaunaytriangulation_data {
+struct test_capigeosdelaunaytriangulation_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     GEOSWKTWriter* w_;
 
-    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_capigeosdelaunaytriangulation_data()
         : geom1_(nullptr), geom2_(nullptr)
     {
-        initGEOS(notice, notice);
         w_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(w_, 1);
     }
@@ -59,7 +47,6 @@ struct test_capigeosdelaunaytriangulation_data {
         GEOSWKTWriter_destroy(w_);
         geom1_ = nullptr;
         geom2_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSDistanceTest.cpp b/tests/unit/capi/GEOSDistanceTest.cpp
index 9b93c7b..84332de 100644
--- a/tests/unit/capi/GEOSDistanceTest.cpp
+++ b/tests/unit/capi/GEOSDistanceTest.cpp
@@ -12,35 +12,23 @@
 #include <memory>
 #include <math.h>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosdistance_data {
+struct test_capigeosdistance_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     GEOSGeometry* geom3_;
     GEOSWKTWriter* w_;
 
-    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_capigeosdistance_data()
         : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
     {
-        initGEOS(notice, notice);
         w_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(w_, 1);
     }
@@ -54,7 +42,6 @@ struct test_capigeosdistance_data {
         geom1_ = nullptr;
         geom2_ = nullptr;
         geom3_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSEqualsTest.cpp b/tests/unit/capi/GEOSEqualsTest.cpp
index 36b1fe0..cf837cb 100644
--- a/tests/unit/capi/GEOSEqualsTest.cpp
+++ b/tests/unit/capi/GEOSEqualsTest.cpp
@@ -10,33 +10,21 @@
 #include <cstdlib>
 #include <cstring>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosequals_data {
+struct test_capigeosequals_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
 
-    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_capigeosequals_data()
         : geom1_(nullptr), geom2_(nullptr)
     {
-        initGEOS(notice, notice);
     }
 
     ~test_capigeosequals_data()
@@ -45,7 +33,6 @@ struct test_capigeosequals_data {
         GEOSGeom_destroy(geom2_);
         geom1_ = nullptr;
         geom2_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSFrechetDistanceTest.cpp b/tests/unit/capi/GEOSFrechetDistanceTest.cpp
index 11042a1..57581e1 100644
--- a/tests/unit/capi/GEOSFrechetDistanceTest.cpp
+++ b/tests/unit/capi/GEOSFrechetDistanceTest.cpp
@@ -11,35 +11,23 @@
 #include <memory>
 #include <math.h>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosfrechetdistance_data {
+struct test_capigeosfrechetdistance_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     GEOSGeometry* geom3_;
     GEOSWKTWriter* w_;
 
-    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_capigeosfrechetdistance_data()
         : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
     {
-        initGEOS(notice, notice);
         w_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(w_, 1);
     }
@@ -53,7 +41,6 @@ struct test_capigeosfrechetdistance_data {
         geom1_ = nullptr;
         geom2_ = nullptr;
         geom3_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSGeomToWKTTest.cpp b/tests/unit/capi/GEOSGeomToWKTTest.cpp
index b634c7a..7e2b56e 100644
--- a/tests/unit/capi/GEOSGeomToWKTTest.cpp
+++ b/tests/unit/capi/GEOSGeomToWKTTest.cpp
@@ -11,39 +11,25 @@
 #include <cstdlib>
 #include <memory>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosgeomtowkt_data {
+struct test_capigeosgeomtowkt_data : public capitest::utility {
     GEOSGeometry* geom1_;
 
-    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_capigeosgeomtowkt_data()
         : geom1_(nullptr)
-    {
-        initGEOS(notice, notice);
-    }
+    {}
 
     ~test_capigeosgeomtowkt_data()
     {
         GEOSGeom_destroy(geom1_);
         geom1_ = nullptr;
-        finishGEOS();
     }
 
     void
diff --git a/tests/unit/capi/GEOSGeom_extentTest.cpp b/tests/unit/capi/GEOSGeom_extentTest.cpp
index ab29333..c0ab9f8 100644
--- a/tests/unit/capi/GEOSGeom_extentTest.cpp
+++ b/tests/unit/capi/GEOSGeom_extentTest.cpp
@@ -9,32 +9,10 @@
 #include <cstdio>
 #include <cstdlib>
 
+#include "capi_test_utils.h"
+
 namespace tut {
-struct test_capigeosgeom_extent {
-    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_capigeosgeom_extent()
-    {
-        initGEOS(notice, notice);
-    }
-
-    ~test_capigeosgeom_extent()
-    {
-        finishGEOS();
-    }
-
-};
+struct test_capigeosgeom_extent : public capitest::utility {};
 
 typedef test_group<test_capigeosgeom_extent> group;
 typedef group::object object;
diff --git a/tests/unit/capi/GEOSGetCentroidTest.cpp b/tests/unit/capi/GEOSGetCentroidTest.cpp
index ae99dcf..0871780 100644
--- a/tests/unit/capi/GEOSGetCentroidTest.cpp
+++ b/tests/unit/capi/GEOSGetCentroidTest.cpp
@@ -11,36 +11,24 @@
 #include <cstdlib>
 #include <cstring>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capicentroid_data {
+struct test_capicentroid_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     GEOSWKTWriter* wktw_;
     char* wkt_;
     double area_;
 
-    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_capicentroid_data()
         : geom1_(nullptr), geom2_(nullptr), wkt_(nullptr)
     {
-        initGEOS(notice, notice);
         wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setRoundingPrecision(wktw_, 6);
@@ -55,7 +43,6 @@ struct test_capicentroid_data {
         geom1_ = nullptr;
         geom2_ = nullptr;
         wkt_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSHausdorffDistanceTest.cpp b/tests/unit/capi/GEOSHausdorffDistanceTest.cpp
index 19b7d2a..8b573e0 100644
--- a/tests/unit/capi/GEOSHausdorffDistanceTest.cpp
+++ b/tests/unit/capi/GEOSHausdorffDistanceTest.cpp
@@ -11,35 +11,23 @@
 #include <memory>
 #include <math.h>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeoshausdorffdistance_data {
+struct test_capigeoshausdorffdistance_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     GEOSGeometry* geom3_;
     GEOSWKTWriter* w_;
 
-    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_capigeoshausdorffdistance_data()
         : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
     {
-        initGEOS(notice, notice);
         w_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(w_, 1);
     }
@@ -53,7 +41,6 @@ struct test_capigeoshausdorffdistance_data {
         geom1_ = nullptr;
         geom2_ = nullptr;
         geom3_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSInterpolateTest.cpp b/tests/unit/capi/GEOSInterpolateTest.cpp
index b2d22ae..c49014f 100644
--- a/tests/unit/capi/GEOSInterpolateTest.cpp
+++ b/tests/unit/capi/GEOSInterpolateTest.cpp
@@ -9,39 +9,25 @@
 #include <cstdlib>
 #include <cmath>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capiinterpolate_data {
+struct test_capiinterpolate_data : public capitest::utility {
     GEOSGeometry* geom1_;
 
-    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_capiinterpolate_data()
         : geom1_(nullptr)
-    {
-        initGEOS(notice, notice);
-    }
+    {}
 
     ~test_capiinterpolate_data()
     {
         GEOSGeom_destroy(geom1_);
         geom1_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSIntersectionPrecTest.cpp b/tests/unit/capi/GEOSIntersectionPrecTest.cpp
index 1376eb8..74e8264 100644
--- a/tests/unit/capi/GEOSIntersectionPrecTest.cpp
+++ b/tests/unit/capi/GEOSIntersectionPrecTest.cpp
@@ -10,36 +10,24 @@
 #include <cstdio>
 #include <cstdlib>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosintersectionprec_data {
+struct test_capigeosintersectionprec_data : public capitest::utility {
     GEOSWKTWriter* wktw_;
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     GEOSGeometry* geom3_;
     GEOSGeometry* expected_;
 
-    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_capigeosintersectionprec_data()
         : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr)
     {
-        initGEOS(notice, notice);
         wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setOutputDimension(wktw_, 3);
@@ -77,7 +65,6 @@ struct test_capigeosintersectionprec_data {
         geom2_ = nullptr;
         geom3_ = nullptr;
         expected_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSIntersectsTest.cpp b/tests/unit/capi/GEOSIntersectsTest.cpp
index efcc3e5..7f85a94 100644
--- a/tests/unit/capi/GEOSIntersectsTest.cpp
+++ b/tests/unit/capi/GEOSIntersectsTest.cpp
@@ -10,34 +10,21 @@
 #include <cstdlib>
 #include <cstring>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosintersects_data {
+struct test_capigeosintersects_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
 
-    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_capigeosintersects_data()
         : geom1_(nullptr), geom2_(nullptr)
-    {
-        initGEOS(notice, notice);
-    }
+    {}
 
     ~test_capigeosintersects_data()
     {
@@ -45,7 +32,6 @@ struct test_capigeosintersects_data {
         GEOSGeom_destroy(geom2_);
         geom1_ = nullptr;
         geom2_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSLineMergeTest.cpp b/tests/unit/capi/GEOSLineMergeTest.cpp
index 59ae269..e744ed5 100644
--- a/tests/unit/capi/GEOSLineMergeTest.cpp
+++ b/tests/unit/capi/GEOSLineMergeTest.cpp
@@ -8,37 +8,15 @@
 #include <cstdarg>
 #include <cstdio>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeoslinemerge_data {
-
-    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_capigeoslinemerge_data()
-    {
-        initGEOS(notice, notice);
-    }
-
-    ~test_capigeoslinemerge_data()
-    {
-        finishGEOS();
-    }
-
+struct test_capigeoslinemerge_data : public capitest::utility {
 };
 
 typedef test_group<test_capigeoslinemerge_data> group;
diff --git a/tests/unit/capi/GEOSLineString_PointTest.cpp b/tests/unit/capi/GEOSLineString_PointTest.cpp
index 76bc5fd..15e929b 100644
--- a/tests/unit/capi/GEOSLineString_PointTest.cpp
+++ b/tests/unit/capi/GEOSLineString_PointTest.cpp
@@ -9,39 +9,25 @@
 #include <cstdlib>
 #include <cmath>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capilinestringpoint_data {
+struct test_capilinestringpoint_data : public capitest::utility {
     GEOSGeometry* geom1_;
 
-    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_capilinestringpoint_data()
         : geom1_(nullptr)
-    {
-        initGEOS(notice, notice);
-    }
+    {}
 
     ~test_capilinestringpoint_data()
     {
         GEOSGeom_destroy(geom1_);
         geom1_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSMakeValidTest.cpp b/tests/unit/capi/GEOSMakeValidTest.cpp
index 27dce46..3f890ed 100644
--- a/tests/unit/capi/GEOSMakeValidTest.cpp
+++ b/tests/unit/capi/GEOSMakeValidTest.cpp
@@ -10,31 +10,20 @@
 #include <cmath>
 #include <cstring>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capimakevalid_data {
+struct test_capimakevalid_data : public capitest::utility {
     GEOSWKTWriter* wktw_;
     GEOSGeometry* geom1_ = nullptr;
     GEOSGeometry* geom2_ = nullptr;
     GEOSGeometry* expect_ = nullptr;
 
-    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");
-    }
-
     std::string
     toWKT(GEOSGeometry* g)
     {
@@ -46,7 +35,6 @@ struct test_capimakevalid_data {
 
     test_capimakevalid_data()
     {
-        initGEOS(notice, notice);
         wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setOutputDimension(wktw_, 3);
@@ -58,7 +46,6 @@ struct test_capimakevalid_data {
         if (geom2_) GEOSGeom_destroy(geom2_);
         if (expect_) GEOSGeom_destroy(expect_);
         GEOSWKTWriter_destroy(wktw_);
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSMaximumInscribedCircleTest.cpp b/tests/unit/capi/GEOSMaximumInscribedCircleTest.cpp
index 341c1f1..9a81e5b 100644
--- a/tests/unit/capi/GEOSMaximumInscribedCircleTest.cpp
+++ b/tests/unit/capi/GEOSMaximumInscribedCircleTest.cpp
@@ -11,36 +11,24 @@
 #include <cstdlib>
 #include <cstring>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capimaximuminscribedcircle_data {
+struct test_capimaximuminscribedcircle_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     GEOSWKTWriter* wktw_;
     char* wkt_;
     double area_;
 
-    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_capimaximuminscribedcircle_data()
         : geom1_(nullptr), geom2_(nullptr), wkt_(nullptr)
     {
-        initGEOS(notice, notice);
         wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setRoundingPrecision(wktw_, 8);
@@ -55,7 +43,6 @@ struct test_capimaximuminscribedcircle_data {
         geom1_ = nullptr;
         geom2_ = nullptr;
         wkt_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSMinimumBoundingCircleTest.cpp b/tests/unit/capi/GEOSMinimumBoundingCircleTest.cpp
index 156c742..309b9d9 100644
--- a/tests/unit/capi/GEOSMinimumBoundingCircleTest.cpp
+++ b/tests/unit/capi/GEOSMinimumBoundingCircleTest.cpp
@@ -11,13 +11,15 @@
 #include <cstdlib>
 #include <cstring>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capiminimumboundingcircle_data {
+struct test_capiminimumboundingcircle_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     GEOSGeometry* geom3_;
@@ -25,23 +27,9 @@ struct test_capiminimumboundingcircle_data {
     char* wkt_;
     double area_;
 
-    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_capiminimumboundingcircle_data()
         : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), wkt_(nullptr)
     {
-        initGEOS(notice, notice);
         wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setRoundingPrecision(wktw_, 8);
@@ -58,7 +46,6 @@ struct test_capiminimumboundingcircle_data {
         geom2_ = nullptr;
         geom3_ = nullptr;
         wkt_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSMinimumClearanceTest.cpp b/tests/unit/capi/GEOSMinimumClearanceTest.cpp
index 5d72ff7..75c4ada 100644
--- a/tests/unit/capi/GEOSMinimumClearanceTest.cpp
+++ b/tests/unit/capi/GEOSMinimumClearanceTest.cpp
@@ -8,37 +8,16 @@
 #include <cstdio>
 #include <cstdlib>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosminimumclearance_data {
+struct test_capigeosminimumclearance_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_capigeosminimumclearance_data()
-    {
-        initGEOS(notice, notice);
-    }
-
-    ~test_capigeosminimumclearance_data()
-    {
-        finishGEOS();
-    }
-
-    void
     testClearance(const std::string& wkx_input,
                   const std::string& wkx_expected,
                   double clearance)
diff --git a/tests/unit/capi/GEOSMinimumRectangleTest.cpp b/tests/unit/capi/GEOSMinimumRectangleTest.cpp
index 647418e..2704ff0 100644
--- a/tests/unit/capi/GEOSMinimumRectangleTest.cpp
+++ b/tests/unit/capi/GEOSMinimumRectangleTest.cpp
@@ -9,34 +9,22 @@
 #include <cstdio>
 #include <cstdlib>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosminimumrectangle_data {
+struct test_capigeosminimumrectangle_data : public capitest::utility {
     GEOSGeometry* input_;
     GEOSWKTWriter* wktw_;
     char* wkt_;
 
-    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_capigeosminimumrectangle_data()
         : input_(nullptr), wkt_(nullptr)
     {
-        initGEOS(notice, notice);
         wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setRoundingPrecision(wktw_, 8);
@@ -49,7 +37,6 @@ struct test_capigeosminimumrectangle_data {
         GEOSWKTWriter_destroy(wktw_);
         GEOSFree(wkt_);
         wkt_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSMinimumWidthTest.cpp b/tests/unit/capi/GEOSMinimumWidthTest.cpp
index cfef4b6..3a69b6e 100644
--- a/tests/unit/capi/GEOSMinimumWidthTest.cpp
+++ b/tests/unit/capi/GEOSMinimumWidthTest.cpp
@@ -8,34 +8,22 @@
 #include <cstdio>
 #include <cstdlib>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosminimumwidth_data {
+struct test_capigeosminimumwidth_data : public capitest::utility {
     GEOSGeometry* input_;
     GEOSWKTWriter* wktw_;
     char* wkt_;
 
-    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_capigeosminimumwidth_data()
         : input_(nullptr), wkt_(nullptr)
     {
-        initGEOS(notice, notice);
         wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setRoundingPrecision(wktw_, 8);
@@ -48,7 +36,6 @@ struct test_capigeosminimumwidth_data {
         GEOSWKTWriter_destroy(wktw_);
         GEOSFree(wkt_);
         wkt_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSNearestPointsTest.cpp b/tests/unit/capi/GEOSNearestPointsTest.cpp
index a4780a8..e618d5b 100644
--- a/tests/unit/capi/GEOSNearestPointsTest.cpp
+++ b/tests/unit/capi/GEOSNearestPointsTest.cpp
@@ -10,34 +10,21 @@
 #include <cstdio>
 #include <cstdlib>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosnearestpoints_data {
+struct test_capigeosnearestpoints_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
 
-    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_capigeosnearestpoints_data()
         : geom1_(nullptr), geom2_(nullptr)
-    {
-        initGEOS(notice, notice);
-    }
+    {}
 
     ~test_capigeosnearestpoints_data()
     {
@@ -45,7 +32,6 @@ struct test_capigeosnearestpoints_data {
         GEOSGeom_destroy(geom2_);
         geom1_ = nullptr;
         geom2_ = nullptr;
-        finishGEOS();
     }
 
     void checkNearestPoints(const char* wkt1, const char* wkt2,
diff --git a/tests/unit/capi/GEOSNodeTest.cpp b/tests/unit/capi/GEOSNodeTest.cpp
index 58dbb26..27a53e6 100644
--- a/tests/unit/capi/GEOSNodeTest.cpp
+++ b/tests/unit/capi/GEOSNodeTest.cpp
@@ -10,34 +10,22 @@
 #include <cstdlib>
 #include <memory>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosnode_data {
+struct test_capigeosnode_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     GEOSWKTWriter* w_;
 
-    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_capigeosnode_data()
         : geom1_(nullptr), geom2_(nullptr), w_(nullptr)
     {
-        initGEOS(notice, notice);
         w_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(w_, 1);
     }
@@ -49,7 +37,6 @@ struct test_capigeosnode_data {
         GEOSWKTWriter_destroy(w_);
         geom1_ = nullptr;
         geom2_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSOffsetCurveTest.cpp b/tests/unit/capi/GEOSOffsetCurveTest.cpp
index 70840d8..2500a24 100644
--- a/tests/unit/capi/GEOSOffsetCurveTest.cpp
+++ b/tests/unit/capi/GEOSOffsetCurveTest.cpp
@@ -10,36 +10,24 @@
 #include <cstdlib>
 #include <cstring>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capioffsetcurve_data {
+struct test_capioffsetcurve_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     GEOSWKTWriter* wktw_;
     char* wkt_;
     double area_;
 
-    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_capioffsetcurve_data()
         : geom1_(nullptr), geom2_(nullptr), wkt_(nullptr)
     {
-        initGEOS(notice, notice);
         wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
     }
@@ -53,7 +41,6 @@ struct test_capioffsetcurve_data {
         geom1_ = nullptr;
         geom2_ = nullptr;
         wkt_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSPointOnSurfaceTest.cpp b/tests/unit/capi/GEOSPointOnSurfaceTest.cpp
index 917e62f..006206a 100644
--- a/tests/unit/capi/GEOSPointOnSurfaceTest.cpp
+++ b/tests/unit/capi/GEOSPointOnSurfaceTest.cpp
@@ -11,36 +11,24 @@
 #include <cstdlib>
 #include <cstring>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capipointonsurface_data {
+struct test_capipointonsurface_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     GEOSWKTWriter* wktw_;
     char* wkt_;
     double area_;
 
-    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_capipointonsurface_data()
         : geom1_(nullptr), geom2_(nullptr), wkt_(nullptr)
     {
-        initGEOS(notice, notice);
         wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setRoundingPrecision(wktw_, 4);
@@ -55,7 +43,6 @@ struct test_capipointonsurface_data {
         geom1_ = nullptr;
         geom2_ = nullptr;
         wkt_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSPolygonizeTest.cpp b/tests/unit/capi/GEOSPolygonizeTest.cpp
index 56cfcdb..f885907 100644
--- a/tests/unit/capi/GEOSPolygonizeTest.cpp
+++ b/tests/unit/capi/GEOSPolygonizeTest.cpp
@@ -10,36 +10,15 @@
 #include <cstdlib>
 #include <memory>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeospolygonize_data {
-    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_capigeospolygonize_data()
-    {
-        initGEOS(notice, notice);
-    }
-
-    ~test_capigeospolygonize_data()
-    {
-        finishGEOS();
-    }
-
+struct test_capigeospolygonize_data : public capitest::utility {
 };
 
 typedef test_group<test_capigeospolygonize_data> group;
diff --git a/tests/unit/capi/GEOSPreparedDistanceTest.cpp b/tests/unit/capi/GEOSPreparedDistanceTest.cpp
index 892cc43..b7f550e 100644
--- a/tests/unit/capi/GEOSPreparedDistanceTest.cpp
+++ b/tests/unit/capi/GEOSPreparedDistanceTest.cpp
@@ -9,35 +9,22 @@
 #include <cstdio>
 #include <cstdlib>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosprepareddistance_data {
+struct test_capigeosprepareddistance_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     const GEOSPreparedGeometry* pgeom1_;
 
-    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_capigeosprepareddistance_data()
         : geom1_(nullptr), geom2_(nullptr), pgeom1_(nullptr)
-    {
-        initGEOS(notice, notice);
-    }
+    {}
 
     ~test_capigeosprepareddistance_data()
     {
@@ -47,7 +34,6 @@ struct test_capigeosprepareddistance_data {
         geom1_ = nullptr;
         geom2_ = nullptr;
         geom1_ = nullptr;
-        finishGEOS();
     }
 
     void checkDistance(const char* wkt1, const char* wkt2,
diff --git a/tests/unit/capi/GEOSPreparedGeometryTest.cpp b/tests/unit/capi/GEOSPreparedGeometryTest.cpp
index 0e49304..3c427c0 100644
--- a/tests/unit/capi/GEOSPreparedGeometryTest.cpp
+++ b/tests/unit/capi/GEOSPreparedGeometryTest.cpp
@@ -13,39 +13,24 @@
 #include <cstdlib>
 #include <memory>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeospreparedgeometry_data {
+struct test_capigeospreparedgeometry_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
 
     const GEOSPreparedGeometry* prepGeom1_;
     const GEOSPreparedGeometry* prepGeom2_;
 
-
-
-    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_capigeospreparedgeometry_data()
         : geom1_(nullptr), geom2_(nullptr), prepGeom1_(nullptr), prepGeom2_(nullptr)
-    {
-        initGEOS(notice, notice);
-    }
+    {}
 
     ~test_capigeospreparedgeometry_data()
     {
@@ -57,7 +42,6 @@ struct test_capigeospreparedgeometry_data {
         geom2_ = nullptr;
         prepGeom1_ = nullptr;
         prepGeom2_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSPreparedNearestPointsTest.cpp b/tests/unit/capi/GEOSPreparedNearestPointsTest.cpp
index 6b6790b..9e2fbb5 100644
--- a/tests/unit/capi/GEOSPreparedNearestPointsTest.cpp
+++ b/tests/unit/capi/GEOSPreparedNearestPointsTest.cpp
@@ -10,35 +10,22 @@
 #include <cstdio>
 #include <cstdlib>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeospreparednearestpoints_data {
+struct test_capigeospreparednearestpoints_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     const GEOSPreparedGeometry* pgeom1_;
 
-    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_capigeospreparednearestpoints_data()
         : geom1_(nullptr), geom2_(nullptr), pgeom1_(nullptr)
-    {
-        initGEOS(notice, notice);
-    }
+    {}
 
     ~test_capigeospreparednearestpoints_data()
     {
@@ -48,7 +35,6 @@ struct test_capigeospreparednearestpoints_data {
         geom1_ = nullptr;
         geom2_ = nullptr;
         geom1_ = nullptr;
-        finishGEOS();
     }
 
     void checkNearestPoints(const char* wkt1, const char* wkt2,
diff --git a/tests/unit/capi/GEOSProjectTest.cpp b/tests/unit/capi/GEOSProjectTest.cpp
index 8a71566..cf023c2 100644
--- a/tests/unit/capi/GEOSProjectTest.cpp
+++ b/tests/unit/capi/GEOSProjectTest.cpp
@@ -9,34 +9,21 @@
 #include <cstdlib>
 #include <cmath>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capiproject_data {
+struct test_capiproject_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
 
-    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_capiproject_data()
         : geom1_(nullptr), geom2_(nullptr)
-    {
-        initGEOS(notice, notice);
-    }
+    {}
 
     ~test_capiproject_data()
     {
@@ -44,7 +31,6 @@ struct test_capiproject_data {
         GEOSGeom_destroy(geom2_);
         geom1_ = nullptr;
         geom2_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSRelateBoundaryNodeRuleTest.cpp b/tests/unit/capi/GEOSRelateBoundaryNodeRuleTest.cpp
index de08067..66f48b1 100644
--- a/tests/unit/capi/GEOSRelateBoundaryNodeRuleTest.cpp
+++ b/tests/unit/capi/GEOSRelateBoundaryNodeRuleTest.cpp
@@ -9,42 +9,28 @@
 #include <cstdio>
 #include <cstdlib>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosrelateboundarynoderule_data {
+struct test_capigeosrelateboundarynoderule_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     char* pat_;
 
-    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_capigeosrelateboundarynoderule_data()
         : geom1_(nullptr), geom2_(nullptr), pat_(nullptr)
-    {
-        initGEOS(notice, notice);
-    }
+    {}
 
     ~test_capigeosrelateboundarynoderule_data()
     {
         GEOSGeom_destroy(geom1_);
         GEOSGeom_destroy(geom2_);
         GEOSFree(pat_);
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSRelatePatternMatchTest.cpp b/tests/unit/capi/GEOSRelatePatternMatchTest.cpp
index 90549d4..5c89c3d 100644
--- a/tests/unit/capi/GEOSRelatePatternMatchTest.cpp
+++ b/tests/unit/capi/GEOSRelatePatternMatchTest.cpp
@@ -9,37 +9,15 @@
 #include <cstdio>
 #include <cstdlib>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosrelatepatternmatch_data {
-
-    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_capigeosrelatepatternmatch_data()
-    {
-        initGEOS(notice, notice);
-    }
-
-    ~test_capigeosrelatepatternmatch_data()
-    {
-        finishGEOS();
-    }
-
+struct test_capigeosrelatepatternmatch_data : public capitest::utility {
 };
 
 typedef test_group<test_capigeosrelatepatternmatch_data> group;
diff --git a/tests/unit/capi/GEOSReverseTest.cpp b/tests/unit/capi/GEOSReverseTest.cpp
index 42d218f..5f5b802 100644
--- a/tests/unit/capi/GEOSReverseTest.cpp
+++ b/tests/unit/capi/GEOSReverseTest.cpp
@@ -8,35 +8,15 @@
 #include <cstdio>
 #include <cstdlib>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosreverse {
-    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_capigeosreverse()
-    {
-        initGEOS(notice, notice);
-    }
-
-    ~test_capigeosreverse()
-    {
-        finishGEOS();
-    }
+struct test_capigeosreverse : public capitest::utility {
 };
 
 typedef test_group<test_capigeosreverse> group;
diff --git a/tests/unit/capi/GEOSSTRtreeTest.cpp b/tests/unit/capi/GEOSSTRtreeTest.cpp
index 5d9e757..cfd833a 100644
--- a/tests/unit/capi/GEOSSTRtreeTest.cpp
+++ b/tests/unit/capi/GEOSSTRtreeTest.cpp
@@ -10,6 +10,8 @@
 #include <cstring>
 #include <cmath>
 
+#include "capi_test_utils.h"
+
 struct INTPOINT {
     INTPOINT(int p_x, int p_y) : x(p_x), y(p_y) {}
     int x;
@@ -44,24 +46,7 @@ namespace tut {
 //
 
 // Common data used in test cases.
-struct test_capistrtree_data {
-    test_capistrtree_data()
-    {
-        initGEOS(notice, notice);
-    }
-
-    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");
-    }
+struct test_capistrtree_data : public capitest::utility {
 };
 
 typedef test_group<test_capistrtree_data> group;
diff --git a/tests/unit/capi/GEOSSegmentIntersectionTest.cpp b/tests/unit/capi/GEOSSegmentIntersectionTest.cpp
index a08c4b7..aec95a8 100644
--- a/tests/unit/capi/GEOSSegmentIntersectionTest.cpp
+++ b/tests/unit/capi/GEOSSegmentIntersectionTest.cpp
@@ -8,35 +8,15 @@
 #include <cstdio>
 #include <cstdlib>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeossegmentintersection {
-    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_capigeossegmentintersection()
-    {
-        initGEOS(notice, notice);
-    }
-
-    ~test_capigeossegmentintersection()
-    {
-        finishGEOS();
-    }
+struct test_capigeossegmentintersection : capitest::utility {
 };
 
 typedef test_group<test_capigeossegmentintersection> group;
diff --git a/tests/unit/capi/GEOSSharedPathsTest.cpp b/tests/unit/capi/GEOSSharedPathsTest.cpp
index 69413e1..31aac47 100644
--- a/tests/unit/capi/GEOSSharedPathsTest.cpp
+++ b/tests/unit/capi/GEOSSharedPathsTest.cpp
@@ -10,35 +10,23 @@
 #include <cstdlib>
 #include <memory>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeossharedpaths_data {
+struct test_capigeossharedpaths_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     GEOSGeometry* geom3_;
     GEOSWKTWriter* w_;
 
-    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_capigeossharedpaths_data()
         : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
     {
-        initGEOS(notice, notice);
         w_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(w_, 1);
     }
@@ -52,7 +40,6 @@ struct test_capigeossharedpaths_data {
         geom1_ = nullptr;
         geom2_ = nullptr;
         geom3_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSSimplifyTest.cpp b/tests/unit/capi/GEOSSimplifyTest.cpp
index 42edfaf..f875b23 100644
--- a/tests/unit/capi/GEOSSimplifyTest.cpp
+++ b/tests/unit/capi/GEOSSimplifyTest.cpp
@@ -10,34 +10,21 @@
 #include <cstdlib>
 #include <memory>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeossimplify_data {
+struct test_capigeossimplify_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
 
-    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_capigeossimplify_data()
         : geom1_(nullptr), geom2_(nullptr)
-    {
-        initGEOS(notice, notice);
-    }
+    {}
 
     ~test_capigeossimplify_data()
     {
@@ -45,7 +32,6 @@ struct test_capigeossimplify_data {
         GEOSGeom_destroy(geom2_);
         geom1_ = nullptr;
         geom2_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSSnapTest.cpp b/tests/unit/capi/GEOSSnapTest.cpp
index 29a99e9..bba70ff 100644
--- a/tests/unit/capi/GEOSSnapTest.cpp
+++ b/tests/unit/capi/GEOSSnapTest.cpp
@@ -10,35 +10,23 @@
 #include <cstdlib>
 #include <memory>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeossnap_data {
+struct test_capigeossnap_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     GEOSGeometry* geom3_;
     GEOSWKTWriter* w_;
 
-    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_capigeossnap_data()
         : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
     {
-        initGEOS(notice, notice);
         w_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(w_, 1);
         GEOSWKTWriter_setRoundingPrecision(w_, 8);
@@ -53,7 +41,6 @@ struct test_capigeossnap_data {
         geom1_ = nullptr;
         geom2_ = nullptr;
         geom3_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSUnaryUnionTest.cpp b/tests/unit/capi/GEOSUnaryUnionTest.cpp
index 5e55af1..fcd1965 100644
--- a/tests/unit/capi/GEOSUnaryUnionTest.cpp
+++ b/tests/unit/capi/GEOSUnaryUnionTest.cpp
@@ -10,34 +10,22 @@
 #include <cstdlib>
 #include <cstring>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capiunaryunion_data {
+struct test_capiunaryunion_data : public capitest::utility {
     GEOSWKTWriter* wktw_;
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
 
-    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_capiunaryunion_data()
         : geom1_(nullptr), geom2_(nullptr)
     {
-        initGEOS(notice, notice);
         wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setOutputDimension(wktw_, 3);
@@ -59,7 +47,6 @@ struct test_capiunaryunion_data {
         GEOSWKTWriter_destroy(wktw_);
         geom1_ = nullptr;
         geom2_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSUserDataTest.cpp b/tests/unit/capi/GEOSUserDataTest.cpp
index 3c1588a..b1b65a4 100644
--- a/tests/unit/capi/GEOSUserDataTest.cpp
+++ b/tests/unit/capi/GEOSUserDataTest.cpp
@@ -10,39 +10,25 @@
 #include <cstdlib>
 #include <memory>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeouserdata_data {
+struct test_capigeouserdata_data : public capitest::utility {
     GEOSGeometry* geom_;
 
-    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_capigeouserdata_data()
         : geom_(nullptr)
-    {
-        initGEOS(notice, notice);
-    }
+    {}
 
     ~test_capigeouserdata_data()
     {
         GEOSGeom_destroy(geom_);
         geom_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSVoronoiDiagramTest.cpp b/tests/unit/capi/GEOSVoronoiDiagramTest.cpp
index 91808a5..2d2a21f 100644
--- a/tests/unit/capi/GEOSVoronoiDiagramTest.cpp
+++ b/tests/unit/capi/GEOSVoronoiDiagramTest.cpp
@@ -10,34 +10,22 @@
 #include <cstdlib>
 #include <memory>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeosvoronoidiagram_data {
+struct test_capigeosvoronoidiagram_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
     GEOSWKTWriter* w_;
 
-    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_capigeosvoronoidiagram_data()
         : geom1_(nullptr), geom2_(nullptr)
     {
-        initGEOS(notice, notice);
         w_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(w_, 1);
     }
@@ -71,7 +59,6 @@ struct test_capigeosvoronoidiagram_data {
         GEOSWKTWriter_destroy(w_);
         geom1_ = nullptr;
         geom2_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSWithinTest.cpp b/tests/unit/capi/GEOSWithinTest.cpp
index 9165deb..8807ff6 100644
--- a/tests/unit/capi/GEOSWithinTest.cpp
+++ b/tests/unit/capi/GEOSWithinTest.cpp
@@ -9,34 +9,21 @@
 #include <cstdio>
 #include <cstdlib>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capigeoswithin_data {
+struct test_capigeoswithin_data : public capitest::utility {
     GEOSGeometry* geom1_;
     GEOSGeometry* geom2_;
 
-    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_capigeoswithin_data()
         : geom1_(nullptr), geom2_(nullptr)
-    {
-        initGEOS(notice, notice);
-    }
+    {}
 
     ~test_capigeoswithin_data()
     {
@@ -44,7 +31,6 @@ struct test_capigeoswithin_data {
         GEOSGeom_destroy(geom2_);
         geom1_ = nullptr;
         geom2_ = nullptr;
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSisClosedTest.cpp b/tests/unit/capi/GEOSisClosedTest.cpp
index 37d4f90..6cd944e 100644
--- a/tests/unit/capi/GEOSisClosedTest.cpp
+++ b/tests/unit/capi/GEOSisClosedTest.cpp
@@ -11,37 +11,23 @@
 #include <cstdlib>
 #include <cstring>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capiisclosed_data {
+struct test_capiisclosed_data : public capitest::utility {
     GEOSGeometry* geom_;
 
-    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_capiisclosed_data() : geom_(nullptr)
-    {
-        initGEOS(notice, notice);
-    }
+    {}
 
     ~test_capiisclosed_data()
     {
         GEOSGeom_destroy(geom_);
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/GEOSisValidDetailTest.cpp b/tests/unit/capi/GEOSisValidDetailTest.cpp
index ae554e7..67a1681 100644
--- a/tests/unit/capi/GEOSisValidDetailTest.cpp
+++ b/tests/unit/capi/GEOSisValidDetailTest.cpp
@@ -11,35 +11,23 @@
 #include <cstdlib>
 #include <cstring>
 
+#include "capi_test_utils.h"
+
 namespace tut {
 //
 // Test Group
 //
 
 // Common data used in test cases.
-struct test_capiisvaliddetail_data {
+struct test_capiisvaliddetail_data : public capitest::utility {
     GEOSWKTWriter* wktw_;
     GEOSGeometry* geom_;
     GEOSGeometry* loc_;
     char* reason_;
 
-    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_capiisvaliddetail_data()
         : geom_(nullptr), loc_(nullptr), reason_(nullptr)
     {
-        initGEOS(notice, notice);
         wktw_ = GEOSWKTWriter_create();
         GEOSWKTWriter_setTrim(wktw_, 1);
         GEOSWKTWriter_setOutputDimension(wktw_, 3);
@@ -71,7 +59,6 @@ struct test_capiisvaliddetail_data {
         GEOSGeom_destroy(loc_);
         GEOSFree(reason_);
         GEOSWKTWriter_destroy(wktw_);
-        finishGEOS();
     }
 
 };
diff --git a/tests/unit/capi/capi_test_utils.h b/tests/unit/capi/capi_test_utils.h
index c722ffc..a528c8c 100644
--- a/tests/unit/capi/capi_test_utils.h
+++ b/tests/unit/capi/capi_test_utils.h
@@ -64,7 +64,7 @@ namespace capitest {
         ensure_geometry_equals(GEOSGeometry* g1, const char* g2str)
         {
             GEOSGeometry* g2 = GEOSGeomFromWKT(g2str);
-            tut::ensure(g2 != 0);
+            tut::ensure(g2 != nullptr);
             GEOSNormalize(g1);
             GEOSNormalize(g2);
             char rslt = GEOSEqualsExact(g1, g2, 1e-12);

commit fa1244de4b24beebb5c4b5a8b37c992ffed44e62
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sun Jan 31 10:31:34 2021 -0500

    Clear MSVC warnings

diff --git a/tests/unit/capi/capi_test_utils.h b/tests/unit/capi/capi_test_utils.h
index 7ce6312..c722ffc 100644
--- a/tests/unit/capi/capi_test_utils.h
+++ b/tests/unit/capi/capi_test_utils.h
@@ -37,13 +37,13 @@ namespace capitest {
             std::fprintf(stdout, "\n");
         }
 
-        void
+        static void
         ensure_geometry_equals(GEOSGeometry* g1, GEOSGeometry* g2, double tolerance)
         {
             GEOSNormalize(g1);
             GEOSNormalize(g2);
-            bool rslt = GEOSEqualsExact(g1, g2, tolerance);
-            if (!rslt)
+            char rslt = GEOSEqualsExact(g1, g2, tolerance);
+            if (rslt != 1)
             {
                 char* wkt1 = GEOSGeomToWKT(g1);
                 char* wkt2 = GEOSGeomToWKT(g2);
@@ -52,24 +52,23 @@ namespace capitest {
                 GEOSFree(wkt2);
             }
             tut::ensure_equals("GEOSEqualsExact(g1, g2, tolerance)", rslt, 1);
-            return;
         }
 
-        void
+        static void
         ensure_geometry_equals(GEOSGeometry* g1, GEOSGeometry* g2)
         {
             return ensure_geometry_equals(g1, g2, 1e-12);
         }
 
-        void
+        static void
         ensure_geometry_equals(GEOSGeometry* g1, const char* g2str)
         {
             GEOSGeometry* g2 = GEOSGeomFromWKT(g2str);
             tut::ensure(g2 != 0);
             GEOSNormalize(g1);
             GEOSNormalize(g2);
-            bool rslt = GEOSEqualsExact(g1, g2, 1e-12);
-            if (!rslt)
+            char rslt = GEOSEqualsExact(g1, g2, 1e-12);
+            if (rslt != 1)
             {
                 char* wkt1 = GEOSGeomToWKT(g1);
                 char* wkt2 = GEOSGeomToWKT(g2);
@@ -79,7 +78,6 @@ namespace capitest {
             }
             GEOSGeom_destroy(g2);
             tut::ensure_equals("GEOSEqualsExact(g1, g2, 1e-12)", rslt, 1);
-            return;
         }
 
     };
diff --git a/tests/unit/io/WKBReaderTest.cpp b/tests/unit/io/WKBReaderTest.cpp
index 5e2f2e9..d646284 100644
--- a/tests/unit/io/WKBReaderTest.cpp
+++ b/tests/unit/io/WKBReaderTest.cpp
@@ -542,32 +542,32 @@ void object::test<24>
 
     // POINT EMPTY
     g = readHex(std::string("0101000000000000000000F87F000000000000F87F"));
-    ensure_equals("POINT EMPTY isEmpty", g->isEmpty(), 1);
+    ensure("POINT EMPTY isEmpty", g->isEmpty());
     ensure_equals("POINT EMPTY getCoordinateDimension", g->getCoordinateDimension(), 2);
 
     // POINT Z EMPTY
     g = readHex(std::string("0101000080000000000000F87F000000000000F87F000000000000F87F"));
-    ensure_equals("POINT Z EMPTY isEmpty", g->isEmpty(), 1);
+    ensure("POINT Z EMPTY isEmpty", g->isEmpty());
     ensure_equals("POINT Z EMPTY getCoordinateDimension", g->getCoordinateDimension(), 3);
 
     // LINESTRING EMPTY
     g = readHex(std::string("010200000000000000"));
-    ensure_equals("LINESTRING EMPTY isEmpty", g->isEmpty(), 1);
+    ensure("LINESTRING EMPTY isEmpty", g->isEmpty());
     ensure_equals("LINESTRING EMPTY getCoordinateDimension", g->getCoordinateDimension(), 2);
 
     // LINESTRING Z EMPTY
     g = readHex(std::string("010200008000000000"));
-    ensure_equals("LINESTRING Z EMPTY isEmpty", g->isEmpty(), 1);
+    ensure("LINESTRING Z EMPTY isEmpty", g->isEmpty());
     ensure_equals("LINESTRING Z EMPTY getCoordinateDimension", g->getCoordinateDimension(), 3);
 
     // POLYGON EMPTY
     g = readHex(std::string("010300000000000000"));
-    ensure_equals("POLYGON EMPTY isEmpty", g->isEmpty(), 1);
+    ensure("POLYGON EMPTY isEmpty", g->isEmpty());
     ensure_equals("POLYGON EMPTY getCoordinateDimension", g->getCoordinateDimension(), 2);
 
     // POLYGON Z EMPTY
     g = readHex(std::string("010300008000000000"));
-    ensure_equals("POLYGON Z EMPTY isEmpty", g->isEmpty(), 1);
+    ensure("POLYGON Z EMPTY isEmpty", g->isEmpty());
     ensure_equals("POLYGON Z EMPTY getCoordinateDimension", g->getCoordinateDimension(), 3);
 
 }

commit 1d110bf278253692659c6ac40e3cec6273539ba7
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sat Jan 30 20:51:06 2021 -0500

    Shrink EdgeSourceInfo

diff --git a/benchmarks/ClassSizes.cpp b/benchmarks/ClassSizes.cpp
index 86b2592..ea5dfc3 100644
--- a/benchmarks/ClassSizes.cpp
+++ b/benchmarks/ClassSizes.cpp
@@ -43,6 +43,9 @@
 #include <geos/triangulate/quadedge/QuadEdge.h>
 #include <geos/triangulate/quadedge/QuadEdgeQuartet.h>
 #include <geos/triangulate/quadedge/Vertex.h>
+#include <geos/operation/overlayng/Edge.h>
+#include <geos/operation/overlayng/EdgeSourceInfo.h>
+#include <geos/operation/overlayng/OverlayLabel.h>
 
 using namespace geos;
 
@@ -76,6 +79,9 @@ main()
     check(triangulate::quadedge::QuadEdge);
     check(triangulate::quadedge::QuadEdgeQuartet);
     check(triangulate::quadedge::Vertex);
+    check(operation::overlayng::Edge);
+    check(operation::overlayng::EdgeSourceInfo);
+    check(operation::overlayng::OverlayLabel);
     check(int64_t);
 }
 
diff --git a/include/geos/operation/overlayng/EdgeSourceInfo.h b/include/geos/operation/overlayng/EdgeSourceInfo.h
index a70678c..650dbd5 100644
--- a/include/geos/operation/overlayng/EdgeSourceInfo.h
+++ b/include/geos/operation/overlayng/EdgeSourceInfo.h
@@ -41,7 +41,7 @@ private:
 
     // Members
     uint8_t index;
-    int dim;
+    int8_t dim;
     bool edgeIsHole;
     int depthDelta;
 

commit b8e60bb2d84cc8ceab47ea3a2d93e6a3e4e8997a
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sat Jan 30 20:40:28 2021 -0500

    Mark some methods as static/const

diff --git a/include/geos/operation/overlayng/Edge.h b/include/geos/operation/overlayng/Edge.h
index a5f8c25..f51808d 100644
--- a/include/geos/operation/overlayng/Edge.h
+++ b/include/geos/operation/overlayng/Edge.h
@@ -90,7 +90,7 @@ private:
     * For line edges the line location is not significant
     * (since there is no parent area for which to determine location).
     */
-    void initLabel(OverlayLabel& lbl, uint8_t geomIndex, int dim, int depthDelta, bool p_isHole) const;
+    static void initLabel(OverlayLabel& lbl, uint8_t geomIndex, int dim, int depthDelta, bool p_isHole);
 
     static int labelDim(int dim, int depthDelta);
     bool isHole(int index) const;
diff --git a/include/geos/operation/overlayng/EdgeNodingBuilder.h b/include/geos/operation/overlayng/EdgeNodingBuilder.h
index ed32e23..e395113 100644
--- a/include/geos/operation/overlayng/EdgeNodingBuilder.h
+++ b/include/geos/operation/overlayng/EdgeNodingBuilder.h
@@ -112,7 +112,7 @@ private:
     *   In this case, a validation step is applied to the output from the noder.
     */
     Noder* getNoder();
-    std::unique_ptr<Noder> createFixedPrecisionNoder(const PrecisionModel* pm);
+    static std::unique_ptr<Noder> createFixedPrecisionNoder(const PrecisionModel* pm);
     std::unique_ptr<Noder> createFloatingPrecisionNoder(bool doValidation);
 
 
@@ -172,9 +172,9 @@ private:
     * @param line the line to process
     * @return the points of the line with repeated points removed
     */
-    std::unique_ptr<CoordinateArraySequence> removeRepeatedPoints(const LineString* line);
+    static std::unique_ptr<CoordinateArraySequence> removeRepeatedPoints(const LineString* line);
 
-    int computeDepthDelta(const LinearRing* ring, bool isHole);
+    static int computeDepthDelta(const LinearRing* ring, bool isHole);
 
     void add(const Geometry* g, uint8_t geomIndex);
 
diff --git a/include/geos/operation/overlayng/LineBuilder.h b/include/geos/operation/overlayng/LineBuilder.h
index 7194d74..58055e6 100644
--- a/include/geos/operation/overlayng/LineBuilder.h
+++ b/include/geos/operation/overlayng/LineBuilder.h
@@ -116,12 +116,12 @@ private:
     * (For instance, the intersection of line edge and a collapsed boundary
     * is included in the result).
     */
-    static geom::Location effectiveLocation(const OverlayLabel* lbl, uint8_t geomIndex) ;
+    static geom::Location effectiveLocation(const OverlayLabel* lbl, uint8_t geomIndex);
 
     void addResultLines();
     void addResultLinesMerged();
 
-    std::unique_ptr<geom::LineString> toLine(OverlayEdge* edge);
+    std::unique_ptr<geom::LineString> toLine(OverlayEdge* edge) const;
 
     void addResultLinesForNodes();
 
diff --git a/src/operation/overlayng/Edge.cpp b/src/operation/overlayng/Edge.cpp
index fdf5600..d31e257 100644
--- a/src/operation/overlayng/Edge.cpp
+++ b/src/operation/overlayng/Edge.cpp
@@ -73,7 +73,7 @@ Edge::isCollapsed(const CoordinateSequence* pts) {
 */
 /*private*/
 void
-Edge::initLabel(OverlayLabel& lbl, uint8_t geomIndex, int dim, int depthDelta, bool p_isHole) const
+Edge::initLabel(OverlayLabel& lbl, uint8_t geomIndex, int dim, int depthDelta, bool p_isHole)
 {
     int dimLabel = labelDim(dim, depthDelta);
 
diff --git a/src/operation/overlayng/EdgeKey.cpp b/src/operation/overlayng/EdgeKey.cpp
index 537a86f..ebc9d58 100644
--- a/src/operation/overlayng/EdgeKey.cpp
+++ b/src/operation/overlayng/EdgeKey.cpp
@@ -13,8 +13,6 @@
  **********************************************************************/
 
 #include <geos/operation/overlayng/EdgeKey.h>
-#include <geos/geom/Dimension.h>
-#include <geos/geom/CoordinateSequence.h>
 
 
 namespace geos {      // geos
diff --git a/src/operation/overlayng/LineBuilder.cpp b/src/operation/overlayng/LineBuilder.cpp
index e22eb66..2b9dada 100644
--- a/src/operation/overlayng/LineBuilder.cpp
+++ b/src/operation/overlayng/LineBuilder.cpp
@@ -177,7 +177,7 @@ LineBuilder::addResultLines()
 }
 
 std::unique_ptr<LineString>
-LineBuilder::toLine(OverlayEdge* edge)
+LineBuilder::toLine(OverlayEdge* edge) const
 {
     // bool isForward = edge->isForward();
     std::unique_ptr<CoordinateArraySequence> pts(new CoordinateArraySequence());

commit fa9cd1fa5a3d950c7324ab3e69af09195a07c310
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sat Jan 30 20:32:50 2021 -0500

    Clear clang warnings in OverlayNG

diff --git a/include/geos/operation/overlayng/Edge.h b/include/geos/operation/overlayng/Edge.h
index d5cc3e7..a5f8c25 100644
--- a/include/geos/operation/overlayng/Edge.h
+++ b/include/geos/operation/overlayng/Edge.h
@@ -90,7 +90,7 @@ private:
     * For line edges the line location is not significant
     * (since there is no parent area for which to determine location).
     */
-    void initLabel(OverlayLabel& lbl, int geomIndex, int dim, int depthDelta, bool isHole) const;
+    void initLabel(OverlayLabel& lbl, uint8_t geomIndex, int dim, int depthDelta, bool p_isHole) const;
 
     static int labelDim(int dim, int depthDelta);
     bool isHole(int index) const;
diff --git a/include/geos/operation/overlayng/EdgeNodingBuilder.h b/include/geos/operation/overlayng/EdgeNodingBuilder.h
index 44cc0d8..ed32e23 100644
--- a/include/geos/operation/overlayng/EdgeNodingBuilder.h
+++ b/include/geos/operation/overlayng/EdgeNodingBuilder.h
@@ -116,18 +116,18 @@ private:
     std::unique_ptr<Noder> createFloatingPrecisionNoder(bool doValidation);
 
 
-    void addCollection(const GeometryCollection* gc, int geomIndex);
-    void addGeometryCollection(const GeometryCollection* gc, int geomIndex, int expectedDim);
-    void addPolygon(const Polygon* poly, int geomIndex);
-    void addPolygonRing(const LinearRing* ring, bool isHole, int geomIndex);
-    void addLine(const LineString* line, int geomIndex);
-    void addLine(std::unique_ptr<CoordinateArraySequence>& pts, int geomIndex);
+    void addCollection(const GeometryCollection* gc, uint8_t geomIndex);
+    void addGeometryCollection(const GeometryCollection* gc, uint8_t geomIndex, int expectedDim);
+    void addPolygon(const Polygon* poly, uint8_t geomIndex);
+    void addPolygonRing(const LinearRing* ring, bool isHole, uint8_t geomIndex);
+    void addLine(const LineString* line, uint8_t geomIndex);
+    void addLine(std::unique_ptr<CoordinateArraySequence>& pts, uint8_t geomIndex);
     void addEdge(std::unique_ptr<std::vector<Coordinate>> pts, const EdgeSourceInfo* info);
     void addEdge(std::unique_ptr<CoordinateArraySequence>& cas, const EdgeSourceInfo* info);
 
     // Create a EdgeSourceInfo* owned by EdgeNodingBuilder
-    const EdgeSourceInfo* createEdgeSourceInfo(int index, int depthDelta, bool isHole);
-    const EdgeSourceInfo* createEdgeSourceInfo(int index);
+    const EdgeSourceInfo* createEdgeSourceInfo(uint8_t index, int depthDelta, bool isHole);
+    const EdgeSourceInfo* createEdgeSourceInfo(uint8_t index);
 
     /**
     * Tests whether a geometry (represented by its envelope)
@@ -176,7 +176,7 @@ private:
 
     int computeDepthDelta(const LinearRing* ring, bool isHole);
 
-    void add(const Geometry* g, int geomIndex);
+    void add(const Geometry* g, uint8_t geomIndex);
 
     /**
     * Nodes a set of segment strings and creates {@link Edge}s from the result.
@@ -226,7 +226,7 @@ public:
     * @param geomIndex index of input geometry
     * @return true if there are edges for the geometry
     */
-    bool hasEdgesFor(int geomIndex) const;
+    bool hasEdgesFor(uint8_t geomIndex) const;
 
     /**
     * Creates a set of labelled {Edge}s.
diff --git a/include/geos/operation/overlayng/EdgeSourceInfo.h b/include/geos/operation/overlayng/EdgeSourceInfo.h
index 43bade5..a70678c 100644
--- a/include/geos/operation/overlayng/EdgeSourceInfo.h
+++ b/include/geos/operation/overlayng/EdgeSourceInfo.h
@@ -40,7 +40,7 @@ class GEOS_DLL EdgeSourceInfo {
 private:
 
     // Members
-    int index;
+    uint8_t index;
     int dim;
     bool edgeIsHole;
     int depthDelta;
@@ -48,10 +48,10 @@ private:
 
 public:
 
-    EdgeSourceInfo(int p_index, int p_depthDelta, bool p_isHole);
-    EdgeSourceInfo(int p_index);
+    EdgeSourceInfo(uint8_t p_index, int p_depthDelta, bool p_isHole);
+    EdgeSourceInfo(uint8_t p_index);
 
-    int getIndex() const { return index; }
+    uint8_t getIndex() const { return index; }
     int getDimension() const { return dim; }
     int getDepthDelta() const { return depthDelta; }
     bool isHole() const { return edgeIsHole; }
diff --git a/include/geos/operation/overlayng/InputGeometry.h b/include/geos/operation/overlayng/InputGeometry.h
index 3cf46b3..862ac9f 100644
--- a/include/geos/operation/overlayng/InputGeometry.h
+++ b/include/geos/operation/overlayng/InputGeometry.h
@@ -58,13 +58,13 @@ public:
     InputGeometry(const Geometry* geomA, const Geometry* geomB);
 
     bool isSingle() const;
-    int getDimension(int index) const;
-    const Geometry* getGeometry(int geomIndex) const;
-    const Envelope* getEnvelope(int geomIndex) const;
-    bool isEmpty(int geomIndex) const;
-    bool isArea(int geomIndex) const;
+    int getDimension(uint8_t index) const;
+    const Geometry* getGeometry(uint8_t geomIndex) const;
+    const Envelope* getEnvelope(uint8_t geomIndex) const;
+    bool isEmpty(uint8_t geomIndex) const;
+    bool isArea(uint8_t geomIndex) const;
     int getAreaIndex() const;
-    bool isLine(int geomIndex) const;
+    bool isLine(uint8_t geomIndex) const;
     bool isAllPoints() const;
     bool hasPoints() const;
 
@@ -75,7 +75,7 @@ public:
     * @param geomIndex
     * @return true if the input geometry has edges
     */
-    bool hasEdges(int geomIndex) const;
+    bool hasEdges(uint8_t geomIndex) const;
 
     /**
     * Determines the location within an area geometry.
@@ -88,10 +88,10 @@ public:
     *
     * @see Location
     */
-    Location locatePointInArea(int geomIndex, const Coordinate& pt);
+    Location locatePointInArea(uint8_t geomIndex, const Coordinate& pt);
 
-    PointOnGeometryLocator* getLocator(int geomIndex);
-    void setCollapsed(int geomIndex, bool isGeomCollapsed);
+    PointOnGeometryLocator* getLocator(uint8_t geomIndex);
+    void setCollapsed(uint8_t geomIndex, bool isGeomCollapsed);
 
 
 };
diff --git a/include/geos/operation/overlayng/IntersectionPointBuilder.h b/include/geos/operation/overlayng/IntersectionPointBuilder.h
index 63637e6..90531c7 100644
--- a/include/geos/operation/overlayng/IntersectionPointBuilder.h
+++ b/include/geos/operation/overlayng/IntersectionPointBuilder.h
@@ -81,7 +81,7 @@ private:
     * inputs, and none of the edges are themselves in the result.
     */
     bool isResultPoint(OverlayEdge* nodeEdge) const;
-    bool isEdgeOf(const OverlayLabel* label, int i) const;
+    bool isEdgeOf(const OverlayLabel* label, uint8_t i) const;
 
 
 public:
diff --git a/include/geos/operation/overlayng/LineBuilder.h b/include/geos/operation/overlayng/LineBuilder.h
index f0a4a12..7194d74 100644
--- a/include/geos/operation/overlayng/LineBuilder.h
+++ b/include/geos/operation/overlayng/LineBuilder.h
@@ -116,7 +116,7 @@ private:
     * (For instance, the intersection of line edge and a collapsed boundary
     * is included in the result).
     */
-    geom::Location effectiveLocation(const OverlayLabel* lbl, int geomIndex) const;
+    static geom::Location effectiveLocation(const OverlayLabel* lbl, uint8_t geomIndex) ;
 
     void addResultLines();
     void addResultLinesMerged();
@@ -149,12 +149,12 @@ private:
     * Finds the next edge around a node which forms
     * part of a result line.
     */
-    OverlayEdge* nextLineEdgeUnvisited(OverlayEdge* node) const;
+    static OverlayEdge* nextLineEdgeUnvisited(OverlayEdge* node) ;
 
     /**
     * Computes the degree of the line edges incident on a node
     */
-    int degreeOfLines(OverlayEdge* node) const;
+    static int degreeOfLines(OverlayEdge* node) ;
 
 
 
diff --git a/include/geos/operation/overlayng/OverlayEdge.h b/include/geos/operation/overlayng/OverlayEdge.h
index 3ca8490..0f38b56 100644
--- a/include/geos/operation/overlayng/OverlayEdge.h
+++ b/include/geos/operation/overlayng/OverlayEdge.h
@@ -99,7 +99,7 @@ public:
 
     OverlayLabel* getLabel() const;
 
-    Location getLocation(int index, int position) const;
+    Location getLocation(uint8_t index, int position) const;
 
     const Coordinate& getCoordinate() const;
 
diff --git a/include/geos/operation/overlayng/OverlayEdge.inl b/include/geos/operation/overlayng/OverlayEdge.inl
index 0c70a98..8df2fa7 100644
--- a/include/geos/operation/overlayng/OverlayEdge.inl
+++ b/include/geos/operation/overlayng/OverlayEdge.inl
@@ -45,7 +45,7 @@ OverlayEdge::getLabel() const
 
 /*public*/
 INLINE Location
-OverlayEdge::getLocation(int index, int position) const
+OverlayEdge::getLocation(uint8_t index, int position) const
 {
     return label->getLocation(index, position, direction);
 }
diff --git a/include/geos/operation/overlayng/OverlayLabel.h b/include/geos/operation/overlayng/OverlayLabel.h
index 869682f..6738e1b 100644
--- a/include/geos/operation/overlayng/OverlayLabel.h
+++ b/include/geos/operation/overlayng/OverlayLabel.h
@@ -105,7 +105,7 @@ private:
 
 
     std::string dimensionSymbol(int dim) const;
-    void locationString(int index, bool isForward, std::ostream& os) const;
+    void locationString(uint8_t index, bool isForward, std::ostream& os) const;
 
 
 public:
@@ -132,23 +132,23 @@ public:
         , bLocRight(LOC_UNKNOWN)
         , bLocLine(LOC_UNKNOWN) {};
 
-    OverlayLabel(int p_index)
+    explicit OverlayLabel(uint8_t p_index)
         : OverlayLabel()
     {
         initLine(p_index);
     };
 
-    OverlayLabel(int p_index, Location p_locLeft, Location p_locRight, bool p_isHole)
+    OverlayLabel(uint8_t p_index, Location p_locLeft, Location p_locRight, bool p_isHole)
         : OverlayLabel()
     {
         initBoundary(p_index, p_locLeft, p_locRight, p_isHole);
     };
 
-    int dimension(int index) const { return index == 0 ? aDim : bDim; };
-    void initBoundary(int index, Location locLeft, Location locRight, bool p_isHole);
-    void initCollapse(int index, bool p_isHole);
-    void initLine(int index);
-    void initNotPart(int index);
+    int dimension(uint8_t index) const { return index == 0 ? aDim : bDim; };
+    void initBoundary(uint8_t index, Location locLeft, Location locRight, bool p_isHole);
+    void initCollapse(uint8_t index, bool p_isHole);
+    void initLine(uint8_t index);
+    void initNotPart(uint8_t index);
 
     /**
     * Sets the line location.
@@ -159,9 +159,9 @@ public:
     * @param index source to update
     * @param loc location to set
     */
-    void setLocationLine(int index, Location loc);
-    void setLocationAll(int index, Location loc);
-    void setLocationCollapse(int index);
+    void setLocationLine(uint8_t index, Location loc);
+    void setLocationAll(uint8_t index, Location loc);
+    void setLocationCollapse(uint8_t index);
 
     /*
     * Tests whether at least one of the sources is a Line.
@@ -169,10 +169,10 @@ public:
     * @return true if at least one source is a line
     */
     bool isLine() const;
-    bool isLine(int index) const;
-    bool isLinear(int index) const;
-    bool isKnown(int index) const;
-    bool isNotPart(int index) const;
+    bool isLine(uint8_t index) const;
+    bool isLinear(uint8_t index) const;
+    bool isKnown(uint8_t index) const;
+    bool isNotPart(uint8_t index) const;
     bool isBoundaryEither() const;
     bool isBoundaryBoth() const;
 
@@ -190,7 +190,7 @@ public:
     * area touch along their boundary.
     */
     bool isBoundaryTouch() const;
-    bool isBoundary(int index) const;
+    bool isBoundary(uint8_t index) const;
     bool isLineLocationUnknown(int index) const;
 
     /**
@@ -204,10 +204,10 @@ public:
     * @param index
     * @return
     */
-    bool isLineInArea(int index) const;
-    bool isHole(int index) const;
-    bool isCollapse(int index) const;
-    Location getLineLocation(int index) const;
+    bool isLineInArea(uint8_t index) const;
+    bool isHole(uint8_t index) const;
+    bool isCollapse(uint8_t index) const;
+    Location getLineLocation(uint8_t index) const;
 
     /**
     * Tests if a label is a Collapse has location INTERIOR,
@@ -227,7 +227,7 @@ public:
     * @param index source geometry
     * @return true if the label is a line and is interior
     */
-    bool isLineInterior(int index) const;
+    bool isLineInterior(uint8_t index) const;
 
     /**
     * Gets the location for this label for either
@@ -240,7 +240,7 @@ public:
     * @param isForward the direction for a boundary label
     * @return the location for the specified position
     */
-    Location getLocationBoundaryOrLine(int index, int position, bool isForward) const;
+    Location getLocationBoundaryOrLine(uint8_t index, int position, bool isForward) const;
 
     /**
     * Gets the linear location for the given source.
@@ -248,9 +248,9 @@ public:
     * @param index the source index
     * @return the linear location for the source
     */
-    Location getLocation(int index) const;
-    Location getLocation(int index, int position, bool isForward) const;
-    bool hasSides(int index) const;
+    Location getLocation(uint8_t index) const;
+    Location getLocation(uint8_t index, int position, bool isForward) const;
+    bool hasSides(uint8_t index) const;
 
     OverlayLabel copy() const;
 
diff --git a/include/geos/operation/overlayng/OverlayLabel.inl b/include/geos/operation/overlayng/OverlayLabel.inl
index 9c8bb9e..18a914e 100644
--- a/include/geos/operation/overlayng/OverlayLabel.inl
+++ b/include/geos/operation/overlayng/OverlayLabel.inl
@@ -27,14 +27,14 @@ OverlayLabel::isLine() const
 
 /*public*/
 INLINE bool
-OverlayLabel::isLine(int index) const
+OverlayLabel::isLine(uint8_t index) const
 {
     return index == 0 ? aDim == DIM_LINE : bDim == DIM_LINE;
 }
 
 /*public*/
 INLINE bool
-OverlayLabel::isLinear(int index) const
+OverlayLabel::isLinear(uint8_t index) const
 {
     if (index == 0) {
         return aDim == DIM_LINE || aDim == DIM_COLLAPSE;
@@ -44,7 +44,7 @@ OverlayLabel::isLinear(int index) const
 
 /*public*/
 INLINE bool
-OverlayLabel::isKnown(int index) const
+OverlayLabel::isKnown(uint8_t index) const
 {
     if (index == 0) {
         return aDim != DIM_UNKNOWN;
@@ -54,7 +54,7 @@ OverlayLabel::isKnown(int index) const
 
 /*public*/
 INLINE bool
-OverlayLabel::isNotPart(int index) const
+OverlayLabel::isNotPart(uint8_t index) const
 {
     if (index == 0) {
         return aDim == DIM_NOT_PART;
@@ -85,7 +85,7 @@ OverlayLabel::isBoundaryCollapse() const
 
 /*public*/
 INLINE bool
-OverlayLabel::isBoundary(int index) const
+OverlayLabel::isBoundary(uint8_t index) const
 {
     if (index == 0) {
         return aDim == DIM_BOUNDARY;
@@ -123,7 +123,7 @@ OverlayLabel::isLineLocationUnknown(int index) const
 
 /*public*/
 INLINE bool
-OverlayLabel::isLineInArea(int index) const
+OverlayLabel::isLineInArea(uint8_t index) const
 {
     if (index == 0) {
         return aLocLine == Location::INTERIOR;
@@ -133,7 +133,7 @@ OverlayLabel::isLineInArea(int index) const
 
 /*public*/
 INLINE bool
-OverlayLabel::isHole(int index) const
+OverlayLabel::isHole(uint8_t index) const
 {
     if (index == 0) {
         return aIsHole;
@@ -145,7 +145,7 @@ OverlayLabel::isHole(int index) const
 
 /*public*/
 INLINE bool
-OverlayLabel::isCollapse(int index) const
+OverlayLabel::isCollapse(uint8_t index) const
 {
     return dimension(index) == DIM_COLLAPSE;
 }
@@ -172,7 +172,7 @@ OverlayLabel::isBoundaryTouch() const
 
 /*public*/
 INLINE Location
-OverlayLabel::getLineLocation(int index) const
+OverlayLabel::getLineLocation(uint8_t index) const
 {
     if (index == 0) {
         return aLocLine;
@@ -184,7 +184,7 @@ OverlayLabel::getLineLocation(int index) const
 
 /*public*/
 INLINE bool
-OverlayLabel::isLineInterior(int index) const
+OverlayLabel::isLineInterior(uint8_t index) const
 {
     if (index == 0) {
         return aLocLine == Location::INTERIOR;
@@ -193,7 +193,7 @@ OverlayLabel::isLineInterior(int index) const
 }
 /*public*/
 INLINE Location
-OverlayLabel::getLocationBoundaryOrLine(int index, int pos, bool isForward) const
+OverlayLabel::getLocationBoundaryOrLine(uint8_t index, int pos, bool isForward) const
 {
     if (isBoundary(index)) {
         return getLocation(index, pos, isForward);
@@ -204,7 +204,7 @@ OverlayLabel::getLocationBoundaryOrLine(int index, int pos, bool isForward) cons
 
 /*public*/
 INLINE Location
-OverlayLabel::getLocation(int index) const {
+OverlayLabel::getLocation(uint8_t index) const {
     if (index == 0) {
         return aLocLine;
     }
@@ -213,7 +213,7 @@ OverlayLabel::getLocation(int index) const {
 
 /*public*/
 INLINE bool
-OverlayLabel::hasSides(int index) const {
+OverlayLabel::hasSides(uint8_t index) const {
     if (index == 0) {
         return aLocLeft != LOC_UNKNOWN
                || aLocRight != LOC_UNKNOWN;
diff --git a/include/geos/operation/overlayng/OverlayLabeller.h b/include/geos/operation/overlayng/OverlayLabeller.h
index 807626a..8a7359b 100644
--- a/include/geos/operation/overlayng/OverlayLabeller.h
+++ b/include/geos/operation/overlayng/OverlayLabeller.h
@@ -53,7 +53,7 @@ private:
     /**
     * Finds a boundary edge for this geom, if one exists.
     */
-    static OverlayEdge* findPropagationStartEdge(OverlayEdge* nodeEdge, int geomIndex);
+    static OverlayEdge* findPropagationStartEdge(OverlayEdge* nodeEdge, uint8_t geomIndex);
 
     /**
     * At this point collapsed edges with unknown location
@@ -81,7 +81,7 @@ private:
     * but may be more efficient and accurate to do it here.)
     */
     void labelCollapsedEdges();
-    static void labelCollapsedEdge(OverlayEdge* edge, int geomIndex);
+    static void labelCollapsedEdge(OverlayEdge* edge, uint8_t geomIndex);
 
     /**
     * There can be edges which have unknown location
@@ -89,15 +89,15 @@ private:
     * In this case line location is propagated to the connected edges.
     */
     void labelConnectedLinearEdges();
-    void propagateLinearLocations(int geomIndex);
-    static void propagateLinearLocationAtNode(OverlayEdge* eNode, int geomIndex, bool isInputLine, std::deque<OverlayEdge*>& edgeStack);
+    void propagateLinearLocations(uint8_t geomIndex);
+    static void propagateLinearLocationAtNode(OverlayEdge* eNode, uint8_t geomIndex, bool isInputLine, std::deque<OverlayEdge*>& edgeStack);
 
     /**
     * Finds all OverlayEdges which are linear
     * (i.e. line or collapsed) and have a known location
     * for the given input geometry.
     */
-    static std::vector<OverlayEdge*> findLinearEdgesWithLocation(std::vector<OverlayEdge*>& edges, int geomIndex);
+    static std::vector<OverlayEdge*> findLinearEdgesWithLocation(const std::vector<OverlayEdge *> &edges, uint8_t geomIndex);
 
     /**
     * At this point there may still be edges which have unknown location
@@ -123,7 +123,7 @@ private:
     * The location is determined by checking
     * if the edge lies inside the target geometry area (if any).
     */
-    void labelDisconnectedEdge(OverlayEdge* edge, int geomIndex);
+    void labelDisconnectedEdge(OverlayEdge* edge, uint8_t geomIndex);
 
     /**
     * Determines the {@link Location} for an edge within an Area geometry
@@ -134,7 +134,7 @@ private:
     * and precision reduction may cause incorrect results for edges
     * which are close enough to a boundary to become connected.
     */
-    geom::Location locateEdge(int geomIndex, OverlayEdge* edge);
+    geom::Location locateEdge(uint8_t geomIndex, OverlayEdge* edge);
 
     /**
     * Determines the {@link Location} for an edge within an Area geometry
@@ -147,7 +147,7 @@ private:
     * and precision reduction may cause incorrect results for edges
     * which are close enough to a boundary to become connected.
     */
-    geom::Location locateEdgeBothEnds(int geomIndex, OverlayEdge* edge);
+    geom::Location locateEdgeBothEnds(uint8_t geomIndex, OverlayEdge* edge);
 
     /**
     * Labels edges around nodes based on the arrangement
@@ -176,7 +176,7 @@ public:
     * for a given area geometry to all edges (and their sym)
     * with unknown locations for that geometry.
     */
-    void propagateAreaLocations(OverlayEdge* nodeEdge, int geomIndex);
+    void propagateAreaLocations(OverlayEdge* nodeEdge, uint8_t geomIndex);
 
     void markResultAreaEdges(int overlayOpCode);
 
diff --git a/src/operation/overlayng/Edge.cpp b/src/operation/overlayng/Edge.cpp
index 6d6066a..fdf5600 100644
--- a/src/operation/overlayng/Edge.cpp
+++ b/src/operation/overlayng/Edge.cpp
@@ -73,7 +73,7 @@ Edge::isCollapsed(const CoordinateSequence* pts) {
 */
 /*private*/
 void
-Edge::initLabel(OverlayLabel& lbl, int geomIndex, int dim, int depthDelta, bool p_isHole) const
+Edge::initLabel(OverlayLabel& lbl, uint8_t geomIndex, int dim, int depthDelta, bool p_isHole) const
 {
     int dimLabel = labelDim(dim, depthDelta);
 
diff --git a/src/operation/overlayng/EdgeNodingBuilder.cpp b/src/operation/overlayng/EdgeNodingBuilder.cpp
index 851ecf7..f4ba4ab 100644
--- a/src/operation/overlayng/EdgeNodingBuilder.cpp
+++ b/src/operation/overlayng/EdgeNodingBuilder.cpp
@@ -140,7 +140,7 @@ EdgeNodingBuilder::createEdges(std::vector<SegmentString*>* segStrings)
 
 /*public*/
 bool
-EdgeNodingBuilder::hasEdgesFor(int geomIndex) const
+EdgeNodingBuilder::hasEdgesFor(uint8_t geomIndex) const
 {
     assert(geomIndex >= 0 && geomIndex < 2);
     return hasEdges[geomIndex];
@@ -148,7 +148,7 @@ EdgeNodingBuilder::hasEdgesFor(int geomIndex) const
 
 /*private*/
 void
-EdgeNodingBuilder::add(const Geometry* g, int geomIndex)
+EdgeNodingBuilder::add(const Geometry* g, uint8_t geomIndex)
 {
     if (g == nullptr || g->isEmpty())
         return;
@@ -178,7 +178,7 @@ EdgeNodingBuilder::add(const Geometry* g, int geomIndex)
 
 /*private*/
 void
-EdgeNodingBuilder::addCollection(const GeometryCollection* gc, int geomIndex)
+EdgeNodingBuilder::addCollection(const GeometryCollection* gc, uint8_t geomIndex)
 {
     for (std::size_t i = 0; i < gc->getNumGeometries(); i++) {
         const Geometry* g = gc->getGeometryN(i);
@@ -188,7 +188,7 @@ EdgeNodingBuilder::addCollection(const GeometryCollection* gc, int geomIndex)
 
 /*private*/
 void
-EdgeNodingBuilder::addGeometryCollection(const GeometryCollection* gc, int geomIndex, int expectedDim)
+EdgeNodingBuilder::addGeometryCollection(const GeometryCollection* gc, uint8_t geomIndex, int expectedDim)
 {
     for (std::size_t i = 0; i < gc->getNumGeometries(); i++) {
         const Geometry* g = gc->getGeometryN(i);
@@ -201,7 +201,7 @@ EdgeNodingBuilder::addGeometryCollection(const GeometryCollection* gc, int geomI
 
 /*private*/
 void
-EdgeNodingBuilder::addPolygon(const Polygon* poly, int geomIndex)
+EdgeNodingBuilder::addPolygon(const Polygon* poly, uint8_t geomIndex)
 {
     const LinearRing* shell = poly->getExteriorRing();
     addPolygonRing(shell, false, geomIndex);
@@ -218,7 +218,7 @@ EdgeNodingBuilder::addPolygon(const Polygon* poly, int geomIndex)
 
 /*private*/
 void
-EdgeNodingBuilder::addPolygonRing(const LinearRing* ring, bool isHole, int index)
+EdgeNodingBuilder::addPolygonRing(const LinearRing* ring, bool isHole, uint8_t geomIndex)
   {
     // don't add empty rings
     if (ring->isEmpty()) return;
@@ -236,12 +236,12 @@ EdgeNodingBuilder::addPolygonRing(const LinearRing* ring, bool isHole, int index
     }
 
     int depthDelta = computeDepthDelta(ring, isHole);
-    addEdge(pts, createEdgeSourceInfo(index, depthDelta, isHole));
+    addEdge(pts, createEdgeSourceInfo(geomIndex, depthDelta, isHole));
 }
 
 /*private*/
 const EdgeSourceInfo*
-EdgeNodingBuilder::createEdgeSourceInfo(int index)
+EdgeNodingBuilder::createEdgeSourceInfo(uint8_t index)
 {
     // Concentrate small memory allocations via std::deque and
     // retain ownership of the EdgeSourceInfo* in the EdgeNodingBuilder
@@ -251,7 +251,7 @@ EdgeNodingBuilder::createEdgeSourceInfo(int index)
 
 /*private*/
 const EdgeSourceInfo*
-EdgeNodingBuilder::createEdgeSourceInfo(int index, int depthDelta, bool isHole)
+EdgeNodingBuilder::createEdgeSourceInfo(uint8_t index, int depthDelta, bool isHole)
 {
     // Concentrate small memory allocations via std::deque and
     // retain ownership of the EdgeSourceInfo* in the EdgeNodingBuilder
@@ -349,7 +349,7 @@ EdgeNodingBuilder::computeDepthDelta(const LinearRing* ring, bool isHole)
 
 /*private*/
 void
-EdgeNodingBuilder::addLine(const LineString* line, int geomIndex)
+EdgeNodingBuilder::addLine(const LineString* line, uint8_t geomIndex)
 {
     // don't add empty lines
     if (line->isEmpty()) return;
@@ -371,7 +371,7 @@ EdgeNodingBuilder::addLine(const LineString* line, int geomIndex)
 
 /*private*/
 void
-EdgeNodingBuilder::addLine(std::unique_ptr<CoordinateArraySequence>& pts, int geomIndex)
+EdgeNodingBuilder::addLine(std::unique_ptr<CoordinateArraySequence>& pts, uint8_t geomIndex)
 {
     /**
      * Don't add edges that collapse to a point
diff --git a/src/operation/overlayng/EdgeSourceInfo.cpp b/src/operation/overlayng/EdgeSourceInfo.cpp
index db6532f..d48f0e3 100644
--- a/src/operation/overlayng/EdgeSourceInfo.cpp
+++ b/src/operation/overlayng/EdgeSourceInfo.cpp
@@ -19,14 +19,14 @@ namespace operation { // geos.operation
 namespace overlayng { // geos.operation.overlayng
 
 
-EdgeSourceInfo::EdgeSourceInfo(int p_index, int p_depthDelta, bool p_isHole)
+EdgeSourceInfo::EdgeSourceInfo(uint8_t p_index, int p_depthDelta, bool p_isHole)
     : index(p_index)
     , dim(geom::Dimension::A)
     , edgeIsHole(p_isHole)
     , depthDelta(p_depthDelta)
     {}
 
-EdgeSourceInfo::EdgeSourceInfo(int p_index)
+EdgeSourceInfo::EdgeSourceInfo(uint8_t p_index)
     : index(p_index)
     , dim(geom::Dimension::L)
     , edgeIsHole(false)
diff --git a/src/operation/overlayng/InputGeometry.cpp b/src/operation/overlayng/InputGeometry.cpp
index 9df59e0..7949718 100644
--- a/src/operation/overlayng/InputGeometry.cpp
+++ b/src/operation/overlayng/InputGeometry.cpp
@@ -34,7 +34,7 @@ InputGeometry::isSingle() const
 
 /*public*/
 int
-InputGeometry::getDimension(int index) const
+InputGeometry::getDimension(uint8_t index) const
 {
     if (geom[index] == nullptr)
         return -1;
@@ -43,28 +43,28 @@ InputGeometry::getDimension(int index) const
 
 /*public*/
 const Geometry*
-InputGeometry::getGeometry(int geomIndex) const
+InputGeometry::getGeometry(uint8_t geomIndex) const
 {
     return geom[geomIndex];
 }
 
 /*public*/
 const Envelope*
-InputGeometry::getEnvelope(int geomIndex) const
+InputGeometry::getEnvelope(uint8_t geomIndex) const
 {
     return geom[geomIndex]->getEnvelopeInternal();
 }
 
 /*public*/
 bool
-InputGeometry::isEmpty(int geomIndex) const
+InputGeometry::isEmpty(uint8_t geomIndex) const
 {
     return geom[geomIndex]->isEmpty();
 }
 
 /*public*/
 bool
-InputGeometry::isArea(int geomIndex) const
+InputGeometry::isArea(uint8_t geomIndex) const
 {
     return geom[geomIndex] != nullptr && geom[geomIndex]->getDimension() == 2;
 }
@@ -89,7 +89,7 @@ InputGeometry::getAreaIndex() const
 
 /*public*/
 bool
-InputGeometry::isLine(int geomIndex) const
+InputGeometry::isLine(uint8_t geomIndex) const
 {
     return getDimension(geomIndex) == 1;
 }
@@ -118,7 +118,7 @@ InputGeometry::hasPoints() const
 */
 /*public*/
 bool
-InputGeometry::hasEdges(int geomIndex) const
+InputGeometry::hasEdges(uint8_t geomIndex) const
 {
     return geom[geomIndex] != nullptr && geom[geomIndex]->getDimension() > 0;
 }
@@ -136,7 +136,7 @@ InputGeometry::hasEdges(int geomIndex) const
 */
 /*public*/
 Location
-InputGeometry::locatePointInArea(int geomIndex, const Coordinate& pt)
+InputGeometry::locatePointInArea(uint8_t geomIndex, const Coordinate& pt)
 {
     if (isCollapsed[geomIndex] || getGeometry(geomIndex)->isEmpty())
         return Location::EXTERIOR;
@@ -149,7 +149,7 @@ InputGeometry::locatePointInArea(int geomIndex, const Coordinate& pt)
 
 /*private*/
 PointOnGeometryLocator*
-InputGeometry::getLocator(int geomIndex)
+InputGeometry::getLocator(uint8_t geomIndex)
 {
     if (geomIndex == 0) {
         if (ptLocatorA == nullptr)
@@ -166,7 +166,7 @@ InputGeometry::getLocator(int geomIndex)
 
 /*public*/
 void
-InputGeometry::setCollapsed(int geomIndex, bool isGeomCollapsed)
+InputGeometry::setCollapsed(uint8_t geomIndex, bool isGeomCollapsed)
 {
     isCollapsed[geomIndex] = isGeomCollapsed;
 }
diff --git a/src/operation/overlayng/IntersectionPointBuilder.cpp b/src/operation/overlayng/IntersectionPointBuilder.cpp
index fed278a..dc41e44 100644
--- a/src/operation/overlayng/IntersectionPointBuilder.cpp
+++ b/src/operation/overlayng/IntersectionPointBuilder.cpp
@@ -73,7 +73,7 @@ IntersectionPointBuilder::isResultPoint(OverlayEdge* nodeEdge) const
 
 /*private*/
 bool
-IntersectionPointBuilder::isEdgeOf(const OverlayLabel* label, int i) const
+IntersectionPointBuilder::isEdgeOf(const OverlayLabel* label, uint8_t i) const
 {
     if (!isAllowCollapseLines && label->isBoundaryCollapse()) {
         return false;
diff --git a/src/operation/overlayng/LineBuilder.cpp b/src/operation/overlayng/LineBuilder.cpp
index 06e0dcc..e22eb66 100644
--- a/src/operation/overlayng/LineBuilder.cpp
+++ b/src/operation/overlayng/LineBuilder.cpp
@@ -112,7 +112,8 @@ LineBuilder::isResultLine(const OverlayLabel* lbl) const
         * because if line edges are present then there is only one input area,
         * and the result area must be the same as the input area.
         */
-        if (hasResultArea && lbl->isLineInArea(inputAreaIndex))
+        assert(inputAreaIndex == 0 || inputAreaIndex == 1);
+        if (hasResultArea && lbl->isLineInArea(static_cast<uint8_t>(inputAreaIndex)))
             return false;
     }
 
@@ -138,7 +139,7 @@ LineBuilder::isResultLine(const OverlayLabel* lbl) const
 
 /*private*/
 Location
-LineBuilder::effectiveLocation(const OverlayLabel* lbl, int geomIndex) const
+LineBuilder::effectiveLocation(const OverlayLabel* lbl, uint8_t geomIndex)
 {
     if (lbl->isCollapse(geomIndex)) {
         return Location::INTERIOR;
@@ -269,7 +270,7 @@ LineBuilder::buildLine(OverlayEdge* node)
 
 /*private*/
 OverlayEdge*
-LineBuilder::nextLineEdgeUnvisited(OverlayEdge* node) const
+LineBuilder::nextLineEdgeUnvisited(OverlayEdge* node)
 {
     OverlayEdge* e = node;
     do {
@@ -287,7 +288,7 @@ LineBuilder::nextLineEdgeUnvisited(OverlayEdge* node) const
 
 /*private*/
 int
-LineBuilder::degreeOfLines(OverlayEdge* node) const
+LineBuilder::degreeOfLines(OverlayEdge* node)
 {
     int degree = 0;
     OverlayEdge* e = node;
diff --git a/src/operation/overlayng/OverlayEdge.cpp b/src/operation/overlayng/OverlayEdge.cpp
index 15a95bb..7c92765 100644
--- a/src/operation/overlayng/OverlayEdge.cpp
+++ b/src/operation/overlayng/OverlayEdge.cpp
@@ -53,7 +53,7 @@ OverlayEdge::addCoordinates(CoordinateArraySequence* coords) const
 {
     bool isFirstEdge = coords->size() > 0;
     if (direction) {
-        int startIndex = 1;
+        std::size_t startIndex = 1;
         if (isFirstEdge) {
             startIndex = 0;
         }
@@ -67,7 +67,7 @@ OverlayEdge::addCoordinates(CoordinateArraySequence* coords) const
             startIndex = (int)(pts->size()) - 1;
         }
         for (int i = startIndex; i >= 0; i--) {
-            coords->add(pts->getAt(i), false);
+            coords->add(pts->getAt(static_cast<std::size_t>(i)), false);
         }
     }
 }
diff --git a/src/operation/overlayng/OverlayLabel.cpp b/src/operation/overlayng/OverlayLabel.cpp
index cb9167a..0f73fc8 100644
--- a/src/operation/overlayng/OverlayLabel.cpp
+++ b/src/operation/overlayng/OverlayLabel.cpp
@@ -24,7 +24,7 @@ namespace overlayng { // geos.operation.overlayng
 
 /*public*/
 void
-OverlayLabel::initBoundary(int index, Location locLeft, Location locRight, bool p_isHole)
+OverlayLabel::initBoundary(uint8_t index, Location locLeft, Location locRight, bool p_isHole)
 {
     if (index == 0) {
         aDim = DIM_BOUNDARY;
@@ -44,7 +44,7 @@ OverlayLabel::initBoundary(int index, Location locLeft, Location locRight, bool
 
 /*public*/
 void
-OverlayLabel::initCollapse(int index, bool p_isHole)
+OverlayLabel::initCollapse(uint8_t index, bool p_isHole)
 {
     if (index == 0) {
         aDim = DIM_COLLAPSE;
@@ -58,7 +58,7 @@ OverlayLabel::initCollapse(int index, bool p_isHole)
 
 /*public*/
 void
-OverlayLabel::initLine(int index)
+OverlayLabel::initLine(uint8_t index)
 {
     if (index == 0) {
         aDim = DIM_LINE;
@@ -72,7 +72,7 @@ OverlayLabel::initLine(int index)
 
 /*public*/
 void
-OverlayLabel::initNotPart(int index)
+OverlayLabel::initNotPart(uint8_t index)
 {
     // this assumes locations are initialized to UNKNOWN
     if (index == 0) {
@@ -85,7 +85,7 @@ OverlayLabel::initNotPart(int index)
 
 /*public*/
 void
-OverlayLabel::setLocationLine(int index, Location loc)
+OverlayLabel::setLocationLine(uint8_t index, Location loc)
 {
     if (index == 0) {
         aLocLine = loc;
@@ -97,7 +97,7 @@ OverlayLabel::setLocationLine(int index, Location loc)
 
 /*public*/
 void
-OverlayLabel::setLocationAll(int index, Location loc)
+OverlayLabel::setLocationAll(uint8_t index, Location loc)
 {
     if (index == 0) {
         aLocLine = loc;
@@ -113,7 +113,7 @@ OverlayLabel::setLocationAll(int index, Location loc)
 
 /*public*/
 void
-OverlayLabel::setLocationCollapse(int index)
+OverlayLabel::setLocationCollapse(uint8_t index)
 {
     Location loc = isHole(index) ? Location::INTERIOR : Location::EXTERIOR;
     if (index == 0) {
@@ -144,7 +144,7 @@ OverlayLabel::isCollapseAndNotPartInterior() const
 
 /*public*/
 Location
-OverlayLabel::getLocation(int index, int position, bool isForward) const
+OverlayLabel::getLocation(uint8_t index, int position, bool isForward) const
 {
     if (index == 0) {
         switch (position) {
@@ -201,7 +201,7 @@ OverlayLabel::toString(bool isForward, std::ostream& os) const
 
 /*private*/
 void
-OverlayLabel::locationString(int index, bool isForward, std::ostream& os) const
+OverlayLabel::locationString(uint8_t index, bool isForward, std::ostream& os) const
 {
     if (isBoundary(index)) {
         os << getLocation(index, Position::LEFT, isForward);
diff --git a/src/operation/overlayng/OverlayLabeller.cpp b/src/operation/overlayng/OverlayLabeller.cpp
index 5b78768..28d8fa2 100644
--- a/src/operation/overlayng/OverlayLabeller.cpp
+++ b/src/operation/overlayng/OverlayLabeller.cpp
@@ -65,7 +65,7 @@ OverlayLabeller::labelAreaNodeEdges(std::vector<OverlayEdge*>& nodes)
 
 /*public*/
 void
-OverlayLabeller::propagateAreaLocations(OverlayEdge* nodeEdge, int geomIndex)
+OverlayLabeller::propagateAreaLocations(OverlayEdge* nodeEdge, uint8_t geomIndex)
 {
     /*
      * Only propagate for area geometries
@@ -121,7 +121,7 @@ OverlayLabeller::propagateAreaLocations(OverlayEdge* nodeEdge, int geomIndex)
 
 /*private*/
 OverlayEdge*
-OverlayLabeller::findPropagationStartEdge(OverlayEdge* nodeEdge, int geomIndex)
+OverlayLabeller::findPropagationStartEdge(OverlayEdge* nodeEdge, uint8_t geomIndex)
 {
     OverlayEdge* eStart = nodeEdge;
     do {
@@ -151,7 +151,7 @@ OverlayLabeller::labelCollapsedEdges()
 
 /*private*/
 void
-OverlayLabeller::labelCollapsedEdge(OverlayEdge* edge, int geomIndex)
+OverlayLabeller::labelCollapsedEdge(OverlayEdge* edge, uint8_t geomIndex)
 {
     OverlayLabel* label = edge->getLabel();
     if (! label->isCollapse(geomIndex))
@@ -177,7 +177,7 @@ OverlayLabeller::labelConnectedLinearEdges()
 
 /*private*/
 void
-OverlayLabeller::propagateLinearLocations(int geomIndex)
+OverlayLabeller::propagateLinearLocations(uint8_t geomIndex)
 {
     std::vector<OverlayEdge*> linearEdges = findLinearEdgesWithLocation(edges, geomIndex);
     if (linearEdges.empty()) return;
@@ -199,8 +199,8 @@ OverlayLabeller::propagateLinearLocations(int geomIndex)
 /*private static*/
 void
 OverlayLabeller::propagateLinearLocationAtNode(OverlayEdge* eNode,
-    int geomIndex, bool isInputLine,
-    std::deque<OverlayEdge*>& edgeStack)
+                                               uint8_t geomIndex, bool isInputLine,
+                                               std::deque<OverlayEdge*>& edgeStack)
 {
     Location lineLoc = eNode->getLabel()->getLineLocation(geomIndex);
     /**
@@ -232,7 +232,7 @@ OverlayLabeller::propagateLinearLocationAtNode(OverlayEdge* eNode,
 
 /*private static*/
 std::vector<OverlayEdge*>
-OverlayLabeller::findLinearEdgesWithLocation(std::vector<OverlayEdge*>& edges, int geomIndex)
+OverlayLabeller::findLinearEdgesWithLocation(const std::vector<OverlayEdge*>& edges, uint8_t geomIndex)
 {
     std::vector<OverlayEdge*> linearEdges;
     for (OverlayEdge* edge : edges) {
@@ -261,7 +261,7 @@ OverlayLabeller::labelDisconnectedEdges()
 
 /*private*/
 void
-OverlayLabeller::labelDisconnectedEdge(OverlayEdge* edge, int geomIndex)
+OverlayLabeller::labelDisconnectedEdge(OverlayEdge* edge, uint8_t geomIndex)
 {
     OverlayLabel* label = edge->getLabel();
 
@@ -289,7 +289,7 @@ OverlayLabeller::labelDisconnectedEdge(OverlayEdge* edge, int geomIndex)
 
 /*private*/
 Location
-OverlayLabeller::locateEdge(int geomIndex, OverlayEdge* edge)
+OverlayLabeller::locateEdge(uint8_t geomIndex, OverlayEdge* edge)
 {
     Location loc = inputGeometry->locatePointInArea(geomIndex, edge->orig());
     Location edgeLoc = loc != Location::EXTERIOR ? Location::INTERIOR : Location::EXTERIOR;
@@ -298,7 +298,7 @@ OverlayLabeller::locateEdge(int geomIndex, OverlayEdge* edge)
 
 /*private*/
 Location
-OverlayLabeller::locateEdgeBothEnds(int geomIndex, OverlayEdge* edge)
+OverlayLabeller::locateEdgeBothEnds(uint8_t geomIndex, OverlayEdge* edge)
 {
     /*
     * To improve the robustness of the point location,

commit aa52b3cab65291f3eb2fc69fcd100d9b42d4e59a
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sat Jan 30 20:32:35 2021 -0500

    Clear clang warnings

diff --git a/include/geos/planargraph/DirectedEdgeStar.h b/include/geos/planargraph/DirectedEdgeStar.h
index 919d316..7714e26 100644
--- a/include/geos/planargraph/DirectedEdgeStar.h
+++ b/include/geos/planargraph/DirectedEdgeStar.h
@@ -131,7 +131,7 @@ public:
      * \brief Returns the remainder when i is divided by the number of
      * edges in this DirectedEdgeStar.
      */
-    int getIndex(int i) const;
+    unsigned int getIndex(int i) const;
 
     /**
      * \brief Returns the DirectedEdge on the left-hand side
diff --git a/src/planargraph/DirectedEdgeStar.cpp b/src/planargraph/DirectedEdgeStar.cpp
index 91bec1b..13d0737 100644
--- a/src/planargraph/DirectedEdgeStar.cpp
+++ b/src/planargraph/DirectedEdgeStar.cpp
@@ -151,7 +151,7 @@ DirectedEdgeStar::getIndex(const DirectedEdge* dirEdge)
     for(unsigned int i = 0; i < outEdges.size(); ++i) {
         DirectedEdge* de = outEdges[i];
         if(de == dirEdge) {
-            return i;
+            return static_cast<int>(i);
         }
     }
     return -1;
@@ -161,7 +161,7 @@ DirectedEdgeStar::getIndex(const DirectedEdge* dirEdge)
  * Returns the remainder when i is divided by the number of edges in this
  * DirectedEdgeStar.
  */
-int
+unsigned int
 DirectedEdgeStar::getIndex(int i) const
 {
     int modi = i % (int)outEdges.size();
@@ -169,7 +169,7 @@ DirectedEdgeStar::getIndex(int i) const
     if(modi < 0) {
         modi += (int)outEdges.size();
     }
-    return modi;
+    return static_cast<unsigned int>(modi);
 }
 
 /*
diff --git a/src/precision/CommonBits.cpp b/src/precision/CommonBits.cpp
index dd93626..e5d004e 100644
--- a/src/precision/CommonBits.cpp
+++ b/src/precision/CommonBits.cpp
@@ -55,7 +55,7 @@ CommonBits::zeroLowerBits(int64_t bits, int nBits)
 int
 CommonBits::getBit(int64_t bits, int i)
 {
-    int64_t mask = (1ull << i);
+    int64_t mask = static_cast<int64_t>(1ull << i);
     return (bits & mask) != 0 ? 1 : 0;
 }
 
diff --git a/src/shape/fractal/MortonCode.cpp b/src/shape/fractal/MortonCode.cpp
index bf1715a..820b09a 100644
--- a/src/shape/fractal/MortonCode.cpp
+++ b/src/shape/fractal/MortonCode.cpp
@@ -89,7 +89,7 @@ MortonCode::checkLevel(uint32_t level)
 uint32_t
 MortonCode::encode(int x, int y)
 {
-    return (interleave(y) << 1) + interleave(x);
+    return (interleave(static_cast<uint32_t>(y)) << 1) + interleave(static_cast<uint32_t>(x));
 }
 
 uint32_t

commit 0e4e0db82bb4ab331139b32876dbb72e1ed4ea56
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sat Jan 30 19:56:49 2021 -0500

    Mark some methods/parameters const/static

diff --git a/include/geos/operation/overlayng/OverlayEdge.h b/include/geos/operation/overlayng/OverlayEdge.h
index 02b8515..3ca8490 100644
--- a/include/geos/operation/overlayng/OverlayEdge.h
+++ b/include/geos/operation/overlayng/OverlayEdge.h
@@ -118,7 +118,7 @@ public:
     *
     * @param coords the coordinate list to add to
     */
-    void addCoordinates(CoordinateArraySequence* coords);
+    void addCoordinates(CoordinateArraySequence* coords) const;
 
     OverlayEdge* symOE() const;
     OverlayEdge* oNextOE() const;
diff --git a/include/geos/operation/overlayng/OverlayEdgeRing.h b/include/geos/operation/overlayng/OverlayEdgeRing.h
index 0c2058c..2c4fa4d 100644
--- a/include/geos/operation/overlayng/OverlayEdgeRing.h
+++ b/include/geos/operation/overlayng/OverlayEdgeRing.h
@@ -141,7 +141,7 @@ public:
     * @return containing EdgeRing, if there is one
     * or null if no containing EdgeRing is found
     */
-    OverlayEdgeRing* findEdgeRingContaining(std::vector<OverlayEdgeRing*>& erList);
+    OverlayEdgeRing* findEdgeRingContaining(const std::vector<OverlayEdgeRing*>& erList);
 
 
 };
diff --git a/include/geos/operation/overlayng/OverlayLabeller.h b/include/geos/operation/overlayng/OverlayLabeller.h
index 342d63b..807626a 100644
--- a/include/geos/operation/overlayng/OverlayLabeller.h
+++ b/include/geos/operation/overlayng/OverlayLabeller.h
@@ -81,7 +81,7 @@ private:
     * but may be more efficient and accurate to do it here.)
     */
     void labelCollapsedEdges();
-    void labelCollapsedEdge(OverlayEdge* edge, int geomIndex);
+    static void labelCollapsedEdge(OverlayEdge* edge, int geomIndex);
 
     /**
     * There can be edges which have unknown location
@@ -187,7 +187,7 @@ public:
     * The relevant location is either the right side of a boundary edge,
     * or the line location of a non-boundary edge.
     */
-    void markInResultArea(OverlayEdge* e, int overlayOpCode);
+    static void markInResultArea(OverlayEdge* e, int overlayOpCode);
 
     /**
     * Unmarks result area edges where the sym edge
diff --git a/include/geos/operation/overlayng/PolygonBuilder.h b/include/geos/operation/overlayng/PolygonBuilder.h
index d3e363c..9e820fc 100644
--- a/include/geos/operation/overlayng/PolygonBuilder.h
+++ b/include/geos/operation/overlayng/PolygonBuilder.h
@@ -55,17 +55,17 @@ private:
     // Storage
     std::vector<std::unique_ptr<OverlayEdgeRing>> vecOER;
 
-    std::vector<std::unique_ptr<geom::Polygon>> computePolygons(std::vector<OverlayEdgeRing*> shellList);
+    std::vector<std::unique_ptr<geom::Polygon>> computePolygons(const std::vector<OverlayEdgeRing*>& shellList) const;
 
-    void buildRings(std::vector<OverlayEdge*>& resultAreaEdges);
+    void buildRings(const std::vector<OverlayEdge*>& resultAreaEdges);
 
-    void linkResultAreaEdgesMax(std::vector<OverlayEdge*>& resultEdges);
+    static void linkResultAreaEdgesMax(const std::vector<OverlayEdge*>& resultEdges);
 
     /**
     * For all OverlayEdge*s in result, form them into MaximalEdgeRings
     */
-    std::vector<std::unique_ptr<MaximalEdgeRing>>
-        buildMaximalRings(std::vector<OverlayEdge*>& edges);
+    static std::vector<std::unique_ptr<MaximalEdgeRing>>
+        buildMaximalRings(const std::vector<OverlayEdge *> &edges);
 
     /**
     * The lifespan of the OverlayEdgeRings is tieds to the lifespan
@@ -74,9 +74,9 @@ private:
     */
     std::vector<OverlayEdgeRing*> storeMinimalRings(std::vector<std::unique_ptr<OverlayEdgeRing>>& minRings);
 
-    void buildMinimalRings(std::vector<std::unique_ptr<MaximalEdgeRing>>& maxRings);
+    void buildMinimalRings(const std::vector<std::unique_ptr<MaximalEdgeRing>>& maxRings);
 
-    void assignShellsAndHoles(std::vector<OverlayEdgeRing*>& minRings);
+    void assignShellsAndHoles(const std::vector<OverlayEdgeRing *> &minRings);
 
     /**
     * Finds the single shell, if any, out of
@@ -87,7 +87,7 @@ private:
     * @return the shell ring, if there is one
     * or null, if all rings are holes
     */
-    OverlayEdgeRing* findSingleShell(std::vector<OverlayEdgeRing*>& edgeRings) const;
+    static OverlayEdgeRing* findSingleShell(const std::vector<OverlayEdgeRing *> &edgeRings) ;
 
     /**
     * For the set of minimal rings comprising a maximal ring,
@@ -99,7 +99,7 @@ private:
     * chosen might lie on the shell, which might return an incorrect result from the
     * PIP test
     */
-    void assignHoles(OverlayEdgeRing* shell, std::vector<OverlayEdgeRing*>& edgeRings);
+    static void assignHoles(OverlayEdgeRing* shell, const std::vector<OverlayEdgeRing *> &edgeRings);
 
 
     /**
@@ -114,7 +114,7 @@ private:
     *
     * @throws TopologyException if a hole cannot be assigned to a shell
     */
-    void placeFreeHoles(std::vector<OverlayEdgeRing*> shellList, std::vector<OverlayEdgeRing*> freeHoleList);
+    void placeFreeHoles(const std::vector<OverlayEdgeRing*> & shellList, const std::vector<OverlayEdgeRing*>& freeHoleList) const;
 
 
 
@@ -138,8 +138,8 @@ public:
     PolygonBuilder& operator=(const PolygonBuilder&) = delete;
 
     // Methods
-    std::vector<std::unique_ptr<geom::Polygon>> getPolygons();
-    std::vector<OverlayEdgeRing*> getShellRings();
+    std::vector<std::unique_ptr<geom::Polygon>> getPolygons() const;
+    std::vector<OverlayEdgeRing*> getShellRings() const;
 
 
 };
diff --git a/src/operation/overlayng/OverlayEdge.cpp b/src/operation/overlayng/OverlayEdge.cpp
index 025bc10..15a95bb 100644
--- a/src/operation/overlayng/OverlayEdge.cpp
+++ b/src/operation/overlayng/OverlayEdge.cpp
@@ -49,7 +49,7 @@ OverlayEdge::getCoordinatesOriented()
 */
 /*public*/
 void
-OverlayEdge::addCoordinates(CoordinateArraySequence* coords)
+OverlayEdge::addCoordinates(CoordinateArraySequence* coords) const
 {
     bool isFirstEdge = coords->size() > 0;
     if (direction) {
diff --git a/src/operation/overlayng/OverlayEdgeRing.cpp b/src/operation/overlayng/OverlayEdgeRing.cpp
index 4fead2c..0949c2d 100644
--- a/src/operation/overlayng/OverlayEdgeRing.cpp
+++ b/src/operation/overlayng/OverlayEdgeRing.cpp
@@ -188,7 +188,7 @@ OverlayEdgeRing::getCoordinates()
 */
 /*public*/
 OverlayEdgeRing*
-OverlayEdgeRing::findEdgeRingContaining(std::vector<OverlayEdgeRing*>& erList)
+OverlayEdgeRing::findEdgeRingContaining(const std::vector<OverlayEdgeRing*>& erList)
 {
     const LinearRing* testRing = ring.get();
     const Envelope* testEnv = testRing->getEnvelopeInternal();
diff --git a/src/operation/overlayng/OverlayLabeller.cpp b/src/operation/overlayng/OverlayLabeller.cpp
index 89032de..5b78768 100644
--- a/src/operation/overlayng/OverlayLabeller.cpp
+++ b/src/operation/overlayng/OverlayLabeller.cpp
@@ -180,7 +180,7 @@ void
 OverlayLabeller::propagateLinearLocations(int geomIndex)
 {
     std::vector<OverlayEdge*> linearEdges = findLinearEdgesWithLocation(edges, geomIndex);
-    if (linearEdges.size() <= 0) return;
+    if (linearEdges.empty()) return;
 
     std::deque<OverlayEdge*> edgeStack;
     edgeStack.insert(edgeStack.begin(), linearEdges.begin(), linearEdges.end());
@@ -274,7 +274,7 @@ OverlayLabeller::labelDisconnectedEdge(OverlayEdge* edge, int geomIndex)
     if (!inputGeometry->isArea(geomIndex)) {
         label->setLocationAll(geomIndex, Location::EXTERIOR);
         return;
-    };
+    }
 
     /**
     * Locate edge in input area using a Point-In-Poly check.
diff --git a/src/operation/overlayng/OverlayNG.cpp b/src/operation/overlayng/OverlayNG.cpp
index 0fe848f..5bfd524 100644
--- a/src/operation/overlayng/OverlayNG.cpp
+++ b/src/operation/overlayng/OverlayNG.cpp
@@ -286,7 +286,7 @@ OverlayNG::extractResult(int p_opCode, OverlayGraph* graph)
     std::vector<OverlayEdge*> resultAreaEdges = graph->getResultAreaEdges();
     PolygonBuilder polyBuilder(resultAreaEdges, geomFact);
     std::vector<std::unique_ptr<Polygon>> resultPolyList = polyBuilder.getPolygons();
-    bool hasResultAreaComponents = resultPolyList.size() > 0;
+    bool hasResultAreaComponents = (!resultPolyList.empty());
 
     std::vector<std::unique_ptr<LineString>> resultLineList;
     std::vector<std::unique_ptr<Point>> resultPointList;
@@ -308,7 +308,7 @@ OverlayNG::extractResult(int p_opCode, OverlayGraph* graph)
          * Only an intersection op can produce point results
          * from non-point inputs.
          */
-        bool hasResultComponents = hasResultAreaComponents || resultLineList.size() > 0;
+        bool hasResultComponents = hasResultAreaComponents || (!resultLineList.empty());
         bool allowResultPoints = ! hasResultComponents || isAllowMixedIntResult;
         if (opCode == INTERSECTION && allowResultPoints) {
             IntersectionPointBuilder pointBuilder(graph, geomFact);
@@ -317,9 +317,9 @@ OverlayNG::extractResult(int p_opCode, OverlayGraph* graph)
         }
     }
 
-    if (resultPolyList.size() == 0 &&
-        resultLineList.size() == 0 &&
-        resultPointList.size() == 0)
+    if (resultPolyList.empty() &&
+        resultLineList.empty() &&
+        resultPointList.empty())
     {
         return createEmptyResult();
     }
diff --git a/src/operation/overlayng/PolygonBuilder.cpp b/src/operation/overlayng/PolygonBuilder.cpp
index cfe4d52..31f16ba 100644
--- a/src/operation/overlayng/PolygonBuilder.cpp
+++ b/src/operation/overlayng/PolygonBuilder.cpp
@@ -28,21 +28,21 @@ namespace overlayng { // geos.operation.overlayng
 
 /*public*/
 std::vector<std::unique_ptr<Polygon>>
-PolygonBuilder::getPolygons()
+PolygonBuilder::getPolygons() const
 {
     return computePolygons(shellList);
 }
 
 /*public*/
 std::vector<OverlayEdgeRing*>
-PolygonBuilder::getShellRings()
+PolygonBuilder::getShellRings() const
 {
     return shellList;
 }
 
 /*private*/
 std::vector<std::unique_ptr<Polygon>>
-PolygonBuilder::computePolygons(std::vector<OverlayEdgeRing*> shells)
+PolygonBuilder::computePolygons(const std::vector<OverlayEdgeRing*>& shells) const
 {
     std::vector<std::unique_ptr<Polygon>> resultPolyList;
     // add Polygons for all shells
@@ -55,7 +55,7 @@ PolygonBuilder::computePolygons(std::vector<OverlayEdgeRing*> shells)
 
 /*private*/
 void
-PolygonBuilder::buildRings(std::vector<OverlayEdge*>& resultAreaEdges)
+PolygonBuilder::buildRings(const std::vector<OverlayEdge*>& resultAreaEdges)
 {
     linkResultAreaEdgesMax(resultAreaEdges);
     std::vector<std::unique_ptr<MaximalEdgeRing>> maxRings = buildMaximalRings(resultAreaEdges);
@@ -65,7 +65,7 @@ PolygonBuilder::buildRings(std::vector<OverlayEdge*>& resultAreaEdges)
 
 /*private*/
 void
-PolygonBuilder::linkResultAreaEdgesMax(std::vector<OverlayEdge*>& resultEdges)
+PolygonBuilder::linkResultAreaEdgesMax(const std::vector<OverlayEdge*>& resultEdges)
 {
     for (OverlayEdge* edge : resultEdges) {
         // TODO: find some way to skip nodes which are already linked
@@ -75,7 +75,7 @@ PolygonBuilder::linkResultAreaEdgesMax(std::vector<OverlayEdge*>& resultEdges)
 
 /*private*/
 std::vector<std::unique_ptr<MaximalEdgeRing>>
-PolygonBuilder::buildMaximalRings(std::vector<OverlayEdge*>& edges)
+PolygonBuilder::buildMaximalRings(const std::vector<OverlayEdge*>& edges)
 {
     std::vector<std::unique_ptr<MaximalEdgeRing>> edgeRings;
     for (OverlayEdge* e : edges) {
@@ -104,7 +104,7 @@ PolygonBuilder::storeMinimalRings(std::vector<std::unique_ptr<OverlayEdgeRing>>&
 
 /*private*/
 void
-PolygonBuilder::buildMinimalRings(std::vector<std::unique_ptr<MaximalEdgeRing>>& maxRings)
+PolygonBuilder::buildMinimalRings(const std::vector<std::unique_ptr<MaximalEdgeRing>>& maxRings)
 {
     for (auto& erMax : maxRings) {
         auto minRings = erMax->buildMinimalRings(geometryFactory);
@@ -115,7 +115,7 @@ PolygonBuilder::buildMinimalRings(std::vector<std::unique_ptr<MaximalEdgeRing>>&
 
 /*private*/
 void
-PolygonBuilder::assignShellsAndHoles(std::vector<OverlayEdgeRing*>& minRings)
+PolygonBuilder::assignShellsAndHoles(const std::vector<OverlayEdgeRing*> &minRings)
 {
     /**
     * Two situations may occur:
@@ -137,7 +137,7 @@ PolygonBuilder::assignShellsAndHoles(std::vector<OverlayEdgeRing*>& minRings)
 
 /*private*/
 OverlayEdgeRing*
-PolygonBuilder::findSingleShell(std::vector<OverlayEdgeRing*>& edgeRings) const
+PolygonBuilder::findSingleShell(const std::vector<OverlayEdgeRing*> &edgeRings)
 {
     std::size_t shellCount = 0;
     OverlayEdgeRing* shell = nullptr;
@@ -153,7 +153,7 @@ PolygonBuilder::findSingleShell(std::vector<OverlayEdgeRing*>& edgeRings) const
 
 /*private*/
 void
-PolygonBuilder::assignHoles(OverlayEdgeRing* shell, std::vector<OverlayEdgeRing*>& edgeRings)
+PolygonBuilder::assignHoles(OverlayEdgeRing* shell, const std::vector<OverlayEdgeRing*> &edgeRings)
 {
     for (auto er : edgeRings) {
         if (er->isHole()) {
@@ -164,7 +164,7 @@ PolygonBuilder::assignHoles(OverlayEdgeRing* shell, std::vector<OverlayEdgeRing*
 
 /*private*/
 void
-PolygonBuilder::placeFreeHoles(std::vector<OverlayEdgeRing*> shells, std::vector<OverlayEdgeRing*> freeHoles)
+PolygonBuilder::placeFreeHoles(const std::vector<OverlayEdgeRing*>& shells, const std::vector<OverlayEdgeRing*> & freeHoles) const
 {
     // TODO: use a spatial index to improve performance
     for (OverlayEdgeRing* hole : freeHoles) {

commit d3e7be57885620ef6eb87315aaba56e5455d40f8
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sat Jan 30 12:31:21 2021 -0500

    Clear clang warnings

diff --git a/include/geos/geomgraph/Depth.h b/include/geos/geomgraph/Depth.h
index 736432f..f222aa4 100644
--- a/include/geos/geomgraph/Depth.h
+++ b/include/geos/geomgraph/Depth.h
@@ -49,8 +49,8 @@ public:
     geom::Location getLocation(int geomIndex, int posIndex) const;
     void add(int geomIndex, int posIndex, geom::Location location);
     bool isNull() const;
-    bool isNull(int geomIndex) const;
-    bool isNull(int geomIndex, int posIndex) const;
+    bool isNull(uint8_t geomIndex) const;
+    bool isNull(uint8_t geomIndex, uint8_t posIndex) const;
     int getDelta(int geomIndex) const;
     void normalize();
     void add(const Label& lbl);
diff --git a/include/geos/geomgraph/Depth.inl b/include/geos/geomgraph/Depth.inl
index dac6d4a..78f93fd 100644
--- a/include/geos/geomgraph/Depth.inl
+++ b/include/geos/geomgraph/Depth.inl
@@ -98,13 +98,13 @@ Depth::isNull() const
 }
 
 INLINE bool
-Depth::isNull(int geomIndex) const
+Depth::isNull(uint8_t geomIndex) const
 {
     return depth[geomIndex][1] == NULL_VALUE;
 }
 
 INLINE bool
-Depth::isNull(int geomIndex, int posIndex) const
+Depth::isNull(uint8_t geomIndex, uint8_t posIndex) const
 {
     return depth[geomIndex][posIndex] == NULL_VALUE;
 }
diff --git a/include/geos/geomgraph/EdgeList.h b/include/geos/geomgraph/EdgeList.h
index bf6597a..7aa22a0 100644
--- a/include/geos/geomgraph/EdgeList.h
+++ b/include/geos/geomgraph/EdgeList.h
@@ -105,7 +105,7 @@ public:
 
     Edge* findEqualEdge(const Edge* e) const;
 
-    Edge* get(int i);
+    Edge* get(std::size_t i);
 
     int findEdgeIndex(const Edge* e) const;
 
diff --git a/include/geos/geomgraph/EdgeRing.h b/include/geos/geomgraph/EdgeRing.h
index fa0312b..84c5cc0 100644
--- a/include/geos/geomgraph/EdgeRing.h
+++ b/include/geos/geomgraph/EdgeRing.h
@@ -162,7 +162,7 @@ protected:
      * information to the overall labelling, and is
      * simply skipped.
      */
-    void mergeLabel(const Label& deLabel, int geomIndex);
+    void mergeLabel(const Label& deLabel, uint8_t geomIndex);
 
     void addPoints(Edge* edge, bool isForward, bool isFirstEdge);
 
diff --git a/include/geos/geomgraph/GeometryGraph.h b/include/geos/geomgraph/GeometryGraph.h
index c0cbca3..961e480 100644
--- a/include/geos/geomgraph/GeometryGraph.h
+++ b/include/geos/geomgraph/GeometryGraph.h
@@ -101,7 +101,7 @@ private:
      * the index of this geometry as an argument to a spatial function
      * (used for labelling)
      */
-    int argIndex;
+    uint8_t argIndex;
 
     /// Cache for fast responses to getBoundaryPoints
     std::unique_ptr< geom::CoordinateSequence > boundaryPoints;
@@ -129,7 +129,7 @@ private:
 
     void addLineString(const geom::LineString* line);
 
-    void insertPoint(int argIndex, const geom::Coordinate& coord,
+    void insertPoint(uint8_t p_argIndex, const geom::Coordinate& coord,
                      geom::Location onLocation);
 
     /** \brief
@@ -139,9 +139,9 @@ private:
      * This is used to add the boundary
      * points of dim-1 geometries (Curves/MultiCurves).
      */
-    void insertBoundaryPoint(int argIndex, const geom::Coordinate& coord);
+    void insertBoundaryPoint(uint8_t p_argIndex, const geom::Coordinate& coord);
 
-    void addSelfIntersectionNodes(int argIndex);
+    void addSelfIntersectionNodes(uint8_t p_argIndex);
 
     /** \brief
      * Add a node for a self-intersection.
@@ -150,7 +150,7 @@ private:
      * which is a boundary) then insert it as a potential boundary node.
      * Otherwise, just add it as a regular node.
      */
-    void addSelfIntersectionNode(int argIndex,
+    void addSelfIntersectionNode(uint8_t p_argIndex,
                                  const geom::Coordinate& coord, geom::Location loc);
 
     // Declare type as noncopyable
@@ -167,11 +167,9 @@ public:
         const algorithm::BoundaryNodeRule& boundaryNodeRule,
         int boundaryCount);
 
-    GeometryGraph();
+    GeometryGraph(uint8_t newArgIndex, const geom::Geometry* newParentGeom);
 
-    GeometryGraph(int newArgIndex, const geom::Geometry* newParentGeom);
-
-    GeometryGraph(int newArgIndex, const geom::Geometry* newParentGeom,
+    GeometryGraph(uint8_t newArgIndex, const geom::Geometry* newParentGeom,
                   const algorithm::BoundaryNodeRule& boundaryNodeRule);
 
     ~GeometryGraph() override;
diff --git a/include/geos/geomgraph/GeometryGraph.inl b/include/geos/geomgraph/GeometryGraph.inl
index 18a53c3..fcd44ee 100644
--- a/include/geos/geomgraph/GeometryGraph.inl
+++ b/include/geos/geomgraph/GeometryGraph.inl
@@ -29,7 +29,7 @@ namespace geomgraph { // geos::geomgraph
 INLINE void
 GeometryGraph::getBoundaryNodes(std::vector<Node*>& bdyNodes)
 {
-    nodes->getBoundaryNodes(argIndex, bdyNodes);
+    nodes->getBoundaryNodes(static_cast<uint8_t>(argIndex), bdyNodes);
 }
 
 INLINE const geom::Geometry*
diff --git a/include/geos/geomgraph/Node.h b/include/geos/geomgraph/Node.h
index 5297711..a5fe39d 100644
--- a/include/geos/geomgraph/Node.h
+++ b/include/geos/geomgraph/Node.h
@@ -92,13 +92,13 @@ public:
      */
     virtual void mergeLabel(const Label& label2);
 
-    virtual void setLabel(int argIndex, geom::Location onLocation);
+    virtual void setLabel(uint8_t argIndex, geom::Location onLocation);
 
     /** \brief
      * Updates the label of a node to BOUNDARY,
      * obeying the mod-2 boundaryDetermination rule.
      */
-    virtual void setLabelBoundary(int argIndex);
+    virtual void setLabelBoundary(uint8_t argIndex);
 
     /**
      * The location for a given eltIndex for a node will be one
@@ -108,7 +108,7 @@ public:
      * in the boundary.
      * The merged location is the maximum of the two input values.
      */
-    virtual geom::Location computeMergedLocation(const Label& label2, int eltIndex);
+    virtual geom::Location computeMergedLocation(const Label& label2, uint8_t eltIndex);
 
     virtual std::string print();
 
diff --git a/include/geos/geomgraph/NodeMap.h b/include/geos/geomgraph/NodeMap.h
index 31bb597..3a2b85d 100644
--- a/include/geos/geomgraph/NodeMap.h
+++ b/include/geos/geomgraph/NodeMap.h
@@ -102,7 +102,7 @@ public:
         return nodeMap.end();
     }
 
-    void getBoundaryNodes(int geomIndex,
+    void getBoundaryNodes(uint8_t geomIndex,
                           std::vector<Node*>& bdyNodes) const;
 
     std::string print() const;
diff --git a/include/geos/geomgraph/PlanarGraph.h b/include/geos/geomgraph/PlanarGraph.h
index 374b7fa..67f145e 100644
--- a/include/geos/geomgraph/PlanarGraph.h
+++ b/include/geos/geomgraph/PlanarGraph.h
@@ -112,7 +112,7 @@ public:
 
     virtual std::vector<EdgeEnd*>* getEdgeEnds();
 
-    virtual bool isBoundaryNode(int geomIndex, const geom::Coordinate& coord);
+    virtual bool isBoundaryNode(uint8_t geomIndex, const geom::Coordinate& coord);
 
     virtual void add(EdgeEnd* e);
 
diff --git a/include/geos/operation/overlay/LineBuilder.h b/include/geos/operation/overlay/LineBuilder.h
index 0db0a66..3c09f73 100644
--- a/include/geos/operation/overlay/LineBuilder.h
+++ b/include/geos/operation/overlay/LineBuilder.h
@@ -118,7 +118,7 @@ private:
     /**
      * Label an isolated node with its relationship to the target geometry.
      */
-    void labelIsolatedLine(geomgraph::Edge* e, int targetIndex);
+    void labelIsolatedLine(geomgraph::Edge* e, uint8_t targetIndex);
 
     /*
      * If the given CoordinateSequence has mixed 3d/2d vertexes
diff --git a/include/geos/operation/overlay/OverlayOp.h b/include/geos/operation/overlay/OverlayOp.h
index 3f34525..3912ab7 100644
--- a/include/geos/operation/overlay/OverlayOp.h
+++ b/include/geos/operation/overlay/OverlayOp.h
@@ -264,7 +264,7 @@ private:
      * but in the original arg Geometry it is actually
      * in the interior due to the Boundary Determination Rule)
      */
-    void copyPoints(int argIndex, const geom::Envelope* env = nullptr);
+    void copyPoints(uint8_t argIndex, const geom::Envelope* env = nullptr);
 
     /** \brief
      * Compute initial labelling for all DirectedEdges at each node.
@@ -309,7 +309,7 @@ private:
     /** \brief
      * Label an isolated node with its relationship to the target geometry.
      */
-    void labelIncompleteNode(geomgraph::Node* n, int targetIndex);
+    void labelIncompleteNode(geomgraph::Node* n, uint8_t targetIndex);
 
     /** \brief
      * Find all edges whose label indicates that they are in the result
@@ -389,7 +389,7 @@ private:
     double avgz[2];
     bool avgzcomputed[2];
 
-    double getAverageZ(int targetIndex);
+    double getAverageZ(uint8_t targetIndex);
     static double getAverageZ(const geom::Polygon* poly);
 
     ElevationMatrix* elevationMatrix;
diff --git a/include/geos/operation/relate/EdgeEndBundle.h b/include/geos/operation/relate/EdgeEndBundle.h
index bc573b8..383da8c 100644
--- a/include/geos/operation/relate/EdgeEndBundle.h
+++ b/include/geos/operation/relate/EdgeEndBundle.h
@@ -93,11 +93,11 @@ protected:
      *  - otherwise, the attribute is NULL.
      *
      */
-    void computeLabelOn(int geomIndex,
+    void computeLabelOn(uint8_t geomIndex,
                         const algorithm::BoundaryNodeRule& boundaryNodeRule);
 
-    void computeLabelSides(int geomIndex);
-    void computeLabelSide(int geomIndex, int side);
+    void computeLabelSides(uint8_t geomIndex);
+    void computeLabelSide(uint8_t geomIndex, uint32_t side);
 };
 
 } // namespace geos:operation:relate
diff --git a/include/geos/operation/relate/RelateComputer.h b/include/geos/operation/relate/RelateComputer.h
index f904510..8cc0f84 100644
--- a/include/geos/operation/relate/RelateComputer.h
+++ b/include/geos/operation/relate/RelateComputer.h
@@ -103,9 +103,9 @@ private:
         geomgraph::index::SegmentIntersector* intersector,
         geom::IntersectionMatrix* imX);
 
-    void copyNodesAndLabels(int argIndex);
-    void computeIntersectionNodes(int argIndex);
-    void labelIntersectionNodes(int argIndex);
+    void copyNodesAndLabels(uint8_t argIndex);
+    void computeIntersectionNodes(uint8_t argIndex);
+    void labelIntersectionNodes(uint8_t argIndex);
 
     /**
      * If the Geometries are disjoint, we need to enter their dimension and
@@ -128,7 +128,7 @@ private:
      * did, they would have caused an intersection to be computed and hence would
      * not be isolated)
      */
-    void labelIsolatedEdges(int thisIndex, int targetIndex);
+    void labelIsolatedEdges(uint8_t thisIndex, uint8_t targetIndex);
 
     /**
      * Label an isolated edge of a graph with its relationship to the target
@@ -137,7 +137,7 @@ private:
      * or the exterior.
      * If the target has dim 0, the edge must be in the exterior
      */
-    void labelIsolatedEdge(geomgraph::Edge* e, int targetIndex,
+    void labelIsolatedEdge(geomgraph::Edge* e, uint8_t targetIndex,
                            const geom::Geometry* target);
 
     /**
@@ -154,7 +154,7 @@ private:
     /**
      * Label an isolated node with its relationship to the target geometry.
      */
-    void labelIsolatedNode(geomgraph::Node* n, int targetIndex);
+    void labelIsolatedNode(geomgraph::Node* n, uint8_t targetIndex);
 };
 
 
diff --git a/include/geos/operation/relate/RelateNodeGraph.h b/include/geos/operation/relate/RelateNodeGraph.h
index a6b92b7..4ca311c 100644
--- a/include/geos/operation/relate/RelateNodeGraph.h
+++ b/include/geos/operation/relate/RelateNodeGraph.h
@@ -78,9 +78,9 @@ public:
     void build(geomgraph::GeometryGraph* geomGraph);
 
     void computeIntersectionNodes(geomgraph::GeometryGraph* geomGraph,
-                                  int argIndex);
+                                  uint8_t argIndex);
 
-    void copyNodesAndLabels(geomgraph::GeometryGraph* geomGraph, int argIndex);
+    void copyNodesAndLabels(geomgraph::GeometryGraph* geomGraph, uint8_t argIndex);
 
     void insertEdgeEnds(std::vector<geomgraph::EdgeEnd*>* ee);
 
diff --git a/include/geos/planargraph/Edge.h b/include/geos/planargraph/Edge.h
index 506a744..1ffee03 100644
--- a/include/geos/planargraph/Edge.h
+++ b/include/geos/planargraph/Edge.h
@@ -23,6 +23,7 @@
 #include <vector> // for typedefs
 #include <set> // for typedefs
 #include <iosfwd> // ostream
+#include <cstdint>
 
 #ifdef _MSC_VER
 #pragma warning(push)
diff --git a/src/geomgraph/Depth.cpp b/src/geomgraph/Depth.cpp
index fe497fa..3801c18 100644
--- a/src/geomgraph/Depth.cpp
+++ b/src/geomgraph/Depth.cpp
@@ -45,7 +45,7 @@ namespace geomgraph { // geos.geomgraph
 void
 Depth::normalize()
 {
-    for(int i = 0; i < 2; i++) {
+    for(uint8_t i = 0; i < 2; i++) {
         if(!isNull(i)) {
             int minDepth = depth[i][1];
             if(depth[i][2] < minDepth) {
@@ -68,8 +68,8 @@ Depth::normalize()
 void
 Depth::add(const Label& lbl)
 {
-    for(uint32_t i = 0; i < 2; i++) {
-        for(uint32_t j = 1; j < 3; j++) {
+    for(uint8_t i = 0; i < 2; i++) {
+        for(uint8_t j = 1; j < 3; j++) {
             Location loc = lbl.getLocation(i, j);
             if(loc == Location::EXTERIOR || loc == Location::INTERIOR) {
                 // initialize depth if it is null, otherwise
diff --git a/src/geomgraph/EdgeEndStar.cpp b/src/geomgraph/EdgeEndStar.cpp
index 156aca6..daeb6b3 100644
--- a/src/geomgraph/EdgeEndStar.cpp
+++ b/src/geomgraph/EdgeEndStar.cpp
@@ -143,20 +143,17 @@ EdgeEndStar::computeLabelling(std::vector<GeometryGraph*>* geomGraph)
      */
     bool hasDimensionalCollapseEdge[2] = {false, false};
 
-    EdgeEndStar::iterator endIt = end();
-    for(EdgeEndStar::iterator it = begin(); it != endIt; ++it) {
-        EdgeEnd* e = *it;
+    for(EdgeEnd* e : *this) {
         assert(e);
         const Label& label = e->getLabel();
-        for(int geomi = 0; geomi < 2; geomi++) {
+        for(uint8_t geomi = 0; geomi < 2; geomi++) {
             if(label.isLine(geomi) && label.getLocation(geomi) == Location::BOUNDARY) {
                 hasDimensionalCollapseEdge[geomi] = true;
             }
         }
     }
 
-    for(EdgeEndStar::iterator it = begin(); it != end(); ++it) {
-        EdgeEnd* e = *it;
+    for(EdgeEnd* e : *this) {
         assert(e);
         Label& label = e->getLabel();
         for(uint32_t geomi = 0; geomi < 2; ++geomi) {
diff --git a/src/geomgraph/EdgeList.cpp b/src/geomgraph/EdgeList.cpp
index eb5a0c8..d609235 100644
--- a/src/geomgraph/EdgeList.cpp
+++ b/src/geomgraph/EdgeList.cpp
@@ -84,7 +84,7 @@ EdgeList::findEqualEdge(const Edge* e) const
 }
 
 Edge*
-EdgeList::get(int i)
+EdgeList::get(std::size_t i)
 {
     return edges[i];
 }
@@ -97,9 +97,9 @@ EdgeList::get(int i)
 int
 EdgeList::findEdgeIndex(const Edge* e) const
 {
-    for(int i = 0, s = (int)edges.size(); i < s; ++i) {
+    for(std::size_t i = 0; i < edges.size(); ++i) {
         if(edges[i]->equals(e)) {
-            return i;
+            return static_cast<int>(i);
         }
     }
     return -1;
@@ -128,8 +128,8 @@ EdgeList::print()
 void
 EdgeList::clearList()
 {
-    for(unsigned int pos = 0; pos < edges.size(); pos++) {
-        delete edges[pos];
+    for(auto & edge : edges) {
+        delete edge;
     }
 
     edges.clear();
diff --git a/src/geomgraph/EdgeRing.cpp b/src/geomgraph/EdgeRing.cpp
index 80566ff..6481ed0 100644
--- a/src/geomgraph/EdgeRing.cpp
+++ b/src/geomgraph/EdgeRing.cpp
@@ -285,7 +285,7 @@ EdgeRing::mergeLabel(const Label& deLabel)
 
 /*protected*/
 void
-EdgeRing::mergeLabel(const Label& deLabel, int geomIndex)
+EdgeRing::mergeLabel(const Label& deLabel, uint8_t geomIndex)
 {
 
     testInvariant();
diff --git a/src/geomgraph/GeometryGraph.cpp b/src/geomgraph/GeometryGraph.cpp
index 2d7d824..e7286c0 100644
--- a/src/geomgraph/GeometryGraph.cpp
+++ b/src/geomgraph/GeometryGraph.cpp
@@ -429,7 +429,7 @@ GeometryGraph::computeEdgeIntersections(GeometryGraph* g,
 }
 
 void
-GeometryGraph::insertPoint(int p_argIndex, const Coordinate& coord,
+GeometryGraph::insertPoint(uint8_t p_argIndex, const Coordinate &coord,
                            geom::Location onLocation)
 {
 #if GEOS_DEBUG > 1
@@ -452,7 +452,7 @@ GeometryGraph::insertPoint(int p_argIndex, const Coordinate& coord,
  * iff if it is in the boundaries of an odd number of Geometries
  */
 void
-GeometryGraph::insertBoundaryPoint(int p_argIndex, const Coordinate& coord)
+GeometryGraph::insertBoundaryPoint(uint8_t p_argIndex, const Coordinate &coord)
 {
     Node* n = nodes->addNode(coord);
     // nodes always have labels
@@ -475,11 +475,9 @@ GeometryGraph::insertBoundaryPoint(int p_argIndex, const Coordinate& coord)
 
 /*private*/
 void
-GeometryGraph::addSelfIntersectionNodes(int p_argIndex)
+GeometryGraph::addSelfIntersectionNodes(uint8_t p_argIndex)
 {
-    for(std::vector<Edge*>::iterator i = edges->begin(), endIt = edges->end();
-            i != endIt; ++i) {
-        Edge* e = *i;
+    for(Edge* e : *edges) {
         Location eLoc = e->getLabel().getLocation(p_argIndex);
         EdgeIntersectionList& eiL = e->eiList;
         for(const EdgeIntersection& ei : eiL) {
@@ -491,8 +489,8 @@ GeometryGraph::addSelfIntersectionNodes(int p_argIndex)
 
 /*private*/
 void
-GeometryGraph::addSelfIntersectionNode(int p_argIndex,
-                                       const Coordinate& coord, Location loc)
+GeometryGraph::addSelfIntersectionNode(uint8_t p_argIndex,
+                                       const Coordinate &coord, Location loc)
 {
     // if this node is already a boundary node, don't change it
     if(isBoundaryNode(p_argIndex, coord)) {
@@ -524,7 +522,7 @@ GeometryGraph::getInvalidPoint()
     return invalidPoint;
 }
 
-GeometryGraph::GeometryGraph(int newArgIndex,
+GeometryGraph::GeometryGraph(uint8_t newArgIndex,
                              const geom::Geometry* newParentGeom)
     :
     PlanarGraph(),
@@ -539,7 +537,7 @@ GeometryGraph::GeometryGraph(int newArgIndex,
     }
 }
 
-GeometryGraph::GeometryGraph(int newArgIndex,
+GeometryGraph::GeometryGraph(uint8_t newArgIndex,
                              const geom::Geometry* newParentGeom,
                              const algorithm::BoundaryNodeRule& bnr)
     :
@@ -555,18 +553,6 @@ GeometryGraph::GeometryGraph(int newArgIndex,
     }
 }
 
-GeometryGraph::GeometryGraph()
-    :
-    PlanarGraph(),
-    parentGeom(nullptr),
-    useBoundaryDeterminationRule(true),
-    boundaryNodeRule(algorithm::BoundaryNodeRule::getBoundaryOGCSFS()),
-    argIndex(-1),
-    hasTooFewPointsVar(false)
-{
-}
-
-
 /* public static */
 Location
 GeometryGraph::determineBoundary(
diff --git a/src/geomgraph/Node.cpp b/src/geomgraph/Node.cpp
index 7b0214e..458e95b 100644
--- a/src/geomgraph/Node.cpp
+++ b/src/geomgraph/Node.cpp
@@ -173,7 +173,7 @@ Node::mergeLabel(const Node& n)
 void
 Node::mergeLabel(const Label& label2)
 {
-    for(int i = 0; i < 2; i++) {
+    for(uint8_t i = 0; i < 2; i++) {
         Location loc = computeMergedLocation(label2, i);
         Location thisLoc = label.getLocation(i);
         if(thisLoc == Location::NONE) {
@@ -185,7 +185,7 @@ Node::mergeLabel(const Label& label2)
 
 /*public*/
 void
-Node::setLabel(int argIndex, Location onLocation)
+Node::setLabel(uint8_t argIndex, Location onLocation)
 {
     if(label.isNull()) {
         label = Label(argIndex, onLocation);
@@ -199,7 +199,7 @@ Node::setLabel(int argIndex, Location onLocation)
 
 /*public*/
 void
-Node::setLabelBoundary(int argIndex)
+Node::setLabelBoundary(uint8_t argIndex)
 {
     Location loc = label.getLocation(argIndex);
     // flip the loc
@@ -222,7 +222,7 @@ Node::setLabelBoundary(int argIndex)
 
 /*public*/
 Location
-Node::computeMergedLocation(const Label& label2, int eltIndex)
+Node::computeMergedLocation(const Label& label2, uint8_t eltIndex)
 {
     Location loc = label.getLocation(eltIndex);
     if(!label2.isNull(eltIndex)) {
diff --git a/src/geomgraph/NodeMap.cpp b/src/geomgraph/NodeMap.cpp
index 56548ae..2175f15 100644
--- a/src/geomgraph/NodeMap.cpp
+++ b/src/geomgraph/NodeMap.cpp
@@ -139,7 +139,7 @@ NodeMap::find(const Coordinate& coord) const
 }
 
 void
-NodeMap::getBoundaryNodes(int geomIndex, std::vector<Node*>& bdyNodes) const
+NodeMap::getBoundaryNodes(uint8_t geomIndex, std::vector<Node*>& bdyNodes) const
 {
     for(auto& it: nodeMap) {
         Node* node = it.second;
diff --git a/src/geomgraph/PlanarGraph.cpp b/src/geomgraph/PlanarGraph.cpp
index d344147..b9eb545 100644
--- a/src/geomgraph/PlanarGraph.cpp
+++ b/src/geomgraph/PlanarGraph.cpp
@@ -107,7 +107,7 @@ PlanarGraph::getEdgeEnds()
 
 /*public*/
 bool
-PlanarGraph::isBoundaryNode(int geomIndex, const Coordinate& coord)
+PlanarGraph::isBoundaryNode(uint8_t geomIndex, const Coordinate& coord)
 {
     assert(nodes);
 
diff --git a/src/noding/NodingIntersectionFinder.cpp b/src/noding/NodingIntersectionFinder.cpp
index ffa55ff..eb1ad19 100644
--- a/src/noding/NodingIntersectionFinder.cpp
+++ b/src/noding/NodingIntersectionFinder.cpp
@@ -79,7 +79,7 @@ NodingIntersectionFinder::processIntersections(
     /**
      * Check for an intersection between two vertices which are not both endpoints.
      */
-    long long segDiff = segIndex1 - segIndex0;
+    long long segDiff = static_cast<long long>(segIndex1 - segIndex0);
     bool isAdjacentSegment = isSameSegString && std::abs(segDiff) <= 1;
     bool isInteriorVertexInt = (!isAdjacentSegment) &&
                                isInteriorVertexIntersection(p00, p01, p10, p11, isEnd00, isEnd01, isEnd10, isEnd11);
diff --git a/src/operation/overlay/LineBuilder.cpp b/src/operation/overlay/LineBuilder.cpp
index d7b7707..ac791f6 100644
--- a/src/operation/overlay/LineBuilder.cpp
+++ b/src/operation/overlay/LineBuilder.cpp
@@ -295,7 +295,7 @@ LineBuilder::labelIsolatedLines(std::vector<Edge*>* edgesList)
  * Label an isolated node with its relationship to the target geometry.
  */
 void
-LineBuilder::labelIsolatedLine(Edge* e, int targetIndex)
+LineBuilder::labelIsolatedLine(Edge* e, uint8_t targetIndex)
 {
     Location loc = ptLocator->locate(e->getCoordinate(),
                                 op->getArgGeometry(targetIndex));
diff --git a/src/operation/overlay/OverlayOp.cpp b/src/operation/overlay/OverlayOp.cpp
index cfcd342..a046e45 100644
--- a/src/operation/overlay/OverlayOp.cpp
+++ b/src/operation/overlay/OverlayOp.cpp
@@ -233,7 +233,7 @@ OverlayOp::replaceCollapsedEdges()
 
 /*private*/
 void
-OverlayOp::copyPoints(int argIndex, const Envelope* env)
+OverlayOp::copyPoints(uint8_t argIndex, const Envelope* env)
 {
 //#define GEOS_DEBUG_COPY_POINTS 1
 
@@ -392,7 +392,7 @@ OverlayOp::labelIncompleteNodes()
 
 /*private*/
 void
-OverlayOp::labelIncompleteNode(Node* n, int targetIndex)
+OverlayOp::labelIncompleteNode(Node* n, uint8_t targetIndex)
 {
 #if GEOS_DEBUG
     std::cerr << "OverlayOp::labelIncompleteNode(" << n->print() << ", " << targetIndex << ")" << std::endl;
@@ -464,7 +464,7 @@ OverlayOp::getAverageZ(const Polygon* poly)
 
 /*private*/
 double
-OverlayOp::getAverageZ(int targetIndex)
+OverlayOp::getAverageZ(uint8_t targetIndex)
 {
     if(avgzcomputed[targetIndex]) {
         return avgz[targetIndex];
@@ -968,7 +968,7 @@ OverlayOp::computeLabelsFromDepths()
         }
 
         depth.normalize();
-        for(int i = 0; i < 2; i++) {
+        for(uint8_t i = 0; i < 2; i++) {
             if(!lbl.isNull(i) && lbl.isArea() && !depth.isNull(i)) {
                 /*
                  * if the depths are equal, this edge is the result of
diff --git a/src/operation/overlayng/ElevationModel.cpp b/src/operation/overlayng/ElevationModel.cpp
index a34257e..250a7e1 100644
--- a/src/operation/overlayng/ElevationModel.cpp
+++ b/src/operation/overlayng/ElevationModel.cpp
@@ -97,7 +97,7 @@ ElevationModel::ElevationModel(const Envelope& nExtent, int nNumCellX, int nNumC
     if(cellSizeY <= 0.0) {
         numCellY = 1;
     }
-    cells.resize(numCellX * numCellY);
+    cells.resize(static_cast<std::size_t>(numCellX) * static_cast<std::size_t>(numCellY));
 }
 
 /* public */
@@ -268,7 +268,7 @@ ElevationModel::getCell(double x, double y) //, bool isCreateIfMissing
               << " offset " << cellOffset << std::endl;
 #endif
     assert ( cellOffset < numCellX * numCellY );
-    ElevationModel::ElevationCell& cell = cells[cellOffset];
+    ElevationModel::ElevationCell& cell = cells[static_cast<std::size_t>(cellOffset)];
     return cell;
 }
 
diff --git a/src/operation/relate/EdgeEndBundle.cpp b/src/operation/relate/EdgeEndBundle.cpp
index 8563640..4939b61 100644
--- a/src/operation/relate/EdgeEndBundle.cpp
+++ b/src/operation/relate/EdgeEndBundle.cpp
@@ -93,7 +93,7 @@ EdgeEndBundle::computeLabel(
         label = Label(Location::NONE);
     }
     // compute the On label, and the side labels if present
-    for(int i = 0; i < 2; i++) {
+    for(uint8_t i = 0; i < 2; i++) {
         computeLabelOn(i, boundaryNodeRule);
         if(isArea) {
             computeLabelSides(i);
@@ -103,7 +103,7 @@ EdgeEndBundle::computeLabel(
 
 
 void
-EdgeEndBundle::computeLabelOn(int geomIndex, const algorithm::BoundaryNodeRule& boundaryNodeRule)
+EdgeEndBundle::computeLabelOn(uint8_t geomIndex, const algorithm::BoundaryNodeRule& boundaryNodeRule)
 {
     // compute the ON location value
     int boundaryCount = 0;
@@ -134,7 +134,7 @@ EdgeEndBundle::computeLabelOn(int geomIndex, const algorithm::BoundaryNodeRule&
  * Compute the labelling for each side
  */
 void
-EdgeEndBundle::computeLabelSides(int geomIndex)
+EdgeEndBundle::computeLabelSides(uint8_t geomIndex)
 {
     computeLabelSide(geomIndex, Position::LEFT);
     computeLabelSide(geomIndex, Position::RIGHT);
@@ -155,7 +155,7 @@ EdgeEndBundle::computeLabelSides(int geomIndex)
  *  results in the summary label having the Geometry interior on <b>both</b> sides.
  */
 void
-EdgeEndBundle::computeLabelSide(int geomIndex, int side)
+EdgeEndBundle::computeLabelSide(uint8_t geomIndex, uint32_t side)
 {
     for(EdgeEnd* e: edgeEnds) {
         if(e->getLabel().isArea()) {
diff --git a/src/operation/relate/RelateComputer.cpp b/src/operation/relate/RelateComputer.cpp
index 2f60953..aa16d8e 100644
--- a/src/operation/relate/RelateComputer.cpp
+++ b/src/operation/relate/RelateComputer.cpp
@@ -307,7 +307,7 @@ RelateComputer::computeProperIntersectionIM(SegmentIntersector* intersector, Int
  * in the interior due to the Boundary Determination Rule)
  */
 void
-RelateComputer::copyNodesAndLabels(int argIndex)
+RelateComputer::copyNodesAndLabels(uint8_t argIndex)
 {
     const NodeMap* nm = (*arg)[argIndex]->getNodeMap();
     for(const auto& it: *nm) {
@@ -329,7 +329,7 @@ RelateComputer::copyNodesAndLabels(int argIndex)
  * Endpoint nodes will already be labelled from when they were inserted.
  */
 void
-RelateComputer::computeIntersectionNodes(int argIndex)
+RelateComputer::computeIntersectionNodes(uint8_t argIndex)
 {
     std::vector<Edge*>* edges = (*arg)[argIndex]->getEdges();
     for(Edge* e: *edges) {
@@ -357,7 +357,7 @@ RelateComputer::computeIntersectionNodes(int argIndex)
  * Endpoint nodes will already be labelled from when they were inserted.
  */
 void
-RelateComputer::labelIntersectionNodes(int argIndex)
+RelateComputer::labelIntersectionNodes(uint8_t argIndex)
 {
     std::vector<Edge*>* edges = (*arg)[argIndex]->getEdges();
     for(Edge* e: *edges) {
@@ -431,7 +431,7 @@ RelateComputer::updateIM(IntersectionMatrix& imX)
 
 /*private*/
 void
-RelateComputer::labelIsolatedEdges(int thisIndex, int targetIndex)
+RelateComputer::labelIsolatedEdges(uint8_t thisIndex, uint8_t targetIndex)
 {
     std::vector<Edge*>* edges = (*arg)[thisIndex]->getEdges();
     for(Edge* e: *edges) {
@@ -444,7 +444,7 @@ RelateComputer::labelIsolatedEdges(int thisIndex, int targetIndex)
 
 /* private */
 void
-RelateComputer::labelIsolatedEdge(Edge* e, int targetIndex, const Geometry* target)
+RelateComputer::labelIsolatedEdge(Edge* e, uint8_t targetIndex, const Geometry* target)
 {
     // this won't work for GeometryCollections with both dim 2 and 1 geoms
     if(target->getDimension() > 0) {
@@ -482,7 +482,7 @@ RelateComputer::labelIsolatedNodes()
 
 /* private */
 void
-RelateComputer::labelIsolatedNode(Node* n, int targetIndex)
+RelateComputer::labelIsolatedNode(Node* n, uint8_t targetIndex)
 {
     Location loc = ptLocator.locate(n->getCoordinate(),
                                (*arg)[targetIndex]->getGeometry());
diff --git a/src/operation/relate/RelateNodeGraph.cpp b/src/operation/relate/RelateNodeGraph.cpp
index f979ead..28eac28 100644
--- a/src/operation/relate/RelateNodeGraph.cpp
+++ b/src/operation/relate/RelateNodeGraph.cpp
@@ -86,8 +86,8 @@ RelateNodeGraph::build(GeometryGraph* geomGraph)
  * Precondition: edge intersections have been computed.
  */
 void
-RelateNodeGraph::computeIntersectionNodes(GeometryGraph* geomGraph,
-        int argIndex)
+RelateNodeGraph::computeIntersectionNodes(GeometryGraph *geomGraph,
+                                          uint8_t argIndex)
 {
     std::vector<Edge*>* edges = geomGraph->getEdges();
     std::vector<Edge*>::iterator edgeIt = edges->begin();
@@ -119,7 +119,7 @@ RelateNodeGraph::computeIntersectionNodes(GeometryGraph* geomGraph,
  * in the interior due to the Boundary Determination Rule)
  */
 void
-RelateNodeGraph::copyNodesAndLabels(GeometryGraph* geomGraph, int argIndex)
+RelateNodeGraph::copyNodesAndLabels(GeometryGraph *geomGraph, uint8_t argIndex)
 {
     auto& nMap = geomGraph->getNodeMap()->nodeMap;
     for(auto& entry : nMap) {
diff --git a/src/planargraph/DirectedEdgeStar.cpp b/src/planargraph/DirectedEdgeStar.cpp
index 9ee1ad3..91bec1b 100644
--- a/src/planargraph/DirectedEdgeStar.cpp
+++ b/src/planargraph/DirectedEdgeStar.cpp
@@ -134,7 +134,7 @@ DirectedEdgeStar::getIndex(const Edge* edge)
     for(unsigned int i = 0; i < outEdges.size(); ++i) {
         DirectedEdge* de = outEdges[i];
         if(de->getEdge() == edge) {
-            return i;
+            return static_cast<int>(i);
         }
     }
     return -1;
diff --git a/src/planargraph/Edge.cpp b/src/planargraph/Edge.cpp
index ae7bf82..1b0a271 100644
--- a/src/planargraph/Edge.cpp
+++ b/src/planargraph/Edge.cpp
@@ -48,7 +48,8 @@ Edge::setDirectedEdges(DirectedEdge* de0, DirectedEdge* de1)
 DirectedEdge*
 Edge::getDirEdge(int i)
 {
-    return dirEdge[i];
+    // keep signature signed to avoid conflict with Edge::getDirEdge(Node*) when i == 0
+    return dirEdge[static_cast<std::size_t>(i)];
 }
 
 /*
diff --git a/src/triangulate/quadedge/TrianglePredicate.cpp b/src/triangulate/quadedge/TrianglePredicate.cpp
index c943407..4584b61 100644
--- a/src/triangulate/quadedge/TrianglePredicate.cpp
+++ b/src/triangulate/quadedge/TrianglePredicate.cpp
@@ -46,12 +46,12 @@ TrianglePredicate::isInCircleNormalized(
     // https://www.cs.cmu.edu/~quake/robust.html
     // https://www.cs.cmu.edu/afs/cs/project/quake/public/code/predicates.c
 
-    long double adx = a.x - p.x;
-    long double ady = a.y - p.y;
-    long double bdx = b.x - p.x;
-    long double bdy = b.y - p.y;
-    long double cdx = c.x - p.x;
-    long double cdy = c.y - p.y;
+    long double adx = static_cast<long double>(a.x) - static_cast<long double>(p.x);
+    long double ady = static_cast<long double>(a.y) - static_cast<long double>(p.y);
+    long double bdx = static_cast<long double>(b.x) - static_cast<long double>(p.x);
+    long double bdy = static_cast<long double>(b.y) - static_cast<long double>(p.y);
+    long double cdx = static_cast<long double>(c.x) - static_cast<long double>(p.x);
+    long double cdy = static_cast<long double>(c.y) - static_cast<long double>(p.y);
 
     long double bdxcdy = bdx * cdy;
     long double cdxbdy = cdx * bdy;

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

Summary of changes:
 benchmarks/ClassSizes.cpp                          |   6 ++
 include/geos/geomgraph/Depth.h                     |   4 +-
 include/geos/geomgraph/Depth.inl                   |   4 +-
 include/geos/geomgraph/EdgeList.h                  |   2 +-
 include/geos/geomgraph/EdgeRing.h                  |   2 +-
 include/geos/geomgraph/GeometryGraph.h             |  16 ++--
 include/geos/geomgraph/GeometryGraph.inl           |   2 +-
 include/geos/geomgraph/Node.h                      |   6 +-
 include/geos/geomgraph/NodeMap.h                   |   2 +-
 include/geos/geomgraph/PlanarGraph.h               |   2 +-
 include/geos/operation/overlay/LineBuilder.h       |   2 +-
 include/geos/operation/overlay/OverlayOp.h         |   6 +-
 include/geos/operation/overlayng/Edge.h            |   2 +-
 .../geos/operation/overlayng/EdgeNodingBuilder.h   |  26 +++---
 include/geos/operation/overlayng/EdgeSourceInfo.h  |  10 +-
 include/geos/operation/overlayng/InputGeometry.h   |  20 ++--
 .../operation/overlayng/IntersectionPointBuilder.h |   2 +-
 include/geos/operation/overlayng/LineBuilder.h     |   8 +-
 include/geos/operation/overlayng/OverlayEdge.h     |   4 +-
 include/geos/operation/overlayng/OverlayEdge.inl   |   2 +-
 include/geos/operation/overlayng/OverlayEdgeRing.h |   2 +-
 include/geos/operation/overlayng/OverlayLabel.h    |  50 +++++-----
 include/geos/operation/overlayng/OverlayLabel.inl  |  26 +++---
 include/geos/operation/overlayng/OverlayLabeller.h |  20 ++--
 include/geos/operation/overlayng/PolygonBuilder.h  |  24 ++---
 include/geos/operation/relate/EdgeEndBundle.h      |   6 +-
 include/geos/operation/relate/RelateComputer.h     |  12 +--
 include/geos/operation/relate/RelateNodeGraph.h    |   4 +-
 include/geos/planargraph/DirectedEdgeStar.h        |   2 +-
 include/geos/planargraph/Edge.h                    |   1 +
 src/geomgraph/Depth.cpp                            |   6 +-
 src/geomgraph/EdgeEndStar.cpp                      |   9 +-
 src/geomgraph/EdgeList.cpp                         |  10 +-
 src/geomgraph/EdgeRing.cpp                         |   2 +-
 src/geomgraph/GeometryGraph.cpp                    |  30 ++----
 src/geomgraph/Node.cpp                             |   8 +-
 src/geomgraph/NodeMap.cpp                          |   2 +-
 src/geomgraph/PlanarGraph.cpp                      |   2 +-
 src/noding/NodingIntersectionFinder.cpp            |   2 +-
 src/operation/overlay/LineBuilder.cpp              |   2 +-
 src/operation/overlay/OverlayOp.cpp                |   8 +-
 src/operation/overlayng/Edge.cpp                   |   2 +-
 src/operation/overlayng/EdgeKey.cpp                |   2 -
 src/operation/overlayng/EdgeNodingBuilder.cpp      |  22 ++---
 src/operation/overlayng/EdgeSourceInfo.cpp         |   4 +-
 src/operation/overlayng/ElevationModel.cpp         |   4 +-
 src/operation/overlayng/InputGeometry.cpp          |  20 ++--
 .../overlayng/IntersectionPointBuilder.cpp         |   2 +-
 src/operation/overlayng/LineBuilder.cpp            |  11 ++-
 src/operation/overlayng/OverlayEdge.cpp            |   6 +-
 src/operation/overlayng/OverlayEdgeRing.cpp        |   2 +-
 src/operation/overlayng/OverlayLabel.cpp           |  18 ++--
 src/operation/overlayng/OverlayLabeller.cpp        |  24 ++---
 src/operation/overlayng/OverlayNG.cpp              |  10 +-
 src/operation/overlayng/PolygonBuilder.cpp         |  22 ++---
 src/operation/relate/EdgeEndBundle.cpp             |   8 +-
 src/operation/relate/RelateComputer.cpp            |  12 +--
 src/operation/relate/RelateNodeGraph.cpp           |   6 +-
 src/planargraph/DirectedEdgeStar.cpp               |   8 +-
 src/planargraph/Edge.cpp                           |   3 +-
 src/precision/CommonBits.cpp                       |   2 +-
 src/shape/fractal/MortonCode.cpp                   |   2 +-
 src/triangulate/quadedge/TrianglePredicate.cpp     |  12 +--
 tests/unit/capi/GEOSBufferTest.cpp                 |  33 +------
 tests/unit/capi/GEOSBuildAreaTest.cpp              |  41 +--------
 tests/unit/capi/GEOSClipByRectTest.cpp             |  44 ++-------
 tests/unit/capi/GEOSContainsTest.cpp               |  35 +------
 tests/unit/capi/GEOSConvexHullTest.cpp             |  35 +------
 tests/unit/capi/GEOSCoordSeqTest.cpp               |  19 +---
 tests/unit/capi/GEOSDelaunayTriangulationTest.cpp  |  77 ++++------------
 tests/unit/capi/GEOSDistanceTest.cpp               |  43 +--------
 tests/unit/capi/GEOSEqualsTest.cpp                 |  36 +-------
 tests/unit/capi/GEOSFrechetDistanceTest.cpp        |  43 +--------
 tests/unit/capi/GEOSGeomFromWKBTest.cpp            |  11 +--
 tests/unit/capi/GEOSGeomToWKTTest.cpp              |  32 +------
 tests/unit/capi/GEOSGeom_extentTest.cpp            |  28 +-----
 tests/unit/capi/GEOSGeom_setPrecisionTest.cpp      |  47 +---------
 tests/unit/capi/GEOSGetCentroidTest.cpp            |  42 +--------
 tests/unit/capi/GEOSHausdorffDistanceTest.cpp      |  43 +--------
 tests/unit/capi/GEOSInterpolateTest.cpp            |  33 +------
 tests/unit/capi/GEOSIntersectionPrecTest.cpp       |  59 +-----------
 tests/unit/capi/GEOSIntersectionTest.cpp           |  30 +-----
 tests/unit/capi/GEOSIntersectsTest.cpp             |  36 +-------
 tests/unit/capi/GEOSLineMergeTest.cpp              |  28 +-----
 tests/unit/capi/GEOSLineString_PointTest.cpp       |  33 +------
 tests/unit/capi/GEOSMakeValidTest.cpp              |  58 ++----------
 tests/unit/capi/GEOSMaximumInscribedCircleTest.cpp |  32 +------
 tests/unit/capi/GEOSMinimumBoundingCircleTest.cpp  |  42 +--------
 tests/unit/capi/GEOSMinimumClearanceTest.cpp       |  27 +-----
 tests/unit/capi/GEOSMinimumRectangleTest.cpp       |  38 +-------
 tests/unit/capi/GEOSMinimumWidthTest.cpp           |  35 +------
 tests/unit/capi/GEOSNearestPointsTest.cpp          |  35 +------
 tests/unit/capi/GEOSNodeTest.cpp                   |  43 ++-------
 tests/unit/capi/GEOSOffsetCurveTest.cpp            |  42 +--------
 tests/unit/capi/GEOSPointOnSurfaceTest.cpp         |  39 +-------
 tests/unit/capi/GEOSPolygonizeTest.cpp             |  27 +-----
 tests/unit/capi/GEOSPreparedDistanceTest.cpp       |  31 +------
 tests/unit/capi/GEOSPreparedGeometryTest.cpp       |  33 +------
 tests/unit/capi/GEOSPreparedNearestPointsTest.cpp  |  31 +------
 tests/unit/capi/GEOSProjectTest.cpp                |  36 +-------
 tests/unit/capi/GEOSRelateBoundaryNodeRuleTest.cpp |  30 +-----
 tests/unit/capi/GEOSRelatePatternMatchTest.cpp     |  29 +-----
 tests/unit/capi/GEOSReverseTest.cpp                |  26 +-----
 tests/unit/capi/GEOSSTRtreeTest.cpp                |  21 +----
 tests/unit/capi/GEOSSegmentIntersectionTest.cpp    |  26 +-----
 tests/unit/capi/GEOSSharedPathsTest.cpp            |  42 +--------
 tests/unit/capi/GEOSSimplifyTest.cpp               |  36 +-------
 tests/unit/capi/GEOSSnapTest.cpp                   |  62 +++----------
 tests/unit/capi/GEOSUnaryUnionTest.cpp             |  45 +--------
 tests/unit/capi/GEOSUserDataTest.cpp               |  49 +++-------
 tests/unit/capi/GEOSVoronoiDiagramTest.cpp         | 102 +++++----------------
 tests/unit/capi/GEOSWithinTest.cpp                 |  36 +-------
 tests/unit/capi/GEOSisClosedTest.cpp               |  47 +++-------
 tests/unit/capi/GEOSisValidDetailTest.cpp          |  58 +++---------
 tests/unit/capi/capi_test_utils.h                  |  67 ++++++++++++--
 tests/unit/io/WKBReaderTest.cpp                    |  12 +--
 116 files changed, 594 insertions(+), 2029 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list