Browse Source

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

pull/3/merge
jean-pierre charras 9 years ago
parent
commit
60310b3d32
  1. 20
      qa/geometry/test_segment.cpp

20
qa/geometry/test_segment.cpp

@ -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()
Loading…
Cancel
Save