Started extracting methods out of the main test.
Started extracting methods out of the main test, which will hopefully make us able to make the tests independent. Merge branch 'master' into voe_split_methods Conflicts: src/voice_engine/main/test/auto_test/voe_extended_test.cc src/voice_engine/main/test/auto_test/voe_extended_test.h src/voice_engine/main/test/auto_test/voe_standard_test.cc src/voice_engine/main/test/auto_test/voe_standard_test.h Extracted methods out of the standard test. Added space before inheritance colons. Rolled back some header file changes. Fixed long lines. Fixed long lines. Fixed indentation. There is nothing but whitespace changes here, except for removing some extraneous semicolons in .h files and fixing a spelling error in a comment. BUG= TEST= Review URL: http://webrtc-codereview.appspot.com/313001 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1131 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
d03718d1e4
commit
dd094fd6ae
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -273,88 +273,101 @@ class VoETestManager {
|
||||
int DoStandardTest();
|
||||
|
||||
const char* AudioFilename() const {
|
||||
return audioFilename_.c_str();
|
||||
return audio_filename_.c_str();
|
||||
}
|
||||
|
||||
VoiceEngine* VoiceEnginePtr() const {
|
||||
return ve;
|
||||
return voice_engine_;
|
||||
}
|
||||
VoEBase* BasePtr() const {
|
||||
return base;
|
||||
return voe_base_;
|
||||
}
|
||||
VoECodec* CodecPtr() const {
|
||||
return codec;
|
||||
return voe_codec_;
|
||||
}
|
||||
VoEVolumeControl* VolumeControlPtr() const {
|
||||
return volume;
|
||||
return voe_volume_control_;
|
||||
}
|
||||
VoEDtmf* DtmfPtr() const {
|
||||
return dtmf;
|
||||
return voe_dtmf_;
|
||||
}
|
||||
VoERTP_RTCP* RTP_RTCPPtr() const {
|
||||
return rtp_rtcp;
|
||||
return voe_rtp_rtcp_;
|
||||
}
|
||||
VoEAudioProcessing* APMPtr() const {
|
||||
return apm;
|
||||
return voe_apm_;
|
||||
}
|
||||
|
||||
VoENetwork* NetworkPtr() const {
|
||||
return netw;
|
||||
return voe_network_;
|
||||
}
|
||||
|
||||
VoEFile* FilePtr() const {
|
||||
return file;
|
||||
return voe_file_;
|
||||
}
|
||||
|
||||
VoEHardware* HardwarePtr() const {
|
||||
return hardware;
|
||||
return voe_hardware_;
|
||||
}
|
||||
|
||||
VoEVideoSync* VideoSyncPtr() const {
|
||||
return vsync;
|
||||
return voe_vsync_;
|
||||
}
|
||||
|
||||
VoEEncryption* EncryptionPtr() const {
|
||||
return encrypt;
|
||||
return voe_encrypt_;
|
||||
}
|
||||
|
||||
VoEExternalMedia* ExternalMediaPtr() const {
|
||||
return xmedia;
|
||||
return voe_xmedia_;
|
||||
}
|
||||
|
||||
VoECallReport* CallReportPtr() const {
|
||||
return report;
|
||||
return voe_call_report_;
|
||||
}
|
||||
|
||||
#ifdef _TEST_NETEQ_STATS_
|
||||
VoENetEqStats* NetEqStatsPtr() const {
|
||||
return neteqst;
|
||||
return voe_neteq_stats_;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
private:
|
||||
bool initialized_;
|
||||
VoiceEngine* ve;
|
||||
VoEBase* base;
|
||||
VoECallReport* report;
|
||||
VoECodec* codec;
|
||||
VoEDtmf* dtmf;
|
||||
VoEEncryption* encrypt;
|
||||
VoEExternalMedia* xmedia;
|
||||
VoEFile* file;
|
||||
VoEHardware* hardware;
|
||||
int TestTraceApi();
|
||||
int TestHardwareBeforeInitializing();
|
||||
int SetUp();
|
||||
int TestRtpRtcpBeforeStreaming();
|
||||
int TestHardwareBeforeStreaming();
|
||||
int TestCodecsBeforeStreaming();
|
||||
int TestNetworkBeforeStreaming();
|
||||
int TestStartStreaming(FakeExternalTransport& channel0_transport);
|
||||
int TestStartPlaying();
|
||||
int TestHoldAndNetEq();
|
||||
int TestCodecs();
|
||||
|
||||
bool initialized_;
|
||||
|
||||
VoiceEngine* voice_engine_;
|
||||
VoEBase* voe_base_;
|
||||
VoECallReport* voe_call_report_;
|
||||
VoECodec* voe_codec_;
|
||||
VoEDtmf* voe_dtmf_;
|
||||
VoEEncryption* voe_encrypt_;
|
||||
VoEExternalMedia* voe_xmedia_;
|
||||
VoEFile* voe_file_;
|
||||
VoEHardware* voe_hardware_;
|
||||
VoENetwork* voe_network_;
|
||||
#ifdef _TEST_NETEQ_STATS_
|
||||
VoENetEqStats* neteqst;
|
||||
VoENetEqStats* voe_neteq_stats_;
|
||||
#endif
|
||||
VoENetwork* netw;
|
||||
VoERTP_RTCP* rtp_rtcp;
|
||||
VoEVideoSync* vsync;
|
||||
VoEVolumeControl* volume;
|
||||
VoEAudioProcessing* apm;
|
||||
int instanceCount;
|
||||
std::string resourcePath_;
|
||||
std::string audioFilename_;
|
||||
VoERTP_RTCP* voe_rtp_rtcp_;
|
||||
VoEVideoSync* voe_vsync_;
|
||||
VoEVolumeControl* voe_volume_control_;
|
||||
VoEAudioProcessing* voe_apm_;
|
||||
|
||||
std::string resource_path_;
|
||||
std::string audio_filename_;
|
||||
};
|
||||
|
||||
} // namespace voetest
|
||||
|
||||
@ -136,16 +136,16 @@
|
||||
if ((expr)) \
|
||||
{ \
|
||||
TEST_LOG_ERROR("Error at line:%i, %s \n",__LINE__, #expr); \
|
||||
TEST_LOG_ERROR("Error code: %i\n",base->LastError()); \
|
||||
TEST_LOG_ERROR("Error code: %i\n",voe_base_->LastError()); \
|
||||
} \
|
||||
}
|
||||
#define TEST_ERROR(code) \
|
||||
{ \
|
||||
int err = base->LastError(); \
|
||||
int err = voe_base_->LastError(); \
|
||||
if (err != code) \
|
||||
{ \
|
||||
TEST_LOG_ERROR("Invalid error code (%d, should be %d) at line %d\n",
|
||||
code, err, __LINE__);
|
||||
code, err, __LINE__);
|
||||
}
|
||||
}
|
||||
#else
|
||||
@ -157,20 +157,21 @@ code, err, __LINE__);
|
||||
if ((expr)) \
|
||||
{ \
|
||||
TEST_LOG_ERROR("\nError at line:%i, %s \n",__LINE__, #expr); \
|
||||
TEST_LOG_ERROR("Error code: %i\n",base->LastError()); \
|
||||
TEST_LOG_ERROR("Error code: %i\n", voe_base_->LastError()); \
|
||||
PAUSE \
|
||||
return -1; \
|
||||
return -1; \
|
||||
} \
|
||||
}
|
||||
#define TEST_ERROR(code) \
|
||||
{ \
|
||||
int err = base->LastError(); \
|
||||
if (err != code) \
|
||||
{ \
|
||||
TEST_LOG_ERROR("Invalid error code (%d, should be %d) at line %d\n", err, code, __LINE__); \
|
||||
PAUSE \
|
||||
return -1; \
|
||||
} \
|
||||
#define TEST_ERROR(code) \
|
||||
{ \
|
||||
int err = voe_base_->LastError(); \
|
||||
if (err != code) \
|
||||
{ \
|
||||
TEST_LOG_ERROR("Invalid error code (%d, should be %d) at line %d\n", \
|
||||
err, code, __LINE__); \
|
||||
PAUSE \
|
||||
return -1; \
|
||||
} \
|
||||
}
|
||||
#endif // #ifdef _INSTRUMENTATION_TESTING_
|
||||
#define EXCLUDE() \
|
||||
|
||||
@ -59,11 +59,11 @@ enum ExtendedSelection {
|
||||
// External transport (Transport)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class my_transportation : public Transport {
|
||||
class FakeExternalTransport : public Transport {
|
||||
public:
|
||||
my_transportation(VoENetwork* ptr);
|
||||
virtual ~my_transportation();
|
||||
VoENetwork* myNetw;
|
||||
FakeExternalTransport(VoENetwork* ptr);
|
||||
virtual ~FakeExternalTransport();
|
||||
VoENetwork* my_network_;
|
||||
int SendPacket(int channel, const void *data, int len);
|
||||
int SendRTCPPacket(int channel, const void *data, int len);
|
||||
void SetDelayStatus(bool enabled, unsigned int delayInMs = 100);
|
||||
@ -71,15 +71,15 @@ class my_transportation : public Transport {
|
||||
static bool Run(void* ptr);
|
||||
bool Process();
|
||||
private:
|
||||
ThreadWrapper* _thread;
|
||||
CriticalSectionWrapper* _lock;
|
||||
EventWrapper* _event;
|
||||
ThreadWrapper* thread_;
|
||||
CriticalSectionWrapper* lock_;
|
||||
EventWrapper* event_;
|
||||
private:
|
||||
unsigned char _packetBuffer[1612];
|
||||
int _length;
|
||||
int _channel;
|
||||
bool _delayIsEnabled;
|
||||
int _delayTimeInMs;
|
||||
unsigned char packet_buffer_[1612];
|
||||
int length_;
|
||||
int channel_;
|
||||
bool delay_is_enabled_;
|
||||
int delay_time_in_ms_;
|
||||
};
|
||||
|
||||
// Main test function
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user