barelymusician/engine/engine_test.cpp
// Tests that engine starts and stops playback as expected.
Tests that engine starts and stops playback as expected.
Tests that engine starts and stops playback as expected .
TEST(EngineTest, StartStopPlayback) {
  Engine engine;
  EXPECT_EQ(engine.GetTransport().GetPosition(), 0.0);
  EXPECT_FALSE(engine.GetTransport().IsPlaying());
  engine.Update(10.0);
  EXPECT_EQ(engine.GetTransport().GetPosition(), 0.0);
  EXPECT_FALSE(engine.GetTransport().IsPlaying());
  engine.Start();
  EXPECT_EQ(engine.GetTransport().GetPosition(), 0.0);
  EXPECT_TRUE(engine.GetTransport().IsPlaying());
  engine.Update(20.0);
  EXPECT_EQ(engine.GetTransport().GetPosition(), 20.0);
  EXPECT_TRUE(engine.GetTransport().IsPlaying());
  engine.Stop();
  EXPECT_EQ(engine.GetTransport().GetPosition(), 20.0);
  EXPECT_FALSE(engine.GetTransport().IsPlaying());
  engine.Update(30.0);
  EXPECT_EQ(engine.GetTransport().GetPosition(), 20.0);
  EXPECT_FALSE(engine.GetTransport().IsPlaying());
}
TEST ( EngineTest , StartStopPlayback ) { Engine engine ; EXPECT_EQ ( engine . GetTransport ( ) . GetPosition ( ) , 0.0 ) ; EXPECT_FALSE ( engine . GetTransport ( ) . IsPlaying ( ) ) ; engine . Update ( 10.0 ) ; EXPECT_EQ ( engine . GetTransport ( ) . GetPosition ( ) , 0.0 ) ; EXPECT_FALSE ( engine . GetTransport ( ) . IsPlaying ( ) ) ; engine . Start ( ) ; EXPECT_EQ ( engine . GetTransport ( ) . GetPosition ( ) , 0.0 ) ; EXPECT_TRUE ( engine . GetTransport ( ) . IsPlaying ( ) ) ; engine . Update ( 20.0 ) ; EXPECT_EQ ( engine . GetTransport ( ) . GetPosition ( ) , 20.0 ) ; EXPECT_TRUE ( engine . GetTransport ( ) . IsPlaying ( ) ) ; engine . Stop ( ) ; EXPECT_EQ ( engine . GetTransport ( ) . GetPosition ( ) , 20.0 ) ; EXPECT_FALSE ( engine . GetTransport ( ) . IsPlaying ( ) ) ; engine . Update ( 30.0 ) ; EXPECT_EQ ( engine . GetTransport ( ) . GetPosition ( ) , 20.0 ) ; EXPECT_FALSE ( engine . GetTransport ( ) . IsPlaying ( ) ) ; }
Tests that engine starts and stops playback as expected.
Tests that engine starts and stops playback as expected .