[geos-commits] [SCM] GEOS branch main updated. c7d3c151f0e39faac66091a3ad4510eea6754eba
git at osgeo.org
git at osgeo.org
Tue Mar 24 14:05:00 PDT 2026
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".
The branch, main has been updated
via c7d3c151f0e39faac66091a3ad4510eea6754eba (commit)
from b4ffacf814c0095b7631ed2e0b2757aaf3d6b33b (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 c7d3c151f0e39faac66091a3ad4510eea6754eba
Author: Daniel Baston <dbaston at gmail.com>
Date: Tue Mar 24 16:40:06 2026 -0400
geos_unit: add missing check in GeometryCollection equality test
diff --git a/tests/unit/utility.h b/tests/unit/utility.h
index 21825988b..a9003be56 100644
--- a/tests/unit/utility.h
+++ b/tests/unit/utility.h
@@ -407,7 +407,11 @@ ensure_equals_exact_geometry_xyz(const geos::geom::Geometry *lhs_in,
}
else if (const GeometryCollection* gc1 = dynamic_cast<const GeometryCollection *>(lhs_in)) {
const GeometryCollection *gc2 = static_cast<const GeometryCollection *>(rhs_in);
- for (unsigned int i = 0; i < gc1->getNumGeometries(); i++) {
+ ensure_equals("number of components does not match",
+ gc1->getNumGeometries(),
+ gc2->getNumGeometries());
+
+ for (unsigned int i = 0; i < gc1->getNumGeometries(); i++) {
ensure_equals_exact_geometry_xyz(gc1->getGeometryN(i), gc2->getGeometryN(i), tolerance);
}
}
@@ -493,7 +497,11 @@ ensure_equals_exact_geometry_xyzm(const geos::geom::Geometry *lhs_in,
}
else if (const GeometryCollection* gc1 = dynamic_cast<const GeometryCollection *>(lhs_in)) {
const GeometryCollection *gc2 = static_cast<const GeometryCollection *>(rhs_in);
- for (unsigned int i = 0; i < gc1->getNumGeometries(); i++) {
+ ensure_equals("number of components does not match",
+ gc1->getNumGeometries(),
+ gc2->getNumGeometries());
+
+ for (unsigned int i = 0; i < gc1->getNumGeometries(); i++) {
ensure_equals_exact_geometry_xyzm(gc1->getGeometryN(i), gc2->getGeometryN(i), tolerance);
}
} else {
@@ -584,6 +592,10 @@ ensure_equals_exact_geometry(const geos::geom::Geometry *lhs_in,
}
else if (const GeometryCollection* gc1 = dynamic_cast<const GeometryCollection *>(lhs_in)) {
const GeometryCollection *gc2 = static_cast<const GeometryCollection *>(rhs_in);
+ ensure_equals("number of components does not match",
+ gc1->getNumGeometries(),
+ gc2->getNumGeometries());
+
for (unsigned int i = 0; i < gc1->getNumGeometries(); i++) {
ensure_equals_exact_geometry(gc1->getGeometryN(i), gc2->getGeometryN(i), tolerance);
}
-----------------------------------------------------------------------
Summary of changes:
tests/unit/utility.h | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list