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

Unified Diff: net/quic/core/quic_protocol_test.cc

Issue 2220333003: Add VersionOfIndex() to quic_protocol.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@129220409
Patch Set: Created 4 years, 4 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/core/quic_protocol.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_protocol_test.cc
diff --git a/net/quic/core/quic_protocol_test.cc b/net/quic/core/quic_protocol_test.cc
index 0626bfd055ca365644ce3263eeeedb47ea52437f..48d9fd0a58e4c62dd7f68d7a51aff753d9ed5eb0 100644
--- a/net/quic/core/quic_protocol_test.cc
+++ b/net/quic/core/quic_protocol_test.cc
@@ -314,6 +314,20 @@ TEST(QuicProtocolTest, QuicVersionManager) {
EXPECT_EQ(QUIC_VERSION_35, manager.GetSupportedVersions()[1]);
}
+TEST(QuicProtocolTest, LookUpVersionByIndex) {
+ QuicVersionVector all_versions = {
+ QUIC_VERSION_30, QUIC_VERSION_31, QUIC_VERSION_32, QUIC_VERSION_33,
+ QUIC_VERSION_34, QUIC_VERSION_35, QUIC_VERSION_36};
+ int version_count = all_versions.size();
+ for (int i = -5; i <= version_count + 1; ++i) {
+ if (i >= 0 && i < version_count) {
+ EXPECT_EQ(all_versions[i], VersionOfIndex(all_versions, i)[0]);
+ } else {
+ EXPECT_EQ(QUIC_VERSION_UNSUPPORTED, VersionOfIndex(all_versions, i)[0]);
+ }
+ }
+}
+
// Tests that a queue contains the expected data after calls to Add().
TEST(PacketNumberQueueTest, AddRange) {
PacketNumberQueue queue;
« no previous file with comments | « net/quic/core/quic_protocol.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698