[postgis-devel] Tests for *_force_dims

Kristian Thy thy at 42.dk
Sat Dec 28 14:38:12 PST 2019


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>

(Bonus question: can CUnit provide coverage reports?)

Any pointers or comments appreciated!

-- 
/Kristian


More information about the postgis-devel mailing list