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

Side by Side Diff: net/quic/congestion_control/tcp_loss_algorithm_test.cc

Issue 1481403005: Fix size_t truncations in net for 64-bit VS 2015 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR feedback 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 | « net/dns/dns_test_util.cc ('k') | net/quic/congestion_control/time_loss_algorithm_test.cc » ('j') | 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/congestion_control/tcp_loss_algorithm.h" 5 #include "net/quic/congestion_control/tcp_loss_algorithm.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 if (i == 3) { 147 if (i == 3) {
148 clock_.AdvanceTime(rtt_stats_.smoothed_rtt().Multiply(0.25)); 148 clock_.AdvanceTime(rtt_stats_.smoothed_rtt().Multiply(0.25));
149 } 149 }
150 } 150 }
151 151
152 // Early retransmit when the final packet gets acked and 1.25 RTTs have 152 // Early retransmit when the final packet gets acked and 1.25 RTTs have
153 // elapsed since the packets were sent. 153 // elapsed since the packets were sent.
154 unacked_packets_.RemoveFromInFlight(kNumSentPackets); 154 unacked_packets_.RemoveFromInFlight(kNumSentPackets);
155 // This simulates a single ack following multiple missing packets with FACK. 155 // This simulates a single ack following multiple missing packets with FACK.
156 for (size_t i = 1; i < kNumSentPackets; ++i) { 156 for (size_t i = 1; i < kNumSentPackets; ++i) {
157 unacked_packets_.NackPacket(i, kNumSentPackets - i); 157 unacked_packets_.NackPacket(i, static_cast<uint16>(kNumSentPackets - i));
158 } 158 }
159 QuicPacketNumber lost[] = {1, 2}; 159 QuicPacketNumber lost[] = {1, 2};
160 VerifyLosses(kNumSentPackets, lost, arraysize(lost)); 160 VerifyLosses(kNumSentPackets, lost, arraysize(lost));
161 // The time has already advanced 1/4 an RTT, so ensure the timeout is set 161 // The time has already advanced 1/4 an RTT, so ensure the timeout is set
162 // 1.25 RTTs after the earliest pending packet(3), not the last(4). 162 // 1.25 RTTs after the earliest pending packet(3), not the last(4).
163 EXPECT_EQ(clock_.Now().Add(rtt_stats_.smoothed_rtt()), 163 EXPECT_EQ(clock_.Now().Add(rtt_stats_.smoothed_rtt()),
164 loss_algorithm_.GetLossTimeout()); 164 loss_algorithm_.GetLossTimeout());
165 165
166 clock_.AdvanceTime(rtt_stats_.smoothed_rtt()); 166 clock_.AdvanceTime(rtt_stats_.smoothed_rtt());
167 QuicPacketNumber lost2[] = {1, 2, 3}; 167 QuicPacketNumber lost2[] = {1, 2, 3};
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 unacked_packets_.IncreaseLargestObserved(2); 206 unacked_packets_.IncreaseLargestObserved(2);
207 unacked_packets_.RemoveFromInFlight(2); 207 unacked_packets_.RemoveFromInFlight(2);
208 unacked_packets_.NackPacket(1, 1); 208 unacked_packets_.NackPacket(1, 1);
209 QuicPacketNumber lost[] = {1}; 209 QuicPacketNumber lost[] = {1};
210 VerifyLosses(2, lost, arraysize(lost)); 210 VerifyLosses(2, lost, arraysize(lost));
211 } 211 }
212 212
213 } // namespace 213 } // namespace
214 } // namespace test 214 } // namespace test
215 } // namespace net 215 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/dns_test_util.cc ('k') | net/quic/congestion_control/time_loss_algorithm_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698