OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 "webrtc/modules/audio_processing/test/echo_canceller_test_tools.h" | 11 #include "webrtc/modules/audio_processing/test/echo_canceller_test_tools.h" |
12 | 12 |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "webrtc/base/array_view.h" | 15 #include "webrtc/rtc_base/array_view.h" |
16 #include "webrtc/base/checks.h" | 16 #include "webrtc/rtc_base/checks.h" |
17 #include "webrtc/base/random.h" | 17 #include "webrtc/rtc_base/random.h" |
18 #include "webrtc/test/gtest.h" | 18 #include "webrtc/test/gtest.h" |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 | 21 |
22 TEST(EchoCancellerTestTools, FloatDelayBuffer) { | 22 TEST(EchoCancellerTestTools, FloatDelayBuffer) { |
23 constexpr size_t kDelay = 10; | 23 constexpr size_t kDelay = 10; |
24 DelayBuffer<float> delay_buffer(kDelay); | 24 DelayBuffer<float> delay_buffer(kDelay); |
25 std::vector<float> v(1000, 0.f); | 25 std::vector<float> v(1000, 0.f); |
26 for (size_t k = 0; k < v.size(); ++k) { | 26 for (size_t k = 0; k < v.size(); ++k) { |
27 v[k] = k; | 27 v[k] = k; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 std::vector<float> v(50, 0.f); | 62 std::vector<float> v(50, 0.f); |
63 std::vector<float> v_ref = v; | 63 std::vector<float> v_ref = v; |
64 RandomizeSampleVector(&random_generator, v); | 64 RandomizeSampleVector(&random_generator, v); |
65 EXPECT_NE(v, v_ref); | 65 EXPECT_NE(v, v_ref); |
66 v_ref = v; | 66 v_ref = v; |
67 RandomizeSampleVector(&random_generator, v); | 67 RandomizeSampleVector(&random_generator, v); |
68 EXPECT_NE(v, v_ref); | 68 EXPECT_NE(v, v_ref); |
69 } | 69 } |
70 | 70 |
71 } // namespace webrtc | 71 } // namespace webrtc |
OLD | NEW |