Fix qa/geometry/test_segment.cpp to reflect the changes in SEG class (changes in commit cbb5708c36)

This commit is contained in:
jean-pierre charras 2017-04-15 09:10:42 +02:00
parent b321efffaf
commit 60310b3d32
1 changed files with 12 additions and 8 deletions

View File

@ -38,22 +38,26 @@ BOOST_FIXTURE_TEST_SUITE( SegmentReference, CommonTestData )
*/
BOOST_AUTO_TEST_CASE( SegmentReference )
{
VECTOR2I A( 10, 20 );
VECTOR2I B( 100, 200 );
VECTOR2I pointA( 10, 20 );
VECTOR2I pointB( 100, 200 );
// Build a segment referencing the previous points
SEG segment(A, B);
SEG segment( pointA, pointB );
BOOST_CHECK_EQUAL( A, VECTOR2I( 10, 20) );
BOOST_CHECK_EQUAL( B, VECTOR2I( 100, 200) );
BOOST_CHECK_EQUAL( pointA, VECTOR2I( 10, 20) );
BOOST_CHECK_EQUAL( pointB, VECTOR2I( 100, 200) );
// Modify the ends of the segments
segment.A += VECTOR2I( 10, 10 );
segment.B += VECTOR2I( 100, 100 );
// Check that the original points are also modified
BOOST_CHECK_EQUAL( A, VECTOR2I( 20, 30) );
BOOST_CHECK_EQUAL( B, VECTOR2I( 200, 300) );
// Check that the original points are not modified
BOOST_CHECK_EQUAL( pointA, VECTOR2I( 10, 20) );
BOOST_CHECK_EQUAL( pointB, VECTOR2I( 100, 200) );
// Check that the ends in segment are modified
BOOST_CHECK_EQUAL( segment.A, VECTOR2I( 20, 30) );
BOOST_CHECK_EQUAL( segment.B, VECTOR2I( 200, 300) );
}
BOOST_AUTO_TEST_SUITE_END()