tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

agc2_testing_common_unittest.cc (968B)


      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 <vector>
     14 
     15 #include "test/gtest.h"
     16 
     17 namespace webrtc {
     18 
     19 TEST(GainController2TestingCommon, LinSpace) {
     20  std::vector<double> points1 = test::LinSpace(-1.0, 2.0, 4);
     21  const std::vector<double> expected_points1{{-1.0, 0.0, 1.0, 2.0}};
     22  EXPECT_EQ(expected_points1, points1);
     23 
     24  std::vector<double> points2 = test::LinSpace(0.0, 1.0, 4);
     25  const std::vector<double> expected_points2{{0.0, 1.0 / 3.0, 2.0 / 3.0, 1.0}};
     26  EXPECT_EQ(points2, expected_points2);
     27 }
     28 
     29 }  // namespace webrtc