OLD | NEW |
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 |
11 // Unit tests for DtmfToneGenerator class. | 11 // Unit tests for DtmfToneGenerator class. |
12 | 12 |
13 #include "webrtc/modules/audio_coding/neteq/dtmf_tone_generator.h" | 13 #include "webrtc/modules/audio_coding/neteq/dtmf_tone_generator.h" |
14 | 14 |
15 #include <math.h> | 15 #include <math.h> |
16 | 16 |
| 17 #include "webrtc/modules/audio_coding/neteq/audio_multi_vector.h" |
17 #include "webrtc/test/gtest.h" | 18 #include "webrtc/test/gtest.h" |
18 #include "webrtc/modules/audio_coding/neteq/audio_multi_vector.h" | |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 | 21 |
22 class DtmfToneGeneratorTest : public ::testing::Test { | 22 class DtmfToneGeneratorTest : public ::testing::Test { |
23 protected: | 23 protected: |
24 static const double kLowFreqHz[16]; | 24 static const double kLowFreqHz[16]; |
25 static const double kHighFreqHz[16]; | 25 static const double kHighFreqHz[16]; |
26 // This is the attenuation applied to all cases. | 26 // This is the attenuation applied to all cases. |
27 const double kBaseAttenuation = 16141.0 / 16384.0; | 27 const double kBaseAttenuation = 16141.0 / 16384.0; |
28 const double k3dbAttenuation = 23171.0 / 32768; | 28 const double k3dbAttenuation = 23171.0 / 32768; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |