File indexing completed on 2025-01-18 09:13:05
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <boost/test/unit_test.hpp>
0010
0011 #include "ActsFatras/Kernel/InteractionList.hpp"
0012
0013 #include <tuple>
0014
0015 namespace ActsFatras::detail {
0016 template <class T, class Tuple>
0017 struct TupleIndexOf;
0018 }
0019
0020 using ActsFatras::detail::TupleIndexOf;
0021
0022 BOOST_AUTO_TEST_SUITE(FatrasTupleIndexOf)
0023
0024 BOOST_AUTO_TEST_CASE(Regular) {
0025 using T = std::tuple<int, double, float>;
0026
0027 BOOST_CHECK_EQUAL((TupleIndexOf<int, T>::value), 0u);
0028 BOOST_CHECK_EQUAL((TupleIndexOf<double, T>::value), 1u);
0029 BOOST_CHECK_EQUAL((TupleIndexOf<float, T>::value), 2u);
0030 }
0031
0032 BOOST_AUTO_TEST_CASE(Duplicates) {
0033 using T = std::tuple<double, int, double>;
0034
0035
0036 BOOST_CHECK_EQUAL((TupleIndexOf<double, T>::value), 0u);
0037 BOOST_CHECK_EQUAL((TupleIndexOf<int, T>::value), 1u);
0038 }
0039
0040 BOOST_AUTO_TEST_SUITE_END()