From 005b6fffe639b50ba2deebe32424e109fd40f2b1 Mon Sep 17 00:00:00 2001 From: "pkasting@chromium.org" Date: Fri, 30 Jan 2015 19:41:42 +0000 Subject: [PATCH] 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 --- talk/app/webrtc/peerconnectioninterface_unittest.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/talk/app/webrtc/peerconnectioninterface_unittest.cc b/talk/app/webrtc/peerconnectioninterface_unittest.cc index 09cd137bb..3b5c354c7 100644 --- a/talk/app/webrtc/peerconnectioninterface_unittest.cc +++ b/talk/app/webrtc/peerconnectioninterface_unittest.cc @@ -433,7 +433,7 @@ class PeerConnectionInterfaceTest : public testing::Test { void CreateOfferAsRemoteDescription() { rtc::scoped_ptr 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 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 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 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 answer; - EXPECT_TRUE(DoCreateAnswer(answer.use())); + ASSERT_TRUE(DoCreateAnswer(answer.use())); audio_ssrc = 0; video_ssrc = 0; EXPECT_TRUE(GetFirstSsrc(GetFirstAudioContent(answer->description()),