From afc39731dc277f06020577a9c1f2cfd14970ed11 Mon Sep 17 00:00:00 2001 From: "phoglund@webrtc.org" Date: Tue, 3 Apr 2012 23:09:42 +0000 Subject: [PATCH] Rewrote NetEQ stats test. BUG= TEST= Review URL: https://webrtc-codereview.appspot.com/466002 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1982 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../auto_test/standard/neteq_stats_test.cc | 52 +++++++++++++++++++ .../main/test/auto_test/voe_standard_test.cc | 42 --------------- .../main/test/voice_engine_tests.gypi | 1 + 3 files changed, 53 insertions(+), 42 deletions(-) create mode 100644 src/voice_engine/main/test/auto_test/standard/neteq_stats_test.cc diff --git a/src/voice_engine/main/test/auto_test/standard/neteq_stats_test.cc b/src/voice_engine/main/test/auto_test/standard/neteq_stats_test.cc new file mode 100644 index 0000000000..cdde7186ed --- /dev/null +++ b/src/voice_engine/main/test/auto_test/standard/neteq_stats_test.cc @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "voice_engine/main/test/auto_test/fixtures/after_streaming_fixture.h" + +class NetEQStatsTest : public AfterStreamingFixture { +}; + +TEST_F(NetEQStatsTest, ManualPrintStatisticsAfterRunningAWhile) { + Sleep(5000); + + webrtc::NetworkStatistics network_statistics; + + EXPECT_EQ(0, voe_neteq_stats_->GetNetworkStatistics( + channel_, network_statistics)); + + TEST_LOG("Inspect these statistics and ensure they make sense.\n"); + + TEST_LOG(" currentAccelerateRate = %hu \n", + network_statistics.currentAccelerateRate); + TEST_LOG(" currentBufferSize = %hu \n", + network_statistics.currentBufferSize); + TEST_LOG(" currentDiscardRate = %hu \n", + network_statistics.currentDiscardRate); + TEST_LOG(" currentExpandRate = %hu \n", + network_statistics.currentExpandRate); + TEST_LOG(" currentPacketLossRate = %hu \n", + network_statistics.currentPacketLossRate); + TEST_LOG(" currentPreemptiveRate = %hu \n", + network_statistics.currentPreemptiveRate); + TEST_LOG(" preferredBufferSize = %hu \n", + network_statistics.preferredBufferSize); + TEST_LOG(" jitterPeaksFound = %i \n", + network_statistics.jitterPeaksFound); + TEST_LOG(" clockDriftPPM = %i \n", + network_statistics.clockDriftPPM); + TEST_LOG(" meanWaitingTimeMs = %i \n", + network_statistics.meanWaitingTimeMs); + TEST_LOG(" medianWaitingTimeMs = %i \n", + network_statistics.medianWaitingTimeMs); + TEST_LOG(" minWaitingTimeMs = %i \n", + network_statistics.minWaitingTimeMs); + TEST_LOG(" maxWaitingTimeMs = %i \n", + network_statistics.maxWaitingTimeMs); +} diff --git a/src/voice_engine/main/test/auto_test/voe_standard_test.cc b/src/voice_engine/main/test/auto_test/voe_standard_test.cc index 6fcecd942b..ed05425a6c 100644 --- a/src/voice_engine/main/test/auto_test/voe_standard_test.cc +++ b/src/voice_engine/main/test/auto_test/voe_standard_test.cc @@ -1035,49 +1035,7 @@ int VoETestManager::DoStandardTest() { #else TEST_LOG("\n\n+++ External media tests NOT ENABLED +++\n"); #endif // #ifdef _TEST_XMEDIA_ - ///////////////////// - // NetEQ statistics -#ifdef _TEST_NETEQ_STATS_ - TEST_LOG("\n\n+++ NetEQ statistics tests +++\n\n"); - -#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API - NetworkStatistics nStats; - TEST_MUSTPASS(voe_neteq_stats_->GetNetworkStatistics(0, nStats)); - TEST_LOG("\nNetwork statistics: \n"); - TEST_LOG(" currentAccelerateRate = %hu \n", - nStats.currentAccelerateRate); - TEST_LOG(" currentBufferSize = %hu \n", - nStats.currentBufferSize); - TEST_LOG(" currentDiscardRate = %hu \n", - nStats.currentDiscardRate); - TEST_LOG(" currentExpandRate = %hu \n", - nStats.currentExpandRate); - TEST_LOG(" currentPacketLossRate = %hu \n", - nStats.currentPacketLossRate); - TEST_LOG(" currentPreemptiveRate = %hu \n", - nStats.currentPreemptiveRate); - TEST_LOG(" preferredBufferSize = %hu \n", - nStats.preferredBufferSize); - TEST_LOG(" jitterPeaksFound = %i \n", - nStats.jitterPeaksFound); - TEST_LOG(" clockDriftPPM = %i \n", - nStats.clockDriftPPM); - TEST_LOG(" meanWaitingTimeMs = %i \n", - nStats.meanWaitingTimeMs); - TEST_LOG(" medianWaitingTimeMs = %i \n", - nStats.medianWaitingTimeMs); - TEST_LOG(" minWaitingTimeMs = %i \n", - nStats.minWaitingTimeMs); - TEST_LOG(" maxWaitingTimeMs = %i \n", - nStats.maxWaitingTimeMs); -#else - TEST_LOG("Skipping NetEQ statistics tests - " - "WEBRTC_VOICE_ENGINE_NETEQ_STATS_API not defined \n"); -#endif // #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API -#else - TEST_LOG("\n\n+++ NetEQ statistics tests NOT ENABLED +++\n"); -#endif // #ifdef _TEST_NETEQ_STATS_ ////////////////// // Stop streaming TEST_LOG("\n\n+++ Stop streaming +++\n\n"); diff --git a/src/voice_engine/main/test/voice_engine_tests.gypi b/src/voice_engine/main/test/voice_engine_tests.gypi index 80a9fe2f29..94f940a1e5 100644 --- a/src/voice_engine/main/test/voice_engine_tests.gypi +++ b/src/voice_engine/main/test/voice_engine_tests.gypi @@ -47,6 +47,7 @@ 'auto_test/standard/hardware_before_streaming_test.cc', 'auto_test/standard/hardware_test.cc', 'auto_test/standard/manual_hold_test.cc', + 'auto_test/standard/neteq_stats_test.cc', 'auto_test/standard/neteq_test.cc', 'auto_test/standard/network_before_streaming_test.cc', 'auto_test/standard/network_test.cc',