OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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/test/gtest.h" |
| 12 #include "webrtc/base/random.h" |
11 #include "webrtc/modules/congestion_controller/median_slope_estimator.h" | 13 #include "webrtc/modules/congestion_controller/median_slope_estimator.h" |
12 #include "webrtc/rtc_base/random.h" | |
13 #include "webrtc/test/gtest.h" | |
14 | 14 |
15 namespace webrtc { | 15 namespace webrtc { |
16 | 16 |
17 namespace { | 17 namespace { |
18 constexpr size_t kWindowSize = 20; | 18 constexpr size_t kWindowSize = 20; |
19 constexpr double kGain = 1; | 19 constexpr double kGain = 1; |
20 constexpr int64_t kAvgTimeBetweenPackets = 10; | 20 constexpr int64_t kAvgTimeBetweenPackets = 10; |
21 constexpr size_t kPacketCount = 2 * kWindowSize + 1; | 21 constexpr size_t kPacketCount = 2 * kWindowSize + 1; |
22 | 22 |
23 void TestEstimator(double slope, double jitter_stddev, double tolerance) { | 23 void TestEstimator(double slope, double jitter_stddev, double tolerance) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 TEST(MedianSlopeEstimator, JitteryLineSlopeMinusOne) { | 64 TEST(MedianSlopeEstimator, JitteryLineSlopeMinusOne) { |
65 TestEstimator(-1, kAvgTimeBetweenPackets / 3.0, 0.05); | 65 TestEstimator(-1, kAvgTimeBetweenPackets / 3.0, 0.05); |
66 } | 66 } |
67 | 67 |
68 TEST(MedianSlopeEstimator, JitteryLineSlopeZero) { | 68 TEST(MedianSlopeEstimator, JitteryLineSlopeZero) { |
69 TestEstimator(0, kAvgTimeBetweenPackets / 3.0, 0.02); | 69 TestEstimator(0, kAvgTimeBetweenPackets / 3.0, 0.02); |
70 } | 70 } |
71 | 71 |
72 } // namespace webrtc | 72 } // namespace webrtc |
OLD | NEW |