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

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

Issue 2334583002: Revert of Introduced new scheme for controlling the functionality inside the audio processing module (Closed)
Patch Set: 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
90 TEST(LevelControlBitExactnessTest, DISABLED_Mono8kHz) { 71 TEST(LevelControlBitExactnessTest, DISABLED_Mono8kHz) {
91 const float kOutputReference[] = {-0.013939f, -0.012154f, -0.009054f}; 72 const float kOutputReference[] = {-0.013939f, -0.012154f, -0.009054f};
92 RunBitexactnessTest(AudioProcessing::kSampleRate8kHz, 1, 73 RunBitexactnessTest(AudioProcessing::kSampleRate8kHz, 1,
93 kOutputReference); 74 kOutputReference);
94 } 75 }
95 76
96 TEST(LevelControlBitExactnessTest, DISABLED_Mono16kHz) { 77 TEST(LevelControlBitExactnessTest, DISABLED_Mono16kHz) {
97 const float kOutputReference[] = {-0.013706f, -0.013215f, -0.013018f}; 78 const float kOutputReference[] = {-0.013706f, -0.013215f, -0.013018f};
98 RunBitexactnessTest(AudioProcessing::kSampleRate16kHz, 1, 79 RunBitexactnessTest(AudioProcessing::kSampleRate16kHz, 1,
99 kOutputReference); 80 kOutputReference);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 TEST(LevelControlBitExactnessTest, DISABLED_Stereo48kHz) { 123 TEST(LevelControlBitExactnessTest, DISABLED_Stereo48kHz) {
143 const float kOutputReference[] = {-0.010643f, -0.006334f, -0.011377f, 124 const float kOutputReference[] = {-0.010643f, -0.006334f, -0.011377f,
144 -0.049088f, -0.023600f, -0.050465f}; 125 -0.049088f, -0.023600f, -0.050465f};
145 RunBitexactnessTest(AudioProcessing::kSampleRate48kHz, 2, 126 RunBitexactnessTest(AudioProcessing::kSampleRate48kHz, 2,
146 kOutputReference); 127 kOutputReference);
147 } 128 }
148 129
149 130
150 131
151 } // namespace webrtc 132 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698