The angle needs to be added to the start angle.
Add tests to cover this:
* Check end point is correct
* Check midpoints are within tolerance
This would have prevented the bug fixed in 5813164d1,
as well as the bug fixed in this commit.
As well as failed tests, this manifests when routing across
Edge.Cuts arcs (unless they happen to start at 0 degrees
staritng angle).
Expose as expected failure to prove tests catch it.
Fix to follow in separate commit.
Prevent a divide-by-zero bug in SHAPE_ARC::ConvertToPolyline.
When the radius is zero, just use the initial angle (it makes
no different anyway, the result is the centre point, which is
the start point.
Add unit test of SHAPE_ARC::ConvertToPolyline.
This function has a bug when the arc is of zero radius. This
test shows the bug, but does not fix it yet.
SEG collisions and distances are a fundamental part of SHAPE collision testing
and are therefore critical for DRC correctness.
Also a few Collinear tests.
This test assumed points on a edge are counted as colliding.
This is not true: points on an edge are NOT counted at inside
the poly_set.
THe test does still consider points on a *hole* edge as collisions.
The API to SHAPE_POLY_SET is unclear on if this is correct.
The "refactor" element of qa_shape_poly_set_refactor has been
previously removed, so these tests are now just regular tests on
libcommon classes. These can therefore be moved to qa_common
and the qa_shape_poly_set_refactor unit test suit can finally be
totally removed.
Test a few "centre-point-angle" cases and add some
generic geom code for testing vectors and boxes are within
tolerance (since rounding often creeps in).
Much of the arc-checking code will be useful to other
construction methods (e.g. point-point-point).
There are expected failures for the bbox code when
the arc passes though, but does not end on, a quadrant point
(0, 90, 180, 270). This is due to a defective
implementation of SHAPE_ARC::BBox() that does not take
into account the quadrant points. This will be fixed
as a follow-up.
This includes:
* Linkage against the Boost unit test libs
* Configuration of the Boost libs
* A place for common generics "extras" for unit test harnesses
including
* A simple way to allow "expected-failure" tests (without
breaking Boost < 1.58, e.g. Ubuntu LTS)
* Moving some simple numeric predicates from the geom tests
to the utils library.
Expand unit test docs to describe the expected failures macro.
Add a few COLOR4D tests, including one with expected failures due
to a pre-existing bug. This will be fixed in a follow-up commit.
* Renames /qa/common to /qa/qa_utils, as it is not to do with /common
* Renames /qa/geometry to /qa/common
* Put existing geometry tests into a subdirectory of /qa/common, to
echo the layout of the main tree.
The intention is to provide a place to put tests of other libcommon
code in the /qa/common suite.