1 #define BOOST_TEST_MODULE NoOp_policy_t
2 #include <boost/test/auto_unit_test.hpp>
4 #include "artdaq/RoutingPolicies/makeRoutingManagerPolicy.hh"
5 #include "fhiclcpp/ParameterSet.h"
6 #include "fhiclcpp/make_ParameterSet.h"
8 BOOST_AUTO_TEST_SUITE(NoOp_policy_t)
12 fhicl::ParameterSet ps;
13 fhicl::make_ParameterSet(
"receiver_ranks: [1,2,3,4]", ps);
17 BOOST_REQUIRE_EQUAL(noop->GetReceiverCount(), 4);
20 noop->AddReceiverToken(1, 1);
21 noop->AddReceiverToken(3, 1);
22 noop->AddReceiverToken(2, 1);
23 noop->AddReceiverToken(4, 1);
24 noop->AddReceiverToken(2, 1);
25 auto secondTable = noop->GetCurrentTable();
26 BOOST_REQUIRE_EQUAL(secondTable.size(), 5);
27 BOOST_REQUIRE_EQUAL(secondTable[0].destination_rank, 1);
28 BOOST_REQUIRE_EQUAL(secondTable[1].destination_rank, 3);
29 BOOST_REQUIRE_EQUAL(secondTable[2].destination_rank, 2);
30 BOOST_REQUIRE_EQUAL(secondTable[3].destination_rank, 4);
31 BOOST_REQUIRE_EQUAL(secondTable[4].destination_rank, 2);
32 BOOST_REQUIRE_EQUAL(secondTable[0].sequence_id, 1);
33 BOOST_REQUIRE_EQUAL(secondTable[1].sequence_id, 2);
34 BOOST_REQUIRE_EQUAL(secondTable[2].sequence_id, 3);
35 BOOST_REQUIRE_EQUAL(secondTable[3].sequence_id, 4);
36 BOOST_REQUIRE_EQUAL(secondTable[4].sequence_id, 5);
38 noop->AddReceiverToken(1, 0);
40 auto thirdTable = noop->GetCurrentTable();
41 BOOST_REQUIRE_EQUAL(thirdTable.size(), 0);
44 BOOST_AUTO_TEST_SUITE_END()
std::shared_ptr< RoutingManagerPolicy > makeRoutingManagerPolicy(std::string const &policy_plugin_spec, fhicl::ParameterSet const &ps)
Load a RoutingManagerPolicy plugin.