Subject: [ggl] Updating tests
From: Mateusz Loskot (mateusz)
Date: 2009-04-17 17:36:10
Barend Gehrels wrote:
> Mateusz Loskot wrote:
>> Are the tests structured in any way or how new tests are added is a
>> matter of individual programmer choice?
> It also depends on the problem at hand (2D/3D, integer/double,
> strategies). We didn't create real guidelines for this but here is a
> small list
> - test_main is provided by Boost
> - in test main: call test_all to test for all geometries, using
> different point types
> - in test_all: call test_geometry for different geometries (linestring,
> polygon, box etc)
> This works for generic algorithms working the same for all geometries
> (such as append). Other tests will need more specific testcases, so then:
> - in test_all: call test_point, test_linestring, test_polygon etc (line
> in area.cpp, but the _area may be dropped, it is a bit redunant)
> There are also specific cases for different strategies (like in area.cpp).
These are very helpful. Actually, I don't have any detailed questions
to this, before I start preparing new tests.
Or may be just one question, what about organizing tests in similar tree
as the files which are being tested?
For instance, give the current source tree, tests would go into "test"
subdirectory (following Boost) this way:
>> As I see, test files are named after algorithms (intersection) or types
>> (point_ll or segment) or (probably) namespace or directories
>> (i.e. core, wkt). Is there any rationale behind this structure?
> Testing algorithms is the main purpose.
> wkt is also a sort of algorithm
> but moved to io/wkt to get more structure, we'll also get io/wkb and
> maybe more (kml,...)
> Testing geometries is especially useful to test the concepts (segment)
> or specific methods (latlong), actually they might adapted or merged
> with the custom tests (custom_linestring)
> Core is a bit weird now, indeed, actually more core-tests might be added
Yes, I've noticed core needs some love in this area ;-)
>> Do you mean that all types and algorithms under geometry/strategies
>> need to be covered with tests?
> Actually yes, if applicable
>>> This case should be added. There are more differences in the
>>> "comparisons" of US counties, they have to be checked, I think GEOS
>>> is wrong there and Terralib is also wrong.
>> That's interesting. I will see what I can find about that.
> It is interesting indeed. It was on my list but if you've time to figure
> it out, would be useful. I'll send you more about this tonight. If geos
> is wrong indeed, we can make a ticket and we should contact terralib. If
> we are wrong (and then also cgal is) we have to do some more work :-)
Right. I'm going to be busy moving to new flat but will try to get on it
in the next week.
-- Mateusz Loskot, http://mateusz.loskot.net Charter Member of OSGeo, http://osgeo.org
Geometry list run by mateusz at loskot.net