1 #define BOOST_TEST_MODULE (EventRange_t) 2 #include "boost/test/unit_test.hpp" 21 BOOST_AUTO_TEST_SUITE(EventRange_t)
25 auto er = EventRange::forSubRun(134);
26 BOOST_TEST(er.is_valid());
27 BOOST_TEST(er.is_full_subRun());
28 BOOST_TEST(er.contains(er.subRun(), 17));
29 std::ostringstream oss;
31 BOOST_TEST(oss.str() ==
"SubRun: 134 (full sub-run)"s);
38 BOOST_TEST(!er1.merge(er2));
39 BOOST_TEST(!er1.is_disjoint(er2));
40 BOOST_TEST(er1.is_valid());
41 BOOST_TEST(!er1.is_full_subRun());
48 BOOST_TEST(er1.is_adjacent(er2));
49 BOOST_TEST(er1.is_disjoint(er2));
50 BOOST_TEST(er1.merge(er2));
53 BOOST_TEST(er1 == ref);
54 std::ostringstream oss;
56 BOOST_TEST(oss.str() ==
"SubRun: 1 Event range: [2,6)"s);
58 BOOST_TEST(er1.contains(1, 2));
59 BOOST_TEST(er1.contains(1, 4));
60 BOOST_TEST(!er1.contains(1, 6));
61 BOOST_TEST(!er1.contains(2, 4));
71 BOOST_TEST(er0 < er1);
72 BOOST_TEST(er1 < er2);
73 BOOST_TEST(er2 < er3);
74 BOOST_TEST(er0.is_disjoint(er3));
75 BOOST_TEST(!er0.is_disjoint(er1));
76 BOOST_TEST(er3.is_disjoint(er4));
83 BOOST_TEST(er1.is_subset(er0));
84 BOOST_TEST(!er1.is_superset(er0));
85 BOOST_TEST(!er0.is_subset(er1));
86 BOOST_TEST(er0.is_superset(er1));
87 BOOST_TEST(!er1.is_overlapping(er0));
88 BOOST_TEST(!er0.is_overlapping(er1));
95 BOOST_TEST(!er1.is_subset(er0));
96 BOOST_TEST(!er1.is_superset(er0));
97 BOOST_TEST(!er0.is_subset(er1));
98 BOOST_TEST(!er0.is_superset(er1));
99 BOOST_TEST(er1.is_overlapping(er0));
100 BOOST_TEST(er0.is_overlapping(er1));
103 BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(fullSubRun)
bool lessThan(CluLen c1, CluLen c2)
constexpr auto fullSubRun()