Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-11-03 08:59:12

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
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 }  // namespace ActsFatras::detail
0019 
0020 using ActsFatras::detail::TupleIndexOf;
0021 
0022 namespace ActsTests {
0023 
0024 BOOST_AUTO_TEST_SUITE(KernelSuite)
0025 
0026 BOOST_AUTO_TEST_CASE(Regular) {
0027   using T = std::tuple<int, double, float>;
0028 
0029   BOOST_CHECK_EQUAL((TupleIndexOf<int, T>::value), 0u);
0030   BOOST_CHECK_EQUAL((TupleIndexOf<double, T>::value), 1u);
0031   BOOST_CHECK_EQUAL((TupleIndexOf<float, T>::value), 2u);
0032 }
0033 
0034 BOOST_AUTO_TEST_CASE(Duplicates) {
0035   using T = std::tuple<double, int, double>;
0036 
0037   // should return the first matching type
0038   BOOST_CHECK_EQUAL((TupleIndexOf<double, T>::value), 0u);
0039   BOOST_CHECK_EQUAL((TupleIndexOf<int, T>::value), 1u);
0040 }
0041 
0042 BOOST_AUTO_TEST_SUITE_END()
0043 
0044 }  // namespace ActsTests