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

Unified Diff: webrtc/modules/audio_coding/test/EncodeDecodeTest.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/EncodeDecodeTest.cc
diff --git a/webrtc/modules/audio_coding/test/EncodeDecodeTest.cc b/webrtc/modules/audio_coding/test/EncodeDecodeTest.cc
index ef45705e20aac0b1b984911d249b6415a3c28f7f..e2a3a1278c8355f87f0bbe93f3e256ea6ab6636f 100644
--- a/webrtc/modules/audio_coding/test/EncodeDecodeTest.cc
+++ b/webrtc/modules/audio_coding/test/EncodeDecodeTest.cc
@@ -15,6 +15,7 @@
#include <stdlib.h>
#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/base/checks.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/common_types.h"
#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
@@ -63,6 +64,11 @@ void Sender::Setup(AudioCodingModule *acm, RTPStream *rtpStream,
if (channels == 2) {
_pcmFile.ReadStereo(true);
}
+ static const int kTestLengthMs = 500;
ivoc 2015/12/10 12:23:57 Not sure what the point of static is here.
hlundin-webrtc 2015/12/10 12:49:59 Gone.
+ const int test_length_blocks = rtc::CheckedDivExact(kTestLengthMs, 10);
+ _pcmFile.SetNum10MsBlocksToRead(test_length_blocks);
+ // Fast-forward 1 second (100 blocks) since the file starts with silence.
+ _pcmFile.FastForward(100);
// Set the codec for the current test.
if ((testMode == 0) || (testMode == 1)) {
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/test/PCMFile.h » ('j') | webrtc/modules/audio_coding/test/PCMFile.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698