Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Unified Diff: webrtc/modules/audio_coding/test/TestVADDTX.cc

Issue 1513223002: Reduce the runtime of some ACM tests in modules_tests (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/test/TestVADDTX.cc
diff --git a/webrtc/modules/audio_coding/test/TestVADDTX.cc b/webrtc/modules/audio_coding/test/TestVADDTX.cc
index 98b1224762ddd6e72df426b9aaf776a2c302ed0a..6a0b270e27018853af815e864e96192ca748899f 100644
--- a/webrtc/modules/audio_coding/test/TestVADDTX.cc
+++ b/webrtc/modules/audio_coding/test/TestVADDTX.cc
@@ -12,6 +12,7 @@
#include <string>
+#include "webrtc/base/checks.h"
#include "webrtc/engine_configurations.h"
#include "webrtc/modules/audio_coding/test/PCMFile.h"
#include "webrtc/modules/audio_coding/test/utility.h"
@@ -87,6 +88,12 @@ void TestVadDtx::Run(std::string in_filename, int frequency, int channels,
PCMFile in_file;
in_file.Open(in_filename, frequency, "rb");
in_file.ReadStereo(channels > 1);
+ static const int kTestLengthMs = 1000;
+ const int test_length_blocks = rtc::CheckedDivExact(kTestLengthMs, 10);
+ in_file.SetNum10MsBlocksToRead(test_length_blocks);
+ // 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) {

Powered by Google App Engine
This is Rietveld 408576698