changeset 1639:7482da1cd920 single-point

Test getEventsStartingWithin (briefly)
author Chris Cannam
date Wed, 13 Mar 2019 10:55:24 +0000
parents b57a75aa5ae3
children e7f557789f99
files base/test/TestEventSeries.h
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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