modules/audio_coding/neteq/expand_unittest.cc
TEST_F(ExpandTest, DelayedPacketOutage) {
  AudioMultiVector output(num_channels_);
  size_t sum_output_len_samples = 0;
  for (int i = 0; i < 10; ++i) {
    EXPECT_EQ(0, expand_.Process(&output));
    EXPECT_GT(output.Size(), 0u);
    sum_output_len_samples += output.Size();
    EXPECT_EQ(0, statistics_.last_outage_duration_ms());
  }
  expand_.SetParametersForNormalAfterExpand();
  // Convert |sum_output_len_samples| to milliseconds.
  EXPECT_EQ(rtc::checked_cast<int>(sum_output_len_samples /
                                   (test_sample_rate_hz_ / 1000)),
            statistics_.last_outage_duration_ms());
}
// This test calls the expand object to produce concealment data a few times,
// and then ends by calling SetParametersForNormalAfterExpand. This simulates
// the situation where the packet next up for decoding was just delayed, not
// lost.
This test calls the expand object to produce concealment data a few times,
and then ends by calling SetParametersForNormalAfterExpand. This simulates
the situation where the packet next up for decoding was just delayed, not
lost.
This test calls the expand object to produce concealment data a few times and then ends by calling SetParametersForNormalAfterExpand . This simulates the situation where the packet next up for decoding was just delayed not lost .
TEST_F(ExpandTest, DelayedPacketOutage) {
  AudioMultiVector output(num_channels_);
  size_t sum_output_len_samples = 0;
  for (int i = 0; i < 10; ++i) {
    EXPECT_EQ(0, expand_.Process(&output));
    EXPECT_GT(output.Size(), 0u);
    sum_output_len_samples += output.Size();
    EXPECT_EQ(0, statistics_.last_outage_duration_ms());
  }
  expand_.SetParametersForNormalAfterExpand();
  EXPECT_EQ(rtc::checked_cast<int>(sum_output_len_samples /
                                   (test_sample_rate_hz_ / 1000)),
            statistics_.last_outage_duration_ms());
}
TEST_F ( ExpandTest , DelayedPacketOutage ) { AudioMultiVector output ( num_channels_ ) ; size_t sum_output_len_samples = 0 ; for ( int i = 0 ; i < 10 ; ++ i ) { EXPECT_EQ ( 0 , expand_ . Process ( & output ) ) ; EXPECT_GT ( output . Size ( ) , 0u ) ; sum_output_len_samples += output . Size ( ) ; EXPECT_EQ ( 0 , statistics_ . last_outage_duration_ms ( ) ) ; } expand_ . SetParametersForNormalAfterExpand ( ) ; EXPECT_EQ ( rtc :: checked_cast < int > ( sum_output_len_samples / ( test_sample_rate_hz_ / 1000 ) ) , statistics_ . last_outage_duration_ms ( ) ) ; }
This test calls the expand object to produce concealment data a few times,
and then ends by calling SetParametersForNormalAfterExpand.
This test calls the expand object to produce concealment data a few times and then ends by calling SetParametersForNormalAfterExpand .
// Convert |sum_output_len_samples| to milliseconds.