# HG changeset patch # User Chris Cannam # Date 1552474524 0 # Node ID 7482da1cd92038815338e401456a9ded97fd197a # Parent b57a75aa5ae338d2344b8675cb80ad1f0f3b78f9 Test getEventsStartingWithin (briefly) diff -r b57a75aa5ae3 -r 7482da1cd920 base/test/TestEventSeries.h --- a/base/test/TestEventSeries.h Wed Mar 13 10:55:02 2019 +0000 +++ b/base/test/TestEventSeries.h Wed Mar 13 10:55:24 2019 +0000 @@ -447,6 +447,27 @@ QCOMPARE(s.getEventsWithin(2, 7), EventVector({ b, c, cc })); } + void eventPatternStartingWithin() { + + EventSeries s; + Event a(0, 1.0f, 18, QString("a")); + Event b(3, 2.0f, 6, QString("b")); + Event c(5, 3.0f, 2, QString("c")); + Event cc(5, 3.1f, 2, QString("cc")); + Event d(6, 4.0f, 10, QString("d")); + Event dd(6, 4.5f, 10, QString("dd")); + Event e(14, 5.0f, 3, QString("e")); + s.add(b); + s.add(c); + s.add(d); + s.add(a); + s.add(cc); + s.add(dd); + s.add(e); + QCOMPARE(s.getEventsStartingWithin(2, 7), + EventVector({ b, c, cc, d, dd })); + } + void eventPatternAddRemove() { // This is mostly here to exercise the innards of EventSeries