comparison base/test/TestEventSeries.h @ 1639:7482da1cd920 single-point

Test getEventsStartingWithin (briefly)
author Chris Cannam
date Wed, 13 Mar 2019 10:55:24 +0000
parents e8e51f3ca120
children e7f557789f99
comparison
equal deleted inserted replaced
1638:b57a75aa5ae3 1639:7482da1cd920
443 s.add(a); 443 s.add(a);
444 s.add(cc); 444 s.add(cc);
445 s.add(dd); 445 s.add(dd);
446 s.add(e); 446 s.add(e);
447 QCOMPARE(s.getEventsWithin(2, 7), EventVector({ b, c, cc })); 447 QCOMPARE(s.getEventsWithin(2, 7), EventVector({ b, c, cc }));
448 }
449
450 void eventPatternStartingWithin() {
451
452 EventSeries s;
453 Event a(0, 1.0f, 18, QString("a"));
454 Event b(3, 2.0f, 6, QString("b"));
455 Event c(5, 3.0f, 2, QString("c"));
456 Event cc(5, 3.1f, 2, QString("cc"));
457 Event d(6, 4.0f, 10, QString("d"));
458 Event dd(6, 4.5f, 10, QString("dd"));
459 Event e(14, 5.0f, 3, QString("e"));
460 s.add(b);
461 s.add(c);
462 s.add(d);
463 s.add(a);
464 s.add(cc);
465 s.add(dd);
466 s.add(e);
467 QCOMPARE(s.getEventsStartingWithin(2, 7),
468 EventVector({ b, c, cc, d, dd }));
448 } 469 }
449 470
450 void eventPatternAddRemove() { 471 void eventPatternAddRemove() {
451 472
452 // This is mostly here to exercise the innards of EventSeries 473 // This is mostly here to exercise the innards of EventSeries