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

Side by Side Diff: media/cast/net/rtp/packet_storage_unittest.cc

Issue 1488893003: Fix size_t truncations in media for 64-bit VS 2015 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « media/cast/net/rtcp/rtcp_builder_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/cast/net/rtp/packet_storage.h" 5 #include "media/cast/net/rtp/packet_storage.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 15 matching lines...) Expand all
26 PacketStorage* storage) { 26 PacketStorage* storage) {
27 const base::TimeTicks kTicks; 27 const base::TimeTicks kTicks;
28 const int kSsrc = 1; 28 const int kSsrc = 1;
29 for (size_t i = 0; i < number_of_frames; ++i) { 29 for (size_t i = 0; i < number_of_frames; ++i) {
30 SendPacketVector packets; 30 SendPacketVector packets;
31 // First frame has 1 packet, second frame has 2 packets, etc. 31 // First frame has 1 packet, second frame has 2 packets, etc.
32 const size_t kNumberOfPackets = i + 1; 32 const size_t kNumberOfPackets = i + 1;
33 for (size_t j = 0; j < kNumberOfPackets; ++j) { 33 for (size_t j = 0; j < kNumberOfPackets; ++j) {
34 Packet test_packet(1, 0); 34 Packet test_packet(1, 0);
35 packets.push_back( 35 packets.push_back(
36 std::make_pair( 36 std::make_pair(PacedPacketSender::MakePacketKey(
37 PacedPacketSender::MakePacketKey(kTicks, kSsrc, j), 37 kTicks, kSsrc, base::checked_cast<uint16>(j)),
38 new base::RefCountedData<Packet>(test_packet))); 38 new base::RefCountedData<Packet>(test_packet)));
39 } 39 }
40 storage->StoreFrame(first_frame_id, packets); 40 storage->StoreFrame(first_frame_id, packets);
41 ++first_frame_id; 41 ++first_frame_id;
42 } 42 }
43 } 43 }
44 44
45 TEST(PacketStorageTest, NumberOfStoredFrames) { 45 TEST(PacketStorageTest, NumberOfStoredFrames) {
46 PacketStorage storage; 46 PacketStorage storage;
47 47
48 uint32 frame_id = 0; 48 uint32 frame_id = 0;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 EXPECT_EQ(1u, storage.GetNumberOfStoredFrames()); 118 EXPECT_EQ(1u, storage.GetNumberOfStoredFrames());
119 EXPECT_FALSE(storage.GetFrame8(kFirstFrameId + 4)); 119 EXPECT_FALSE(storage.GetFrame8(kFirstFrameId + 4));
120 120
121 storage.ReleaseFrame(kFirstFrameId + 1); 121 storage.ReleaseFrame(kFirstFrameId + 1);
122 EXPECT_EQ(0u, storage.GetNumberOfStoredFrames()); 122 EXPECT_EQ(0u, storage.GetNumberOfStoredFrames());
123 EXPECT_FALSE(storage.GetFrame8(kFirstFrameId + 1)); 123 EXPECT_FALSE(storage.GetFrame8(kFirstFrameId + 1));
124 } 124 }
125 125
126 } // namespace cast 126 } // namespace cast
127 } // namespace media 127 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/net/rtcp/rtcp_builder_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698