File indexing completed on 2025-01-18 09:12:45
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <boost/test/unit_test.hpp>
0010
0011 #include "Acts/Propagator/ConstrainedStep.hpp"
0012
0013 #include <limits>
0014
0015 namespace Acts::Test {
0016
0017
0018
0019 BOOST_AUTO_TEST_CASE(ConstrainedStepTest) {
0020
0021 ConstrainedStep stepSize_p(0.25);
0022
0023
0024 BOOST_CHECK_EQUAL(stepSize_p.accuracy(), std::numeric_limits<double>::max());
0025 BOOST_CHECK_EQUAL(stepSize_p.value(ConstrainedStep::Type::Navigator),
0026 std::numeric_limits<double>::max());
0027 BOOST_CHECK_EQUAL(stepSize_p.value(ConstrainedStep::Type::Actor),
0028 std::numeric_limits<double>::max());
0029 BOOST_CHECK_EQUAL(stepSize_p.value(ConstrainedStep::Type::User), 0.25);
0030
0031
0032 BOOST_CHECK_EQUAL(stepSize_p.value(), 0.25);
0033
0034
0035 stepSize_p.setAccuracy(0.1);
0036 BOOST_CHECK_EQUAL(stepSize_p.value(), 0.1);
0037
0038
0039 stepSize_p.update(0.05, ConstrainedStep::Type::Navigator);
0040 BOOST_CHECK_EQUAL(stepSize_p.value(), 0.05);
0041
0042 stepSize_p.update(0.15, ConstrainedStep::Type::Navigator);
0043 BOOST_CHECK_EQUAL(stepSize_p.value(), 0.05);
0044
0045
0046 stepSize_p.release(ConstrainedStep::Type::Navigator);
0047 stepSize_p.update(0.15, ConstrainedStep::Type::Navigator);
0048 BOOST_CHECK_EQUAL(stepSize_p.value(), 0.1);
0049
0050
0051 stepSize_p.update(0.05, ConstrainedStep::Type::User);
0052 stepSize_p.setAccuracy(0.03);
0053 BOOST_CHECK_EQUAL(stepSize_p.value(), 0.03);
0054
0055
0056 stepSize_p.releaseAccuracy();
0057 BOOST_CHECK_EQUAL(stepSize_p.accuracy(), std::numeric_limits<double>::max());
0058 BOOST_CHECK_EQUAL(stepSize_p.value(), 0.05);
0059 }
0060
0061 }