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:
parent
6165a735ae
commit
9a3cfb8570
|
@ -28,7 +28,7 @@ add_definitions(-DBOOST_TEST_DYN_LINK)
|
||||||
|
|
||||||
add_executable( qa_shape_poly_set_refactor
|
add_executable( qa_shape_poly_set_refactor
|
||||||
test_module.cpp
|
test_module.cpp
|
||||||
test_chamfer_fillet.cpp
|
test_chamfer.cpp
|
||||||
test_collision.cpp
|
test_collision.cpp
|
||||||
test_iterator.cpp
|
test_iterator.cpp
|
||||||
test_segment.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_dependencies( qa_shape_poly_set_refactor pcbnew )
|
||||||
|
|
||||||
add_test( NAME shape_poly_set_refactor
|
add_test( NAME shape_poly_set_refactor
|
||||||
COMMAND qa_shape_poly_set_refactor --run_test=!ChamferFillet/Fillet
|
COMMAND qa_shape_poly_set_refactor
|
||||||
)
|
)
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
/**
|
/**
|
||||||
* Declares the ChamferFilletFixture struct as the boost test fixture.
|
* Declares the ChamferFilletFixture struct as the boost test fixture.
|
||||||
*/
|
*/
|
||||||
BOOST_FIXTURE_TEST_SUITE( ChamferFillet, ChamferFilletFixture )
|
BOOST_FIXTURE_TEST_SUITE( Chamfer, ChamferFilletFixture )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function lexicographicOrder
|
* 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()
|
BOOST_AUTO_TEST_SUITE_END()
|
Loading…
Reference in New Issue