barelymusician/engine/event_queue_test.cpp
// Tests that adding multiple events are queued as expected.
Tests that adding multiple events are queued as expected.
Tests that adding multiple events are queued as expected .
TEST(EventQueueTest, AddMultipleEvents) {
  EventQueue events;
  EXPECT_THAT(events.GetNext(10.0), IsNull());
  for (double i = 0.0; i < 10.0; ++i) {
    events.Add(i, SetNoteOffEvent{i});
  }
  for (double i = 0.0; i < 10.0; ++i) {
    EXPECT_THAT(
        events.GetNext(10.0),
        AllOf(NotNull(), Pointee(Pair(i, VariantWith<SetNoteOffEvent>(Field(
                                             &SetNoteOffEvent::pitch, i))))));
  }
  EXPECT_THAT(events.GetNext(10.0), IsNull());
}
TEST ( EventQueueTest , AddMultipleEvents ) { EventQueue events ; EXPECT_THAT ( events . GetNext ( 10.0 ) , IsNull ( ) ) ; for ( double i = 0.0 ; i < 10.0 ; ++ i ) { events . Add ( i , SetNoteOffEvent { i } ) ; } for ( double i = 0.0 ; i < 10.0 ; ++ i ) { EXPECT_THAT ( events . GetNext ( 10.0 ) , AllOf ( NotNull ( ) , Pointee ( Pair ( i , VariantWith < SetNoteOffEvent > ( Field ( & SetNoteOffEvent :: pitch , i ) ) ) ) ) ) ; } EXPECT_THAT ( events . GetNext ( 10.0 ) , IsNull ( ) ) ; }
Tests that adding multiple events are queued as expected.
Tests that adding multiple events are queued as expected .
// All events are already returned.