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

Unified Diff: net/quic/quic_protocol_test.cc

Issue 2192633002: Switch to PacketNumberQueue interval iteration and avoid allocations in new ACK frame generation. G… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@128431128
Patch Set: Rebase Created 4 years, 5 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
« no previous file with comments | « net/quic/quic_protocol.cc ('k') | net/quic/quic_sent_entropy_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_protocol_test.cc
diff --git a/net/quic/quic_protocol_test.cc b/net/quic/quic_protocol_test.cc
index 2ae17b5e08b7ef04403d52185b2aa8601d6f653c..95b18fedf66d52289580ee793c14f5ca98eecd44 100644
--- a/net/quic/quic_protocol_test.cc
+++ b/net/quic/quic_protocol_test.cc
@@ -377,14 +377,21 @@ TEST(PacketNumberQueueTest, Iterators) {
PacketNumberQueue queue;
queue.Add(1, 100);
- const std::vector<QuicPacketNumber> actual(queue.begin(), queue.end());
+ const std::vector<QuicPacketNumber> actual_numbers(queue.begin(),
+ queue.end());
+ const std::vector<Interval<QuicPacketNumber>> actual_intervals(
+ queue.begin_intervals(), queue.end_intervals());
- std::vector<QuicPacketNumber> expected;
+ std::vector<QuicPacketNumber> expected_numbers;
for (int i = 1; i < 100; ++i) {
- expected.push_back(i);
+ expected_numbers.push_back(i);
}
- EXPECT_EQ(expected, actual);
+ std::vector<Interval<QuicPacketNumber>> expected_intervals;
+ expected_intervals.push_back(Interval<QuicPacketNumber>(1, 100));
+
+ EXPECT_EQ(expected_intervals, actual_intervals);
+ EXPECT_EQ(expected_numbers, actual_numbers);
PacketNumberQueue::const_iterator it_low = queue.lower_bound(10);
EXPECT_EQ(10u, *it_low);
« no previous file with comments | « net/quic/quic_protocol.cc ('k') | net/quic/quic_sent_entropy_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698