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 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "webrtc/base/checks.h" |
12 extern "C" { | 13 extern "C" { |
13 #include "webrtc/modules/audio_processing/aec/aec_core.h" | 14 #include "webrtc/modules/audio_processing/aec/aec_core.h" |
14 } | 15 } |
15 #include "webrtc/modules/audio_processing/aec/echo_cancellation_internal.h" | 16 #include "webrtc/modules/audio_processing/aec/echo_cancellation_internal.h" |
16 #include "webrtc/modules/audio_processing/aec/include/echo_cancellation.h" | 17 #include "webrtc/modules/audio_processing/aec/include/echo_cancellation.h" |
17 #include "webrtc/test/testsupport/gtest_disable.h" | 18 #include "webrtc/test/testsupport/gtest_disable.h" |
18 #include "webrtc/typedefs.h" | 19 #include "webrtc/typedefs.h" |
19 | 20 |
20 namespace { | 21 namespace { |
21 | 22 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 for (int i = 0; i < kSamplesPerChunk; i++) { | 61 for (int i = 0; i < kSamplesPerChunk; i++) { |
61 far_[i] = 257.0; | 62 far_[i] = 257.0; |
62 near_[i] = 514.0; | 63 near_[i] = 514.0; |
63 } | 64 } |
64 memset(out_, 0, sizeof(out_)); | 65 memset(out_, 0, sizeof(out_)); |
65 near_ptr_ = near_; | 66 near_ptr_ = near_; |
66 out_ptr_ = out_; | 67 out_ptr_ = out_; |
67 } | 68 } |
68 | 69 |
69 void SystemDelayTest::SetUp() { | 70 void SystemDelayTest::SetUp() { |
70 ASSERT_EQ(0, WebRtcAec_Create(&handle_)); | 71 handle_ = WebRtcAec_Create(); |
| 72 ASSERT_TRUE(handle_); |
71 self_ = reinterpret_cast<Aec*>(handle_); | 73 self_ = reinterpret_cast<Aec*>(handle_); |
72 } | 74 } |
73 | 75 |
74 void SystemDelayTest::TearDown() { | 76 void SystemDelayTest::TearDown() { |
75 // Free AEC | 77 // Free AEC |
76 WebRtcAec_Free(handle_); | 78 WebRtcAec_Free(handle_); |
77 handle_ = NULL; | 79 handle_ = NULL; |
78 } | 80 } |
79 | 81 |
80 // In SWB mode nothing is added to the buffer handling with respect to | 82 // In SWB mode nothing is added to the buffer handling with respect to |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 | 489 |
488 // Verify that the system delay is non-negative. | 490 // Verify that the system delay is non-negative. |
489 EXPECT_LE(0, WebRtcAec_system_delay(self_->aec)); | 491 EXPECT_LE(0, WebRtcAec_system_delay(self_->aec)); |
490 } | 492 } |
491 // Verify we are not in a non-causal state. | 493 // Verify we are not in a non-causal state. |
492 EXPECT_FALSE(non_causal); | 494 EXPECT_FALSE(non_causal); |
493 } | 495 } |
494 } | 496 } |
495 | 497 |
496 } // namespace | 498 } // namespace |
OLD | NEW |