Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1089)

Unified Diff: webrtc/pc/mediasession_unittest.cc

Issue 2685783014: Replace NULL with nullptr in all C++ files. (Closed)
Patch Set: Fixing android. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/pc/mediasession_unittest.cc
diff --git a/webrtc/pc/mediasession_unittest.cc b/webrtc/pc/mediasession_unittest.cc
index 6676240b0c4e8b258e5098b1e996d4b5a1559ac9..a5d93ae4b05f903004cec9d7939cd8fb8cf58106 100644
--- a/webrtc/pc/mediasession_unittest.cc
+++ b/webrtc/pc/mediasession_unittest.cc
@@ -300,13 +300,13 @@ class MediaSessionDescriptionFactoryTest : public testing::Test {
desc.reset(f1_.CreateOffer(options, current_desc.get()));
} else {
std::unique_ptr<SessionDescription> offer;
- offer.reset(f1_.CreateOffer(options, NULL));
+ offer.reset(f1_.CreateOffer(options, nullptr));
desc.reset(f1_.CreateAnswer(offer.get(), options, current_desc.get()));
}
- ASSERT_TRUE(desc.get() != NULL);
+ ASSERT_TRUE(desc.get() != nullptr);
const TransportInfo* ti_audio = desc->GetTransportInfoByName("audio");
if (options.has_audio()) {
- EXPECT_TRUE(ti_audio != NULL);
+ EXPECT_TRUE(ti_audio != nullptr);
if (has_current_desc) {
EXPECT_EQ(current_audio_ufrag, ti_audio->description.ice_ufrag);
EXPECT_EQ(current_audio_pwd, ti_audio->description.ice_pwd);
@@ -319,11 +319,11 @@ class MediaSessionDescriptionFactoryTest : public testing::Test {
EXPECT_EQ(options.enable_ice_renomination, GetIceRenomination(ti_audio));
} else {
- EXPECT_TRUE(ti_audio == NULL);
+ EXPECT_TRUE(ti_audio == nullptr);
}
const TransportInfo* ti_video = desc->GetTransportInfoByName("video");
if (options.has_video()) {
- EXPECT_TRUE(ti_video != NULL);
+ EXPECT_TRUE(ti_video != nullptr);
if (options.bundle_enabled) {
EXPECT_EQ(ti_audio->description.ice_ufrag,
ti_video->description.ice_ufrag);
@@ -342,11 +342,11 @@ class MediaSessionDescriptionFactoryTest : public testing::Test {
}
EXPECT_EQ(options.enable_ice_renomination, GetIceRenomination(ti_video));
} else {
- EXPECT_TRUE(ti_video == NULL);
+ EXPECT_TRUE(ti_video == nullptr);
}
const TransportInfo* ti_data = desc->GetTransportInfoByName("data");
if (options.has_data()) {
- EXPECT_TRUE(ti_data != NULL);
+ EXPECT_TRUE(ti_data != nullptr);
if (options.bundle_enabled) {
EXPECT_EQ(ti_audio->description.ice_ufrag,
ti_data->description.ice_ufrag);
@@ -366,7 +366,7 @@ class MediaSessionDescriptionFactoryTest : public testing::Test {
EXPECT_EQ(options.enable_ice_renomination, GetIceRenomination(ti_data));
} else {
- EXPECT_TRUE(ti_video == NULL);
+ EXPECT_TRUE(ti_video == nullptr);
}
}
@@ -380,23 +380,23 @@ class MediaSessionDescriptionFactoryTest : public testing::Test {
std::unique_ptr<SessionDescription> desc;
if (offer) {
options.bundle_enabled = false;
- ref_desc.reset(f1_.CreateOffer(options, NULL));
+ ref_desc.reset(f1_.CreateOffer(options, nullptr));
options.bundle_enabled = true;
desc.reset(f1_.CreateOffer(options, ref_desc.get()));
} else {
options.bundle_enabled = true;
- ref_desc.reset(f1_.CreateOffer(options, NULL));
- desc.reset(f1_.CreateAnswer(ref_desc.get(), options, NULL));
+ ref_desc.reset(f1_.CreateOffer(options, nullptr));
+ desc.reset(f1_.CreateAnswer(ref_desc.get(), options, nullptr));
}
- ASSERT_TRUE(desc.get() != NULL);
+ ASSERT_TRUE(desc.get() != nullptr);
const cricket::MediaContentDescription* audio_media_desc =
static_cast<const cricket::MediaContentDescription*>(
desc.get()->GetContentDescriptionByName("audio"));
- ASSERT_TRUE(audio_media_desc != NULL);
+ ASSERT_TRUE(audio_media_desc != nullptr);
const cricket::MediaContentDescription* video_media_desc =
static_cast<const cricket::MediaContentDescription*>(
desc.get()->GetContentDescriptionByName("video"));
- ASSERT_TRUE(video_media_desc != NULL);
+ ASSERT_TRUE(video_media_desc != nullptr);
EXPECT_TRUE(CompareCryptoParams(audio_media_desc->cryptos(),
video_media_desc->cryptos()));
EXPECT_EQ(1u, audio_media_desc->cryptos().size());
@@ -427,21 +427,21 @@ class MediaSessionDescriptionFactoryTest : public testing::Test {
cricket::MediaContentDirection expected_direction_in_answer) {
MediaSessionOptions opts;
opts.recv_video = true;
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
ContentInfo* ac_offer = offer->GetContentByName("audio");
- ASSERT_TRUE(ac_offer != NULL);
+ ASSERT_TRUE(ac_offer != nullptr);
AudioContentDescription* acd_offer =
static_cast<AudioContentDescription*>(ac_offer->description);
acd_offer->set_direction(direction_in_offer);
ContentInfo* vc_offer = offer->GetContentByName("video");
- ASSERT_TRUE(vc_offer != NULL);
+ ASSERT_TRUE(vc_offer != nullptr);
VideoContentDescription* vcd_offer =
static_cast<VideoContentDescription*>(vc_offer->description);
vcd_offer->set_direction(direction_in_offer);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
const AudioContentDescription* acd_answer =
GetFirstAudioContentDescription(answer.get());
EXPECT_EQ(expected_direction_in_answer, acd_answer->direction());
@@ -452,10 +452,10 @@ class MediaSessionDescriptionFactoryTest : public testing::Test {
bool VerifyNoCNCodecs(const cricket::ContentInfo* content) {
const cricket::ContentDescription* description = content->description;
- RTC_CHECK(description != NULL);
+ RTC_CHECK(description != nullptr);
const cricket::AudioContentDescription* audio_content_desc =
static_cast<const cricket::AudioContentDescription*>(description);
- RTC_CHECK(audio_content_desc != NULL);
+ RTC_CHECK(audio_content_desc != nullptr);
for (size_t i = 0; i < audio_content_desc->codecs().size(); ++i) {
if (audio_content_desc->codecs()[i].name == "CN")
return false;
@@ -473,14 +473,14 @@ class MediaSessionDescriptionFactoryTest : public testing::Test {
f1_.set_secure(SEC_ENABLED);
f2_.set_secure(SEC_ENABLED);
std::unique_ptr<SessionDescription> offer(
- f1_.CreateOffer(offer_opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ f1_.CreateOffer(offer_opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), answer_opts, NULL));
+ f2_.CreateAnswer(offer.get(), answer_opts, nullptr));
const ContentInfo* ac = answer->GetContentByName("audio");
const ContentInfo* vc = answer->GetContentByName("video");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc != nullptr);
EXPECT_EQ(std::string(NS_JINGLE_RTP), ac->type);
EXPECT_EQ(std::string(NS_JINGLE_RTP), vc->type);
const AudioContentDescription* acd =
@@ -520,12 +520,12 @@ class MediaSessionDescriptionFactoryTest : public testing::Test {
TEST_F(MediaSessionDescriptionFactoryTest, TestCreateAudioOffer) {
f1_.set_secure(SEC_ENABLED);
std::unique_ptr<SessionDescription> offer(
- f1_.CreateOffer(MediaSessionOptions(), NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ f1_.CreateOffer(MediaSessionOptions(), nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
const ContentInfo* ac = offer->GetContentByName("audio");
const ContentInfo* vc = offer->GetContentByName("video");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc == NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc == nullptr);
EXPECT_EQ(std::string(NS_JINGLE_RTP), ac->type);
const AudioContentDescription* acd =
static_cast<const AudioContentDescription*>(ac->description);
@@ -543,12 +543,12 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateVideoOffer) {
MediaSessionOptions opts;
opts.recv_video = true;
f1_.set_secure(SEC_ENABLED);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
const ContentInfo* ac = offer->GetContentByName("audio");
const ContentInfo* vc = offer->GetContentByName("video");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc != nullptr);
EXPECT_EQ(std::string(NS_JINGLE_RTP), ac->type);
EXPECT_EQ(std::string(NS_JINGLE_RTP), vc->type);
const AudioContentDescription* acd =
@@ -586,16 +586,16 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestBundleOfferWithSameCodecPlType) {
opts.recv_video = true;
opts.data_channel_type = cricket::DCT_RTP;
opts.bundle_enabled = true;
- std::unique_ptr<SessionDescription> offer(f2_.CreateOffer(opts, NULL));
+ std::unique_ptr<SessionDescription> offer(f2_.CreateOffer(opts, nullptr));
const VideoContentDescription* vcd =
GetFirstVideoContentDescription(offer.get());
const AudioContentDescription* acd =
GetFirstAudioContentDescription(offer.get());
const DataContentDescription* dcd =
GetFirstDataContentDescription(offer.get());
- ASSERT_TRUE(NULL != vcd);
- ASSERT_TRUE(NULL != acd);
- ASSERT_TRUE(NULL != dcd);
+ ASSERT_TRUE(nullptr != vcd);
+ ASSERT_TRUE(nullptr != acd);
+ ASSERT_TRUE(nullptr != dcd);
EXPECT_NE(vcd->codecs()[0].id, acd->codecs()[0].id);
EXPECT_NE(vcd->codecs()[0].id, dcd->codecs()[0].id);
EXPECT_NE(acd->codecs()[0].id, dcd->codecs()[0].id);
@@ -615,9 +615,9 @@ TEST_F(MediaSessionDescriptionFactoryTest,
opts.recv_video = false;
opts.data_channel_type = cricket::DCT_NONE;
opts.bundle_enabled = true;
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
MediaSessionOptions updated_opts;
updated_opts.recv_audio = true;
@@ -633,9 +633,9 @@ TEST_F(MediaSessionDescriptionFactoryTest,
GetFirstVideoContentDescription(updated_offer.get());
const DataContentDescription* dcd =
GetFirstDataContentDescription(updated_offer.get());
- EXPECT_TRUE(NULL != vcd);
- EXPECT_TRUE(NULL != acd);
- EXPECT_TRUE(NULL != dcd);
+ EXPECT_TRUE(nullptr != vcd);
+ EXPECT_TRUE(nullptr != acd);
+ EXPECT_TRUE(nullptr != dcd);
ASSERT_CRYPTO(acd, 1U, CS_AES_CM_128_HMAC_SHA1_80);
EXPECT_EQ(std::string(cricket::kMediaProtocolSavpf), acd->protocol());
@@ -650,12 +650,12 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateRtpDataOffer) {
MediaSessionOptions opts;
opts.data_channel_type = cricket::DCT_RTP;
f1_.set_secure(SEC_ENABLED);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
const ContentInfo* ac = offer->GetContentByName("audio");
const ContentInfo* dc = offer->GetContentByName("data");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(dc != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(dc != nullptr);
EXPECT_EQ(std::string(NS_JINGLE_RTP), ac->type);
EXPECT_EQ(std::string(NS_JINGLE_RTP), dc->type);
const AudioContentDescription* acd =
@@ -686,9 +686,9 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateSctpDataOffer) {
opts.bundle_enabled = true;
opts.data_channel_type = cricket::DCT_SCTP;
f1_.set_secure(SEC_ENABLED);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- EXPECT_TRUE(offer.get() != NULL);
- EXPECT_TRUE(offer->GetContentByName("data") != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ EXPECT_TRUE(offer.get() != nullptr);
+ EXPECT_TRUE(offer->GetContentByName("data") != nullptr);
}
// Test creating an sctp data channel from an already generated offer.
@@ -698,10 +698,10 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateImplicitSctpDataOffer) {
opts.bundle_enabled = true;
opts.data_channel_type = cricket::DCT_SCTP;
f1_.set_secure(SEC_ENABLED);
- std::unique_ptr<SessionDescription> offer1(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer1.get() != NULL);
+ std::unique_ptr<SessionDescription> offer1(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer1.get() != nullptr);
const ContentInfo* data = offer1->GetContentByName("data");
- ASSERT_TRUE(data != NULL);
+ ASSERT_TRUE(data != nullptr);
const MediaContentDescription* mdesc =
static_cast<const MediaContentDescription*>(data->description);
ASSERT_EQ(cricket::kMediaProtocolSctp, mdesc->protocol());
@@ -713,7 +713,7 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateImplicitSctpDataOffer) {
std::unique_ptr<SessionDescription> offer2(
f1_.CreateOffer(opts, offer1.get()));
data = offer2->GetContentByName("data");
- ASSERT_TRUE(data != NULL);
+ ASSERT_TRUE(data != nullptr);
mdesc = static_cast<const MediaContentDescription*>(data->description);
EXPECT_EQ(cricket::kMediaProtocolSctp, mdesc->protocol());
}
@@ -724,12 +724,12 @@ TEST_F(MediaSessionDescriptionFactoryTest,
MediaSessionOptions opts;
opts.recv_video = true;
f1_.set_add_legacy_streams(false);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
const ContentInfo* ac = offer->GetContentByName("audio");
const ContentInfo* vc = offer->GetContentByName("video");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc != nullptr);
const AudioContentDescription* acd =
static_cast<const AudioContentDescription*>(ac->description);
const VideoContentDescription* vcd =
@@ -747,8 +747,8 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateSendOnlyOffer) {
options.AddSendStream(MEDIA_TYPE_VIDEO, kVideoTrack1, kMediaStream1);
options.AddSendStream(MEDIA_TYPE_AUDIO, kAudioTrack1, kMediaStream1);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(options, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(options, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
EXPECT_EQ(2u, offer->contents().size());
EXPECT_TRUE(IsMediaContentOfType(&offer->contents()[0], MEDIA_TYPE_AUDIO));
EXPECT_TRUE(IsMediaContentOfType(&offer->contents()[1], MEDIA_TYPE_VIDEO));
@@ -765,15 +765,15 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateOfferContentOrder) {
opts.recv_video = false;
opts.data_channel_type = cricket::DCT_SCTP;
- std::unique_ptr<SessionDescription> offer1(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer1.get() != NULL);
+ std::unique_ptr<SessionDescription> offer1(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer1.get() != nullptr);
EXPECT_EQ(1u, offer1->contents().size());
EXPECT_TRUE(IsMediaContentOfType(&offer1->contents()[0], MEDIA_TYPE_DATA));
opts.recv_video = true;
std::unique_ptr<SessionDescription> offer2(
f1_.CreateOffer(opts, offer1.get()));
- ASSERT_TRUE(offer2.get() != NULL);
+ ASSERT_TRUE(offer2.get() != nullptr);
EXPECT_EQ(2u, offer2->contents().size());
EXPECT_TRUE(IsMediaContentOfType(&offer2->contents()[0], MEDIA_TYPE_DATA));
EXPECT_TRUE(IsMediaContentOfType(&offer2->contents()[1], MEDIA_TYPE_VIDEO));
@@ -781,7 +781,7 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateOfferContentOrder) {
opts.recv_audio = true;
std::unique_ptr<SessionDescription> offer3(
f1_.CreateOffer(opts, offer2.get()));
- ASSERT_TRUE(offer3.get() != NULL);
+ ASSERT_TRUE(offer3.get() != nullptr);
EXPECT_EQ(3u, offer3->contents().size());
EXPECT_TRUE(IsMediaContentOfType(&offer3->contents()[0], MEDIA_TYPE_DATA));
EXPECT_TRUE(IsMediaContentOfType(&offer3->contents()[1], MEDIA_TYPE_VIDEO));
@@ -789,8 +789,8 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateOfferContentOrder) {
// Verifies the default order is audio-video-data, so that the previous checks
// didn't pass by accident.
- std::unique_ptr<SessionDescription> offer4(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer4.get() != NULL);
+ std::unique_ptr<SessionDescription> offer4(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer4.get() != nullptr);
EXPECT_EQ(3u, offer4->contents().size());
EXPECT_TRUE(IsMediaContentOfType(&offer4->contents()[0], MEDIA_TYPE_AUDIO));
EXPECT_TRUE(IsMediaContentOfType(&offer4->contents()[1], MEDIA_TYPE_VIDEO));
@@ -802,14 +802,14 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateAudioAnswer) {
f1_.set_secure(SEC_ENABLED);
f2_.set_secure(SEC_ENABLED);
std::unique_ptr<SessionDescription> offer(
- f1_.CreateOffer(MediaSessionOptions(), NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ f1_.CreateOffer(MediaSessionOptions(), nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), MediaSessionOptions(), NULL));
+ f2_.CreateAnswer(offer.get(), MediaSessionOptions(), nullptr));
const ContentInfo* ac = answer->GetContentByName("audio");
const ContentInfo* vc = answer->GetContentByName("video");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc == NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc == nullptr);
EXPECT_EQ(std::string(NS_JINGLE_RTP), ac->type);
const AudioContentDescription* acd =
static_cast<const AudioContentDescription*>(ac->description);
@@ -829,15 +829,14 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateAudioAnswerGcm) {
f2_.set_secure(SEC_ENABLED);
MediaSessionOptions options;
options.crypto_options.enable_gcm_crypto_suites = true;
- std::unique_ptr<SessionDescription> offer(
- f1_.CreateOffer(options, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(options, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), options, NULL));
+ f2_.CreateAnswer(offer.get(), options, nullptr));
const ContentInfo* ac = answer->GetContentByName("audio");
const ContentInfo* vc = answer->GetContentByName("video");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc == NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc == nullptr);
EXPECT_EQ(std::string(NS_JINGLE_RTP), ac->type);
const AudioContentDescription* acd =
static_cast<const AudioContentDescription*>(ac->description);
@@ -856,14 +855,14 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateVideoAnswer) {
opts.recv_video = true;
f1_.set_secure(SEC_ENABLED);
f2_.set_secure(SEC_ENABLED);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
const ContentInfo* ac = answer->GetContentByName("audio");
const ContentInfo* vc = answer->GetContentByName("video");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc != nullptr);
EXPECT_EQ(std::string(NS_JINGLE_RTP), ac->type);
EXPECT_EQ(std::string(NS_JINGLE_RTP), vc->type);
const AudioContentDescription* acd =
@@ -907,14 +906,14 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateDataAnswer) {
opts.data_channel_type = cricket::DCT_RTP;
f1_.set_secure(SEC_ENABLED);
f2_.set_secure(SEC_ENABLED);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
const ContentInfo* ac = answer->GetContentByName("audio");
const ContentInfo* vc = answer->GetContentByName("data");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc != nullptr);
EXPECT_EQ(std::string(NS_JINGLE_RTP), ac->type);
EXPECT_EQ(std::string(NS_JINGLE_RTP), vc->type);
const AudioContentDescription* acd =
@@ -941,14 +940,14 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateDataAnswerGcm) {
opts.crypto_options.enable_gcm_crypto_suites = true;
f1_.set_secure(SEC_ENABLED);
f2_.set_secure(SEC_ENABLED);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
const ContentInfo* ac = answer->GetContentByName("audio");
const ContentInfo* vc = answer->GetContentByName("data");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc != nullptr);
EXPECT_EQ(std::string(NS_JINGLE_RTP), ac->type);
EXPECT_EQ(std::string(NS_JINGLE_RTP), vc->type);
const AudioContentDescription* acd =
@@ -977,24 +976,24 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateAnswerContentOrder) {
// Creates a data only offer.
opts.recv_audio = false;
opts.data_channel_type = cricket::DCT_SCTP;
- std::unique_ptr<SessionDescription> offer1(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer1.get() != NULL);
+ std::unique_ptr<SessionDescription> offer1(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer1.get() != nullptr);
// Appends audio to the offer.
opts.recv_audio = true;
std::unique_ptr<SessionDescription> offer2(
f1_.CreateOffer(opts, offer1.get()));
- ASSERT_TRUE(offer2.get() != NULL);
+ ASSERT_TRUE(offer2.get() != nullptr);
// Appends video to the offer.
opts.recv_video = true;
std::unique_ptr<SessionDescription> offer3(
f1_.CreateOffer(opts, offer2.get()));
- ASSERT_TRUE(offer3.get() != NULL);
+ ASSERT_TRUE(offer3.get() != nullptr);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer3.get(), opts, NULL));
- ASSERT_TRUE(answer.get() != NULL);
+ f2_.CreateAnswer(offer3.get(), opts, nullptr));
+ ASSERT_TRUE(answer.get() != nullptr);
EXPECT_EQ(3u, answer->contents().size());
EXPECT_TRUE(IsMediaContentOfType(&answer->contents()[0], MEDIA_TYPE_DATA));
EXPECT_TRUE(IsMediaContentOfType(&answer->contents()[1], MEDIA_TYPE_AUDIO));
@@ -1036,24 +1035,24 @@ TEST_F(MediaSessionDescriptionFactoryTest,
opts.recv_audio = false;
f1_.set_secure(SEC_ENABLED);
f2_.set_secure(SEC_ENABLED);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
ContentInfo* dc_offer = offer->GetContentByName("data");
- ASSERT_TRUE(dc_offer != NULL);
+ ASSERT_TRUE(dc_offer != nullptr);
DataContentDescription* dcd_offer =
static_cast<DataContentDescription*>(dc_offer->description);
- ASSERT_TRUE(dcd_offer != NULL);
+ ASSERT_TRUE(dcd_offer != nullptr);
std::string protocol = "a weird unknown protocol";
dcd_offer->set_protocol(protocol);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
const ContentInfo* dc_answer = answer->GetContentByName("data");
- ASSERT_TRUE(dc_answer != NULL);
+ ASSERT_TRUE(dc_answer != nullptr);
EXPECT_TRUE(dc_answer->rejected);
const DataContentDescription* dcd_answer =
static_cast<const DataContentDescription*>(dc_answer->description);
- ASSERT_TRUE(dcd_answer != NULL);
+ ASSERT_TRUE(dcd_answer != nullptr);
EXPECT_EQ(protocol, dcd_answer->protocol());
}
@@ -1065,22 +1064,22 @@ TEST_F(MediaSessionDescriptionFactoryTest, AudioOfferAnswerWithCryptoDisabled) {
tdf1_.set_secure(SEC_DISABLED);
tdf2_.set_secure(SEC_DISABLED);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
const AudioContentDescription* offer_acd =
GetFirstAudioContentDescription(offer.get());
- ASSERT_TRUE(offer_acd != NULL);
+ ASSERT_TRUE(offer_acd != nullptr);
EXPECT_EQ(std::string(cricket::kMediaProtocolAvpf), offer_acd->protocol());
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
const ContentInfo* ac_answer = answer->GetContentByName("audio");
- ASSERT_TRUE(ac_answer != NULL);
+ ASSERT_TRUE(ac_answer != nullptr);
EXPECT_FALSE(ac_answer->rejected);
const AudioContentDescription* answer_acd =
GetFirstAudioContentDescription(answer.get());
- ASSERT_TRUE(answer_acd != NULL);
+ ASSERT_TRUE(answer_acd != nullptr);
EXPECT_EQ(std::string(cricket::kMediaProtocolAvpf), answer_acd->protocol());
}
@@ -1095,10 +1094,10 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestOfferAnswerWithRtpExtensions) {
f2_.set_audio_rtp_header_extensions(MAKE_VECTOR(kAudioRtpExtension2));
f2_.set_video_rtp_header_extensions(MAKE_VECTOR(kVideoRtpExtension2));
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
EXPECT_EQ(MAKE_VECTOR(kAudioRtpExtension1),
GetFirstAudioContentDescription(
@@ -1122,15 +1121,15 @@ TEST_F(MediaSessionDescriptionFactoryTest,
opts.data_channel_type = cricket::DCT_RTP;
f1_.set_add_legacy_streams(false);
f2_.set_add_legacy_streams(false);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
const ContentInfo* ac = answer->GetContentByName("audio");
const ContentInfo* vc = answer->GetContentByName("video");
const ContentInfo* dc = answer->GetContentByName("data");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc != nullptr);
const AudioContentDescription* acd =
static_cast<const AudioContentDescription*>(ac->description);
const VideoContentDescription* vcd =
@@ -1148,8 +1147,8 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestPartial) {
opts.recv_video = true;
opts.data_channel_type = cricket::DCT_RTP;
f1_.set_secure(SEC_ENABLED);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
const ContentInfo* ac = offer->GetContentByName("audio");
const ContentInfo* vc = offer->GetContentByName("video");
const ContentInfo* dc = offer->GetContentByName("data");
@@ -1194,14 +1193,14 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateVideoAnswerRtcpMux) {
offer_opts.rtcp_mux_enabled = true;
answer_opts.rtcp_mux_enabled = true;
- offer.reset(f1_.CreateOffer(offer_opts, NULL));
- answer.reset(f2_.CreateAnswer(offer.get(), answer_opts, NULL));
- ASSERT_TRUE(NULL != GetFirstAudioContentDescription(offer.get()));
- ASSERT_TRUE(NULL != GetFirstVideoContentDescription(offer.get()));
- ASSERT_TRUE(NULL != GetFirstDataContentDescription(offer.get()));
- ASSERT_TRUE(NULL != GetFirstAudioContentDescription(answer.get()));
- ASSERT_TRUE(NULL != GetFirstVideoContentDescription(answer.get()));
- ASSERT_TRUE(NULL != GetFirstDataContentDescription(answer.get()));
+ offer.reset(f1_.CreateOffer(offer_opts, nullptr));
+ answer.reset(f2_.CreateAnswer(offer.get(), answer_opts, nullptr));
+ ASSERT_TRUE(nullptr != GetFirstAudioContentDescription(offer.get()));
+ ASSERT_TRUE(nullptr != GetFirstVideoContentDescription(offer.get()));
+ ASSERT_TRUE(nullptr != GetFirstDataContentDescription(offer.get()));
+ ASSERT_TRUE(nullptr != GetFirstAudioContentDescription(answer.get()));
+ ASSERT_TRUE(nullptr != GetFirstVideoContentDescription(answer.get()));
+ ASSERT_TRUE(nullptr != GetFirstDataContentDescription(answer.get()));
EXPECT_TRUE(GetFirstAudioContentDescription(offer.get())->rtcp_mux());
EXPECT_TRUE(GetFirstVideoContentDescription(offer.get())->rtcp_mux());
EXPECT_TRUE(GetFirstDataContentDescription(offer.get())->rtcp_mux());
@@ -1212,14 +1211,14 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateVideoAnswerRtcpMux) {
offer_opts.rtcp_mux_enabled = true;
answer_opts.rtcp_mux_enabled = false;
- offer.reset(f1_.CreateOffer(offer_opts, NULL));
- answer.reset(f2_.CreateAnswer(offer.get(), answer_opts, NULL));
- ASSERT_TRUE(NULL != GetFirstAudioContentDescription(offer.get()));
- ASSERT_TRUE(NULL != GetFirstVideoContentDescription(offer.get()));
- ASSERT_TRUE(NULL != GetFirstDataContentDescription(offer.get()));
- ASSERT_TRUE(NULL != GetFirstAudioContentDescription(answer.get()));
- ASSERT_TRUE(NULL != GetFirstVideoContentDescription(answer.get()));
- ASSERT_TRUE(NULL != GetFirstDataContentDescription(answer.get()));
+ offer.reset(f1_.CreateOffer(offer_opts, nullptr));
+ answer.reset(f2_.CreateAnswer(offer.get(), answer_opts, nullptr));
+ ASSERT_TRUE(nullptr != GetFirstAudioContentDescription(offer.get()));
+ ASSERT_TRUE(nullptr != GetFirstVideoContentDescription(offer.get()));
+ ASSERT_TRUE(nullptr != GetFirstDataContentDescription(offer.get()));
+ ASSERT_TRUE(nullptr != GetFirstAudioContentDescription(answer.get()));
+ ASSERT_TRUE(nullptr != GetFirstVideoContentDescription(answer.get()));
+ ASSERT_TRUE(nullptr != GetFirstDataContentDescription(answer.get()));
EXPECT_TRUE(GetFirstAudioContentDescription(offer.get())->rtcp_mux());
EXPECT_TRUE(GetFirstVideoContentDescription(offer.get())->rtcp_mux());
EXPECT_TRUE(GetFirstDataContentDescription(offer.get())->rtcp_mux());
@@ -1230,14 +1229,14 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateVideoAnswerRtcpMux) {
offer_opts.rtcp_mux_enabled = false;
answer_opts.rtcp_mux_enabled = true;
- offer.reset(f1_.CreateOffer(offer_opts, NULL));
- answer.reset(f2_.CreateAnswer(offer.get(), answer_opts, NULL));
- ASSERT_TRUE(NULL != GetFirstAudioContentDescription(offer.get()));
- ASSERT_TRUE(NULL != GetFirstVideoContentDescription(offer.get()));
- ASSERT_TRUE(NULL != GetFirstDataContentDescription(offer.get()));
- ASSERT_TRUE(NULL != GetFirstAudioContentDescription(answer.get()));
- ASSERT_TRUE(NULL != GetFirstVideoContentDescription(answer.get()));
- ASSERT_TRUE(NULL != GetFirstDataContentDescription(answer.get()));
+ offer.reset(f1_.CreateOffer(offer_opts, nullptr));
+ answer.reset(f2_.CreateAnswer(offer.get(), answer_opts, nullptr));
+ ASSERT_TRUE(nullptr != GetFirstAudioContentDescription(offer.get()));
+ ASSERT_TRUE(nullptr != GetFirstVideoContentDescription(offer.get()));
+ ASSERT_TRUE(nullptr != GetFirstDataContentDescription(offer.get()));
+ ASSERT_TRUE(nullptr != GetFirstAudioContentDescription(answer.get()));
+ ASSERT_TRUE(nullptr != GetFirstVideoContentDescription(answer.get()));
+ ASSERT_TRUE(nullptr != GetFirstDataContentDescription(answer.get()));
EXPECT_FALSE(GetFirstAudioContentDescription(offer.get())->rtcp_mux());
EXPECT_FALSE(GetFirstVideoContentDescription(offer.get())->rtcp_mux());
EXPECT_FALSE(GetFirstDataContentDescription(offer.get())->rtcp_mux());
@@ -1248,14 +1247,14 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateVideoAnswerRtcpMux) {
offer_opts.rtcp_mux_enabled = false;
answer_opts.rtcp_mux_enabled = false;
- offer.reset(f1_.CreateOffer(offer_opts, NULL));
- answer.reset(f2_.CreateAnswer(offer.get(), answer_opts, NULL));
- ASSERT_TRUE(NULL != GetFirstAudioContentDescription(offer.get()));
- ASSERT_TRUE(NULL != GetFirstVideoContentDescription(offer.get()));
- ASSERT_TRUE(NULL != GetFirstDataContentDescription(offer.get()));
- ASSERT_TRUE(NULL != GetFirstAudioContentDescription(answer.get()));
- ASSERT_TRUE(NULL != GetFirstVideoContentDescription(answer.get()));
- ASSERT_TRUE(NULL != GetFirstDataContentDescription(answer.get()));
+ offer.reset(f1_.CreateOffer(offer_opts, nullptr));
+ answer.reset(f2_.CreateAnswer(offer.get(), answer_opts, nullptr));
+ ASSERT_TRUE(nullptr != GetFirstAudioContentDescription(offer.get()));
+ ASSERT_TRUE(nullptr != GetFirstVideoContentDescription(offer.get()));
+ ASSERT_TRUE(nullptr != GetFirstDataContentDescription(offer.get()));
+ ASSERT_TRUE(nullptr != GetFirstAudioContentDescription(answer.get()));
+ ASSERT_TRUE(nullptr != GetFirstVideoContentDescription(answer.get()));
+ ASSERT_TRUE(nullptr != GetFirstDataContentDescription(answer.get()));
EXPECT_FALSE(GetFirstAudioContentDescription(offer.get())->rtcp_mux());
EXPECT_FALSE(GetFirstVideoContentDescription(offer.get())->rtcp_mux());
EXPECT_FALSE(GetFirstDataContentDescription(offer.get())->rtcp_mux());
@@ -1268,15 +1267,15 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateVideoAnswerRtcpMux) {
TEST_F(MediaSessionDescriptionFactoryTest, TestCreateAudioAnswerToVideo) {
MediaSessionOptions opts;
opts.recv_video = true;
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), MediaSessionOptions(), NULL));
+ f2_.CreateAnswer(offer.get(), MediaSessionOptions(), nullptr));
const ContentInfo* ac = answer->GetContentByName("audio");
const ContentInfo* vc = answer->GetContentByName("video");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc != NULL);
- ASSERT_TRUE(vc->description != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc != nullptr);
+ ASSERT_TRUE(vc->description != nullptr);
EXPECT_TRUE(vc->rejected);
}
@@ -1284,15 +1283,15 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateAudioAnswerToVideo) {
TEST_F(MediaSessionDescriptionFactoryTest, TestCreateNoDataAnswerToDataOffer) {
MediaSessionOptions opts;
opts.data_channel_type = cricket::DCT_RTP;
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), MediaSessionOptions(), NULL));
+ f2_.CreateAnswer(offer.get(), MediaSessionOptions(), nullptr));
const ContentInfo* ac = answer->GetContentByName("audio");
const ContentInfo* dc = answer->GetContentByName("data");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(dc != NULL);
- ASSERT_TRUE(dc->description != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(dc != nullptr);
+ ASSERT_TRUE(dc->description != nullptr);
EXPECT_TRUE(dc->rejected);
}
@@ -1302,25 +1301,25 @@ TEST_F(MediaSessionDescriptionFactoryTest,
MediaSessionOptions opts;
opts.recv_video = true;
opts.data_channel_type = cricket::DCT_RTP;
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
ContentInfo* ac = offer->GetContentByName("audio");
ContentInfo* vc = offer->GetContentByName("video");
ContentInfo* dc = offer->GetContentByName("data");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc != NULL);
- ASSERT_TRUE(dc != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc != nullptr);
+ ASSERT_TRUE(dc != nullptr);
ac->rejected = true;
vc->rejected = true;
dc->rejected = true;
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
ac = answer->GetContentByName("audio");
vc = answer->GetContentByName("video");
dc = answer->GetContentByName("data");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc != NULL);
- ASSERT_TRUE(dc != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc != nullptr);
+ ASSERT_TRUE(dc != nullptr);
EXPECT_TRUE(ac->rejected);
EXPECT_TRUE(vc->rejected);
EXPECT_TRUE(dc->rejected);
@@ -1342,15 +1341,15 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateMultiStreamVideoOffer) {
opts.AddSendStream(MEDIA_TYPE_DATA, kDataTrack2, kMediaStream1);
f1_.set_secure(SEC_ENABLED);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
- ASSERT_TRUE(offer.get() != NULL);
+ ASSERT_TRUE(offer.get() != nullptr);
const ContentInfo* ac = offer->GetContentByName("audio");
const ContentInfo* vc = offer->GetContentByName("video");
const ContentInfo* dc = offer->GetContentByName("data");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc != NULL);
- ASSERT_TRUE(dc != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc != nullptr);
+ ASSERT_TRUE(dc != nullptr);
const AudioContentDescription* acd =
static_cast<const AudioContentDescription*>(ac->description);
const VideoContentDescription* vcd =
@@ -1415,13 +1414,13 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateMultiStreamVideoOffer) {
std::unique_ptr<SessionDescription> updated_offer(
f1_.CreateOffer(opts, offer.get()));
- ASSERT_TRUE(updated_offer.get() != NULL);
+ ASSERT_TRUE(updated_offer.get() != nullptr);
ac = updated_offer->GetContentByName("audio");
vc = updated_offer->GetContentByName("video");
dc = updated_offer->GetContentByName("data");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc != NULL);
- ASSERT_TRUE(dc != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc != nullptr);
+ ASSERT_TRUE(dc != nullptr);
const AudioContentDescription* updated_acd =
static_cast<const AudioContentDescription*>(ac->description);
const VideoContentDescription* updated_vcd =
@@ -1475,11 +1474,11 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateSimulcastVideoOffer) {
MediaSessionOptions opts;
const int num_sim_layers = 3;
opts.AddSendVideoStream(kVideoTrack1, kMediaStream1, num_sim_layers);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
- ASSERT_TRUE(offer.get() != NULL);
+ ASSERT_TRUE(offer.get() != nullptr);
const ContentInfo* vc = offer->GetContentByName("video");
- ASSERT_TRUE(vc != NULL);
+ ASSERT_TRUE(vc != nullptr);
const VideoContentDescription* vcd =
static_cast<const VideoContentDescription*>(vc->description);
@@ -1488,7 +1487,7 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateSimulcastVideoOffer) {
EXPECT_EQ(kVideoTrack1, video_streams[0].id);
const SsrcGroup* sim_ssrc_group =
video_streams[0].get_ssrc_group(cricket::kSimSsrcGroupSemantics);
- ASSERT_TRUE(sim_ssrc_group != NULL);
+ ASSERT_TRUE(sim_ssrc_group != nullptr);
EXPECT_EQ(static_cast<size_t>(num_sim_layers), sim_ssrc_group->ssrcs.size());
}
@@ -1504,7 +1503,8 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateMultiStreamVideoAnswer) {
offer_opts.data_channel_type = cricket::DCT_RTP;
f1_.set_secure(SEC_ENABLED);
f2_.set_secure(SEC_ENABLED);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(offer_opts, NULL));
+ std::unique_ptr<SessionDescription> offer(
+ f1_.CreateOffer(offer_opts, nullptr));
MediaSessionOptions opts;
opts.AddSendStream(MEDIA_TYPE_VIDEO, kVideoTrack1, kMediaStream1);
@@ -1515,15 +1515,15 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateMultiStreamVideoAnswer) {
opts.AddSendStream(MEDIA_TYPE_DATA, kDataTrack2, kMediaStream1);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
- ASSERT_TRUE(answer.get() != NULL);
+ ASSERT_TRUE(answer.get() != nullptr);
const ContentInfo* ac = answer->GetContentByName("audio");
const ContentInfo* vc = answer->GetContentByName("video");
const ContentInfo* dc = answer->GetContentByName("data");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc != NULL);
- ASSERT_TRUE(dc != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc != nullptr);
+ ASSERT_TRUE(dc != nullptr);
const AudioContentDescription* acd =
static_cast<const AudioContentDescription*>(ac->description);
const VideoContentDescription* vcd =
@@ -1585,13 +1585,13 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateMultiStreamVideoAnswer) {
std::unique_ptr<SessionDescription> updated_answer(
f2_.CreateAnswer(offer.get(), opts, answer.get()));
- ASSERT_TRUE(updated_answer.get() != NULL);
+ ASSERT_TRUE(updated_answer.get() != nullptr);
ac = updated_answer->GetContentByName("audio");
vc = updated_answer->GetContentByName("video");
dc = updated_answer->GetContentByName("data");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc != NULL);
- ASSERT_TRUE(dc != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc != nullptr);
+ ASSERT_TRUE(dc != nullptr);
const AudioContentDescription* updated_acd =
static_cast<const AudioContentDescription*>(ac->description);
const VideoContentDescription* updated_vcd =
@@ -1638,9 +1638,9 @@ TEST_F(MediaSessionDescriptionFactoryTest,
opts.recv_audio = true;
opts.recv_video = true;
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
const AudioContentDescription* acd =
GetFirstAudioContentDescription(answer.get());
@@ -1699,10 +1699,10 @@ TEST_F(MediaSessionDescriptionFactoryTest,
AddRtxCodec(VideoCodec::CreateRtxCodec(125, kVideoCodecs2[0].id), &f2_codecs);
f2_.set_video_codecs(f2_codecs);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
const VideoContentDescription* vcd =
GetFirstVideoContentDescription(answer.get());
@@ -1743,9 +1743,9 @@ TEST_F(MediaSessionDescriptionFactoryTest,
opts.recv_audio = true;
opts.recv_video = false;
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
const AudioContentDescription* acd =
GetFirstAudioContentDescription(answer.get());
@@ -1843,8 +1843,8 @@ TEST_F(MediaSessionDescriptionFactoryTest, RtxWithoutApt) {
AddRtxCodec(VideoCodec::CreateRtxCodec(125, kVideoCodecs2[0].id), &f2_codecs);
f2_.set_video_codecs(f2_codecs);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
// kCodecParamAssociatedPayloadType will always be added to the offer when RTX
// is selected. Manually remove kCodecParamAssociatedPayloadType so that it
// is possible to test that that RTX is dropped when
@@ -1852,7 +1852,7 @@ TEST_F(MediaSessionDescriptionFactoryTest, RtxWithoutApt) {
VideoContentDescription* desc =
static_cast<cricket::VideoContentDescription*>(
offer->GetContentDescriptionByName(cricket::CN_VIDEO));
- ASSERT_TRUE(desc != NULL);
+ ASSERT_TRUE(desc != nullptr);
std::vector<VideoCodec> codecs = desc->codecs();
for (std::vector<VideoCodec>::iterator iter = codecs.begin();
iter != codecs.end(); ++iter) {
@@ -1863,7 +1863,7 @@ TEST_F(MediaSessionDescriptionFactoryTest, RtxWithoutApt) {
desc->set_codecs(codecs);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
std::vector<std::string> codec_names =
GetCodecNames(GetFirstVideoContentDescription(answer.get())->codecs());
@@ -1887,12 +1887,12 @@ TEST_F(MediaSessionDescriptionFactoryTest, FilterOutRtxIfAptDoesntMatch) {
AddRtxCodec(VideoCodec::CreateRtxCodec(125, kVideoCodecs2[1].id), &f2_codecs);
f2_.set_video_codecs(f2_codecs);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
// Associated payload type doesn't match, therefore, RTX codec is removed in
// the answer.
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
std::vector<std::string> codec_names =
GetCodecNames(GetFirstVideoContentDescription(answer.get())->codecs());
@@ -1923,10 +1923,10 @@ TEST_F(MediaSessionDescriptionFactoryTest,
// H264-SVC codec is removed in the answer, therefore, associated RTX codec
// for H264-SVC should also be removed.
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
const VideoContentDescription* vcd =
GetFirstVideoContentDescription(answer.get());
std::vector<VideoCodec> expected_codecs = MAKE_VECTOR(kVideoCodecsAnswer);
@@ -1989,11 +1989,11 @@ TEST_F(MediaSessionDescriptionFactoryTest, SimSsrcsGenerateMultipleRtxSsrcs) {
// Ensure that the offer has an RTX ssrc for each regular ssrc, and that there
// is a FID ssrc + grouping for each.
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
VideoContentDescription* desc = static_cast<VideoContentDescription*>(
offer->GetContentDescriptionByName(cricket::CN_VIDEO));
- ASSERT_TRUE(desc != NULL);
+ ASSERT_TRUE(desc != nullptr);
EXPECT_TRUE(desc->multistream());
const StreamParamsVec& streams = desc->streams();
// Single stream.
@@ -2108,9 +2108,9 @@ TEST_F(MediaSessionDescriptionFactoryTest,
f2_.set_audio_rtp_header_extensions(MAKE_VECTOR(kAudioRtpExtension2));
f2_.set_video_rtp_header_extensions(MAKE_VECTOR(kVideoRtpExtension2));
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), opts, NULL));
+ f2_.CreateAnswer(offer.get(), opts, nullptr));
EXPECT_EQ(MAKE_VECTOR(kAudioRtpExtensionAnswer),
GetFirstAudioContentDescription(
@@ -2161,7 +2161,7 @@ TEST_F(MediaSessionDescriptionFactoryTest, RtpExtensionIdReused) {
f1_.set_audio_rtp_header_extensions(MAKE_VECTOR(kAudioRtpExtension3));
f1_.set_video_rtp_header_extensions(MAKE_VECTOR(kVideoRtpExtension3));
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, nullptr));
// Since the audio extensions used ID 3 for "both_audio_and_video", so should
// the video extensions.
@@ -2202,12 +2202,12 @@ TEST(MediaSessionDescription, CopySessionDescription) {
source.AddContent(cricket::CN_VIDEO, cricket::NS_JINGLE_RTP, vcd);
std::unique_ptr<SessionDescription> copy(source.Copy());
- ASSERT_TRUE(copy.get() != NULL);
+ ASSERT_TRUE(copy.get() != nullptr);
EXPECT_TRUE(copy->HasGroup(cricket::CN_AUDIO));
const ContentInfo* ac = copy->GetContentByName("audio");
const ContentInfo* vc = copy->GetContentByName("video");
- ASSERT_TRUE(ac != NULL);
- ASSERT_TRUE(vc != NULL);
+ ASSERT_TRUE(ac != nullptr);
+ ASSERT_TRUE(vc != nullptr);
EXPECT_EQ(std::string(NS_JINGLE_RTP), ac->type);
const AudioContentDescription* acd_copy =
static_cast<const AudioContentDescription*>(ac->description);
@@ -2356,19 +2356,19 @@ TEST_F(MediaSessionDescriptionFactoryTest,
tdf2_.set_secure(SEC_DISABLED);
std::unique_ptr<SessionDescription> offer(
- f1_.CreateOffer(MediaSessionOptions(), NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ f1_.CreateOffer(MediaSessionOptions(), nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
ContentInfo* offer_content = offer->GetContentByName("audio");
- ASSERT_TRUE(offer_content != NULL);
+ ASSERT_TRUE(offer_content != nullptr);
AudioContentDescription* offer_audio_desc =
static_cast<AudioContentDescription*>(offer_content->description);
offer_audio_desc->set_protocol(cricket::kMediaProtocolDtlsSavpf);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), MediaSessionOptions(), NULL));
- ASSERT_TRUE(answer != NULL);
+ f2_.CreateAnswer(offer.get(), MediaSessionOptions(), nullptr));
+ ASSERT_TRUE(answer != nullptr);
ContentInfo* answer_content = answer->GetContentByName("audio");
- ASSERT_TRUE(answer_content != NULL);
+ ASSERT_TRUE(answer_content != nullptr);
ASSERT_TRUE(answer_content->rejected);
}
@@ -2382,20 +2382,20 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestOfferDtlsSavpfCreateAnswer) {
tdf2_.set_secure(SEC_ENABLED);
std::unique_ptr<SessionDescription> offer(
- f1_.CreateOffer(MediaSessionOptions(), NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ f1_.CreateOffer(MediaSessionOptions(), nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
ContentInfo* offer_content = offer->GetContentByName("audio");
- ASSERT_TRUE(offer_content != NULL);
+ ASSERT_TRUE(offer_content != nullptr);
AudioContentDescription* offer_audio_desc =
static_cast<AudioContentDescription*>(offer_content->description);
offer_audio_desc->set_protocol(cricket::kMediaProtocolDtlsSavpf);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), MediaSessionOptions(), NULL));
- ASSERT_TRUE(answer != NULL);
+ f2_.CreateAnswer(offer.get(), MediaSessionOptions(), nullptr));
+ ASSERT_TRUE(answer != nullptr);
const ContentInfo* answer_content = answer->GetContentByName("audio");
- ASSERT_TRUE(answer_content != NULL);
+ ASSERT_TRUE(answer_content != nullptr);
ASSERT_FALSE(answer_content->rejected);
const AudioContentDescription* answer_audio_desc =
@@ -2421,56 +2421,56 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCryptoDtls) {
const cricket::TransportDescription* video_trans_desc;
// Generate an offer with SDES and DTLS support.
- offer.reset(f1_.CreateOffer(options, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ offer.reset(f1_.CreateOffer(options, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
audio_media_desc = static_cast<const cricket::MediaContentDescription*>(
offer->GetContentDescriptionByName("audio"));
- ASSERT_TRUE(audio_media_desc != NULL);
+ ASSERT_TRUE(audio_media_desc != nullptr);
video_media_desc = static_cast<const cricket::MediaContentDescription*>(
offer->GetContentDescriptionByName("video"));
- ASSERT_TRUE(video_media_desc != NULL);
+ ASSERT_TRUE(video_media_desc != nullptr);
EXPECT_EQ(2u, audio_media_desc->cryptos().size());
EXPECT_EQ(1u, video_media_desc->cryptos().size());
audio_trans_desc = offer->GetTransportDescriptionByName("audio");
- ASSERT_TRUE(audio_trans_desc != NULL);
+ ASSERT_TRUE(audio_trans_desc != nullptr);
video_trans_desc = offer->GetTransportDescriptionByName("video");
- ASSERT_TRUE(video_trans_desc != NULL);
- ASSERT_TRUE(audio_trans_desc->identity_fingerprint.get() != NULL);
- ASSERT_TRUE(video_trans_desc->identity_fingerprint.get() != NULL);
+ ASSERT_TRUE(video_trans_desc != nullptr);
+ ASSERT_TRUE(audio_trans_desc->identity_fingerprint.get() != nullptr);
+ ASSERT_TRUE(video_trans_desc->identity_fingerprint.get() != nullptr);
// Generate an answer with only SDES support, since tdf2 has crypto disabled.
- answer.reset(f2_.CreateAnswer(offer.get(), options, NULL));
- ASSERT_TRUE(answer.get() != NULL);
+ answer.reset(f2_.CreateAnswer(offer.get(), options, nullptr));
+ ASSERT_TRUE(answer.get() != nullptr);
audio_media_desc = static_cast<const cricket::MediaContentDescription*>(
answer->GetContentDescriptionByName("audio"));
- ASSERT_TRUE(audio_media_desc != NULL);
+ ASSERT_TRUE(audio_media_desc != nullptr);
video_media_desc = static_cast<const cricket::MediaContentDescription*>(
answer->GetContentDescriptionByName("video"));
- ASSERT_TRUE(video_media_desc != NULL);
+ ASSERT_TRUE(video_media_desc != nullptr);
EXPECT_EQ(1u, audio_media_desc->cryptos().size());
EXPECT_EQ(1u, video_media_desc->cryptos().size());
audio_trans_desc = answer->GetTransportDescriptionByName("audio");
- ASSERT_TRUE(audio_trans_desc != NULL);
+ ASSERT_TRUE(audio_trans_desc != nullptr);
video_trans_desc = answer->GetTransportDescriptionByName("video");
- ASSERT_TRUE(video_trans_desc != NULL);
- ASSERT_TRUE(audio_trans_desc->identity_fingerprint.get() == NULL);
- ASSERT_TRUE(video_trans_desc->identity_fingerprint.get() == NULL);
+ ASSERT_TRUE(video_trans_desc != nullptr);
+ ASSERT_TRUE(audio_trans_desc->identity_fingerprint.get() == nullptr);
+ ASSERT_TRUE(video_trans_desc->identity_fingerprint.get() == nullptr);
// Enable DTLS; the answer should now only have DTLS support.
tdf2_.set_secure(SEC_ENABLED);
- answer.reset(f2_.CreateAnswer(offer.get(), options, NULL));
- ASSERT_TRUE(answer.get() != NULL);
+ answer.reset(f2_.CreateAnswer(offer.get(), options, nullptr));
+ ASSERT_TRUE(answer.get() != nullptr);
audio_media_desc = static_cast<const cricket::MediaContentDescription*>(
answer->GetContentDescriptionByName("audio"));
- ASSERT_TRUE(audio_media_desc != NULL);
+ ASSERT_TRUE(audio_media_desc != nullptr);
video_media_desc = static_cast<const cricket::MediaContentDescription*>(
answer->GetContentDescriptionByName("video"));
- ASSERT_TRUE(video_media_desc != NULL);
+ ASSERT_TRUE(video_media_desc != nullptr);
EXPECT_TRUE(audio_media_desc->cryptos().empty());
EXPECT_TRUE(video_media_desc->cryptos().empty());
EXPECT_EQ(std::string(cricket::kMediaProtocolSavpf),
@@ -2479,31 +2479,31 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCryptoDtls) {
video_media_desc->protocol());
audio_trans_desc = answer->GetTransportDescriptionByName("audio");
- ASSERT_TRUE(audio_trans_desc != NULL);
+ ASSERT_TRUE(audio_trans_desc != nullptr);
video_trans_desc = answer->GetTransportDescriptionByName("video");
- ASSERT_TRUE(video_trans_desc != NULL);
- ASSERT_TRUE(audio_trans_desc->identity_fingerprint.get() != NULL);
- ASSERT_TRUE(video_trans_desc->identity_fingerprint.get() != NULL);
+ ASSERT_TRUE(video_trans_desc != nullptr);
+ ASSERT_TRUE(audio_trans_desc->identity_fingerprint.get() != nullptr);
+ ASSERT_TRUE(video_trans_desc->identity_fingerprint.get() != nullptr);
// Try creating offer again. DTLS enabled now, crypto's should be empty
// in new offer.
offer.reset(f1_.CreateOffer(options, offer.get()));
- ASSERT_TRUE(offer.get() != NULL);
+ ASSERT_TRUE(offer.get() != nullptr);
audio_media_desc = static_cast<const cricket::MediaContentDescription*>(
offer->GetContentDescriptionByName("audio"));
- ASSERT_TRUE(audio_media_desc != NULL);
+ ASSERT_TRUE(audio_media_desc != nullptr);
video_media_desc = static_cast<const cricket::MediaContentDescription*>(
offer->GetContentDescriptionByName("video"));
- ASSERT_TRUE(video_media_desc != NULL);
+ ASSERT_TRUE(video_media_desc != nullptr);
EXPECT_TRUE(audio_media_desc->cryptos().empty());
EXPECT_TRUE(video_media_desc->cryptos().empty());
audio_trans_desc = offer->GetTransportDescriptionByName("audio");
- ASSERT_TRUE(audio_trans_desc != NULL);
+ ASSERT_TRUE(audio_trans_desc != nullptr);
video_trans_desc = offer->GetTransportDescriptionByName("video");
- ASSERT_TRUE(video_trans_desc != NULL);
- ASSERT_TRUE(audio_trans_desc->identity_fingerprint.get() != NULL);
- ASSERT_TRUE(video_trans_desc->identity_fingerprint.get() != NULL);
+ ASSERT_TRUE(video_trans_desc != nullptr);
+ ASSERT_TRUE(audio_trans_desc->identity_fingerprint.get() != nullptr);
+ ASSERT_TRUE(video_trans_desc->identity_fingerprint.get() != nullptr);
}
// Test that an answer can't be created if cryptos are required but the offer is
@@ -2515,11 +2515,11 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestSecureAnswerToUnsecureOffer) {
f2_.set_secure(SEC_REQUIRED);
tdf1_.set_secure(SEC_ENABLED);
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(options, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(options, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
std::unique_ptr<SessionDescription> answer(
- f2_.CreateAnswer(offer.get(), options, NULL));
- EXPECT_TRUE(answer.get() == NULL);
+ f2_.CreateAnswer(offer.get(), options, nullptr));
+ EXPECT_TRUE(answer.get() == nullptr);
}
// Test that we accept a DTLS offer without SDES and create an appropriate
@@ -2537,8 +2537,8 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCryptoOfferDtlsButNotSdes) {
std::unique_ptr<SessionDescription> offer, answer;
// Generate an offer with DTLS but without SDES.
- offer.reset(f1_.CreateOffer(options, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ offer.reset(f1_.CreateOffer(options, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
const AudioContentDescription* audio_offer =
GetFirstAudioContentDescription(offer.get());
@@ -2552,27 +2552,27 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCryptoOfferDtlsButNotSdes) {
const cricket::TransportDescription* audio_offer_trans_desc =
offer->GetTransportDescriptionByName("audio");
- ASSERT_TRUE(audio_offer_trans_desc->identity_fingerprint.get() != NULL);
+ ASSERT_TRUE(audio_offer_trans_desc->identity_fingerprint.get() != nullptr);
const cricket::TransportDescription* video_offer_trans_desc =
offer->GetTransportDescriptionByName("video");
- ASSERT_TRUE(video_offer_trans_desc->identity_fingerprint.get() != NULL);
+ ASSERT_TRUE(video_offer_trans_desc->identity_fingerprint.get() != nullptr);
const cricket::TransportDescription* data_offer_trans_desc =
offer->GetTransportDescriptionByName("data");
- ASSERT_TRUE(data_offer_trans_desc->identity_fingerprint.get() != NULL);
+ ASSERT_TRUE(data_offer_trans_desc->identity_fingerprint.get() != nullptr);
// Generate an answer with DTLS.
- answer.reset(f2_.CreateAnswer(offer.get(), options, NULL));
- ASSERT_TRUE(answer.get() != NULL);
+ answer.reset(f2_.CreateAnswer(offer.get(), options, nullptr));
+ ASSERT_TRUE(answer.get() != nullptr);
const cricket::TransportDescription* audio_answer_trans_desc =
answer->GetTransportDescriptionByName("audio");
- EXPECT_TRUE(audio_answer_trans_desc->identity_fingerprint.get() != NULL);
+ EXPECT_TRUE(audio_answer_trans_desc->identity_fingerprint.get() != nullptr);
const cricket::TransportDescription* video_answer_trans_desc =
answer->GetTransportDescriptionByName("video");
- EXPECT_TRUE(video_answer_trans_desc->identity_fingerprint.get() != NULL);
+ EXPECT_TRUE(video_answer_trans_desc->identity_fingerprint.get() != nullptr);
const cricket::TransportDescription* data_answer_trans_desc =
answer->GetTransportDescriptionByName("data");
- EXPECT_TRUE(data_answer_trans_desc->identity_fingerprint.get() != NULL);
+ EXPECT_TRUE(data_answer_trans_desc->identity_fingerprint.get() != nullptr);
}
// Verifies if vad_enabled option is set to false, CN codecs are not present in
@@ -2581,19 +2581,19 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestVADEnableOption) {
MediaSessionOptions options;
options.recv_audio = true;
options.recv_video = true;
- std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(options, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(options, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
const ContentInfo* audio_content = offer->GetContentByName("audio");
EXPECT_FALSE(VerifyNoCNCodecs(audio_content));
options.vad_enabled = false;
- offer.reset(f1_.CreateOffer(options, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ offer.reset(f1_.CreateOffer(options, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
audio_content = offer->GetContentByName("audio");
EXPECT_TRUE(VerifyNoCNCodecs(audio_content));
std::unique_ptr<SessionDescription> answer(
- f1_.CreateAnswer(offer.get(), options, NULL));
- ASSERT_TRUE(answer.get() != NULL);
+ f1_.CreateAnswer(offer.get(), options, nullptr));
+ ASSERT_TRUE(answer.get() != nullptr);
audio_content = answer->GetContentByName("audio");
EXPECT_TRUE(VerifyNoCNCodecs(audio_content));
}
@@ -2757,8 +2757,8 @@ void TestAudioCodecsOffer(MediaContentDirection direction,
if (direction == cricket::MD_SENDONLY || direction == cricket::MD_SENDRECV)
opts.AddSendStream(MEDIA_TYPE_AUDIO, kAudioTrack1, kMediaStream1);
- std::unique_ptr<SessionDescription> offer(sf.CreateOffer(opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ std::unique_ptr<SessionDescription> offer(sf.CreateOffer(opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
const ContentInfo* ac = offer->GetContentByName("audio");
// If the factory didn't add any audio content to the offer, we cannot check
@@ -2862,8 +2862,8 @@ void TestAudioCodecsAnswer(MediaContentDirection offer_direction,
}
std::unique_ptr<SessionDescription> offer(
- offer_factory.CreateOffer(offer_opts, NULL));
- ASSERT_TRUE(offer.get() != NULL);
+ offer_factory.CreateOffer(offer_opts, nullptr));
+ ASSERT_TRUE(offer.get() != nullptr);
MediaSessionOptions answer_opts;
answer_opts.recv_audio = (answer_direction == cricket::MD_RECVONLY ||
@@ -2874,7 +2874,7 @@ void TestAudioCodecsAnswer(MediaContentDirection offer_direction,
answer_opts.AddSendStream(MEDIA_TYPE_AUDIO, kAudioTrack1, kMediaStream1);
}
std::unique_ptr<SessionDescription> answer(
- answer_factory.CreateAnswer(offer.get(), answer_opts, NULL));
+ answer_factory.CreateAnswer(offer.get(), answer_opts, nullptr));
const ContentInfo* ac = answer->GetContentByName("audio");
// If the factory didn't add any audio content to the answer, we cannot check
« webrtc/base/event.cc ('K') | « webrtc/pc/mediasession.cc ('k') | webrtc/pc/mediastream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698