Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:11:24

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2016-2018 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #include <boost/test/unit_test.hpp>
0010 
0011 #include "Acts/Propagator/detail/Auctioneer.hpp"
0012 
0013 #include <array>
0014 
0015 namespace Acts::Test {
0016 
0017 BOOST_AUTO_TEST_CASE(AuctioneerTest_VoidAuctioneer) {
0018   // Build arbitrary vector
0019   std::array<int, 4> vecArb = {0, 2, -5, 4};
0020   std::array<bool, 4> vecRes = {false, true, false, true};
0021   // Let it run through auction
0022   detail::VoidAuctioneer va;
0023   std::array<bool, 4> resultVa = va(vecArb);
0024   // Test that vector did not change
0025   BOOST_CHECK_EQUAL_COLLECTIONS(vecRes.begin(), vecRes.end(), resultVa.begin(),
0026                                 resultVa.end());
0027 }
0028 
0029 BOOST_AUTO_TEST_CASE(AuctioneerTest_FirstValidAuctioneer) {
0030   // Build arbitrary vector
0031   std::array<int, 4> vecArb = {0, 1, -2, 4};
0032   // Let it run through auction
0033   detail::FirstValidAuctioneer fva;
0034   std::array<bool, 4> resultFva = fva(vecArb);
0035   std::array<bool, 4> expected = {false, true, false, false};
0036   // Test that vector did not change
0037   BOOST_CHECK_EQUAL_COLLECTIONS(expected.begin(), expected.end(),
0038                                 resultFva.begin(), resultFva.end());
0039 }
0040 
0041 BOOST_AUTO_TEST_CASE(AuctioneerTest_HighestValidAuctioneer) {
0042   // Build arbitrary vector
0043   std::array<int, 4> vecArb = {0, 1, -2, 4};
0044   // Let it run through auction
0045   detail::HighestValidAuctioneer fva;
0046   std::array<bool, 4> resultFva = fva(vecArb);
0047   std::array<bool, 4> expected = {false, false, false, true};
0048   // Test that vector did not change
0049   BOOST_CHECK_EQUAL_COLLECTIONS(expected.begin(), expected.end(),
0050                                 resultFva.begin(), resultFva.end());
0051 }
0052 }  // namespace Acts::Test