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

Unified Diff: webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc

Issue 1457023002: Rewrote the PRNG using an xorshift* algorithm and moved the files from test/ to base/. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Minor comments Created 5 years, 1 month 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_processing/audio_processing_impl_locking_unittest.cc
diff --git a/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc b/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc
index d1dabee6363baca814b5727375bba0335ccb97c5..19e5e66eb89c9bf5525bb325c548fc0a16b6c3cb 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc
@@ -16,13 +16,13 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/base/array_view.h"
#include "webrtc/base/criticalsection.h"
+#include "webrtc/base/random.h"
#include "webrtc/config.h"
#include "webrtc/modules/audio_processing/test/test_utils.h"
#include "webrtc/modules/include/module_common_types.h"
#include "webrtc/system_wrappers/include/event_wrapper.h"
#include "webrtc/system_wrappers/include/sleep.h"
#include "webrtc/system_wrappers/include/thread_wrapper.h"
-#include "webrtc/test/random.h"
namespace webrtc {
@@ -31,7 +31,7 @@ namespace {
class AudioProcessingImplLockTest;
// Sleeps a random time between 0 and max_sleep milliseconds.
-void SleepRandomMs(int max_sleep, test::Random* rand_gen) {
+void SleepRandomMs(int max_sleep, Random* rand_gen) {
int sleeptime = rand_gen->Rand(0, max_sleep);
SleepMs(sleeptime);
}
@@ -41,7 +41,7 @@ void PopulateAudioFrame(float** frame,
float amplitude,
size_t num_channels,
size_t samples_per_channel,
- test::Random* rand_gen) {
+ Random* rand_gen) {
for (size_t ch = 0; ch < num_channels; ch++) {
for (size_t k = 0; k < samples_per_channel; k++) {
// Store random 16 bit quantized float number between +-amplitude.
@@ -53,7 +53,7 @@ void PopulateAudioFrame(float** frame,
// Populates an audioframe frame of AudioFrame type with random data.
void PopulateAudioFrame(AudioFrame* frame,
int16_t amplitude,
- test::Random* rand_gen) {
+ Random* rand_gen) {
ASSERT_GT(amplitude, 0);
ASSERT_LE(amplitude, 32767);
for (int ch = 0; ch < frame->num_channels_; ch++) {
@@ -331,7 +331,7 @@ class CaptureSideCalledChecker {
class CaptureProcessor {
public:
CaptureProcessor(int max_frame_size,
- test::Random* rand_gen,
+ Random* rand_gen,
FrameCounters* shared_counters_state,
CaptureSideCalledChecker* capture_call_checker,
AudioProcessingImplLockTest* test_framework,
@@ -348,7 +348,7 @@ class CaptureProcessor {
void CallApmCaptureSide();
void ApplyRuntimeSettingScheme();
- test::Random* rand_gen_ = nullptr;
+ Random* rand_gen_ = nullptr;
FrameCounters* frame_counters_ = nullptr;
CaptureSideCalledChecker* capture_call_checker_ = nullptr;
AudioProcessingImplLockTest* test_ = nullptr;
@@ -360,13 +360,13 @@ class CaptureProcessor {
// Class for handling the stats processing.
class StatsProcessor {
public:
- StatsProcessor(test::Random* rand_gen,
+ StatsProcessor(Random* rand_gen,
TestConfig* test_config,
AudioProcessing* apm);
bool Process();
private:
- test::Random* rand_gen_ = nullptr;
+ Random* rand_gen_ = nullptr;
TestConfig* test_config_ = nullptr;
AudioProcessing* apm_ = nullptr;
};
@@ -375,7 +375,7 @@ class StatsProcessor {
class RenderProcessor {
public:
RenderProcessor(int max_frame_size,
- test::Random* rand_gen,
+ Random* rand_gen,
FrameCounters* shared_counters_state,
CaptureSideCalledChecker* capture_call_checker,
AudioProcessingImplLockTest* test_framework,
@@ -392,7 +392,7 @@ class RenderProcessor {
void CallApmRenderSide();
void ApplyRuntimeSettingScheme();
- test::Random* rand_gen_ = nullptr;
+ Random* rand_gen_ = nullptr;
FrameCounters* frame_counters_ = nullptr;
CaptureSideCalledChecker* capture_call_checker_ = nullptr;
AudioProcessingImplLockTest* test_ = nullptr;
@@ -459,7 +459,7 @@ class AudioProcessingImplLockTest
rtc::scoped_ptr<ThreadWrapper> render_thread_;
rtc::scoped_ptr<ThreadWrapper> capture_thread_;
rtc::scoped_ptr<ThreadWrapper> stats_thread_;
- mutable test::Random rand_gen_;
+ mutable Random rand_gen_;
rtc::scoped_ptr<AudioProcessing> apm_;
TestConfig test_config_;
@@ -557,7 +557,7 @@ void AudioProcessingImplLockTest::TearDown() {
stats_thread_->Stop();
}
-StatsProcessor::StatsProcessor(test::Random* rand_gen,
+StatsProcessor::StatsProcessor(Random* rand_gen,
TestConfig* test_config,
AudioProcessing* apm)
: rand_gen_(rand_gen), test_config_(test_config), apm_(apm) {}
@@ -591,7 +591,7 @@ const float CaptureProcessor::kCaptureInputFloatLevel = 0.03125f;
CaptureProcessor::CaptureProcessor(
int max_frame_size,
- test::Random* rand_gen,
+ Random* rand_gen,
FrameCounters* shared_counters_state,
CaptureSideCalledChecker* capture_call_checker,
AudioProcessingImplLockTest* test_framework,
@@ -859,7 +859,7 @@ void CaptureProcessor::ApplyRuntimeSettingScheme() {
const float RenderProcessor::kRenderInputFloatLevel = 0.5f;
RenderProcessor::RenderProcessor(int max_frame_size,
- test::Random* rand_gen,
+ Random* rand_gen,
FrameCounters* shared_counters_state,
CaptureSideCalledChecker* capture_call_checker,
AudioProcessingImplLockTest* test_framework,

Powered by Google App Engine
This is Rietveld 408576698