src/media/audio/audio_core/mixer/test/mixer_response_tests.cc
// Given result and limit arrays, compare as frequency response results (must be greater-or-equal).
// Also perform a less-or-equal check against overall level tolerance (for level results greater
// than 0 dB). If 'summary_only', we limit evaluation to the three basic frequencies.
Given result and limit arrays, compare as frequency response results (must be greater-or-equal).
Also perform a less-or-equal check against overall level tolerance (for level results greater
than 0 dB). If 'summary_only', we limit evaluation to the three basic frequencies.
Given result and limit arrays compare as frequency response results ( must be greater - or - equal ) . Also perform a less - or - equal check against overall level tolerance ( for level results greater than 0 dB ) . If ' summary_only ' we limit evaluation to the three basic frequencies .
void EvaluateFreqRespResults(double* freq_resp_results, const double* freq_resp_limits,
                             bool summary_only = false) {
  bool use_full_set = (!summary_only) && FrequencySet::UseFullFrequencySet;
  const auto first_idx = use_full_set ? FrequencySet::kFirstInBandRefFreqIdx : 0u;
  const auto last_idx =
      use_full_set ? FrequencySet::kFirstOutBandRefFreqIdx : FrequencySet::kSummaryIdxs.size();
  for (auto idx = first_idx; idx < last_idx; ++idx) {
    uint32_t freq = use_full_set ? idx : FrequencySet::kSummaryIdxs[idx];
    EXPECT_GE(freq_resp_results[freq], freq_resp_limits[freq])
        << " [" << freq << "]  " << std::scientific << std::setprecision(9)
        << freq_resp_results[freq];
    EXPECT_LE(freq_resp_results[freq], 0.0 + AudioResult::kPrevLevelToleranceInterpolation)
        << " [" << freq << "]  " << std::scientific << std::setprecision(9)
        << freq_resp_results[freq];
    AudioResult::LevelToleranceInterpolation =
        fmax(AudioResult::LevelToleranceInterpolation, freq_resp_results[freq]);
  }
}
void EvaluateFreqRespResults ( double * freq_resp_results , const double * freq_resp_limits , bool summary_only = false ) { bool use_full_set = ( ! summary_only ) && FrequencySet :: UseFullFrequencySet ; const auto first_idx = use_full_set ? FrequencySet :: kFirstInBandRefFreqIdx : 0u ; const auto last_idx = use_full_set ? FrequencySet :: kFirstOutBandRefFreqIdx : FrequencySet :: kSummaryIdxs . size ( ) ; for ( auto idx = first_idx ; idx < last_idx ; ++ idx ) { uint32_t freq = use_full_set ? idx : FrequencySet :: kSummaryIdxs [ idx ] ; EXPECT_GE ( freq_resp_results [ freq ] , freq_resp_limits [ freq ] ) << " " << freq << " " << std :: scientific << std :: setprecision ( 9 ) << freq_resp_results [ freq ] ; EXPECT_LE ( freq_resp_results [ freq ] , 0.0 + AudioResult :: kPrevLevelToleranceInterpolation ) << " " << freq << " " << std :: scientific << std :: setprecision ( 9 ) << freq_resp_results [ freq ] ; AudioResult :: LevelToleranceInterpolation = fmax ( AudioResult :: LevelToleranceInterpolation , freq_resp_results [ freq ] ) ; } }
Given result and limit arrays, compare as frequency response results (must be greater-or-equal).
Given result and limit arrays compare as frequency response results ( must be greater - or - equal ) .