1 #define BOOST_TEST_MODULE (FileIndex_t) 2 #include "boost/test/unit_test.hpp" 22 BOOST_AUTO_TEST_SUITE(FileIndex_t)
27 BOOST_TEST(fileIndex.
empty());
28 BOOST_TEST(fileIndex.
size() == 0);
29 BOOST_TEST(fileIndex.
begin() == fileIndex.
end());
37 BOOST_TEST(!fileIndex.
empty());
38 BOOST_TEST(fileIndex.
size() == 5);
40 auto it = fileIndex.
begin();
41 BOOST_TEST(it->eventID ==
EventID(100, 101, 102));
42 BOOST_TEST(it->entry == 1);
53 BOOST_TEST(it->entry == 3);
58 BOOST_TEST(it == fileIndex.
end());
151 BOOST_TEST(fileIndex == shouldBe);
157 BOOST_TEST((it - fileIndex.
begin()) == 12);
158 BOOST_TEST(it->eventID ==
EventID(3, 3, 2));
159 BOOST_TEST(it->entry == 5);
162 BOOST_TEST((it - fileIndex.
begin()) == 14);
165 BOOST_TEST((it - fileIndex.
begin()) == 4);
168 BOOST_TEST((it - fileIndex.
begin()) == 8);
171 BOOST_TEST((it - fileIndex.
begin()) == 1);
174 BOOST_TEST((it - fileIndex.
begin()) == 0);
177 BOOST_TEST((it - fileIndex.
begin()) == 5);
180 BOOST_TEST((it - fileIndex.
begin()) == 5);
183 BOOST_TEST((it - fileIndex.
begin()) == 4);
186 BOOST_TEST((it - fileIndex.
begin()) == 7);
189 BOOST_TEST((it - fileIndex.
begin()) == 12);
193 BOOST_TEST(it == fileIndex.
end());
197 BOOST_TEST((it - fileIndex.
begin()) == 4);
201 BOOST_TEST(it == fileIndex.
end());
204 BOOST_TEST((it - fileIndex.
begin()) == 7);
207 BOOST_TEST(it == fileIndex.
end());
210 BOOST_TEST((it - fileIndex.
begin()) == 7);
213 BOOST_TEST((it - fileIndex.
begin()) == 8);
219 BOOST_TEST((it - fileIndex.
begin()) == 5);
222 BOOST_TEST(it == fileIndex.
end());
225 BOOST_TEST((it - fileIndex.
begin()) == 5);
231 BOOST_TEST((it - fileIndex.
begin()) == 1);
234 BOOST_TEST((it - fileIndex.
begin()) == 5);
237 BOOST_TEST((it - fileIndex.
begin()) == 14);
240 BOOST_TEST((it - fileIndex.
begin()) == 8);
243 BOOST_TEST((it - fileIndex.
begin()) == 5);
248 BOOST_TEST((it - fileIndex.
begin()) == 4);
252 BOOST_TEST(it == fileIndex.
end());
256 BOOST_TEST((it - fileIndex.
begin()) == 10);
260 BOOST_TEST((it - fileIndex.
begin()) == 16);
264 BOOST_TEST((it - fileIndex.
begin()) == 22);
268 BOOST_TEST((it - fileIndex.
begin()) == 31);
314 BOOST_TEST(fileIndex == shouldBe);
317 BOOST_TEST((it - fileIndex.
begin()) == 7);
320 BOOST_TEST(it == fileIndex.
end());
323 BOOST_TEST((it - fileIndex.
begin()) == 7);
326 BOOST_TEST((it - fileIndex.
begin()) == 8);
329 BOOST_TEST((it - fileIndex.
begin()) == 5);
332 BOOST_TEST(it == fileIndex.
end());
335 BOOST_TEST((it - fileIndex.
begin()) == 5);
338 BOOST_TEST((it - fileIndex.
begin()) == 1);
341 BOOST_TEST((it - fileIndex.
begin()) == 5);
344 BOOST_TEST(it == fileIndex.
end());
347 BOOST_TEST((it - fileIndex.
begin()) == 8);
350 BOOST_TEST((it - fileIndex.
begin()) == 5);
365 BOOST_TEST(fileIndex1.eventsUniqueAndOrdered());
371 fileIndex2.addEntry(
EventID(1, 2, 1), 1);
372 BOOST_TEST(fileIndex2.eventsUniqueAndOrdered());
378 fileIndex3.addEntry(
EventID(1, 2, 1), 1);
380 BOOST_TEST(fileIndex3.eventsUniqueAndOrdered());
386 fileIndex4.addEntry(
EventID(1, 1, 1), 1);
389 fileIndex4.addEntry(
EventID(2, 1, 1), 2);
390 BOOST_TEST(fileIndex4.eventsUniqueAndOrdered());
396 fileIndex5.addEntry(
EventID(1, 1, 1), 1);
399 fileIndex5.addEntry(
EventID(1, 2, 1), 2);
400 BOOST_TEST(fileIndex5.eventsUniqueAndOrdered());
406 fileIndex6.addEntry(
EventID(1, 2, 1), 1);
409 fileIndex6.addEntry(
EventID(2, 1, 1), 2);
412 fileIndex6.addEntry(
EventID(1, 3, 1), 3);
413 BOOST_TEST(!fileIndex6.eventsUniqueAndOrdered());
419 fileIndex7.addEntry(
EventID(1, 2, 1), 1);
422 fileIndex7.addEntry(
EventID(2, 1, 2), 2);
424 fileIndex7.addEntry(
EventID(2, 3, 1), 3);
425 BOOST_TEST(fileIndex7.eventsUniqueAndOrdered());
431 fileIndex8.addEntry(
EventID(1, 1, 1), 1);
432 fileIndex8.addEntry(
EventID(1, 1, 2), 1);
433 fileIndex8.addEntry(
EventID(1, 1, 3), 1);
434 fileIndex8.addEntry(
EventID(1, 1, 4), 1);
437 fileIndex8.addEntry(
EventID(2, 1, 1), 2);
439 fileIndex8.addEntry(
EventID(2, 3, 2), 3);
440 fileIndex8.addEntry(
EventID(2, 3, 3), 3);
441 fileIndex8.addEntry(
EventID(2, 3, 4), 3);
442 fileIndex8.addEntry(
EventID(2, 3, 5), 3);
443 fileIndex8.addEntry(
EventID(2, 3, 6), 3);
444 BOOST_TEST(fileIndex8.eventsUniqueAndOrdered());
447 BOOST_AUTO_TEST_SUITE_END()
std::vector< Element >::iterator iterator
const_iterator findSubRunOrRunPosition(SubRunID const &srID) const
bool allEventsInEntryOrder() const
void sortBy_Run_SubRun_EventEntry()
std::vector< Element >::size_type size() const
void sortBy_Run_SubRun_Event()
BOOST_AUTO_TEST_CASE(constructAndInsertTest)
const_iterator findPosition(EventID const &eID) const
std::ostream & boost_test_print_type(std::ostream &os, Timestamp const timestamp)
void addEntry(EventID const &eID, EntryNumber_t entry)
bool eventsUniqueAndOrdered() const
std::vector< Element >::const_iterator const_iterator
bool contains(EventID const &id, bool exact) const
static constexpr EventID invalidEvent() noexcept
static SubRunID invalidSubRun(RunID const &rID)