OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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_coding/neteq/tools/neteq_performance_test.h" |
11 #include "webrtc/test/gtest.h" | 12 #include "webrtc/test/gtest.h" |
12 #include "webrtc/modules/audio_coding/neteq/tools/neteq_performance_test.h" | |
13 #include "webrtc/test/testsupport/perf_test.h" | 13 #include "webrtc/test/testsupport/perf_test.h" |
14 #include "webrtc/typedefs.h" | 14 #include "webrtc/typedefs.h" |
15 | 15 |
16 // Runs a test with 10% packet losses and 10% clock drift, to exercise | 16 // Runs a test with 10% packet losses and 10% clock drift, to exercise |
17 // both loss concealment and time-stretching code. | 17 // both loss concealment and time-stretching code. |
18 TEST(NetEqPerformanceTest, Run) { | 18 TEST(NetEqPerformanceTest, Run) { |
19 const int kSimulationTimeMs = 10000000; | 19 const int kSimulationTimeMs = 10000000; |
20 const int kLossPeriod = 10; // Drop every 10th packet. | 20 const int kLossPeriod = 10; // Drop every 10th packet. |
21 const double kDriftFactor = 0.1; | 21 const double kDriftFactor = 0.1; |
22 int64_t runtime = webrtc::test::NetEqPerformanceTest::Run( | 22 int64_t runtime = webrtc::test::NetEqPerformanceTest::Run( |
23 kSimulationTimeMs, kLossPeriod, kDriftFactor); | 23 kSimulationTimeMs, kLossPeriod, kDriftFactor); |
24 ASSERT_GT(runtime, 0); | 24 ASSERT_GT(runtime, 0); |
25 webrtc::test::PrintResult( | 25 webrtc::test::PrintResult( |
26 "neteq_performance", "", "10_pl_10_drift", runtime, "ms", true); | 26 "neteq_performance", "", "10_pl_10_drift", runtime, "ms", true); |
27 } | 27 } |
28 | 28 |
29 // Runs a test with neither packet losses nor clock drift, to put | 29 // Runs a test with neither packet losses nor clock drift, to put |
30 // emphasis on the "good-weather" code path, which is presumably much | 30 // emphasis on the "good-weather" code path, which is presumably much |
31 // more lightweight. | 31 // more lightweight. |
32 TEST(NetEqPerformanceTest, RunClean) { | 32 TEST(NetEqPerformanceTest, RunClean) { |
33 const int kSimulationTimeMs = 10000000; | 33 const int kSimulationTimeMs = 10000000; |
34 const int kLossPeriod = 0; // No losses. | 34 const int kLossPeriod = 0; // No losses. |
35 const double kDriftFactor = 0.0; // No clock drift. | 35 const double kDriftFactor = 0.0; // No clock drift. |
36 int64_t runtime = webrtc::test::NetEqPerformanceTest::Run( | 36 int64_t runtime = webrtc::test::NetEqPerformanceTest::Run( |
37 kSimulationTimeMs, kLossPeriod, kDriftFactor); | 37 kSimulationTimeMs, kLossPeriod, kDriftFactor); |
38 ASSERT_GT(runtime, 0); | 38 ASSERT_GT(runtime, 0); |
39 webrtc::test::PrintResult( | 39 webrtc::test::PrintResult( |
40 "neteq_performance", "", "0_pl_0_drift", runtime, "ms", true); | 40 "neteq_performance", "", "0_pl_0_drift", runtime, "ms", true); |
41 } | 41 } |
OLD | NEW |