File indexing completed on 2025-01-18 09:12:59
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <boost/test/unit_test.hpp>
0010
0011 #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp"
0012 #include "Acts/Utilities/detail/RealQuadraticEquation.hpp"
0013
0014 using Acts::detail::RealQuadraticEquation;
0015
0016 namespace Acts::Test {
0017
0018 BOOST_AUTO_TEST_SUITE(Surfaces)
0019
0020 BOOST_AUTO_TEST_CASE(RealQuadraticEquationConstruction) {
0021 double a(1.0), b(-3.), c(2.);
0022
0023
0024
0025
0026 BOOST_REQUIRE_NO_THROW(RealQuadraticEquation(a, b, c));
0027
0028
0029 RealQuadraticEquation orig(a, b, c);
0030 BOOST_REQUIRE_NO_THROW(RealQuadraticEquation copied(orig); (void)copied);
0031 }
0032
0033 BOOST_AUTO_TEST_CASE(RealQuadraticEquationProperties) {
0034 double a(1.0), b(-3.), c(2.);
0035
0036
0037 RealQuadraticEquation equation(a, b, c);
0038
0039
0040 CHECK_CLOSE_REL(equation.first, 2., 1e-6);
0041 CHECK_CLOSE_REL(equation.second, 1., 1e-6);
0042 BOOST_CHECK_EQUAL(equation.solutions, 2);
0043 }
0044
0045
0046 BOOST_AUTO_TEST_CASE(RealQuadraticEquationAssignment) {
0047 double a(1.0), b(-3.), c(2.);
0048 RealQuadraticEquation realQuadraticEquationObject(a, b, c);
0049
0050
0051
0052 RealQuadraticEquation assignedRealQuadraticEquationObject(9., -3.5, 6.7);
0053 assignedRealQuadraticEquationObject = realQuadraticEquationObject;
0054 CHECK_CLOSE_REL(assignedRealQuadraticEquationObject.first, 2., 1e-6);
0055 CHECK_CLOSE_REL(assignedRealQuadraticEquationObject.second, 1., 1e-6);
0056 BOOST_CHECK_EQUAL(assignedRealQuadraticEquationObject.solutions, 2);
0057
0058
0059
0060 }
0061 BOOST_AUTO_TEST_SUITE_END()
0062
0063 }