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(),
95 diamondBoundsObject.
toStream(std::cout);
96 boost::test_tools::output_test_stream dumpOuput;
97 diamondBoundsObject.
toStream(dumpOuput);
99 dumpOuput.is_equal(
"Acts::DiamondBounds: (halfXatYneg, halfXatYzero, "
100 "halfXatYpos, halfYneg, halfYpos) = (10.0000000, "
101 "50.0000000, 30.0000000, 10.0000000, 20.0000000)"));
110 std::vector<Vector2D> referenceVertices{
111 {-minHalfX, -halfY1}, {minHalfX, -halfY1}, {midHalfX, 0.},
112 {maxHalfX, halfY2}, {-maxHalfX, halfY2}, {-midHalfX, 0.}};
113 const auto& actualVertices = diamondBoundsObject.
vertices();
114 BOOST_CHECK_EQUAL_COLLECTIONS(actualVertices.cbegin(), actualVertices.cend(),
115 referenceVertices.cbegin(),
116 referenceVertices.cend());
120 double minHalfX(10.), midHalfX(20.), maxHalfX(15.), halfY1(5.), halfY2(7.);
121 DiamondBounds diamondBoundsObject(minHalfX, midHalfX, maxHalfX, halfY1,
124 minHalfX, midHalfX, maxHalfX, halfY1, halfY2);
126 BOOST_CHECK_EQUAL(diamondBoundsObject,
127 similarlyConstructeDiamondBoundsObject);
131 2 * minHalfX, 2 * midHalfX, 2 * maxHalfX, 2 * halfY1, 2 * halfY2);
133 assignedDiamondBoundsObject = diamondBoundsObject;
134 BOOST_CHECK_EQUAL(assignedDiamondBoundsObject, diamondBoundsObject);
137 BOOST_AUTO_TEST_SUITE_END()