From 9df3cf3e8c0ae907c1e545eef3aa3f79afd779a8 Mon Sep 17 00:00:00 2001 From: Alex Loiko Date: Tue, 10 Apr 2018 12:18:02 +0200 Subject: [PATCH] Stats calls improve APM fuzzer coverage. A part of the Audio Processing Module interface is GetStatistics. The call collects stats from submodules. We make sure these calls are made by the fuzzer to cover that code path. Bug: webrtc:7820 Change-Id: Ia8f89d9838602dcb2599f676bd5c43e815bbf791 Reviewed-on: https://webrtc-review.googlesource.com/68980 Reviewed-by: Sam Zackrisson Commit-Queue: Alex Loiko Cr-Commit-Position: refs/heads/master@{#22817} --- test/fuzzers/audio_processing_fuzzer_helper.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/fuzzers/audio_processing_fuzzer_helper.cc b/test/fuzzers/audio_processing_fuzzer_helper.cc index bdf5f105e7..868532632f 100644 --- a/test/fuzzers/audio_processing_fuzzer_helper.cc +++ b/test/fuzzers/audio_processing_fuzzer_helper.cc @@ -114,6 +114,11 @@ void FuzzAudioProcessing(test::FuzzDataHelper* fuzz_data, } } + // Make calls to stats gathering functions to cover these + // codeways. + static_cast(apm->GetStatistics()); + static_cast(apm->GetStatistics(true)); + RTC_DCHECK_NE(apm_return_code, AudioProcessing::kBadDataLengthError); } }