9 #include <boost/test/unit_test.hpp>
16 #include <type_traits>
18 using namespace Acts::UnitLiterals;
20 static auto eps = std::numeric_limits<double>::epsilon();
23 BOOST_TEST_DONT_PRINT_LOG_VALUE(Acts::SinglyCharged)
24 BOOST_TEST_DONT_PRINT_LOG_VALUE(Acts::NonNeutralCharge)
25 BOOST_TEST_DONT_PRINT_LOG_VALUE(Acts::AnyCharge)
27 BOOST_AUTO_TEST_SUITE(EventDataCharge)
30 BOOST_CHECK(std::is_trivially_default_constructible_v<Acts::Neutral>);
31 BOOST_CHECK(std::is_trivially_default_constructible_v<Acts::SinglyCharged>);
32 BOOST_CHECK(std::is_nothrow_default_constructible_v<Acts::Neutral>);
33 BOOST_CHECK(std::is_nothrow_default_constructible_v<Acts::SinglyCharged>);
34 BOOST_CHECK(std::is_trivially_constructible_v<Acts::Neutral>);
35 BOOST_CHECK(std::is_trivially_constructible_v<Acts::SinglyCharged>);
38 BOOST_CHECK(std::is_nothrow_constructible_v<Acts::Neutral>);
39 BOOST_CHECK(std::is_nothrow_constructible_v<Acts::SinglyCharged>);
85 BOOST_CHECK_EQUAL(q.extractCharge(1.23), 1_e);
86 BOOST_CHECK_EQUAL(q.extractCharge(2.54), 1_e);
87 BOOST_CHECK_EQUAL(q.extractCharge(-1.98), -1_e);
88 BOOST_CHECK_EQUAL(q.extractCharge(-2.23), -1_e);
100 BOOST_CHECK_EQUAL(q.extractCharge(1.23), 3_e);
101 BOOST_CHECK_EQUAL(q.extractCharge(2.54), 3_e);
102 BOOST_CHECK_EQUAL(q.extractCharge(-1.98), -3_e);
103 BOOST_CHECK_EQUAL(q.extractCharge(-2.23), -3_e);
119 BOOST_CHECK_EQUAL(q.extractCharge(1.23), 0_e);
120 BOOST_CHECK_EQUAL(q.extractCharge(2.54), 0_e);
121 BOOST_CHECK_EQUAL(q.extractCharge(-1.98), 0_e);
122 BOOST_CHECK_EQUAL(q.extractCharge(-2.23), 0_e);
141 BOOST_CHECK_EQUAL(q.extractCharge(1.23), 1_e);
142 BOOST_CHECK_EQUAL(q.extractCharge(2.54), 1_e);
143 BOOST_CHECK_EQUAL(q.extractCharge(-1.98), -1_e);
144 BOOST_CHECK_EQUAL(q.extractCharge(-2.23), -1_e);
160 BOOST_CHECK_EQUAL(q.extractCharge(1.23), 3_e);
161 BOOST_CHECK_EQUAL(q.extractCharge(2.54), 3_e);
162 BOOST_CHECK_EQUAL(q.extractCharge(-1.98), -3_e);
163 BOOST_CHECK_EQUAL(q.extractCharge(-2.23), -3_e);
178 BOOST_AUTO_TEST_SUITE_END()