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

Unified Diff: webrtc/call/rtp_demuxer_unittest.cc

Issue 3003133002: Fix an implicit narrowing conversion found by MSVC (Closed)
Patch Set: no roll Created 3 years, 4 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
« no previous file with comments | « webrtc/api/audio_codecs/L16/audio_encoder_L16.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/rtp_demuxer_unittest.cc
diff --git a/webrtc/call/rtp_demuxer_unittest.cc b/webrtc/call/rtp_demuxer_unittest.cc
index 39dc67b0a17b7ef20f726a6ff699238a280403ac..6fe5fc8d423f345f0d6ee6a9fc5267ade4e43872 100644
--- a/webrtc/call/rtp_demuxer_unittest.cc
+++ b/webrtc/call/rtp_demuxer_unittest.cc
@@ -24,6 +24,7 @@
#include "webrtc/rtc_base/basictypes.h"
#include "webrtc/rtc_base/checks.h"
#include "webrtc/rtc_base/ptr_util.h"
+#include "webrtc/rtc_base/safe_conversions.h"
#include "webrtc/test/gmock.h"
#include "webrtc/test/gtest.h"
@@ -346,7 +347,8 @@ TEST_F(RtpDemuxerTest, OnRtpPacketCalledOnCorrectSinkByRsid) {
}
for (size_t i = 0; i < arraysize(rsids); i++) {
- auto packet = CreatePacketWithSsrcRsid(i, rsids[i]);
+ auto packet = CreatePacketWithSsrcRsid(rtc::checked_cast<uint32_t>(i),
+ rsids[i]);
EXPECT_CALL(sinks[i], OnRtpPacket(SamePacketAs(*packet))).Times(1);
EXPECT_TRUE(demuxer_.OnRtpPacket(*packet));
}
@@ -360,7 +362,8 @@ TEST_F(RtpDemuxerTest, OnRtpPacketCalledOnCorrectSinkByMid) {
}
for (size_t i = 0; i < arraysize(mids); i++) {
- auto packet = CreatePacketWithSsrcMid(i, mids[i]);
+ auto packet = CreatePacketWithSsrcMid(rtc::checked_cast<uint32_t>(i),
+ mids[i]);
EXPECT_CALL(sinks[i], OnRtpPacket(SamePacketAs(*packet))).Times(1);
EXPECT_TRUE(demuxer_.OnRtpPacket(*packet));
}
@@ -414,7 +417,7 @@ TEST_F(RtpDemuxerTest, PacketsDeliveredInRightOrder) {
std::unique_ptr<RtpPacketReceived> packets[5];
for (size_t i = 0; i < arraysize(packets); i++) {
packets[i] = CreatePacketWithSsrc(ssrc);
- packets[i]->SetSequenceNumber(i);
+ packets[i]->SetSequenceNumber(rtc::checked_cast<uint16_t>(i));
}
InSequence sequence;
« no previous file with comments | « webrtc/api/audio_codecs/L16/audio_encoder_L16.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698