modules/audio_coding/neteq/expand_unittest.cc
TEST_F(ExpandTest, CheckOutageStatsAfterReset) {
  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();
    if (i == 5) {
      expand_.Reset();
      sum_output_len_samples = 0;
    }
    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 is similar to the DelayedPacketOutage test above, but with the
// difference that Expand::Reset() is called after 5 calls to Expand::Process().
// This should reset the statistics, and will in the end lead to an outage of
// 5 periods instead of 10.
This test is similar to the DelayedPacketOutage test above, but with the
difference that Expand::Reset() is called after 5 calls to Expand::Process().
This should reset the statistics, and will in the end lead to an outage of
5 periods instead of 10.
This test is similar to the DelayedPacketOutage test above but with the difference that Expand :: Reset () is called after 5 calls to Expand :: Process () . This should reset the statistics and will in the end lead to an outage of 5 periods instead of 10 .
TEST_F(ExpandTest, CheckOutageStatsAfterReset) {
  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();
    if (i == 5) {
      expand_.Reset();
      sum_output_len_samples = 0;
    }
    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 , CheckOutageStatsAfterReset ) { 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 ( ) ; if ( i == 5 ) { expand_ . Reset ( ) ; sum_output_len_samples = 0 ; } 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 is similar to the DelayedPacketOutage test above, but with the
difference that Expand::Reset() is called after 5 calls to Expand::Process().
This test is similar to the DelayedPacketOutage test above but with the difference that Expand :: Reset () is called after 5 calls to Expand :: Process () .
// Convert |sum_output_len_samples| to milliseconds.