20 class ToyRawInputTester;
24 using std::ostringstream;
34 numFilesExpected_ = fileNames_.size();
36 for (
size_t i = 0;
i != numFilesExpected_; ++
i) {
37 expected <<
"open " << fileNames_[
i] <<
'\n';
39 std::vector<std::tuple<int, int, int>> tokens;
49 assert(
p.get_if_present(fileNames_[
i], tokens));
53 for (
auto const& token : tokens) {
54 int newRun, newSubRun, newEvent;
55 std::tie(newRun, newSubRun, newEvent) = token;
59 expected <<
"begin " <<
RunID(currentRun) <<
'\n';
61 if (newSubRun != -1) {
62 ++numSubRunsExpected_;
63 currentSubRun = newSubRun;
64 expected <<
"begin " <<
SubRunID(currentRun, currentSubRun) <<
'\n';
68 expected <<
"event " <<
EventID(currentRun, currentSubRun, newEvent)
73 expectedMessage_ = expected.str();
80 messages_ <<
"open " << fb.
fileName() <<
'\n';
87 messages_ <<
"begin " << r.
id() <<
'\n';
94 messages_ <<
"begin " << sr.
id() <<
'\n';
101 messages_ <<
"event " << e.
id() <<
'\n';
108 std::cerr << rule(
'-') <<
'\n' 109 << expectedMessage_ << rule(
'-') <<
'\n' 111 << messages_.str() << rule(
'+') <<
'\n';
112 assert(numFilesSeen_ == numFilesExpected_);
113 assert(numRunsSeen_ == numRunsExpected_);
114 assert(numSubRunsSeen_ == numSubRunsExpected_);
115 assert(numEventsSeen_ == numEventsExpected_);
116 assert(expectedMessage_ == messages_.str());
120 size_t numEventsSeen_{};
121 size_t numEventsExpected_{};
122 size_t numSubRunsSeen_{};
123 size_t numSubRunsExpected_{};
124 size_t numRunsSeen_{};
125 size_t numRunsExpected_{};
126 size_t numFilesSeen_{};
127 size_t numFilesExpected_{};
130 ostringstream messages_{};
131 string expectedMessage_{};
void make_ParameterSet(intermediate_table const &tbl, ParameterSet &ps)
#define DEFINE_ART_MODULE(klass)
std::string const & fileName() const
IDNumber_t< Level::SubRun > SubRunNumber_t
bool get_if_present(std::string const &key, T &value) const
void parse_document(std::string const &filename, cet::filepath_maker &maker, intermediate_table &result)
IDNumber_t< Level::Run > RunNumber_t