[postgis-devel] Tests for *_force_dims

Paul Ramsey pramsey at cleverelephant.ca
Mon Dec 30 09:16:15 PST 2019

> On Dec 28, 2019, at 2:38 PM, Kristian Thy <thy at 42.dk> wrote:
> Dear List,
> I was looking for a little hobby project for the holidays and found
> <https://trac.osgeo.org/postgis/ticket/3057> which tickled my fancy.
> This is my first time contributing to PostGIS, and I have a question
> regarding tests for the change I'm about to implement.
> My plan - in order to preserve backwards compatibility - is to change
> the *_force_dims functions defined in liblwgeom_internal.h to call
> through to a new set of functions that accepts M and/or Z values, e.g.
> `lwpoint_force_dims(const LWPOINT *lwpoint, int hasz, int hasm)` returns
> `lwpoint_force_dims_with_defaults(lwpoint, hasz, hasm, 0, 0)`.
> From what I've found on the developer wiki I'm expected to add CUnit
> tests for changes to liblwgeom. However, I can't find any current tests
> for these six functions (liblwgeom_internal.h lines 175 through 180) in
> postgis/liblwgeom/cunit.
> Would it be sufficient if I added regression tests for the current and
> new, overloaded methods in postgis/regress/core/lwgeom_regress.sql? I.e.
> what you can see in my fork at
> <https://github.com/kthy/postgis/commit/299747c4e36498ba1cad2cc2b328158c7e33af62>

Yes, this is OK. A handful of Cunit tests would be nice, since it’s a liblwgeom change, but not mandatory.

> (Bonus question: can CUnit provide coverage reports?)

No idea, but coverage is a state of grace and we are all fallen creatures.


> Any pointers or comments appreciated!
> -- 
> /Kristian
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel

More information about the postgis-devel mailing list