Convert some EXPECTs to ASSERTs to avoid crashes when object creation fails.

BUG=none
TEST=none
R=perkj@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8222}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8222 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pkasting@chromium.org 2015-01-30 19:41:42 +00:00
parent 5e161616b1
commit 005b6fffe6

View File

@ -433,7 +433,7 @@ class PeerConnectionInterfaceTest : public testing::Test {
void CreateOfferAsRemoteDescription() {
rtc::scoped_ptr<SessionDescriptionInterface> offer;
EXPECT_TRUE(DoCreateOffer(offer.use()));
ASSERT_TRUE(DoCreateOffer(offer.use()));
std::string sdp;
EXPECT_TRUE(offer->ToString(&sdp));
SessionDescriptionInterface* remote_offer =
@ -445,7 +445,7 @@ class PeerConnectionInterfaceTest : public testing::Test {
void CreateAnswerAsLocalDescription() {
scoped_ptr<SessionDescriptionInterface> answer;
EXPECT_TRUE(DoCreateAnswer(answer.use()));
ASSERT_TRUE(DoCreateAnswer(answer.use()));
// TODO(perkj): Currently SetLocalDescription fails if any parameters in an
// audio codec change, even if the parameter has nothing to do with
@ -465,7 +465,7 @@ class PeerConnectionInterfaceTest : public testing::Test {
void CreatePrAnswerAsLocalDescription() {
scoped_ptr<SessionDescriptionInterface> answer;
EXPECT_TRUE(DoCreateAnswer(answer.use()));
ASSERT_TRUE(DoCreateAnswer(answer.use()));
std::string sdp;
EXPECT_TRUE(answer->ToString(&sdp));
@ -711,7 +711,7 @@ TEST_F(PeerConnectionInterfaceTest, SsrcInOfferAnswer) {
// Test CreateOffer
scoped_ptr<SessionDescriptionInterface> offer;
EXPECT_TRUE(DoCreateOffer(offer.use()));
ASSERT_TRUE(DoCreateOffer(offer.use()));
int audio_ssrc = 0;
int video_ssrc = 0;
EXPECT_TRUE(GetFirstSsrc(GetFirstAudioContent(offer->description()),
@ -723,7 +723,7 @@ TEST_F(PeerConnectionInterfaceTest, SsrcInOfferAnswer) {
// Test CreateAnswer
EXPECT_TRUE(DoSetRemoteDescription(offer.release()));
scoped_ptr<SessionDescriptionInterface> answer;
EXPECT_TRUE(DoCreateAnswer(answer.use()));
ASSERT_TRUE(DoCreateAnswer(answer.use()));
audio_ssrc = 0;
video_ssrc = 0;
EXPECT_TRUE(GetFirstSsrc(GetFirstAudioContent(answer->description()),