Reland of Adding a some checks and switching out a few assert for RTC_[D]CHECK. (patchset #1 id:1 of https://codereview.webrtc.org/2018553002/ )

Adding a some checks and switching out a few assert for RTC_[D]CHECK.
These changes are around use of AudioFrame.data_ to help us catch issues earlier since assert() is left out in release builds, including builds with DCHECK enabled.  I've also added a few full-on CHECKs to avoid reading past buffer boundaries or continuing on in a failed state.

TBR=kjellander@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Committed: https://crrev.com/60c4e0ae8f124f08372645a95042f4a1246d7aa3
Cr-Commit-Position: refs/heads/master@{#12925}

Review URL: https://codereview.webrtc.org/2014973002 .

Cr-Commit-Position: refs/heads/master@{#12926}
This commit is contained in:
Tommi 2016-05-26 21:51:30 +02:00
parent 60c4e0ae8f
commit 5771beb265

View File

@ -309,11 +309,14 @@ TEST_F(AudioCodingModuleTestOldApi, VerifyOutputFrame) {
EXPECT_EQ(kSampleRateHz, audio_frame.sample_rate_hz_);
}
#if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
TEST_F(AudioCodingModuleTestOldApi, FailOnZeroDesiredFrequency) {
AudioFrame audio_frame;
bool muted;
EXPECT_EQ(-1, acm_->PlayoutData10Ms(0, &audio_frame, &muted));
EXPECT_DEATH(acm_->PlayoutData10Ms(0, &audio_frame, &muted),
"dst_sample_rate_hz");
}
#endif
// Checks that the transport callback is invoked once for each speech packet.
// Also checks that the frame type is kAudioFrameSpeech.