From 84eb0e952e2c7132b3acf3ec5c8f53c6ad066ac8 Mon Sep 17 00:00:00 2001 From: "henrik.lundin@webrtc.org" Date: Tue, 28 Jan 2014 21:50:35 +0000 Subject: [PATCH] Add clean test to NetEq perf test Add another test to NetEqPerformanceTest with no packet losses or clock drift. The purpose of this test would be to focus on the "clean" code path, i.e., the path taken when there are no network problems. The reason is that this code path is presumably much lighter in complexity, and regressions could easily drown in the heavier code involved when combating losses and drift. BUG=2859 R=kjellander@webrtc.org Review URL: https://webrtc-codereview.appspot.com/7689005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5452 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../neteq4/test/neteq_performance_unittest.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/webrtc/modules/audio_coding/neteq4/test/neteq_performance_unittest.cc b/webrtc/modules/audio_coding/neteq4/test/neteq_performance_unittest.cc index 20c737651e..2299c0212f 100644 --- a/webrtc/modules/audio_coding/neteq4/test/neteq_performance_unittest.cc +++ b/webrtc/modules/audio_coding/neteq4/test/neteq_performance_unittest.cc @@ -13,6 +13,8 @@ #include "webrtc/test/testsupport/perf_test.h" #include "webrtc/typedefs.h" +// Runs a test with 10% packet losses and 10% clock drift, to exercise +// both loss concealment and time-stretching code. TEST(NetEqPerformanceTest, Run) { const int kSimulationTimeMs = 10000000; const int kLossPeriod = 10; // Drop every 10th packet. @@ -21,5 +23,19 @@ TEST(NetEqPerformanceTest, Run) { kSimulationTimeMs, kLossPeriod, kDriftFactor); ASSERT_GT(runtime, 0); webrtc::test::PrintResult( - "neteq4-runtime", "", "", runtime, "ms", true); + "NetEq-performance", "", "10_pl_10_drift", runtime, "ms", true); +} + +// Runs a test with neither packet losses nor clock drift, to put +// emphasis on the "good-weather" code path, which is presumably much +// more lightweight. +TEST(NetEqPerformanceTest, RunClean) { + const int kSimulationTimeMs = 10000000; + const int kLossPeriod = 0; // No losses. + const double kDriftFactor = 0.0; // No clock drift. + int64_t runtime = webrtc::test::NetEqPerformanceTest::Run( + kSimulationTimeMs, kLossPeriod, kDriftFactor); + ASSERT_GT(runtime, 0); + webrtc::test::PrintResult( + "NetEq-performance", "", "0_pl_0_drift", runtime, "ms", true); }