Fix parallelizability in modules_tests.
R=henrik.lundin@webrtc.org BUG=3873 TEST=third_party/gtest-parallel/gtest-parallel -r 10 -w 64 out/Debug/modules_tests Review URL: https://webrtc-codereview.appspot.com/24799004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7354 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
4cebd84c79
commit
c86e45d7c4
@ -307,10 +307,9 @@ void EncodeDecodeTest::Perform() {
|
|||||||
// Only encode using real mono encoders, not telephone-event and cng.
|
// Only encode using real mono encoders, not telephone-event and cng.
|
||||||
for (int loopPars = 1; loopPars <= numPars[codeId]; loopPars++) {
|
for (int loopPars = 1; loopPars <= numPars[codeId]; loopPars++) {
|
||||||
// Encode all data to file.
|
// Encode all data to file.
|
||||||
EncodeToFile(1, codeId, codePars, _testMode);
|
std::string fileName = EncodeToFile(1, codeId, codePars, _testMode);
|
||||||
|
|
||||||
RTPFile rtpFile;
|
RTPFile rtpFile;
|
||||||
std::string fileName = webrtc::test::OutputPath() + "outFile.rtp";
|
|
||||||
rtpFile.Open(fileName.c_str(), "rb");
|
rtpFile.Open(fileName.c_str(), "rb");
|
||||||
|
|
||||||
_receiver.codeId = codeId;
|
_receiver.codeId = codeId;
|
||||||
@ -329,11 +328,14 @@ void EncodeDecodeTest::Perform() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EncodeDecodeTest::EncodeToFile(int fileType, int codeId, int* codePars,
|
std::string EncodeDecodeTest::EncodeToFile(int fileType,
|
||||||
int testMode) {
|
int codeId,
|
||||||
|
int* codePars,
|
||||||
|
int testMode) {
|
||||||
scoped_ptr<AudioCodingModule> acm(AudioCodingModule::Create(1));
|
scoped_ptr<AudioCodingModule> acm(AudioCodingModule::Create(1));
|
||||||
RTPFile rtpFile;
|
RTPFile rtpFile;
|
||||||
std::string fileName = webrtc::test::OutputPath() + "outFile.rtp";
|
std::string fileName = webrtc::test::TempFilename(webrtc::test::OutputPath(),
|
||||||
|
"encode_decode_rtp");
|
||||||
rtpFile.Open(fileName.c_str(), "wb+");
|
rtpFile.Open(fileName.c_str(), "wb+");
|
||||||
rtpFile.WriteHeader();
|
rtpFile.WriteHeader();
|
||||||
|
|
||||||
@ -348,6 +350,8 @@ void EncodeDecodeTest::EncodeToFile(int fileType, int codeId, int* codePars,
|
|||||||
}
|
}
|
||||||
_sender.Teardown();
|
_sender.Teardown();
|
||||||
rtpFile.Close();
|
rtpFile.Close();
|
||||||
|
|
||||||
|
return fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@ -107,7 +107,10 @@ class EncodeDecodeTest : public ACMTest {
|
|||||||
uint8_t _testMode;
|
uint8_t _testMode;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void EncodeToFile(int fileType, int codeId, int* codePars, int testMode);
|
std::string EncodeToFile(int fileType,
|
||||||
|
int codeId,
|
||||||
|
int* codePars,
|
||||||
|
int testMode);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Sender _sender;
|
Sender _sender;
|
||||||
|
@ -131,7 +131,8 @@ void PacketLossTest::Perform() {
|
|||||||
int codec_id = acm->Codec("opus", 48000, channels_);
|
int codec_id = acm->Codec("opus", 48000, channels_);
|
||||||
|
|
||||||
RTPFile rtpFile;
|
RTPFile rtpFile;
|
||||||
std::string fileName = webrtc::test::OutputPath() + "outFile.rtp";
|
std::string fileName = webrtc::test::TempFilename(webrtc::test::OutputPath(),
|
||||||
|
"packet_loss_test");
|
||||||
|
|
||||||
// Encode to file
|
// Encode to file
|
||||||
rtpFile.Open(fileName.c_str(), "wb+");
|
rtpFile.Open(fileName.c_str(), "wb+");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user