#185 closed defect (fixed)
Possible bug
Reported by: | mloskot | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 3.1.0 |
Component: | Core | Version: | main |
Severity: | Content | Keywords: | |
Cc: | denise.macleod@…, warmerdam |
Description
I'm not sure but it looks like a bug. The first formal parameter of Octant::octant static method is unused, instead second parameter is passed twice:
Here is code at Octant.h:63
/** * Returns the octant of a directed line segment from p0 to p1. */ static int octant(const geom::Coordinate* p0, const geom::Coordinate* p1) { return octant(*p1, *p1); }
Even if it is not a bug, I believe it's nothing wrong to double-check.
Attachments (2)
Change History (8)
comment:1 by , 16 years ago
Cc: | added |
---|
comment:2 by , 16 years ago
Cc: | added |
---|
Denise,
Do you think you could prepare an extension for the unit tests that would actually identify this error, and confirm the fix? It could be something that calls this functionality fairly directly or something that invokes it indirectly via higher level services.
comment:4 by , 16 years ago
Frank -
I tried adding it as it's own set of tests, but had problems getting the .deps/OctantTest.Po file generated; even after changing the makefiles it wasn't being picked up. So I added it as another test to tests/unit/noding/SegmentStringTest.cpp (since SegmentString class was calling Octant class already).
I will attach the changed SegmentStringTest.cpp file, and a diff file. Basically the new test is to call the two interfaces with the same parameters, and ensure that they have the same result.
Here's the run with the bug:
[root@localhost unit]# ./geos_unit geos::noding::SegmentString =============================== GEOS Test Suite Application =============================== geos::noding::SegmentString: ....[5=F] 4 ---> group: geos::noding::SegmentString, test: test<5> problem: assertion failed Tests summary: - failures:1 - passed: 4 [root@localhost unit]#
And the run after the fix was applied:
[root@localhost unit]# ./geos_unit geos::noding::SegmentString =============================== GEOS Test Suite Application =============================== geos::noding::SegmentString: ..... 5 Tests summary: - passed: 5 [root@localhost unit]#
by , 16 years ago
Attachment: | SegmentStringTest.cpp added |
---|
by , 16 years ago
Attachment: | diff.SegmentStringTest.cpp added |
---|
comment:5 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:6 by , 15 years ago
Milestone: | → 3.1.0 |
---|
The fix, on line 63:
Reasoning: