123 for(
const VECTOR2I& point : collidingPoints )
125 std::stringstream ss;
126 ss <<
"Point {" << point.x <<
", " << point.y <<
" }";
129 BOOST_CHECK( common.holeyPolySet.Contains( point ) );
133 for(
const VECTOR2I& point : nonCollidingPoints )
135 std::stringstream ss;
136 ss <<
"Point {" << point.x <<
", " << point.y <<
" }";
139 BOOST_CHECK( !common.holeyPolySet.Contains( point ) );
151 for(
const VECTOR2I& point : collidingPoints )
153 std::stringstream ss;
154 ss <<
"Point {" << point.x <<
", " << point.y <<
" }";
157 BOOST_CHECK( common.holeyPolySet.Collide( point, 0 ) );
161 for(
const VECTOR2I& point : nonCollidingPoints )
163 std::stringstream ss;
164 ss <<
"Point {" << point.x <<
", " << point.y <<
" }";
167 BOOST_CHECK( !common.holeyPolySet.Collide( point, 0 ) );
189 for(
const VECTOR2I& point : common.holeyPoints )
191 BOOST_CHECK_MESSAGE( common.holeyPolySet.CollideVertex( point, cornerHit, 0 ),
" Point " 192 << point.
x <<
", " << point.
y <<
" does not collide with holeyPolySet polygon" );
206 for(
const VECTOR2I& point : common.holeyPoints )
208 BOOST_CHECK( common.holeyPolySet.CollideVertex( point +
VECTOR2I( 1, 1 ), cornerHit, 2 ) );
212 BOOST_AUTO_TEST_SUITE_END()
struct KI_TEST::CommonTestData common
std::vector< VECTOR2I > collidingPoints
Common data for some of the SHAPE_POLY_SET tests:
Define a general 2D-vector/point.
Structure to hold the necessary information in order to index a vertex on a SHAPE_POLY_SET object: th...
Fixture for the Collision test suite.
BOOST_CHECK(v2.Cross(v1)==1)
CollisionFixture()
Constructor.
static bool Collide(const SHAPE_CIRCLE &aA, const SHAPE_CIRCLE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
std::vector< VECTOR2I > nonCollidingPoints
BOOST_AUTO_TEST_CASE(HasHoles)
Declares the CollisionFixture as the boost test suite fixture.
#define BOOST_TEST_INFO(A)
If HAVE_EXPECTED_FAILURES is defined, this means that boost::unit_test::expected_failures is availabl...