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)
30 double radius(0.5), halfz(10.);
34 LineBounds copyConstructedLineBounds(lineBounds);
40 double nominalRadius{0.5};
41 double nominalHalfLength{20.};
42 LineBounds original(nominalRadius, nominalHalfLength);
44 auto valvector = original.
values();
45 std::array<double, LineBounds::eSize>
values{};
47 BOOST_CHECK_EQUAL(original, recreated);
52 double nominalRadius{0.5};
53 double nominalHalfLength{20.};
55 BOOST_CHECK_THROW(
LineBounds(-nominalRadius, nominalHalfLength),
58 BOOST_CHECK_THROW(
LineBounds(nominalRadius, -nominalHalfLength),
62 BOOST_CHECK_THROW(
LineBounds(-nominalRadius, -nominalHalfLength),
68 double nominalRadius{0.5};
69 double nominalHalfLength{20.};
70 LineBounds lineBoundsObject(nominalRadius, nominalHalfLength);
71 LineBounds assignedLineBounds = lineBoundsObject;
72 BOOST_CHECK_EQUAL(assignedLineBounds, lineBoundsObject);
78 double nominalRadius{0.5};
79 double nominalHalfLength{20.};
80 LineBounds lineBoundsObject(nominalRadius, nominalHalfLength);
87 const Vector2 atRadius{0.5, 10.};
88 const Vector2 beyondEnd{0.0, 30.0};
91 const BoundaryCheck trueBoundaryCheckWithTolerance(
true,
true, 0.1, 0.1);
94 !lineBoundsObject.
inside(atRadius, trueBoundaryCheckWithTolerance));
96 !lineBoundsObject.
inside(beyondEnd, trueBoundaryCheckWithTolerance));
97 BOOST_CHECK(lineBoundsObject.
inside(unitZ, trueBoundaryCheckWithTolerance));
98 BOOST_CHECK(!lineBoundsObject.
inside(unitR, trueBoundaryCheckWithTolerance));
103 trueBoundaryCheckWithTolerance));
104 BOOST_CHECK(!lineBoundsObject.inside(
Vector2{-0.8, 10},
105 trueBoundaryCheckWithTolerance));
108 BOOST_CHECK_EQUAL(lineBoundsObject.get(
LineBounds::eR), nominalRadius);
115 boost::test_tools::output_test_stream dumpOuput;
116 lineBoundsObject.toStream(dumpOuput);
117 BOOST_CHECK(dumpOuput.is_equal(
118 "Acts::LineBounds: (radius, halflengthInZ) = (0.5000000, 20.0000000)"));
121 BOOST_AUTO_TEST_SUITE_END()