9 #include <boost/test/unit_test.hpp>
16 using namespace Acts::VectorHelpers;
21 BOOST_AUTO_TEST_SUITE(Utilities)
24 Eigen::Matrix<int, 4, 3> mat;
25 mat << 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0;
28 std::bitset<4 * 3> exp{
"101001011010"};
30 BOOST_CHECK_EQUAL(exp, act);
32 Eigen::Matrix<int, 4, 3> cnv;
33 cnv = bitsetToMatrix<decltype(cnv)>(act);
35 BOOST_CHECK_EQUAL(mat, cnv);
39 double phi()
const {
return 42; }
52 BOOST_CHECK_EQUAL(
phi(s), 42
u);
81 mat << 1, 2, 3, 4, 5, 6, 7, 8, 9;
85 exp << -2, -1, 0, 4, 2, 0, -2, -1, 0;
95 mat << 1, 2, 3, 4, 5, 6, 7, 8, 9;
99 exp << -2, -1, 0, 4, 2, 0, -2, -1, 0;
101 BOOST_CHECK(act.isApprox(exp, 1
e-9));
107 mat << 1, 2, 3, 4, 5, 6, 7, 8, 9;
110 BOOST_CHECK(out.size() > 0);
114 BOOST_CHECK(out.size() > 0);
119 BOOST_CHECK(out.size() > 0);
124 std::vector<std::shared_ptr<int>> vec;
125 vec = {std::make_shared<int>(5), std::make_shared<int>(9),
126 std::make_shared<int>(26), std::make_shared<int>(18473)};
130 std::vector<int*> exp = {
137 BOOST_CHECK_EQUAL_COLLECTIONS(unpacked.begin(), unpacked.end(), exp.begin(),
143 std::vector<std::shared_ptr<const int>> vec;
144 vec = {std::make_shared<const int>(5), std::make_shared<const int>(9),
145 std::make_shared<const int>(26), std::make_shared<const int>(18473)};
149 std::vector<const int*> exp = {
156 BOOST_CHECK_EQUAL_COLLECTIONS(unpacked.begin(), unpacked.end(), exp.begin(),
181 constexpr
size_t imax = 20;
182 for (
size_t i = 0; i < imax; i++) {
183 size_t val = template_switch<functor, 0, imax>(i);
184 BOOST_CHECK_EQUAL(val, i * i * i);
188 BOOST_AUTO_TEST_SUITE_END()