9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
26 BOOST_AUTO_TEST_SUITE(Surfaces)
29 double minHalfX(10.), midHalfX(20.), maxHalfX(15.), halfY1(5.), halfY2(7.);
40 DiamondBounds original(minHalfX, midHalfX, maxHalfX, halfY1, halfY2);
54 double minHalfX(10.), midHalfX(50.), maxHalfX(30.), halfY1(10.), halfY2(20.);
56 DiamondBounds diamondBoundsObject(minHalfX, midHalfX, maxHalfX, halfY1,
84 BOOST_CHECK_EQUAL(diamondBoundsObject.
boundingBox(),
98 diamondBoundsObject.
toStream(std::cout);
99 boost::test_tools::output_test_stream dumpOuput;
100 diamondBoundsObject.
toStream(dumpOuput);
102 dumpOuput.is_equal(
"Acts::DiamondBounds: (halfXatYneg, halfXatYzero, "
103 "halfXatYpos, halfYneg, halfYpos) = (10.0000000, "
104 "50.0000000, 30.0000000, 10.0000000, 20.0000000)"));
113 std::vector<Vector2> referenceVertices{
114 {-minHalfX, -halfY1}, {minHalfX, -halfY1}, {midHalfX, 0.},
115 {maxHalfX, halfY2}, {-maxHalfX, halfY2}, {-midHalfX, 0.}};
116 const auto& actualVertices = diamondBoundsObject.
vertices();
117 BOOST_CHECK_EQUAL_COLLECTIONS(actualVertices.cbegin(), actualVertices.cend(),
118 referenceVertices.cbegin(),
119 referenceVertices.cend());
123 double minHalfX(10.), midHalfX(20.), maxHalfX(15.), halfY1(5.), halfY2(7.);
124 DiamondBounds diamondBoundsObject(minHalfX, midHalfX, maxHalfX, halfY1,
127 minHalfX, midHalfX, maxHalfX, halfY1, halfY2);
129 BOOST_CHECK_EQUAL(diamondBoundsObject,
130 similarlyConstructeDiamondBoundsObject);
134 2 * minHalfX, 2 * midHalfX, 2 * maxHalfX, 2 * halfY1, 2 * halfY2);
136 assignedDiamondBoundsObject = diamondBoundsObject;
137 BOOST_CHECK_EQUAL(assignedDiamondBoundsObject, diamondBoundsObject);
140 BOOST_AUTO_TEST_SUITE_END()