9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
32 BOOST_AUTO_TEST_SUITE(Surfaces)
36 double minHalfX(1.), maxHalfX(6.),
halfY(2.);
47 BOOST_CHECK_EQUAL(copied, original);
52 double minHalfX(1.), maxHalfX(6.),
halfY(2.);
56 auto valvector = original.
values();
57 std::array<double, TrapezoidBounds::eSize>
values{};
60 BOOST_CHECK_EQUAL(original, recreated);
65 double minHalfX(1.), maxHalfX(6.),
halfY(2.);
86 double minHalfX(1.), maxHalfX(6.),
halfY(2.);
110 std::vector<Vector2> expectedVertices{
111 {-1., -2.}, {1., -2.}, {6., 2.}, {-6., 2.}};
112 const auto& actualVertices = trapezoidBoundsObject.
vertices();
113 BOOST_CHECK_EQUAL_COLLECTIONS(actualVertices.cbegin(), actualVertices.cend(),
114 expectedVertices.cbegin(),
115 expectedVertices.cend());
122 BOOST_CHECK_EQUAL(trapezoidBoundsObject.
boundingBox(),
128 boost::test_tools::output_test_stream dumpOuput;
129 trapezoidBoundsObject.
toStream(dumpOuput);
131 dumpOuput.is_equal(
"Acts::TrapezoidBounds: (halfXnegY, halfXposY, "
132 "halfY) = (1.0000000, 6.0000000, 2.0000000)"));
141 std::vector<Vector2> testPoints = {
174 for (
const auto&
p : testPoints) {
175 BOOST_TEST_CONTEXT(
"p=" <<
p.transpose()) {
176 BOOST_CHECK_EQUAL(bc.isInside(
p, vertices),
177 trapezoidBoundsObject.
inside(
p, bc));
183 TrapezoidInsideCheck,
185 bdata::distribution = std::uniform_real_distribution<>(-7,
189 bdata::distribution = std::uniform_real_distribution<>(-3, 3))) ^
190 bdata::xrange(1000) * bdata::make({0.0, 0.1, 0.2, 0.3}),
193 double minHalfX(1.), maxHalfX(6.),
halfY(2.);
195 static const auto vertices = trapezoidBoundsObject.vertices();
200 bc = BoundaryCheck{
true,
true, tol, tol};
203 BOOST_CHECK_EQUAL(bc.isInside({
x,
y},
vertices),
204 trapezoidBoundsObject.inside({
x,
y}, bc));
209 double minHalfX(1.), maxHalfX(6.),
halfY(2.);
215 assignedTrapezoidBoundsObject = trapezoidBoundsObject;
216 BOOST_CHECK_EQUAL(assignedTrapezoidBoundsObject, trapezoidBoundsObject);
219 BOOST_AUTO_TEST_SUITE_END()