Made it possible to run the voe_auto_test standard test in GTest behind a flag. The purpose is to run the whole test without any manual intervention since we want to run the test on a build bot in automated mode.
BUG= TEST= Review URL: http://webrtc-codereview.appspot.com/267001 git-svn-id: http://webrtc.googlecode.com/svn/trunk@903 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
c58ef08da2
commit
cff98ca6ff
18
src/voice_engine/main/test/auto_test/automated_mode.cc
Normal file
18
src/voice_engine/main/test/auto_test/automated_mode.cc
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2011 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 "gtest/gtest.h"
|
||||||
|
|
||||||
|
int RunInAutomatedMode(int argc, char** argv) {
|
||||||
|
// Initialize the testing framework.
|
||||||
|
testing::InitGoogleTest(&argc, argv);
|
||||||
|
|
||||||
|
// Run tests.
|
||||||
|
return RUN_ALL_TESTS();
|
||||||
|
}
|
16
src/voice_engine/main/test/auto_test/automated_mode.h
Normal file
16
src/voice_engine/main/test/auto_test/automated_mode.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2011 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_AUTOMATED_MODE_H_
|
||||||
|
#define SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_AUTOMATED_MODE_H_
|
||||||
|
|
||||||
|
int RunInAutomatedMode(int argc, char** argv);
|
||||||
|
|
||||||
|
#endif // SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_AUTOMATED_MODE_H_
|
@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2011 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 "voe_standard_test.h"
|
||||||
|
|
||||||
|
// These symbols clash with gtest, so undef them:
|
||||||
|
#undef TEST
|
||||||
|
#undef ASSERT_TRUE
|
||||||
|
#undef ASSERT_FALSE
|
||||||
|
|
||||||
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
class VoEStandardIntegrationTest: public testing::Test {
|
||||||
|
public:
|
||||||
|
virtual ~VoEStandardIntegrationTest() {}
|
||||||
|
|
||||||
|
// Initializes the test manager.
|
||||||
|
virtual void SetUp() {
|
||||||
|
ASSERT_TRUE(test_manager_.Init());
|
||||||
|
test_manager_.GetInterfaces();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Releases anything allocated by SetUp.
|
||||||
|
virtual void TearDown() {
|
||||||
|
ASSERT_EQ(0, test_manager_.ReleaseInterfaces());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
voetest::VoETestManager test_manager_;
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_F(VoEStandardIntegrationTest, RunsStandardTestWithoutErrors) {
|
||||||
|
ASSERT_EQ(0, test_manager_.DoStandardTest());
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
@ -29,6 +29,7 @@
|
|||||||
#include "../../source/voice_engine_defines.h" // defines build macros
|
#include "../../source/voice_engine_defines.h" // defines build macros
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "automated_mode.h"
|
||||||
#include "critical_section_wrapper.h"
|
#include "critical_section_wrapper.h"
|
||||||
#include "event_wrapper.h"
|
#include "event_wrapper.h"
|
||||||
#include "thread_wrapper.h"
|
#include "thread_wrapper.h"
|
||||||
@ -197,7 +198,7 @@ void MyRTPObserver::OnIncomingSSRCChanged(const int channel,
|
|||||||
channel, SSRC);
|
channel, SSRC);
|
||||||
TEST_LOG("%s", msg);
|
TEST_LOG("%s", msg);
|
||||||
|
|
||||||
_SSRC[channel] = SSRC;
|
_SSRC[channel] = SSRC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyDeadOrAlive::OnPeriodicDeadOrAlive(const int /*channel*/,
|
void MyDeadOrAlive::OnPeriodicDeadOrAlive(const int /*channel*/,
|
||||||
@ -218,7 +219,7 @@ void MyDeadOrAlive::OnPeriodicDeadOrAlive(const int /*channel*/,
|
|||||||
void MyMedia::Process(const int channel,
|
void MyMedia::Process(const int channel,
|
||||||
const ProcessingTypes type,
|
const ProcessingTypes type,
|
||||||
WebRtc_Word16 audio_10ms[],
|
WebRtc_Word16 audio_10ms[],
|
||||||
const int length,
|
const int length,
|
||||||
const int samplingFreqHz,
|
const int samplingFreqHz,
|
||||||
const bool stereo)
|
const bool stereo)
|
||||||
{
|
{
|
||||||
@ -231,7 +232,7 @@ void MyMedia::Process(const int channel,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// interleaved stereo
|
// interleaved stereo
|
||||||
audio_10ms[2 * i] = (WebRtc_Word16)(audio_10ms[2 * i] *
|
audio_10ms[2 * i] = (WebRtc_Word16)(audio_10ms[2 * i] *
|
||||||
sin(2.0 * 3.14 * f * 400.0 / samplingFreqHz));
|
sin(2.0 * 3.14 * f * 400.0 / samplingFreqHz));
|
||||||
audio_10ms[2 * i + 1] = (WebRtc_Word16)(audio_10ms[2 * i + 1] *
|
audio_10ms[2 * i + 1] = (WebRtc_Word16)(audio_10ms[2 * i + 1] *
|
||||||
@ -278,9 +279,9 @@ my_transportation::~my_transportation()
|
|||||||
{
|
{
|
||||||
delete _thread;
|
delete _thread;
|
||||||
_thread = NULL;
|
_thread = NULL;
|
||||||
delete _event;
|
delete _event;
|
||||||
_event = NULL;
|
_event = NULL;
|
||||||
delete _lock;
|
delete _lock;
|
||||||
_lock = NULL;
|
_lock = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -301,7 +302,7 @@ bool my_transportation::Process()
|
|||||||
_lock->Leave();
|
_lock->Leave();
|
||||||
return true;
|
return true;
|
||||||
case kEventTimeout:
|
case kEventTimeout:
|
||||||
return true;
|
return true;
|
||||||
case kEventError:
|
case kEventError:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -324,7 +325,7 @@ int my_transportation::SendPacket(int channel, const void *data, int len)
|
|||||||
|
|
||||||
int my_transportation::SendRTCPPacket(int channel,const void *data,int len)
|
int my_transportation::SendRTCPPacket(int channel,const void *data,int len)
|
||||||
{
|
{
|
||||||
if (_delayIsEnabled)
|
if (_delayIsEnabled)
|
||||||
{
|
{
|
||||||
Sleep(_delayTimeInMs);
|
Sleep(_delayTimeInMs);
|
||||||
}
|
}
|
||||||
@ -691,7 +692,7 @@ int VoETestManager::ReleaseInterfaces()
|
|||||||
int err(0), remInt(1), j(0);
|
int err(0), remInt(1), j(0);
|
||||||
bool releaseOK(true);
|
bool releaseOK(true);
|
||||||
|
|
||||||
if (base)
|
if (base)
|
||||||
{
|
{
|
||||||
for (remInt=1,j=0; remInt>0; j++)
|
for (remInt=1,j=0; remInt>0; j++)
|
||||||
TEST_MUSTPASS(-1 == (remInt = base->Release()));
|
TEST_MUSTPASS(-1 == (remInt = base->Release()));
|
||||||
@ -909,7 +910,7 @@ int VoETestManager::ReleaseInterfaces()
|
|||||||
TEST_LOG("\nError at line: %i (VoiceEngine::SetTraceFile()"
|
TEST_LOG("\nError at line: %i (VoiceEngine::SetTraceFile()"
|
||||||
"should fail)!\n", __LINE__);
|
"should fail)!\n", __LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (releaseOK == true) ? 0 : -1;
|
return (releaseOK == true) ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -928,7 +929,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
"shall be printed... \n\n");
|
"shall be printed... \n\n");
|
||||||
MyTraceCallback* callback = new MyTraceCallback();
|
MyTraceCallback* callback = new MyTraceCallback();
|
||||||
VoiceEngine::SetTraceCallback(callback);
|
VoiceEngine::SetTraceCallback(callback);
|
||||||
|
|
||||||
// Test the remaining trace APIs
|
// Test the remaining trace APIs
|
||||||
TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename("webrtc_voe_trace.txt"),
|
TEST_MUSTPASS(VoiceEngine::SetTraceFile(GetFilename("webrtc_voe_trace.txt"),
|
||||||
true));
|
true));
|
||||||
@ -1017,7 +1018,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
TEST_MUSTPASS(!rtp_rtcp->GetRTPKeepaliveStatus(-1, on, pt, dT));
|
TEST_MUSTPASS(!rtp_rtcp->GetRTPKeepaliveStatus(-1, on, pt, dT));
|
||||||
// should be off by default
|
// should be off by default
|
||||||
TEST_MUSTPASS(rtp_rtcp->GetRTPKeepaliveStatus(0, on, pt, dT));
|
TEST_MUSTPASS(rtp_rtcp->GetRTPKeepaliveStatus(0, on, pt, dT));
|
||||||
TEST_MUSTPASS(on != false);
|
TEST_MUSTPASS(on != false);
|
||||||
TEST_MUSTPASS(pt != 255);
|
TEST_MUSTPASS(pt != 255);
|
||||||
TEST_MUSTPASS(dT != 0);
|
TEST_MUSTPASS(dT != 0);
|
||||||
|
|
||||||
@ -1097,7 +1098,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
TEST_MUSTPASS(hardware->GetSystemCPULoad(loadPercent));
|
TEST_MUSTPASS(hardware->GetSystemCPULoad(loadPercent));
|
||||||
TEST_LOG("GetSystemCPULoad => %d%%\n", loadPercent);
|
TEST_LOG("GetSystemCPULoad => %d%%\n", loadPercent);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)
|
#if !defined(MAC_IPHONE) && !defined(WEBRTC_ANDROID)
|
||||||
bool playAvail = false, recAvail = false;
|
bool playAvail = false, recAvail = false;
|
||||||
TEST_LOG("Get device status \n");
|
TEST_LOG("Get device status \n");
|
||||||
@ -1105,7 +1106,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
TEST_MUSTPASS(hardware->GetRecordingDeviceStatus(recAvail));
|
TEST_MUSTPASS(hardware->GetRecordingDeviceStatus(recAvail));
|
||||||
TEST_MUSTPASS(!(recAvail && playAvail));
|
TEST_MUSTPASS(!(recAvail && playAvail));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Win, Mac and Linux sound device tests
|
// Win, Mac and Linux sound device tests
|
||||||
#if (defined(WEBRTC_MAC) && !defined(MAC_IPHONE)) || defined(_WIN32) || (defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID))
|
#if (defined(WEBRTC_MAC) && !defined(MAC_IPHONE)) || defined(_WIN32) || (defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID))
|
||||||
int idx, nRec = 0, nPlay = 0;
|
int idx, nRec = 0, nPlay = 0;
|
||||||
@ -1178,7 +1179,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
TEST_MUSTPASS(hardware->SetPlayoutDevice(0));
|
TEST_MUSTPASS(hardware->SetPlayoutDevice(0));
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MAC_IPHONE
|
#ifdef MAC_IPHONE
|
||||||
// Reset sound device
|
// Reset sound device
|
||||||
TEST_LOG("Reset sound device \n");
|
TEST_LOG("Reset sound device \n");
|
||||||
@ -1200,7 +1201,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
cinst.pacsize=480;
|
cinst.pacsize=480;
|
||||||
// should fail since niklas is not a valid codec name
|
// should fail since niklas is not a valid codec name
|
||||||
TEST_MUSTPASS(!codec->GetRecPayloadType(0,cinst));
|
TEST_MUSTPASS(!codec->GetRecPayloadType(0,cinst));
|
||||||
strcpy(cinst.plname,"iSAC");
|
strcpy(cinst.plname,"iSAC");
|
||||||
TEST_MUSTPASS(codec->GetRecPayloadType(0,cinst)); // both iSAC
|
TEST_MUSTPASS(codec->GetRecPayloadType(0,cinst)); // both iSAC
|
||||||
strcpy(cinst.plname,"ISAC"); // and ISAC should work
|
strcpy(cinst.plname,"ISAC"); // and ISAC should work
|
||||||
TEST_MUSTPASS(codec->GetRecPayloadType(0,cinst));
|
TEST_MUSTPASS(codec->GetRecPayloadType(0,cinst));
|
||||||
@ -1271,7 +1272,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
#endif // #ifndef WEBRTC_EXTERNAL_TRANSPORT
|
#endif // #ifndef WEBRTC_EXTERNAL_TRANSPORT
|
||||||
#else
|
#else
|
||||||
TEST_LOG("\n\n+++ Network tests NOT ENABLED +++\n");
|
TEST_LOG("\n\n+++ Network tests NOT ENABLED +++\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
///////////////////
|
///////////////////
|
||||||
// Start streaming
|
// Start streaming
|
||||||
@ -1724,7 +1725,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
cinst.channels=1;
|
cinst.channels=1;
|
||||||
cinst.rate=64000;
|
cinst.rate=64000;
|
||||||
TEST_MUSTPASS(codec->SetSendCodec(0, cinst));
|
TEST_MUSTPASS(codec->SetSendCodec(0, cinst));
|
||||||
// The test here is confusing, what are we expecting? VADtest = false?
|
// The test here is confusing, what are we expecting? VADtest = false?
|
||||||
TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX));
|
TEST_MUSTPASS(codec->GetVADStatus(0, VADtest, vadMode, disabledDTX));
|
||||||
TEST_MUSTPASS(VADtest);
|
TEST_MUSTPASS(VADtest);
|
||||||
TEST_MUSTPASS(codec->SetVADStatus(0, false, vadMode, true));
|
TEST_MUSTPASS(codec->SetVADStatus(0, false, vadMode, true));
|
||||||
@ -1766,7 +1767,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
// Conferencing
|
// Conferencing
|
||||||
|
|
||||||
#ifndef _TEST_BASE_
|
#ifndef _TEST_BASE_
|
||||||
|
|
||||||
TEST_LOG("\n\n+++ (Base) tests NOT ENABLED +++\n");
|
TEST_LOG("\n\n+++ (Base) tests NOT ENABLED +++\n");
|
||||||
#endif // #ifdef _TEST_BASE_
|
#endif // #ifdef _TEST_BASE_
|
||||||
|
|
||||||
@ -1792,7 +1793,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
// the originally set 1234 should be maintained
|
// the originally set 1234 should be maintained
|
||||||
TEST_MUSTPASS(1234 != ssrc1);
|
TEST_MUSTPASS(1234 != ssrc1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// RTCP APP tests
|
// RTCP APP tests
|
||||||
TEST_LOG("Check RTCP APP send/receive \n");
|
TEST_LOG("Check RTCP APP send/receive \n");
|
||||||
@ -2228,7 +2229,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
SLEEP(500);
|
SLEEP(500);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TEST_LOG("Playing Dtmf tone locally \n");
|
TEST_LOG("Playing Dtmf tone locally \n");
|
||||||
/// TEST_MUSTPASS(dtmf->PlayDtmfTone(0, 300, 15));
|
/// TEST_MUSTPASS(dtmf->PlayDtmfTone(0, 300, 15));
|
||||||
SLEEP(500);
|
SLEEP(500);
|
||||||
@ -2665,7 +2666,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
TEST_MUSTPASS(test != true);
|
TEST_MUSTPASS(test != true);
|
||||||
TEST_MUSTPASS(ecMode != kEcAecm);
|
TEST_MUSTPASS(ecMode != kEcAecm);
|
||||||
|
|
||||||
// AECM mode, get and set
|
// AECM mode, get and set
|
||||||
TEST_MUSTPASS(apm->GetAecmMode(aecmMode, enabledCNG));
|
TEST_MUSTPASS(apm->GetAecmMode(aecmMode, enabledCNG));
|
||||||
TEST_MUSTPASS(aecmMode != kAecmQuietEarpieceOrHeadset);
|
TEST_MUSTPASS(aecmMode != kAecmQuietEarpieceOrHeadset);
|
||||||
TEST_MUSTPASS(enabledCNG != false);
|
TEST_MUSTPASS(enabledCNG != false);
|
||||||
@ -2929,7 +2930,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
// Ф Х Ѡ Ц Ч Ш Щ Ъ ЪІ Ь Ѣ
|
// Ф Х Ѡ Ц Ч Ш Щ Ъ ЪІ Ь Ѣ
|
||||||
|
|
||||||
const char* recName = GetFilename(fileName);
|
const char* recName = GetFilename(fileName);
|
||||||
// Generated with
|
// Generated with
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
/* char tempFileNameUTF8[200];
|
/* char tempFileNameUTF8[200];
|
||||||
int err = WideCharToMultiByte(CP_UTF8,0,L"åäö", -1, tempFileNameUTF8,
|
int err = WideCharToMultiByte(CP_UTF8,0,L"åäö", -1, tempFileNameUTF8,
|
||||||
@ -2953,7 +2954,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
TEST_LOG("After 2 seconds we should still be playing\n");
|
TEST_LOG("After 2 seconds we should still be playing\n");
|
||||||
TEST_MUSTPASS(!file->IsPlayingFileLocally(0));
|
TEST_MUSTPASS(!file->IsPlayingFileLocally(0));
|
||||||
#endif
|
#endif
|
||||||
TEST_LOG("Set scaling\n");
|
TEST_LOG("Set scaling\n");
|
||||||
TEST_MUSTPASS(file->ScaleLocalFilePlayout(0,(float)0.11));
|
TEST_MUSTPASS(file->ScaleLocalFilePlayout(0,(float)0.11));
|
||||||
SLEEP(1100);
|
SLEEP(1100);
|
||||||
TEST_LOG("After 3.1 seconds we should NOT be playing\n");
|
TEST_LOG("After 3.1 seconds we should NOT be playing\n");
|
||||||
@ -3030,7 +3031,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
char filterIp[64] = {0};
|
char filterIp[64] = {0};
|
||||||
|
|
||||||
SLEEP(200); // Make sure we have received packets
|
SLEEP(200); // Make sure we have received packets
|
||||||
|
|
||||||
TEST_MUSTPASS(netw->GetSourceInfo(0,
|
TEST_MUSTPASS(netw->GetSourceInfo(0,
|
||||||
sourceRtpPort,
|
sourceRtpPort,
|
||||||
sourceRtcpPort,
|
sourceRtcpPort,
|
||||||
@ -3079,7 +3080,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
{
|
{
|
||||||
TEST_MUSTPASS(rtp_rtcp->SetRTCP_CNAME(0, "Tomas"));
|
TEST_MUSTPASS(rtp_rtcp->SetRTCP_CNAME(0, "Tomas"));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_LOG("Set filter IP to %s => should hear audio\n", sourceIp);
|
TEST_LOG("Set filter IP to %s => should hear audio\n", sourceIp);
|
||||||
TEST_MUSTPASS(netw->SetSourceFilter(0, 0, sourceRtcpPort+10, sourceIp));
|
TEST_MUSTPASS(netw->SetSourceFilter(0, 0, sourceRtcpPort+10, sourceIp));
|
||||||
TEST_MUSTPASS(netw->GetSourceFilter(0,
|
TEST_MUSTPASS(netw->GetSourceFilter(0,
|
||||||
@ -3205,7 +3206,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
// to external transport
|
// to external transport
|
||||||
TEST_MUSTPASS(base->DeleteChannel(0));
|
TEST_MUSTPASS(base->DeleteChannel(0));
|
||||||
TEST_MUSTPASS(base->CreateChannel());
|
TEST_MUSTPASS(base->CreateChannel());
|
||||||
|
|
||||||
TEST_MUSTPASS(netw->RegisterExternalTransport(0, ch0transport));
|
TEST_MUSTPASS(netw->RegisterExternalTransport(0, ch0transport));
|
||||||
|
|
||||||
TEST_MUSTPASS(base->StartReceive(0));
|
TEST_MUSTPASS(base->StartReceive(0));
|
||||||
@ -3349,7 +3350,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
TEST_MUSTPASS(vsync->GetDelayEstimate(0, valInt));
|
TEST_MUSTPASS(vsync->GetDelayEstimate(0, valInt));
|
||||||
TEST_LOG("Delay estimate = %d ms\n", valInt);
|
TEST_LOG("Delay estimate = %d ms\n", valInt);
|
||||||
#if defined(MAC_IPHONE)
|
#if defined(MAC_IPHONE)
|
||||||
TEST_MUSTPASS(valInt <= 30);
|
TEST_MUSTPASS(valInt <= 30);
|
||||||
#else
|
#else
|
||||||
TEST_MUSTPASS(valInt <= 45); // 45=20+25 => can't be this low
|
TEST_MUSTPASS(valInt <= 45); // 45=20+25 => can't be this low
|
||||||
#endif
|
#endif
|
||||||
@ -3398,7 +3399,7 @@ int VoETestManager::DoStandardTest()
|
|||||||
|
|
||||||
unsigned char encrKey[30] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0,
|
unsigned char encrKey[30] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0,
|
||||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
|
||||||
|
|
||||||
TEST_LOG("Enable SRTP encryption and decryption, you should still hear"
|
TEST_LOG("Enable SRTP encryption and decryption, you should still hear"
|
||||||
" the voice\n");
|
" the voice\n");
|
||||||
TEST_MUSTPASS(encrypt->EnableSRTPSend(0,
|
TEST_MUSTPASS(encrypt->EnableSRTPSend(0,
|
||||||
@ -3413,11 +3414,11 @@ int VoETestManager::DoStandardTest()
|
|||||||
20, 4, kEncryptionAndAuthentication, encrKey));
|
20, 4, kEncryptionAndAuthentication, encrKey));
|
||||||
SLEEP(2000);
|
SLEEP(2000);
|
||||||
|
|
||||||
TEST_LOG("Disabling decryption, you should hear nothing or garbage\n");
|
TEST_LOG("Disabling decryption, you should hear nothing or garbage\n");
|
||||||
TEST_MUSTPASS(encrypt->DisableSRTPReceive(0));
|
TEST_MUSTPASS(encrypt->DisableSRTPReceive(0));
|
||||||
SLEEP(2000);
|
SLEEP(2000);
|
||||||
|
|
||||||
TEST_LOG("Enable decryption again, you should hear the voice again\n");
|
TEST_LOG("Enable decryption again, you should hear the voice again\n");
|
||||||
TEST_MUSTPASS(encrypt->EnableSRTPReceive(0,
|
TEST_MUSTPASS(encrypt->EnableSRTPReceive(0,
|
||||||
kCipherAes128CounterMode,
|
kCipherAes128CounterMode,
|
||||||
30,
|
30,
|
||||||
@ -3495,9 +3496,9 @@ int VoETestManager::DoStandardTest()
|
|||||||
WebRtc_Word16 speechData[32000];
|
WebRtc_Word16 speechData[32000];
|
||||||
for (int i = 0; i < 200; i++)
|
for (int i = 0; i < 200; i++)
|
||||||
{
|
{
|
||||||
TEST_MUSTPASS(xmedia->ExternalPlayoutGetData(speechData+i*160,
|
TEST_MUSTPASS(xmedia->ExternalPlayoutGetData(speechData+i*160,
|
||||||
16000,
|
16000,
|
||||||
100,
|
100,
|
||||||
getLen));
|
getLen));
|
||||||
TEST_MUSTPASS(160 != getLen);
|
TEST_MUSTPASS(160 != getLen);
|
||||||
SLEEP(10);
|
SLEEP(10);
|
||||||
@ -3516,9 +3517,9 @@ int VoETestManager::DoStandardTest()
|
|||||||
TEST_LOG("Inserting record data from vector\n");
|
TEST_LOG("Inserting record data from vector\n");
|
||||||
for (int i = 0; i < 200; i++)
|
for (int i = 0; i < 200; i++)
|
||||||
{
|
{
|
||||||
TEST_MUSTPASS(xmedia->ExternalRecordingInsertData(speechData+i*160,
|
TEST_MUSTPASS(xmedia->ExternalRecordingInsertData(speechData+i*160,
|
||||||
160,
|
160,
|
||||||
16000,
|
16000,
|
||||||
20));
|
20));
|
||||||
SLEEP(10);
|
SLEEP(10);
|
||||||
}
|
}
|
||||||
@ -3892,7 +3893,7 @@ void createSummary(VoiceEngine* ve)
|
|||||||
fprintf(stream, "%s\n", str);
|
fprintf(stream, "%s\n", str);
|
||||||
|
|
||||||
strcpy(str, "G.711 A-law");
|
strcpy(str, "G.711 A-law");
|
||||||
fprintf(stream, "\nSupported codecs: %s\n", str);
|
fprintf(stream, "\nSupported codecs: %s\n", str);
|
||||||
strcpy(str, " G.711 mu-law");
|
strcpy(str, " G.711 mu-law");
|
||||||
fprintf(stream, "%s\n", str);
|
fprintf(stream, "%s\n", str);
|
||||||
#ifdef WEBRTC_CODEC_EG711
|
#ifdef WEBRTC_CODEC_EG711
|
||||||
@ -4028,7 +4029,7 @@ void createSummary(VoiceEngine* ve)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
strcpy(str, "VoEBase");
|
strcpy(str, "VoEBase");
|
||||||
fprintf(stream, "\nSupported sub-APIs: %s\n", str);
|
fprintf(stream, "\nSupported sub-APIs: %s\n", str);
|
||||||
#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
|
#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
|
||||||
strcpy(str, " VoECodec");
|
strcpy(str, " VoECodec");
|
||||||
fprintf(stream, "%s\n", str);
|
fprintf(stream, "%s\n", str);
|
||||||
@ -4092,12 +4093,12 @@ void createSummary(VoiceEngine* ve)
|
|||||||
// Using thread. A generic API/Class for all platforms.
|
// Using thread. A generic API/Class for all platforms.
|
||||||
#ifdef THEADTEST // find first NL <=> end of VoiceEngine version string
|
#ifdef THEADTEST // find first NL <=> end of VoiceEngine version string
|
||||||
//Definition of Thread Class
|
//Definition of Thread Class
|
||||||
class ThreadTest
|
class ThreadTest
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ThreadTest(
|
ThreadTest(
|
||||||
VoEBase* base);
|
VoEBase* base);
|
||||||
~ThreadTest()
|
~ThreadTest()
|
||||||
{
|
{
|
||||||
delete _myThread;
|
delete _myThread;
|
||||||
}
|
}
|
||||||
@ -4132,7 +4133,7 @@ bool
|
|||||||
ThreadTest::StartSend(
|
ThreadTest::StartSend(
|
||||||
void* obj)
|
void* obj)
|
||||||
{
|
{
|
||||||
return ((ThreadTest*)obj)->StartSend();
|
return ((ThreadTest*)obj)->StartSend();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4167,7 +4168,7 @@ private:
|
|||||||
//Thread Definition
|
//Thread Definition
|
||||||
unsigned int WINAPI mainTest::StartSend(void *obj)
|
unsigned int WINAPI mainTest::StartSend(void *obj)
|
||||||
{
|
{
|
||||||
return ((mainTest*)obj)->StartSend();
|
return ((mainTest*)obj)->StartSend();
|
||||||
}
|
}
|
||||||
unsigned int WINAPI mainTest::StartSend()
|
unsigned int WINAPI mainTest::StartSend()
|
||||||
{
|
{
|
||||||
@ -4195,17 +4196,10 @@ unsigned int WINAPI mainTest::StartSend()
|
|||||||
|
|
||||||
} // namespace voetest
|
} // namespace voetest
|
||||||
|
|
||||||
|
int RunInManualMode()
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// main
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
using namespace voetest;
|
|
||||||
|
|
||||||
#if !defined(MAC_IPHONE)
|
|
||||||
int main(int , char** )
|
|
||||||
{
|
{
|
||||||
|
using namespace voetest;
|
||||||
|
|
||||||
SubAPIManager apiMgr;
|
SubAPIManager apiMgr;
|
||||||
apiMgr.DisplayStatus();
|
apiMgr.DisplayStatus();
|
||||||
|
|
||||||
@ -4229,34 +4223,47 @@ int main(int , char** )
|
|||||||
|
|
||||||
switch (selection)
|
switch (selection)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
return 0;
|
return 0;
|
||||||
case 1:
|
case 1:
|
||||||
testType = Standard;
|
testType = Standard;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
testType = Extended;
|
testType = Extended;
|
||||||
while (!apiMgr.GetExtendedMenuSelection(extendedSel))
|
while (!apiMgr.GetExtendedMenuSelection(extendedSel))
|
||||||
;
|
continue;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
testType = Stress;
|
testType = Stress;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
testType = Unit;
|
testType = Unit;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
testType = CPU;
|
testType = CPU;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
TEST_LOG("Invalid selection!\n");
|
TEST_LOG("Invalid selection!\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// function that can be called
|
// Function that can be called from other entry functions.
|
||||||
// from other entry functions
|
return runAutoTest(testType, extendedSel);
|
||||||
int retVal = runAutoTest(testType, extendedSel);
|
}
|
||||||
|
|
||||||
return retVal;
|
// ----------------------------------------------------------------------------
|
||||||
|
// main
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if !defined(MAC_IPHONE)
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
if (argc > 1 && std::string(argv[1]) == "--automated") {
|
||||||
|
// This function is defined in automated_mode.cc to avoid macro clashes
|
||||||
|
// with googletest (for instance the ASSERT_TRUE macro).
|
||||||
|
return RunInAutomatedMode(argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
return RunInManualMode();
|
||||||
}
|
}
|
||||||
#endif //#if !defined(MAC_IPHONE)
|
#endif //#if !defined(MAC_IPHONE)
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#ifndef WEBRTC_VOICE_ENGINE_VOE_STANDARD_TEST_H
|
#ifndef WEBRTC_VOICE_ENGINE_VOE_STANDARD_TEST_H
|
||||||
#define WEBRTC_VOICE_ENGINE_VOE_STANDARD_TEST_H
|
#define WEBRTC_VOICE_ENGINE_VOE_STANDARD_TEST_H
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "voe_test_defines.h"
|
#include "voe_test_defines.h"
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
'voice_engine_core',
|
'voice_engine_core',
|
||||||
'<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
|
'<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
|
||||||
'<(webrtc_root)/../test/test.gyp:test_support',
|
'<(webrtc_root)/../test/test.gyp:test_support',
|
||||||
|
'<(webrtc_root)/../testing/gtest.gyp:gtest',
|
||||||
],
|
],
|
||||||
'include_dirs': [
|
'include_dirs': [
|
||||||
'auto_test',
|
'auto_test',
|
||||||
@ -23,10 +24,12 @@
|
|||||||
'<(webrtc_root)/modules/audio_device/main/interface',
|
'<(webrtc_root)/modules/audio_device/main/interface',
|
||||||
],
|
],
|
||||||
'sources': [
|
'sources': [
|
||||||
|
'auto_test/automated_mode.cc',
|
||||||
'auto_test/voe_cpu_test.cc',
|
'auto_test/voe_cpu_test.cc',
|
||||||
'auto_test/voe_cpu_test.h',
|
'auto_test/voe_cpu_test.h',
|
||||||
'auto_test/voe_extended_test.cc',
|
'auto_test/voe_extended_test.cc',
|
||||||
'auto_test/voe_extended_test.h',
|
'auto_test/voe_extended_test.h',
|
||||||
|
'auto_test/voe_standard_integration_test.cc',
|
||||||
'auto_test/voe_standard_test.cc',
|
'auto_test/voe_standard_test.cc',
|
||||||
'auto_test/voe_standard_test.h',
|
'auto_test/voe_standard_test.h',
|
||||||
'auto_test/voe_stress_test.cc',
|
'auto_test/voe_stress_test.cc',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user