barelymusician/dsp/sample_player_test.cpp
// Tests that the sample data is played back as expected.
Tests that the sample data is played back as expected.
Tests that the sample data is played back as expected .
TEST(SamplePlayerTest, SimplePlayback) {
  SamplePlayer sample_player(kSampleRate);
  sample_player.SetData(kData, kSampleRate, kDataLength);
  for (int i = 0; i < kDataLength; ++i) {
    EXPECT_DOUBLE_EQ(sample_player.Next(), kData[i]) << "at index " << i;
  }
  EXPECT_DOUBLE_EQ(sample_player.Next(), 0.0);
}
TEST ( SamplePlayerTest , SimplePlayback ) { SamplePlayer sample_player ( kSampleRate ) ; sample_player . SetData ( kData , kSampleRate , kDataLength ) ; for ( int i = 0 ; i < kDataLength ; ++ i ) { EXPECT_DOUBLE_EQ ( sample_player . Next ( ) , kData [ i ] ) << " " << i ; } EXPECT_DOUBLE_EQ ( sample_player . Next ( ) , 0.0 ) ; }
Tests that the sample data is played back as expected.
Tests that the sample data is played back as expected .