#include "boost/test/unit_test.hpp"
#include "canvas/Persistency/Provenance/EventRange.h"
#include <sstream>
#include <string>
Go to the source code of this file.
#define BOOST_TEST_MODULE (EventRange_t) |
BOOST_AUTO_TEST_CASE |
( |
fullSubRun |
| ) |
|
Definition at line 23 of file EventRange_t.cc.
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);
BOOST_AUTO_TEST_CASE |
( |
merge1 |
| ) |
|
Definition at line 34 of file EventRange_t.cc.
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());
BOOST_AUTO_TEST_CASE |
( |
merge2 |
| ) |
|
Definition at line 44 of file EventRange_t.cc.
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));
Definition at line 64 of file EventRange_t.cc.
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));
BOOST_AUTO_TEST_CASE |
( |
traits1 |
| ) |
|
Definition at line 79 of file EventRange_t.cc.
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));
BOOST_AUTO_TEST_CASE |
( |
traits2 |
| ) |
|
Definition at line 91 of file EventRange_t.cc.
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));