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

Side by Side Diff: webrtc/modules/audio_coding/neteq/dtmf_tone_generator_unittest.cc

Issue 2404183003: Fix bug in DTMF generation where events with level > 36 would be ignored. (Closed)
Patch Set: fix other tests Created 4 years, 2 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 const int event = 7; // Valid event. 157 const int event = 7; // Valid event.
158 const int attenuation = 0; // Valid attenuation. 158 const int attenuation = 0; // Valid attenuation.
159 // Initialize with invalid event -1. 159 // Initialize with invalid event -1.
160 EXPECT_EQ(DtmfToneGenerator::kParameterError, 160 EXPECT_EQ(DtmfToneGenerator::kParameterError,
161 tone_gen.Init(fs, -1, attenuation)); 161 tone_gen.Init(fs, -1, attenuation));
162 // Initialize with invalid event 16. 162 // Initialize with invalid event 16.
163 EXPECT_EQ(DtmfToneGenerator::kParameterError, 163 EXPECT_EQ(DtmfToneGenerator::kParameterError,
164 tone_gen.Init(fs, 16, attenuation)); 164 tone_gen.Init(fs, 16, attenuation));
165 // Initialize with invalid attenuation -1. 165 // Initialize with invalid attenuation -1.
166 EXPECT_EQ(DtmfToneGenerator::kParameterError, tone_gen.Init(fs, event, -1)); 166 EXPECT_EQ(DtmfToneGenerator::kParameterError, tone_gen.Init(fs, event, -1));
167 // Initialize with invalid attenuation 37. 167 // Initialize with invalid attenuation 64.
168 EXPECT_EQ(DtmfToneGenerator::kParameterError, tone_gen.Init(fs, event, 37)); 168 EXPECT_EQ(DtmfToneGenerator::kParameterError, tone_gen.Init(fs, event, 64));
169 EXPECT_FALSE(tone_gen.initialized()); // Should still be uninitialized. 169 EXPECT_FALSE(tone_gen.initialized()); // Should still be uninitialized.
170 170
171 // Initialize with valid parameters. 171 // Initialize with valid parameters.
172 ASSERT_EQ(0, tone_gen.Init(fs, event, attenuation)); 172 ASSERT_EQ(0, tone_gen.Init(fs, event, attenuation));
173 EXPECT_TRUE(tone_gen.initialized()); 173 EXPECT_TRUE(tone_gen.initialized());
174 // NULL pointer to destination. 174 // NULL pointer to destination.
175 EXPECT_EQ(DtmfToneGenerator::kParameterError, 175 EXPECT_EQ(DtmfToneGenerator::kParameterError,
176 tone_gen.Generate(kNumSamples, NULL)); 176 tone_gen.Generate(kNumSamples, NULL));
177 } 177 }
178 178
179 } // namespace webrtc 179 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698