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

Side by Side Diff: net/quic/quic_unacked_packet_map_test.cc

Issue 566373003: Removed unnecessary static_cast and replaced it with "lu". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup_to_remove_75208575
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 "net/quic/quic_unacked_packet_map.h" 5 #include "net/quic/quic_unacked_packet_map.h"
6 6
7 #include "net/quic/test_tools/quic_test_utils.h" 7 #include "net/quic/test_tools/quic_test_utils.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 using std::min; 10 using std::min;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 unacked_packets_.IncreaseLargestObserved(1); 112 unacked_packets_.IncreaseLargestObserved(1);
113 VerifyUnackedPackets(NULL, 0); 113 VerifyUnackedPackets(NULL, 0);
114 VerifyInFlightPackets(NULL, 0); 114 VerifyInFlightPackets(NULL, 0);
115 VerifyRetransmittablePackets(NULL, 0); 115 VerifyRetransmittablePackets(NULL, 0);
116 } 116 }
117 117
118 TEST_F(QuicUnackedPacketMapTest, DiscardOldRttOnly) { 118 TEST_F(QuicUnackedPacketMapTest, DiscardOldRttOnly) {
119 // Acks are only tracked for RTT measurement purposes, and are discarded 119 // Acks are only tracked for RTT measurement purposes, and are discarded
120 // when more than 200 accumulate. 120 // when more than 200 accumulate.
121 for (int i = 1; i < 400; ++i) { 121 for (size_t i = 1; i < 400; ++i) {
122 unacked_packets_.AddPacket(CreateNonRetransmittablePacket(i)); 122 unacked_packets_.AddPacket(CreateNonRetransmittablePacket(i));
123 unacked_packets_.SetSent(i, now_, kDefaultAckLength, false); 123 unacked_packets_.SetSent(i, now_, kDefaultAckLength, false);
124 unacked_packets_.RemoveObsoletePackets(); 124 unacked_packets_.RemoveObsoletePackets();
125 EXPECT_EQ(static_cast<size_t>(min(i, 200)), 125 EXPECT_EQ(min(i, 200lu),
126 unacked_packets_.GetNumUnackedPacketsDebugOnly()); 126 unacked_packets_.GetNumUnackedPacketsDebugOnly());
127 } 127 }
128 } 128 }
129 129
130 TEST_F(QuicUnackedPacketMapTest, RetransmittableInflightAndRtt) { 130 TEST_F(QuicUnackedPacketMapTest, RetransmittableInflightAndRtt) {
131 // Simulate a retransmittable packet being sent and acked. 131 // Simulate a retransmittable packet being sent and acked.
132 unacked_packets_.AddPacket(CreateRetransmittablePacket(1)); 132 unacked_packets_.AddPacket(CreateRetransmittablePacket(1));
133 unacked_packets_.SetSent(1, now_, kDefaultLength, true); 133 unacked_packets_.SetSent(1, now_, kDefaultLength, true);
134 134
135 QuicPacketSequenceNumber unacked[] = { 1 }; 135 QuicPacketSequenceNumber unacked[] = { 1 };
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 unacked_packets_.RestoreInFlight(1); 283 unacked_packets_.RestoreInFlight(1);
284 VerifyUnackedPackets(unacked, arraysize(unacked)); 284 VerifyUnackedPackets(unacked, arraysize(unacked));
285 VerifyInFlightPackets(unacked, arraysize(unacked)); 285 VerifyInFlightPackets(unacked, arraysize(unacked));
286 VerifyRetransmittablePackets(retransmittable, arraysize(retransmittable)); 286 VerifyRetransmittablePackets(retransmittable, arraysize(retransmittable));
287 EXPECT_EQ(2 * kDefaultLength, unacked_packets_.bytes_in_flight()); 287 EXPECT_EQ(2 * kDefaultLength, unacked_packets_.bytes_in_flight());
288 } 288 }
289 289
290 } // namespace 290 } // namespace
291 } // namespace test 291 } // namespace test
292 } // namespace net 292 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698