QA: Remove obsolete fillet refactor tests

These tests are fundamentally broken as they test two fillet
implementations against each other, but the two implementations
no longer have the same interface or meaning (one has a fixed
segment count, one has a fixed error).

This also allows the tests to run on Boost <1.59, which do not
provide the !-syntax for excluding tests. Ubuntu 16 uses
Boost 1.58, so this causes build failures.

Fixes: 1785377
https://bugs.launchpad.net/kicad/+bug/1785377
This commit is contained in:
John Beard 2018-08-05 19:16:55 +01:00 committed by Wayne Stambaugh
parent e34dc4abb1
commit 99549f816f
2 changed files with 3 additions and 39 deletions

View File

@ -28,7 +28,7 @@ add_definitions(-DBOOST_TEST_DYN_LINK)
add_executable( qa_shape_poly_set_refactor
test_module.cpp
test_chamfer_fillet.cpp
test_chamfer.cpp
test_collision.cpp
test_iterator.cpp
test_segment.cpp
@ -56,5 +56,5 @@ target_link_libraries( qa_shape_poly_set_refactor
add_dependencies( qa_shape_poly_set_refactor pcbnew )
add_test( NAME shape_poly_set_refactor
COMMAND qa_shape_poly_set_refactor --run_test=!ChamferFillet/Fillet
COMMAND qa_shape_poly_set_refactor
)

View File

@ -34,7 +34,7 @@
/**
* Declares the ChamferFilletFixture struct as the boost test fixture.
*/
BOOST_FIXTURE_TEST_SUITE( ChamferFillet, ChamferFilletFixture )
BOOST_FIXTURE_TEST_SUITE( Chamfer, ChamferFilletFixture )
/**
* Function lexicographicOrder
@ -120,40 +120,4 @@ BOOST_AUTO_TEST_CASE( Chamfer )
}
}
/**
* Tests the SHAPE_POLY_SET::FilletPolygon, which has been refactored into
* SHAPE_POLY_SET from CPolyLine::Fillet.
* Assuming the code in CPolyLine is right, this test ensures the behaviour of the new
* refactored code does not change anything.
*/
BOOST_AUTO_TEST_CASE( Fillet )
{
SHAPE_POLY_SET::POLYGON actual;
CPolyLine expected;
// Test different radius, up to the half of the minimum segment longitude
for (int radius = 1; radius < 5; radius++)
{
// Test different number of segments
for (size_t segments = 1; segments < 100; segments++)
{
// Chamfered polygon to be tested.
actual = common.holeyPolySet.FilletPolygon( radius, segments, 0 );
// Chamfered polygon assumed to be right.
expected = *legacyPolyLine.Fillet( radius, segments );
// Double check that there are no repeated corners in the legacy shape.
expected.RemoveNullSegments();
// Test equality
for (size_t contourIdx = 0; contourIdx < actual.size(); contourIdx++)
{
TestLineChainEqualCPolyLine(actual[contourIdx], expected, contourIdx);
}
}
}
}
BOOST_AUTO_TEST_SUITE_END()