barelymusician/engine/event_queue_test.cpp
// Tests that adding a single event is queued as expected.
Tests that adding a single event is queued as expected.
Tests that adding a single event is queued as expected .
TEST(EventQueueTest, AddSingleEvent) {
  EventQueue events;
  EXPECT_THAT(events.GetNext(0.0), IsNull());
  EXPECT_THAT(events.GetNext(1.0), IsNull());
  EXPECT_THAT(events.GetNext(10.0), IsNull());
  events.Add(1.0, SetNoteOffEvent{5.0});
  EXPECT_THAT(events.GetNext(0.0), IsNull());
  EXPECT_THAT(events.GetNext(1.0), IsNull());
  EXPECT_THAT(
      events.GetNext(10.0),
      AllOf(NotNull(), Pointee(Pair(1.0, VariantWith<SetNoteOffEvent>(Field(
                                             &SetNoteOffEvent::pitch, 5.0))))));
  EXPECT_THAT(events.GetNext(10.0), IsNull());
}
TEST ( EventQueueTest , AddSingleEvent ) { EventQueue events ; EXPECT_THAT ( events . GetNext ( 0.0 ) , IsNull ( ) ) ; EXPECT_THAT ( events . GetNext ( 1.0 ) , IsNull ( ) ) ; EXPECT_THAT ( events . GetNext ( 10.0 ) , IsNull ( ) ) ; events . Add ( 1.0 , SetNoteOffEvent { 5.0 } ) ; EXPECT_THAT ( events . GetNext ( 0.0 ) , IsNull ( ) ) ; EXPECT_THAT ( events . GetNext ( 1.0 ) , IsNull ( ) ) ; EXPECT_THAT ( events . GetNext ( 10.0 ) , AllOf ( NotNull ( ) , Pointee ( Pair ( 1.0 , VariantWith < SetNoteOffEvent > ( Field ( & SetNoteOffEvent :: pitch , 5.0 ) ) ) ) ) ) ; EXPECT_THAT ( events . GetNext ( 10.0 ) , IsNull ( ) ) ; }
Tests that adding a single event is queued as expected.
Tests that adding a single event is queued as expected .
// Event is already returned.