artdaq_core  v1_07_02
 All Classes Namespaces Functions
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  r1.insertFragment(std::move(f1));
23  r1.insertFragment(std::move(f2));
24  r1.insertFragment(std::move(f3));
25  //BOOST_REQUIRE_EQUAL(r1.numFragments(), 3);
26  }
27  catch (...) {
28  BOOST_REQUIRE(0 && "Should not have thrown exception");
29  }
30 }
31 
32 BOOST_AUTO_TEST_SUITE_END()
33