artdaq_core  v3_01_04
RawEvent_t.cc
1 #include "artdaq-core/Data/RawEvent.hh"
2 #include "artdaq-core/Data/Fragment.hh"
3 
4 #define BOOST_TEST_MODULE(RawEvent_t)
5 #include "cetlib/quiet_unit_test.hpp"
6 
7 BOOST_AUTO_TEST_SUITE(RawEvent_test)
8 
9  BOOST_AUTO_TEST_CASE(InsertFragment)
10  {
11  // SCF - The RawEvent::insertFragment() method used to check and verify that
12  // the sequence ID of the fragment equaled the sequence ID in the RawEvent
13  // header. This doesn't work for the DS50 aggregator as it packs multiple
14  // fragments with different sequence IDs into a single RawEvent. This test
15  // verifies that the we're able to do this.
16  artdaq::RawEvent r1(1, 1, 1);
17  std::unique_ptr<artdaq::Fragment> f1(new artdaq::Fragment(1, 1));
18  std::unique_ptr<artdaq::Fragment> f2(new artdaq::Fragment(2, 1));
19  std::unique_ptr<artdaq::Fragment> f3(new artdaq::Fragment(3, 1));
20 
21  try
22  {
23  r1.insertFragment(std::move(f1));
24  r1.insertFragment(std::move(f2));
25  r1.insertFragment(std::move(f3));
26  //BOOST_REQUIRE_EQUAL(r1.numFragments(), 3);
27  }
28  catch (...)
29  {
30  BOOST_REQUIRE(0 && "Should not have thrown exception");
31  }
32  }
33 
34 BOOST_AUTO_TEST_SUITE_END()
A Fragment contains the data from one piece of the DAQ system for one event The artdaq::Fragment is t...
Definition: Fragment.hh:84
RawEvent is the artdaq view of a generic event, containing a header and zero or more Fragments...
Definition: RawEvent.hh:64