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

Unified Diff: net/quic/congestion_control/tcp_loss_algorithm_test.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
Index: net/quic/congestion_control/tcp_loss_algorithm_test.cc
diff --git a/net/quic/congestion_control/tcp_loss_algorithm_test.cc b/net/quic/congestion_control/tcp_loss_algorithm_test.cc
index 657ab2b6cd80f5565bf75363992eefcf715eb450..df78b2e8b51649ae9a8f5e1ff44a2a14ce2be8cf 100644
--- a/net/quic/congestion_control/tcp_loss_algorithm_test.cc
+++ b/net/quic/congestion_control/tcp_loss_algorithm_test.cc
@@ -17,16 +17,18 @@ namespace test {
class TcpLossAlgorithmTest : public ::testing::Test {
protected:
- TcpLossAlgorithmTest()
- : unacked_packets_() {
+ TcpLossAlgorithmTest() : unacked_packets_() {
rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(100),
QuicTime::Delta::Zero(),
clock_.Now());
}
void SendDataPacket(QuicPacketSequenceNumber sequence_number) {
- SerializedPacket packet(sequence_number, PACKET_1BYTE_SEQUENCE_NUMBER,
- NULL, 0, new RetransmittableFrames());
+ SerializedPacket packet(sequence_number,
+ PACKET_1BYTE_SEQUENCE_NUMBER,
+ NULL,
+ 0,
+ new RetransmittableFrames());
unacked_packets_.AddPacket(packet);
unacked_packets_.SetSent(sequence_number, clock_.Now(), 1000, true);
}
@@ -34,9 +36,8 @@ class TcpLossAlgorithmTest : public ::testing::Test {
void VerifyLosses(QuicPacketSequenceNumber largest_observed,
QuicPacketSequenceNumber* losses_expected,
size_t num_losses) {
- SequenceNumberSet lost_packets =
- loss_algorithm_.DetectLostPackets(
- unacked_packets_, clock_.Now(), largest_observed, rtt_stats_);
+ SequenceNumberSet lost_packets = loss_algorithm_.DetectLostPackets(
+ unacked_packets_, clock_.Now(), largest_observed, rtt_stats_);
EXPECT_EQ(num_losses, lost_packets.size());
for (size_t i = 0; i < num_losses; ++i) {
EXPECT_TRUE(ContainsKey(lost_packets, losses_expected[i]));
@@ -66,7 +67,7 @@ TEST_F(TcpLossAlgorithmTest, NackRetransmit1Packet) {
// Loss on three acks.
unacked_packets_.SetNotPending(4);
unacked_packets_.NackPacket(1, 3);
- QuicPacketSequenceNumber lost[] = { 1 };
+ QuicPacketSequenceNumber lost[] = {1};
VerifyLosses(4, lost, arraysize(lost));
EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout());
}
@@ -85,7 +86,7 @@ TEST_F(TcpLossAlgorithmTest, NackRetransmit1PacketWith1StretchAck) {
unacked_packets_.SetNotPending(2);
unacked_packets_.SetNotPending(3);
unacked_packets_.SetNotPending(4);
- QuicPacketSequenceNumber lost[] = { 1 };
+ QuicPacketSequenceNumber lost[] = {1};
VerifyLosses(4, lost, arraysize(lost));
EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout());
}
@@ -103,7 +104,7 @@ TEST_F(TcpLossAlgorithmTest, NackRetransmit1PacketSingleAck) {
unacked_packets_.NackPacket(2, 2);
unacked_packets_.NackPacket(3, 1);
unacked_packets_.SetNotPending(4);
- QuicPacketSequenceNumber lost[] = { 1 };
+ QuicPacketSequenceNumber lost[] = {1};
VerifyLosses(4, lost, arraysize(lost));
EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout());
}
@@ -122,7 +123,7 @@ TEST_F(TcpLossAlgorithmTest, EarlyRetransmit1Packet) {
loss_algorithm_.GetLossTimeout());
clock_.AdvanceTime(rtt_stats_.latest_rtt().Multiply(1.25));
- QuicPacketSequenceNumber lost[] = { 1 };
+ QuicPacketSequenceNumber lost[] = {1};
VerifyLosses(2, lost, arraysize(lost));
EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout());
}
@@ -144,7 +145,7 @@ TEST_F(TcpLossAlgorithmTest, EarlyRetransmitAllPackets) {
for (size_t i = 1; i < kNumSentPackets; ++i) {
unacked_packets_.NackPacket(i, kNumSentPackets - i);
}
- QuicPacketSequenceNumber lost[] = { 1, 2 };
+ QuicPacketSequenceNumber lost[] = {1, 2};
VerifyLosses(kNumSentPackets, lost, arraysize(lost));
// The time has already advanced 1/4 an RTT, so ensure the timeout is set
// 1.25 RTTs after the earliest pending packet(3), not the last(4).
@@ -152,12 +153,12 @@ TEST_F(TcpLossAlgorithmTest, EarlyRetransmitAllPackets) {
loss_algorithm_.GetLossTimeout());
clock_.AdvanceTime(rtt_stats_.SmoothedRtt());
- QuicPacketSequenceNumber lost2[] = { 1, 2, 3 };
+ QuicPacketSequenceNumber lost2[] = {1, 2, 3};
VerifyLosses(kNumSentPackets, lost2, arraysize(lost2));
EXPECT_EQ(clock_.Now().Add(rtt_stats_.SmoothedRtt().Multiply(0.25)),
loss_algorithm_.GetLossTimeout());
clock_.AdvanceTime(rtt_stats_.SmoothedRtt().Multiply(0.25));
- QuicPacketSequenceNumber lost3[] = { 1, 2, 3, 4 };
+ QuicPacketSequenceNumber lost3[] = {1, 2, 3, 4};
VerifyLosses(kNumSentPackets, lost3, arraysize(lost3));
EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout());
}

Powered by Google App Engine
This is Rietveld 408576698