1 /*
2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include "modules/audio_processing/agc2/agc2_testing_common.h"
12
13 #include "rtc_base/gunit.h"
14
15 namespace webrtc {
16
TEST(AutomaticGainController2Common,TestLinSpace)17 TEST(AutomaticGainController2Common, TestLinSpace) {
18 std::vector<double> points1 = test::LinSpace(-1.0, 2.0, 4);
19 const std::vector<double> expected_points1{{-1.0, 0.0, 1.0, 2.0}};
20 EXPECT_EQ(expected_points1, points1);
21
22 std::vector<double> points2 = test::LinSpace(0.0, 1.0, 4);
23 const std::vector<double> expected_points2{{0.0, 1.0 / 3.0, 2.0 / 3.0, 1.0}};
24 EXPECT_EQ(points2, expected_points2);
25 }
26
27 } // namespace webrtc
28