9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
23 BOOST_AUTO_TEST_SUITE(Surfaces)
26 double minHalfX(10.), midHalfX(20.), maxHalfX(15.), halfY1(5.), halfY2(7.);
33 DiamondBounds(minHalfX, midHalfX, maxHalfX, halfY1, halfY2).type(),
37 DiamondBounds original(minHalfX, midHalfX, maxHalfX, halfY1, halfY2);
51 double minHalfX(10.), midHalfX(50.), maxHalfX(30.), halfY1(10.), halfY2(20.);
53 DiamondBounds diamondBoundsObject(minHalfX, midHalfX, maxHalfX, halfY1,
81 BOOST_CHECK_EQUAL(diamondBoundsObject.
boundingBox(),
99 diamondBoundsObject.
toStream(std::cout);
100 boost::test_tools::output_test_stream dumpOuput;
101 diamondBoundsObject.
toStream(dumpOuput);
103 dumpOuput.is_equal(
"Acts::DiamondBounds: (halfXatYneg, halfXatYzero, "
104 "halfXatYpos, halfYneg, halfYpos) = (10.0000000, "
105 "50.0000000, 30.0000000, 10.0000000, 20.0000000)"));
114 std::vector<Vector2D> referenceVertices{
115 {-minHalfX, -halfY1}, {minHalfX, -halfY1}, {midHalfX, 0.},
116 {maxHalfX, halfY2}, {-maxHalfX, halfY2}, {-midHalfX, 0.}};
117 const auto& actualVertices = diamondBoundsObject.
vertices();
118 BOOST_CHECK_EQUAL_COLLECTIONS(actualVertices.cbegin(), actualVertices.cend(),
119 referenceVertices.cbegin(),
120 referenceVertices.cend());
124 double minHalfX(10.), midHalfX(20.), maxHalfX(15.), halfY1(5.), halfY2(7.);
125 DiamondBounds diamondBoundsObject(minHalfX, midHalfX, maxHalfX, halfY1,
128 minHalfX, midHalfX, maxHalfX, halfY1, halfY2);
130 BOOST_CHECK_EQUAL(diamondBoundsObject,
131 similarlyConstructeDiamondBoundsObject);
135 2 * minHalfX, 2 * midHalfX, 2 * maxHalfX, 2 * halfY1, 2 * halfY2);
137 assignedDiamondBoundsObject = diamondBoundsObject;
138 BOOST_CHECK_EQUAL(assignedDiamondBoundsObject, diamondBoundsObject);
141 BOOST_AUTO_TEST_SUITE_END()