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

Side by Side Diff: webrtc/modules/audio_processing/level_controller/level_controller_unittest.cc

Issue 2292863002: Introduced new scheme for controlling the functionality inside the audio processing module (Closed)
Patch Set: Fixed bad merge Created 4 years, 3 months 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // memory, testing only the last frame implicitly also tests the preceeding 61 // memory, testing only the last frame implicitly also tests the preceeding
62 // frames. 62 // frames.
63 const float kVectorElementErrorBound = 1.0f / 32768.0f; 63 const float kVectorElementErrorBound = 1.0f / 32768.0f;
64 EXPECT_TRUE(test::VerifyDeinterleavedArray( 64 EXPECT_TRUE(test::VerifyDeinterleavedArray(
65 capture_config.num_frames(), capture_config.num_channels(), 65 capture_config.num_frames(), capture_config.num_channels(),
66 output_reference, capture_output, kVectorElementErrorBound)); 66 output_reference, capture_output, kVectorElementErrorBound));
67 } 67 }
68 68
69 } // namespace 69 } // namespace
70 70
71 TEST(LevelControlConfigTest, ToStringEnabled) {
72 AudioProcessing::Config config;
73 config.level_controller.enabled = true;
74 EXPECT_EQ("{enabled: true}",
75 LevelController::ToString(config.level_controller));
76 }
77
78 TEST(LevelControlConfigTest, ToStringNotEnabled) {
79 AudioProcessing::Config config;
80 config.level_controller.enabled = false;
81 EXPECT_EQ("{enabled: false}",
82 LevelController::ToString(config.level_controller));
83 }
84
85 TEST(LevelControlConfigTest, DefaultValue) {
86 AudioProcessing::Config config;
87 EXPECT_FALSE(config.level_controller.enabled);
88 }
89
71 TEST(LevelControlBitExactnessTest, DISABLED_Mono8kHz) { 90 TEST(LevelControlBitExactnessTest, DISABLED_Mono8kHz) {
72 const float kOutputReference[] = {-0.013939f, -0.012154f, -0.009054f}; 91 const float kOutputReference[] = {-0.013939f, -0.012154f, -0.009054f};
73 RunBitexactnessTest(AudioProcessing::kSampleRate8kHz, 1, 92 RunBitexactnessTest(AudioProcessing::kSampleRate8kHz, 1,
74 kOutputReference); 93 kOutputReference);
75 } 94 }
76 95
77 TEST(LevelControlBitExactnessTest, DISABLED_Mono16kHz) { 96 TEST(LevelControlBitExactnessTest, DISABLED_Mono16kHz) {
78 const float kOutputReference[] = {-0.013706f, -0.013215f, -0.013018f}; 97 const float kOutputReference[] = {-0.013706f, -0.013215f, -0.013018f};
79 RunBitexactnessTest(AudioProcessing::kSampleRate16kHz, 1, 98 RunBitexactnessTest(AudioProcessing::kSampleRate16kHz, 1,
80 kOutputReference); 99 kOutputReference);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 TEST(LevelControlBitExactnessTest, DISABLED_Stereo48kHz) { 142 TEST(LevelControlBitExactnessTest, DISABLED_Stereo48kHz) {
124 const float kOutputReference[] = {-0.010643f, -0.006334f, -0.011377f, 143 const float kOutputReference[] = {-0.010643f, -0.006334f, -0.011377f,
125 -0.049088f, -0.023600f, -0.050465f}; 144 -0.049088f, -0.023600f, -0.050465f};
126 RunBitexactnessTest(AudioProcessing::kSampleRate48kHz, 2, 145 RunBitexactnessTest(AudioProcessing::kSampleRate48kHz, 2,
127 kOutputReference); 146 kOutputReference);
128 } 147 }
129 148
130 149
131 150
132 } // namespace webrtc 151 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698