Re-enable AudioCodingModuleMtTest

Increase timeout and decrease test length. Also fixing a bug in the
test, and make sure the test aborts if fatal failure occurrs.

BUG=3426
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/13579005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6312 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org 2014-06-03 12:53:21 +00:00
parent 8e4401b5a0
commit 8d13cd1956

View File

@ -113,6 +113,7 @@ class AudioCodingModuleTest : public ::testing::Test {
rtp_utility_->Populate(&rtp_header_); rtp_utility_->Populate(&rtp_header_);
input_frame_.sample_rate_hz_ = kSampleRateHz; input_frame_.sample_rate_hz_ = kSampleRateHz;
input_frame_.num_channels_ = 1;
input_frame_.samples_per_channel_ = kSampleRateHz * 10 / 1000; // 10 ms. input_frame_.samples_per_channel_ = kSampleRateHz * 10 / 1000; // 10 ms.
COMPILE_ASSERT(kSampleRateHz * 10 / 1000 <= AudioFrame::kMaxDataSizeSamples, COMPILE_ASSERT(kSampleRateHz * 10 / 1000 <= AudioFrame::kMaxDataSizeSamples,
audio_frame_too_small); audio_frame_too_small);
@ -246,8 +247,8 @@ TEST_F(AudioCodingModuleTest, FailOnZeroDesiredFrequency) {
class AudioCodingModuleMtTest : public AudioCodingModuleTest { class AudioCodingModuleMtTest : public AudioCodingModuleTest {
protected: protected:
static const int kNumPackets = 10000; static const int kNumPackets = 5000;
static const int kNumPullCalls = 10000; static const int kNumPullCalls = 5000;
AudioCodingModuleMtTest() AudioCodingModuleMtTest()
: AudioCodingModuleTest(), : AudioCodingModuleTest(),
@ -290,7 +291,7 @@ class AudioCodingModuleMtTest : public AudioCodingModuleTest {
insert_packet_thread_->Stop(); insert_packet_thread_->Stop();
} }
EventTypeWrapper RunTest() { return test_complete_->Wait(60000); } EventTypeWrapper RunTest() { return test_complete_->Wait(120000); }
private: private:
static bool CbSendThread(void* context) { static bool CbSendThread(void* context) {
@ -300,6 +301,10 @@ class AudioCodingModuleMtTest : public AudioCodingModuleTest {
// The send thread doesn't have to care about the current simulated time, // The send thread doesn't have to care about the current simulated time,
// since only the AcmReceiver is using the clock. // since only the AcmReceiver is using the clock.
bool CbSendImpl() { bool CbSendImpl() {
if (HasFatalFailure()) {
// End the test early if a fatal failure (ASSERT_*) has occurred.
test_complete_->Set();
}
++send_count_; ++send_count_;
InsertAudio(); InsertAudio();
Encode(); Encode();
@ -364,7 +369,7 @@ class AudioCodingModuleMtTest : public AudioCodingModuleTest {
SimulatedClock* fake_clock_; SimulatedClock* fake_clock_;
}; };
TEST_F(AudioCodingModuleMtTest, DISABLED_DoTest) { TEST_F(AudioCodingModuleMtTest, DoTest) {
EXPECT_EQ(kEventSignaled, RunTest()); EXPECT_EQ(kEventSignaled, RunTest());
} }