Removing warning suppression flags from pc/.

Bug: webrtc:9251
Change-Id: Ic12126fc03309448fe71a17e6b65343949496f4f
Reviewed-on: https://webrtc-review.googlesource.com/86820
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23838}
This commit is contained in:
Mirko Bonadei 2018-07-03 12:53:23 +02:00 committed by Commit Bot
parent 36c69d5114
commit e12c1fe8d9
9 changed files with 55 additions and 96 deletions

View File

@ -112,15 +112,6 @@ rtc_source_set("rtc_pc") {
] ]
} }
config("libjingle_peerconnection_warnings_config") {
# GN orders flags on a target before flags from configs. The default config
# adds these flags so to cancel them out they need to come from a config and
# cannot be on the target directly.
if (!is_win && !is_clang) {
cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
}
}
rtc_static_library("peerconnection") { rtc_static_library("peerconnection") {
visibility = [ "*" ] visibility = [ "*" ]
cflags = [] cflags = []
@ -182,8 +173,6 @@ rtc_static_library("peerconnection") {
"webrtcsessiondescriptionfactory.h", "webrtcsessiondescriptionfactory.h",
] ]
configs += [ ":libjingle_peerconnection_warnings_config" ]
if (!build_with_chromium && is_clang) { if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
@ -249,8 +238,6 @@ rtc_static_library("create_pc_factory") {
"../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_approved",
] ]
configs += [ ":libjingle_peerconnection_warnings_config" ]
if (!build_with_chromium && is_clang) { if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
@ -271,15 +258,6 @@ rtc_source_set("libjingle_peerconnection") {
} }
if (rtc_include_tests) { if (rtc_include_tests) {
config("rtc_pc_unittests_config") {
# GN orders flags on a target before flags from configs. The default config
# adds -Wall, and this flag have to be after -Wall -- so they need to
# come from a config and can't be on the target directly.
if (!is_win && !is_clang) {
cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
}
}
rtc_test("rtc_pc_unittests") { rtc_test("rtc_pc_unittests") {
testonly = true testonly = true
@ -301,8 +279,6 @@ if (rtc_include_tests) {
include_dirs = [ "//third_party/libsrtp/srtp" ] include_dirs = [ "//third_party/libsrtp/srtp" ]
configs += [ ":rtc_pc_unittests_config" ]
if (!build_with_chromium && is_clang) { if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
@ -440,25 +416,6 @@ if (rtc_include_tests) {
} }
} }
config("peerconnection_unittests_config") {
# The warnings below are enabled by default. Since GN orders compiler flags
# for a target before flags from configs, the only way to disable such
# warnings is by having them in a separate config, loaded from the target.
# TODO(kjellander): Make the code compile without disabling these flags.
# See https://bugs.webrtc.org/3307.
if (is_clang && is_win) {
cflags = [
# See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267
# for -Wno-sign-compare
"-Wno-sign-compare",
]
}
if (!is_win) {
cflags = [ "-Wno-sign-compare" ]
}
}
rtc_test("peerconnection_unittests") { rtc_test("peerconnection_unittests") {
testonly = true testonly = true
sources = [ sources = [
@ -505,8 +462,6 @@ if (rtc_include_tests) {
defines = [ "HAVE_SCTP" ] defines = [ "HAVE_SCTP" ]
} }
configs += [ ":peerconnection_unittests_config" ]
if (!build_with_chromium && is_clang) { if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
@ -562,6 +517,7 @@ if (rtc_include_tests) {
"../rtc_base:rtc_base_tests_main", "../rtc_base:rtc_base_tests_main",
"../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_base_tests_utils",
"../rtc_base:rtc_task_queue", "../rtc_base:rtc_task_queue",
"../rtc_base:safe_conversions",
"../system_wrappers:metrics_default", "../system_wrappers:metrics_default",
"../system_wrappers:runtime_enabled_features_default", "../system_wrappers:runtime_enabled_features_default",
"../test:audio_codec_mocks", "../test:audio_codec_mocks",

View File

@ -15,6 +15,7 @@
#include "pc/sctputils.h" #include "pc/sctputils.h"
#include "pc/test/fakedatachannelprovider.h" #include "pc/test/fakedatachannelprovider.h"
#include "rtc_base/gunit.h" #include "rtc_base/gunit.h"
#include "rtc_base/numerics/safe_conversions.h"
using webrtc::DataChannel; using webrtc::DataChannel;
using webrtc::SctpSidAllocator; using webrtc::SctpSidAllocator;
@ -172,7 +173,8 @@ TEST_F(SctpDataChannelTest, BufferedAmountWhenBlocked) {
} }
EXPECT_EQ(buffer.data.size() * number_of_packets, EXPECT_EQ(buffer.data.size() * number_of_packets,
webrtc_data_channel_->buffered_amount()); webrtc_data_channel_->buffered_amount());
EXPECT_EQ(number_of_packets, observer_->on_buffered_amount_change_count()); EXPECT_EQ(rtc::checked_cast<size_t>(number_of_packets),
observer_->on_buffered_amount_change_count());
} }
// Tests that the queued data are sent when the channel transitions from blocked // Tests that the queued data are sent when the channel transitions from blocked

View File

@ -60,6 +60,7 @@
#include "rtc_base/fakenetwork.h" #include "rtc_base/fakenetwork.h"
#include "rtc_base/firewallsocketserver.h" #include "rtc_base/firewallsocketserver.h"
#include "rtc_base/gunit.h" #include "rtc_base/gunit.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "rtc_base/testcertificateverifier.h" #include "rtc_base/testcertificateverifier.h"
#include "rtc_base/virtualsocketserver.h" #include "rtc_base/virtualsocketserver.h"
#include "test/gmock.h" #include "test/gmock.h"
@ -1595,8 +1596,8 @@ TEST_P(PeerConnectionIntegrationTest,
caller()->CreateAndSetAndSignalOffer(); caller()->CreateAndSetAndSignalOffer();
ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout); ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
// Should be one receiver each for audio/video. // Should be one receiver each for audio/video.
EXPECT_EQ(2, caller()->rtp_receiver_observers().size()); EXPECT_EQ(2U, caller()->rtp_receiver_observers().size());
EXPECT_EQ(2, callee()->rtp_receiver_observers().size()); EXPECT_EQ(2U, callee()->rtp_receiver_observers().size());
// Wait for all "first packet received" callbacks to be fired. // Wait for all "first packet received" callbacks to be fired.
EXPECT_TRUE_WAIT( EXPECT_TRUE_WAIT(
std::all_of(caller()->rtp_receiver_observers().begin(), std::all_of(caller()->rtp_receiver_observers().begin(),
@ -1616,8 +1617,8 @@ TEST_P(PeerConnectionIntegrationTest,
// callback should still be invoked. // callback should still be invoked.
caller()->ResetRtpReceiverObservers(); caller()->ResetRtpReceiverObservers();
callee()->ResetRtpReceiverObservers(); callee()->ResetRtpReceiverObservers();
EXPECT_EQ(2, caller()->rtp_receiver_observers().size()); EXPECT_EQ(2U, caller()->rtp_receiver_observers().size());
EXPECT_EQ(2, callee()->rtp_receiver_observers().size()); EXPECT_EQ(2U, callee()->rtp_receiver_observers().size());
EXPECT_TRUE( EXPECT_TRUE(
std::all_of(caller()->rtp_receiver_observers().begin(), std::all_of(caller()->rtp_receiver_observers().begin(),
caller()->rtp_receiver_observers().end(), caller()->rtp_receiver_observers().end(),
@ -1903,7 +1904,7 @@ TEST_P(PeerConnectionIntegrationTest, AudioToVideoUpgrade) {
// The caller creates a new transceiver to receive video on when receiving // The caller creates a new transceiver to receive video on when receiving
// the offer, but by default it is send only. // the offer, but by default it is send only.
auto transceivers = caller()->pc()->GetTransceivers(); auto transceivers = caller()->pc()->GetTransceivers();
ASSERT_EQ(3, transceivers.size()); ASSERT_EQ(3U, transceivers.size());
ASSERT_EQ(cricket::MEDIA_TYPE_VIDEO, ASSERT_EQ(cricket::MEDIA_TYPE_VIDEO,
transceivers[2]->receiver()->media_type()); transceivers[2]->receiver()->media_type());
transceivers[2]->sender()->SetTrack(caller()->CreateLocalVideoTrack()); transceivers[2]->sender()->SetTrack(caller()->CreateLocalVideoTrack());
@ -2590,7 +2591,7 @@ TEST_P(PeerConnectionIntegrationTest,
// //
// Also, we use "EXPECT_TRUE_WAIT" because the stats collector may decide to // Also, we use "EXPECT_TRUE_WAIT" because the stats collector may decide to
// return cached stats if not enough time has passed since the last update. // return cached stats if not enough time has passed since the last update.
EXPECT_TRUE_WAIT(callee()->OldGetStats()->BytesReceived() > 0U, EXPECT_TRUE_WAIT(callee()->OldGetStats()->BytesReceived() > 0,
kDefaultTimeout); kDefaultTimeout);
} }
@ -3209,10 +3210,10 @@ TEST_P(PeerConnectionIntegrationTest, StressTestUnorderedSctpDataChannel) {
} }
// Wait for all messages to be received. // Wait for all messages to be received.
EXPECT_EQ_WAIT(kNumMessages, EXPECT_EQ_WAIT(rtc::checked_cast<size_t>(kNumMessages),
caller()->data_observer()->received_message_count(), caller()->data_observer()->received_message_count(),
kDefaultTimeout); kDefaultTimeout);
EXPECT_EQ_WAIT(kNumMessages, EXPECT_EQ_WAIT(rtc::checked_cast<size_t>(kNumMessages),
callee()->data_observer()->received_message_count(), callee()->data_observer()->received_message_count(),
kDefaultTimeout); kDefaultTimeout);
@ -3517,17 +3518,17 @@ TEST_P(PeerConnectionIntegrationIceStatesTest, VerifyBestConnection) {
if (TestIPv6()) { if (TestIPv6()) {
// When IPv6 is enabled, we should prefer an IPv6 connection over an IPv4 // When IPv6 is enabled, we should prefer an IPv6 connection over an IPv4
// connection. // connection.
EXPECT_EQ(0u, num_best_ipv4); EXPECT_EQ(0, num_best_ipv4);
EXPECT_EQ(1u, num_best_ipv6); EXPECT_EQ(1, num_best_ipv6);
} else { } else {
EXPECT_EQ(1u, num_best_ipv4); EXPECT_EQ(1, num_best_ipv4);
EXPECT_EQ(0u, num_best_ipv6); EXPECT_EQ(0, num_best_ipv6);
} }
EXPECT_EQ(0u, metrics_observer->GetEnumCounter( EXPECT_EQ(0, metrics_observer->GetEnumCounter(
webrtc::kEnumCounterIceCandidatePairTypeUdp, webrtc::kEnumCounterIceCandidatePairTypeUdp,
webrtc::kIceCandidatePairHostHost)); webrtc::kIceCandidatePairHostHost));
EXPECT_EQ(1u, metrics_observer->GetEnumCounter( EXPECT_EQ(1, metrics_observer->GetEnumCounter(
webrtc::kEnumCounterIceCandidatePairTypeUdp, webrtc::kEnumCounterIceCandidatePairTypeUdp,
webrtc::kIceCandidatePairHostPublicHostPublic)); webrtc::kIceCandidatePairHostPublicHostPublic));
} }
@ -3829,7 +3830,7 @@ TEST_F(PeerConnectionIntegrationTestPlanB, CanSendRemoteVideoTrack) {
caller()->AddVideoTrack(); caller()->AddVideoTrack();
caller()->CreateAndSetAndSignalOffer(); caller()->CreateAndSetAndSignalOffer();
ASSERT_TRUE_WAIT(SignalingStateStable(), kMaxWaitForActivationMs); ASSERT_TRUE_WAIT(SignalingStateStable(), kMaxWaitForActivationMs);
ASSERT_EQ(1, callee()->remote_streams()->count()); ASSERT_EQ(1U, callee()->remote_streams()->count());
// Echo the stream back, and do a new offer/anwer (initiated by callee this // Echo the stream back, and do a new offer/anwer (initiated by callee this
// time). // time).

View File

@ -459,8 +459,8 @@ TEST_P(PeerConnectionEndToEndTest, CallWithCustomCodec) {
// the same ID because they were passed to the same PeerConnectionFactory, // the same ID because they were passed to the same PeerConnectionFactory,
// and the second pair got the same ID---but these two IDs are not equal, // and the second pair got the same ID---but these two IDs are not equal,
// because each PeerConnectionFactory has its own ID. // because each PeerConnectionFactory has its own ID.
EXPECT_EQ(1, encoder_id1.size()); EXPECT_EQ(1U, encoder_id1.size());
EXPECT_EQ(1, encoder_id2.size()); EXPECT_EQ(1U, encoder_id2.size());
EXPECT_EQ(encoder_id1, decoder_id1); EXPECT_EQ(encoder_id1, decoder_id1);
EXPECT_EQ(encoder_id2, decoder_id2); EXPECT_EQ(encoder_id2, decoder_id2);
EXPECT_NE(encoder_id1, encoder_id2); EXPECT_NE(encoder_id1, encoder_id2);
@ -540,16 +540,16 @@ TEST_P(PeerConnectionEndToEndTest, DataChannelIdAssignment) {
Negotiate(); Negotiate();
WaitForConnection(); WaitForConnection();
EXPECT_EQ(1U, caller_dc_1->id() % 2); EXPECT_EQ(1, caller_dc_1->id() % 2);
EXPECT_EQ(0U, callee_dc_1->id() % 2); EXPECT_EQ(0, callee_dc_1->id() % 2);
rtc::scoped_refptr<DataChannelInterface> caller_dc_2( rtc::scoped_refptr<DataChannelInterface> caller_dc_2(
caller_->CreateDataChannel("data", init)); caller_->CreateDataChannel("data", init));
rtc::scoped_refptr<DataChannelInterface> callee_dc_2( rtc::scoped_refptr<DataChannelInterface> callee_dc_2(
callee_->CreateDataChannel("data", init)); callee_->CreateDataChannel("data", init));
EXPECT_EQ(1U, caller_dc_2->id() % 2); EXPECT_EQ(1, caller_dc_2->id() % 2);
EXPECT_EQ(0U, callee_dc_2->id() % 2); EXPECT_EQ(0, callee_dc_2->id() % 2);
} }
// Verifies that the message is received by the right remote DataChannel when // Verifies that the message is received by the right remote DataChannel when

View File

@ -3408,13 +3408,13 @@ TEST_P(PeerConnectionInterfaceTest, SetConfigurationCausingPartialIceRestart) {
// Grab the ufrags. // Grab the ufrags.
std::vector<std::string> initial_ufrags = GetUfrags(pc_->local_description()); std::vector<std::string> initial_ufrags = GetUfrags(pc_->local_description());
ASSERT_EQ(2, initial_ufrags.size()); ASSERT_EQ(2U, initial_ufrags.size());
// Create offer and grab the new ufrags. // Create offer and grab the new ufrags.
CreateOfferAsLocalDescription(); CreateOfferAsLocalDescription();
std::vector<std::string> subsequent_ufrags = std::vector<std::string> subsequent_ufrags =
GetUfrags(pc_->local_description()); GetUfrags(pc_->local_description());
ASSERT_EQ(2, subsequent_ufrags.size()); ASSERT_EQ(2U, subsequent_ufrags.size());
// Ensure that only the ufrag for the second m= section changed. // Ensure that only the ufrag for the second m= section changed.
EXPECT_EQ(initial_ufrags[0], subsequent_ufrags[0]); EXPECT_EQ(initial_ufrags[0], subsequent_ufrags[0]);

View File

@ -343,7 +343,7 @@ class RTCStatsReportVerifier {
bool verify_successful = true; bool verify_successful = true;
std::vector<const RTCTransportStats*> transport_stats = std::vector<const RTCTransportStats*> transport_stats =
report_->GetStatsOfType<RTCTransportStats>(); report_->GetStatsOfType<RTCTransportStats>();
EXPECT_EQ(transport_stats.size(), 1); EXPECT_EQ(transport_stats.size(), 1U);
std::string selected_candidate_pair_id = std::string selected_candidate_pair_id =
*transport_stats[0]->selected_candidate_pair_id; *transport_stats[0]->selected_candidate_pair_id;
for (const RTCStats& stats : *report_) { for (const RTCStats& stats : *report_) {

View File

@ -110,7 +110,7 @@ template <typename T>
std::string IdForType(const RTCStatsReport* report) { std::string IdForType(const RTCStatsReport* report) {
auto stats_of_my_type = report->RTCStatsReport::GetStatsOfType<T>(); auto stats_of_my_type = report->RTCStatsReport::GetStatsOfType<T>();
// We cannot use ASSERT here, since we're within a function. // We cannot use ASSERT here, since we're within a function.
EXPECT_EQ(1, stats_of_my_type.size()) EXPECT_EQ(1U, stats_of_my_type.size())
<< "Unexpected number of stats of this type"; << "Unexpected number of stats of this type";
if (stats_of_my_type.size() == 1) { if (stats_of_my_type.size() == 1) {
return stats_of_my_type[0]->id(); return stats_of_my_type[0]->id();
@ -1470,9 +1470,9 @@ TEST_F(RTCStatsCollectorTest,
rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport(); rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
auto stats_of_my_type = report->GetStatsOfType<RTCMediaStreamStats>(); auto stats_of_my_type = report->GetStatsOfType<RTCMediaStreamStats>();
ASSERT_EQ(1, stats_of_my_type.size()) << "No stream in " << report->ToJson(); ASSERT_EQ(1U, stats_of_my_type.size()) << "No stream in " << report->ToJson();
auto stats_of_track_type = report->GetStatsOfType<RTCMediaStreamTrackStats>(); auto stats_of_track_type = report->GetStatsOfType<RTCMediaStreamTrackStats>();
ASSERT_EQ(1, stats_of_track_type.size()) ASSERT_EQ(1U, stats_of_track_type.size())
<< "Wrong number of tracks in " << report->ToJson(); << "Wrong number of tracks in " << report->ToJson();
RTCMediaStreamStats expected_local_stream(stats_of_my_type[0]->id(), RTCMediaStreamStats expected_local_stream(stats_of_my_type[0]->id(),
@ -1533,9 +1533,9 @@ TEST_F(RTCStatsCollectorTest,
rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport(); rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
auto stats_of_my_type = report->GetStatsOfType<RTCMediaStreamStats>(); auto stats_of_my_type = report->GetStatsOfType<RTCMediaStreamStats>();
ASSERT_EQ(1, stats_of_my_type.size()) << "No stream in " << report->ToJson(); ASSERT_EQ(1U, stats_of_my_type.size()) << "No stream in " << report->ToJson();
auto stats_of_track_type = report->GetStatsOfType<RTCMediaStreamTrackStats>(); auto stats_of_track_type = report->GetStatsOfType<RTCMediaStreamTrackStats>();
ASSERT_EQ(1, stats_of_track_type.size()) ASSERT_EQ(1U, stats_of_track_type.size())
<< "Wrong number of tracks in " << report->ToJson(); << "Wrong number of tracks in " << report->ToJson();
ASSERT_TRUE(*(stats_of_track_type[0]->remote_source)); ASSERT_TRUE(*(stats_of_track_type[0]->remote_source));
@ -1598,7 +1598,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Audio) {
rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport(); rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
auto stats_of_track_type = report->GetStatsOfType<RTCMediaStreamTrackStats>(); auto stats_of_track_type = report->GetStatsOfType<RTCMediaStreamTrackStats>();
ASSERT_EQ(1, stats_of_track_type.size()); ASSERT_EQ(1U, stats_of_track_type.size());
RTCInboundRTPStreamStats expected_audio("RTCInboundRTPAudioStream_1", RTCInboundRTPStreamStats expected_audio("RTCInboundRTPAudioStream_1",
report->timestamp_us()); report->timestamp_us());
@ -1775,9 +1775,9 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Video) {
rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport(); rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
auto stats_of_my_type = report->GetStatsOfType<RTCOutboundRTPStreamStats>(); auto stats_of_my_type = report->GetStatsOfType<RTCOutboundRTPStreamStats>();
ASSERT_EQ(1, stats_of_my_type.size()); ASSERT_EQ(1U, stats_of_my_type.size());
auto stats_of_track_type = report->GetStatsOfType<RTCMediaStreamTrackStats>(); auto stats_of_track_type = report->GetStatsOfType<RTCMediaStreamTrackStats>();
ASSERT_EQ(1, stats_of_track_type.size()); ASSERT_EQ(1U, stats_of_track_type.size());
RTCOutboundRTPStreamStats expected_video(stats_of_my_type[0]->id(), RTCOutboundRTPStreamStats expected_video(stats_of_my_type[0]->id(),
report->timestamp_us()); report->timestamp_us());
@ -2086,11 +2086,11 @@ TEST_F(RTCStatsCollectorTest, StatsReportedOnZeroSsrc) {
std::vector<const RTCMediaStreamTrackStats*> track_stats = std::vector<const RTCMediaStreamTrackStats*> track_stats =
report->GetStatsOfType<RTCMediaStreamTrackStats>(); report->GetStatsOfType<RTCMediaStreamTrackStats>();
EXPECT_EQ(1, track_stats.size()); EXPECT_EQ(1U, track_stats.size());
std::vector<const RTCRTPStreamStats*> rtp_stream_stats = std::vector<const RTCRTPStreamStats*> rtp_stream_stats =
report->GetStatsOfType<RTCRTPStreamStats>(); report->GetStatsOfType<RTCRTPStreamStats>();
EXPECT_EQ(0, rtp_stream_stats.size()); EXPECT_EQ(0U, rtp_stream_stats.size());
} }
TEST_F(RTCStatsCollectorTest, DoNotCrashOnSsrcChange) { TEST_F(RTCStatsCollectorTest, DoNotCrashOnSsrcChange) {
@ -2106,7 +2106,7 @@ TEST_F(RTCStatsCollectorTest, DoNotCrashOnSsrcChange) {
std::vector<const RTCMediaStreamTrackStats*> track_stats = std::vector<const RTCMediaStreamTrackStats*> track_stats =
report->GetStatsOfType<RTCMediaStreamTrackStats>(); report->GetStatsOfType<RTCMediaStreamTrackStats>();
EXPECT_EQ(1, track_stats.size()); EXPECT_EQ(1U, track_stats.size());
} }
// Used for test below, to test calling GetStatsReport during a callback. // Used for test below, to test calling GetStatsReport during a callback.

View File

@ -651,7 +651,7 @@ TEST_F(RtpSenderReceiverTest, AudioSenderCheckTransactionIdRefresh) {
CreateAudioRtpSender(); CreateAudioRtpSender();
RtpParameters params = audio_rtp_sender_->GetParameters(); RtpParameters params = audio_rtp_sender_->GetParameters();
EXPECT_NE(params.transaction_id.size(), 0); EXPECT_NE(params.transaction_id.size(), 0U);
auto saved_transaction_id = params.transaction_id; auto saved_transaction_id = params.transaction_id;
params = audio_rtp_sender_->GetParameters(); params = audio_rtp_sender_->GetParameters();
EXPECT_NE(saved_transaction_id, params.transaction_id); EXPECT_NE(saved_transaction_id, params.transaction_id);
@ -751,19 +751,19 @@ TEST_F(RtpSenderReceiverTest, SetAudioMaxSendBitrate) {
EXPECT_EQ(-1, voice_media_channel_->max_bps()); EXPECT_EQ(-1, voice_media_channel_->max_bps());
webrtc::RtpParameters params = audio_rtp_sender_->GetParameters(); webrtc::RtpParameters params = audio_rtp_sender_->GetParameters();
EXPECT_EQ(1, params.encodings.size()); EXPECT_EQ(1U, params.encodings.size());
EXPECT_FALSE(params.encodings[0].max_bitrate_bps); EXPECT_FALSE(params.encodings[0].max_bitrate_bps);
params.encodings[0].max_bitrate_bps = 1000; params.encodings[0].max_bitrate_bps = 1000;
EXPECT_TRUE(audio_rtp_sender_->SetParameters(params).ok()); EXPECT_TRUE(audio_rtp_sender_->SetParameters(params).ok());
// Read back the parameters and verify they have been changed. // Read back the parameters and verify they have been changed.
params = audio_rtp_sender_->GetParameters(); params = audio_rtp_sender_->GetParameters();
EXPECT_EQ(1, params.encodings.size()); EXPECT_EQ(1U, params.encodings.size());
EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps);
// Verify that the audio channel received the new parameters. // Verify that the audio channel received the new parameters.
params = voice_media_channel_->GetRtpSendParameters(kAudioSsrc); params = voice_media_channel_->GetRtpSendParameters(kAudioSsrc);
EXPECT_EQ(1, params.encodings.size()); EXPECT_EQ(1U, params.encodings.size());
EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps);
// Verify that the global bitrate limit has not been changed. // Verify that the global bitrate limit has not been changed.
@ -776,7 +776,7 @@ TEST_F(RtpSenderReceiverTest, SetAudioBitratePriority) {
CreateAudioRtpSender(); CreateAudioRtpSender();
webrtc::RtpParameters params = audio_rtp_sender_->GetParameters(); webrtc::RtpParameters params = audio_rtp_sender_->GetParameters();
EXPECT_EQ(1, params.encodings.size()); EXPECT_EQ(1U, params.encodings.size());
EXPECT_EQ(webrtc::kDefaultBitratePriority, EXPECT_EQ(webrtc::kDefaultBitratePriority,
params.encodings[0].bitrate_priority); params.encodings[0].bitrate_priority);
double new_bitrate_priority = 2.0; double new_bitrate_priority = 2.0;
@ -784,11 +784,11 @@ TEST_F(RtpSenderReceiverTest, SetAudioBitratePriority) {
EXPECT_TRUE(audio_rtp_sender_->SetParameters(params).ok()); EXPECT_TRUE(audio_rtp_sender_->SetParameters(params).ok());
params = audio_rtp_sender_->GetParameters(); params = audio_rtp_sender_->GetParameters();
EXPECT_EQ(1, params.encodings.size()); EXPECT_EQ(1U, params.encodings.size());
EXPECT_EQ(new_bitrate_priority, params.encodings[0].bitrate_priority); EXPECT_EQ(new_bitrate_priority, params.encodings[0].bitrate_priority);
params = voice_media_channel_->GetRtpSendParameters(kAudioSsrc); params = voice_media_channel_->GetRtpSendParameters(kAudioSsrc);
EXPECT_EQ(1, params.encodings.size()); EXPECT_EQ(1U, params.encodings.size());
EXPECT_EQ(new_bitrate_priority, params.encodings[0].bitrate_priority); EXPECT_EQ(new_bitrate_priority, params.encodings[0].bitrate_priority);
DestroyAudioRtpSender(); DestroyAudioRtpSender();
@ -843,7 +843,7 @@ TEST_F(RtpSenderReceiverTest, VideoSenderCheckTransactionIdRefresh) {
CreateVideoRtpSender(); CreateVideoRtpSender();
RtpParameters params = video_rtp_sender_->GetParameters(); RtpParameters params = video_rtp_sender_->GetParameters();
EXPECT_NE(params.transaction_id.size(), 0); EXPECT_NE(params.transaction_id.size(), 0U);
auto saved_transaction_id = params.transaction_id; auto saved_transaction_id = params.transaction_id;
params = video_rtp_sender_->GetParameters(); params = video_rtp_sender_->GetParameters();
EXPECT_NE(saved_transaction_id, params.transaction_id); EXPECT_NE(saved_transaction_id, params.transaction_id);
@ -968,7 +968,7 @@ TEST_F(RtpSenderReceiverTest, SetVideoMinMaxSendBitrate) {
EXPECT_EQ(-1, video_media_channel_->max_bps()); EXPECT_EQ(-1, video_media_channel_->max_bps());
webrtc::RtpParameters params = video_rtp_sender_->GetParameters(); webrtc::RtpParameters params = video_rtp_sender_->GetParameters();
EXPECT_EQ(1, params.encodings.size()); EXPECT_EQ(1U, params.encodings.size());
EXPECT_FALSE(params.encodings[0].min_bitrate_bps); EXPECT_FALSE(params.encodings[0].min_bitrate_bps);
EXPECT_FALSE(params.encodings[0].max_bitrate_bps); EXPECT_FALSE(params.encodings[0].max_bitrate_bps);
params.encodings[0].min_bitrate_bps = 100; params.encodings[0].min_bitrate_bps = 100;
@ -977,13 +977,13 @@ TEST_F(RtpSenderReceiverTest, SetVideoMinMaxSendBitrate) {
// Read back the parameters and verify they have been changed. // Read back the parameters and verify they have been changed.
params = video_rtp_sender_->GetParameters(); params = video_rtp_sender_->GetParameters();
EXPECT_EQ(1, params.encodings.size()); EXPECT_EQ(1U, params.encodings.size());
EXPECT_EQ(100, params.encodings[0].min_bitrate_bps); EXPECT_EQ(100, params.encodings[0].min_bitrate_bps);
EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps);
// Verify that the video channel received the new parameters. // Verify that the video channel received the new parameters.
params = video_media_channel_->GetRtpSendParameters(kVideoSsrc); params = video_media_channel_->GetRtpSendParameters(kVideoSsrc);
EXPECT_EQ(1, params.encodings.size()); EXPECT_EQ(1U, params.encodings.size());
EXPECT_EQ(100, params.encodings[0].min_bitrate_bps); EXPECT_EQ(100, params.encodings[0].min_bitrate_bps);
EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps);
@ -1025,7 +1025,7 @@ TEST_F(RtpSenderReceiverTest, SetVideoBitratePriority) {
CreateVideoRtpSender(); CreateVideoRtpSender();
webrtc::RtpParameters params = video_rtp_sender_->GetParameters(); webrtc::RtpParameters params = video_rtp_sender_->GetParameters();
EXPECT_EQ(1, params.encodings.size()); EXPECT_EQ(1U, params.encodings.size());
EXPECT_EQ(webrtc::kDefaultBitratePriority, EXPECT_EQ(webrtc::kDefaultBitratePriority,
params.encodings[0].bitrate_priority); params.encodings[0].bitrate_priority);
double new_bitrate_priority = 2.0; double new_bitrate_priority = 2.0;
@ -1033,11 +1033,11 @@ TEST_F(RtpSenderReceiverTest, SetVideoBitratePriority) {
EXPECT_TRUE(video_rtp_sender_->SetParameters(params).ok()); EXPECT_TRUE(video_rtp_sender_->SetParameters(params).ok());
params = video_rtp_sender_->GetParameters(); params = video_rtp_sender_->GetParameters();
EXPECT_EQ(1, params.encodings.size()); EXPECT_EQ(1U, params.encodings.size());
EXPECT_EQ(new_bitrate_priority, params.encodings[0].bitrate_priority); EXPECT_EQ(new_bitrate_priority, params.encodings[0].bitrate_priority);
params = video_media_channel_->GetRtpSendParameters(kVideoSsrc); params = video_media_channel_->GetRtpSendParameters(kVideoSsrc);
EXPECT_EQ(1, params.encodings.size()); EXPECT_EQ(1U, params.encodings.size());
EXPECT_EQ(new_bitrate_priority, params.encodings[0].bitrate_priority); EXPECT_EQ(new_bitrate_priority, params.encodings[0].bitrate_priority);
DestroyVideoRtpSender(); DestroyVideoRtpSender();

View File

@ -3544,7 +3544,7 @@ TEST_F(WebRtcSdpTest, IceCredentialsInCandidateStringIgnored) {
SdpDeserialize(kSdpWithIceCredentialsInCandidateString, &jdesc_output)); SdpDeserialize(kSdpWithIceCredentialsInCandidateString, &jdesc_output));
const IceCandidateCollection* candidates = jdesc_output.candidates(0); const IceCandidateCollection* candidates = jdesc_output.candidates(0);
ASSERT_NE(nullptr, candidates); ASSERT_NE(nullptr, candidates);
ASSERT_EQ(1, candidates->count()); ASSERT_EQ(1U, candidates->count());
cricket::Candidate c = candidates->at(0)->candidate(); cricket::Candidate c = candidates->at(0)->candidate();
EXPECT_EQ("ufrag_voice", c.username()); EXPECT_EQ("ufrag_voice", c.username());
EXPECT_EQ("pwd_voice", c.password()); EXPECT_EQ("pwd_voice", c.password());