examples/composition/note_duration_test.cpp
// Tests that expected positions are returned with respect to the given steps.
Tests that expected positions are returned with respect to the given steps.
Tests that expected positions are returned with respect to the given steps .
TEST_P(PositionTest, GetPosition) {
  const int kNumBeats = 4;
  const int num_steps = GetParam();
  for (int beat = 0; beat < kNumBeats; ++beat) {
    for (int i = 0; i < num_steps; ++i) {
      const double expected_position =
          static_cast<double>(beat) +
          static_cast<double>(i) / static_cast<double>(num_steps);
      EXPECT_DOUBLE_EQ(GetPosition(num_steps * beat + i, num_steps),
                       expected_position);
    }
  }
}
TEST_P ( PositionTest , GetPosition ) { const int kNumBeats = 4 ; const int num_steps = GetParam ( ) ; for ( int beat = 0 ; beat < kNumBeats ; ++ beat ) { for ( int i = 0 ; i < num_steps ; ++ i ) { const double expected_position = static_cast < double > ( beat ) + static_cast < double > ( i ) / static_cast < double > ( num_steps ) ; EXPECT_DOUBLE_EQ ( GetPosition ( num_steps * beat + i , num_steps ) , expected_position ) ; } } }
Tests that expected positions are returned with respect to the given steps.
Tests that expected positions are returned with respect to the given steps .