From b5d3802b7a9665383118782f8a8af8c2ba167d77 Mon Sep 17 00:00:00 2001 From: Sam Zackrisson Date: Fri, 13 Jul 2018 10:20:30 +0200 Subject: [PATCH] Fuzz more aec3 field trials There are many new killswitches for AEC3 code. By fuzzing them, we ensure the code is more thoroughly tested in case we need to trigger any switches. Bug: webrtc:9413 Change-Id: I0bc7609e4d71fc820abfbba7d481b2374c3587cb Reviewed-on: https://webrtc-review.googlesource.com/88225 Commit-Queue: Sam Zackrisson Reviewed-by: Alessio Bazzica Cr-Commit-Position: refs/heads/master@{#23960} --- test/fuzzers/audio_processing_configs_fuzzer.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/test/fuzzers/audio_processing_configs_fuzzer.cc b/test/fuzzers/audio_processing_configs_fuzzer.cc index 4900c0f865..46f8918bf6 100644 --- a/test/fuzzers/audio_processing_configs_fuzzer.cc +++ b/test/fuzzers/audio_processing_configs_fuzzer.cc @@ -38,7 +38,14 @@ const std::string kFieldTrialNames[] = { "WebRTC-Aec3ZeroExternalDelayHeadroomKillSwitch", "WebRTC-Aec3DownSamplingFactor8KillSwitch", "WebRTC-Aec3EnforceSkewHysteresis1", - "WebRTC-Aec3EnforceSkewHysteresis2"}; + "WebRTC-Aec3EnforceSkewHysteresis2", + "WebRTC-Aec3NewSuppressionKillSwitch", + "WebRTC-Aec3LinearModeWithDivergedFilterKillSwitch", + "WebRTC-Aec3MisadjustmentEstimatorKillSwitch", + "WebRTC-Aec3RapidAgcGainRecoveryKillSwitch", + "WebRTC-Aec3SlowFilterAdaptationKillSwitch", + "WebRTC-Aec3SmoothUpdatesTailFreqRespKillSwitch", + "WebRTC-Aec3SuppressorNearendAveragingKillSwitch"}; std::unique_ptr CreateApm(test::FuzzDataHelper* fuzz_data, std::string* field_trial_string) { @@ -69,11 +76,11 @@ std::unique_ptr CreateApm(test::FuzzDataHelper* fuzz_data, rtc::SafeClamp(fuzz_data->ReadOrDefaultValue(0), -50, 50); constexpr size_t kNumFieldTrials = arraysize(kFieldTrialNames); - // This check ensures the uint16_t that is read has enough bits to cover all - // the field trials. - RTC_DCHECK_LE(kNumFieldTrials, 16); + // Verify that the read data type has enough bits to fuzz the field trials. + using FieldTrialBitmaskType = uint32_t; + RTC_DCHECK_LE(kNumFieldTrials, sizeof(FieldTrialBitmaskType) * 8); std::bitset field_trial_bitmask( - fuzz_data->ReadOrDefaultValue(0)); + fuzz_data->ReadOrDefaultValue(0)); for (size_t i = 0; i < kNumFieldTrials; ++i) { if (field_trial_bitmask[i]) { *field_trial_string += kFieldTrialNames[i] + "/Enabled/";