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

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

Issue 12317026: Various small QUIC cleanups after merging to Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_packet_creator.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 5 #include <algorithm>
6 #include <map> 6 #include <map>
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/hash_tables.h" 10 #include "base/hash_tables.h"
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 340
341 // but large numbers should not (even if they're out of order). 341 // but large numbers should not (even if they're out of order).
342 for (uint64 j = 0; j < 10; j++) { 342 for (uint64 j = 0; j < 10; j++) {
343 uint64 num = kEpoch - 1 - j; 343 uint64 num = kEpoch - 1 - j;
344 CheckCalculatePacketSequenceNumber(cur_epoch + num, last); 344 CheckCalculatePacketSequenceNumber(cur_epoch + num, last);
345 } 345 }
346 } 346 }
347 } 347 }
348 348
349 TEST_F(QuicFramerTest, CalculatePacketSequenceNumberFromWireNearNextMax) { 349 TEST_F(QuicFramerTest, CalculatePacketSequenceNumberFromWireNearNextMax) {
350 const uint64 max_number = std::numeric_limits<uint64>::max(); 350 const uint64 max_number = numeric_limits<uint64>::max();
351 const uint64 max_epoch = max_number & ~kMask; 351 const uint64 max_epoch = max_number & ~kMask;
352 352
353 // Cases where the last number was close to the end of the range 353 // Cases where the last number was close to the end of the range
354 for (uint64 i = 0; i < 10; i++) { 354 for (uint64 i = 0; i < 10; i++) {
355 QuicPacketSequenceNumber last = max_number - i; 355 QuicPacketSequenceNumber last = max_number - i;
356 356
357 // Small numbers should not wrap (because they have nowhere to go. 357 // Small numbers should not wrap (because they have nowhere to go.
358 for (uint64 j = 0; j < 10; j++) { 358 for (uint64 j = 0; j < 10; j++) {
359 CheckCalculatePacketSequenceNumber(max_epoch + j, last); 359 CheckCalculatePacketSequenceNumber(max_epoch + j, last);
360 } 360 }
(...skipping 1659 matching lines...) Expand 10 before | Expand all | Expand 10 after
2020 2020
2021 original_raw_length = raw_close_packet->length(); 2021 original_raw_length = raw_close_packet->length();
2022 raw_close_packet.reset( 2022 raw_close_packet.reset(
2023 framer_.ConstructFrameDataPacket(header, frames)); 2023 framer_.ConstructFrameDataPacket(header, frames));
2024 ASSERT_TRUE(raw_ack_packet != NULL); 2024 ASSERT_TRUE(raw_ack_packet != NULL);
2025 EXPECT_EQ(original_raw_length, raw_close_packet->length()); 2025 EXPECT_EQ(original_raw_length, raw_close_packet->length());
2026 } 2026 }
2027 2027
2028 } // namespace test 2028 } // namespace test
2029 } // namespace net 2029 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_packet_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698