Reduce the runtime of some ACM tests in modules_tests
By reducing the length of the audio input, the total runtime of
$ out/Debug/modules_tests --gtest_filter=AudioCodingModuleTest.*
is reduced by more than 10x, when run single-threaded.
The PCMFile helper class is extended with a FastForward method (to
skip initial silence in the test files) and a limiter on how much to
read.
BUG=webrtc:2463
R=ivoc@webrtc.org
Review URL: https://codereview.webrtc.org/1513223002 .
Cr-Commit-Position: refs/heads/master@{#10973}
diff --git a/webrtc/modules/audio_coding/test/TestVADDTX.cc b/webrtc/modules/audio_coding/test/TestVADDTX.cc
index 98b1224..a7d2c21 100644
--- a/webrtc/modules/audio_coding/test/TestVADDTX.cc
+++ b/webrtc/modules/audio_coding/test/TestVADDTX.cc
@@ -87,6 +87,11 @@
PCMFile in_file;
in_file.Open(in_filename, frequency, "rb");
in_file.ReadStereo(channels > 1);
+ // Set test length to 1000 ms (100 blocks of 10 ms each).
+ in_file.SetNum10MsBlocksToRead(100);
+ // Fast-forward both files 500 ms (50 blocks). The first second of the file is
+ // silence, but we want to keep half of that to test silence periods.
+ in_file.FastForward(50);
PCMFile out_file;
if (append) {