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

Unified Diff: net/quic/crypto/strike_register_test.cc

Issue 14816006: Land Recent QUIC changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing NET_PRIVATE_EXPORT to QuicWallTime Created 7 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
« no previous file with comments | « net/quic/crypto/strike_register.cc ('k') | net/quic/quic_client_session_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/strike_register_test.cc
diff --git a/net/quic/crypto/strike_register_test.cc b/net/quic/crypto/strike_register_test.cc
index 4dd479ea0eb0e365c752c65e92ecc43f1bc02a72..d805269942d1ce40e0182a0e97141620feea098e 100644
--- a/net/quic/crypto/strike_register_test.cc
+++ b/net/quic/crypto/strike_register_test.cc
@@ -16,7 +16,7 @@ using net::StrikeRegister;
using std::set;
using std::string;
-const uint8 kOrbit[8] = {1, 2, 3, 4, 5, 6, 7, 8};
+const uint8 kOrbit[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
void
NonceSetTimeAndOrbit(uint8 nonce[32], unsigned time, const uint8 orbit[8]) {
@@ -54,7 +54,7 @@ TEST(StrikeRegisterTest, BadOrbit) {
StrikeRegister set(10 /* max size */, 1000 /* current time */,
100 /* window secs */, kOrbit);
uint8 nonce[32];
- static const uint8 kBadOrbit[8] = {0, 0, 0, 0, 1, 1, 1, 1};
+ static const uint8 kBadOrbit[8] = { 0, 0, 0, 0, 1, 1, 1, 1 };
NonceSetTimeAndOrbit(nonce, 1101, kBadOrbit);
ASSERT_FALSE(set.Insert(nonce, 1100));
}
@@ -186,7 +186,7 @@ class SlowStrikeRegister {
void DropOldestEntry() {
set<string>::iterator oldest = nonces_.begin(), it;
uint32 oldest_time =
- TimeFromBytes(reinterpret_cast<const uint8*>(oldest->data()));
+ TimeFromBytes(reinterpret_cast<const uint8*>(oldest->data()));
for (it = oldest; it != nonces_.end(); it++) {
uint32 t = TimeFromBytes(reinterpret_cast<const uint8*>(it->data()));
@@ -214,10 +214,10 @@ TEST(StrikeRegisterStressTest, Stress) {
srand(42);
unsigned max_entries = 64;
uint32 current_time = 10000, window = 200;
- scoped_ptr<StrikeRegister> s1(new StrikeRegister(
- max_entries, current_time, window, kOrbit));
- scoped_ptr<SlowStrikeRegister> s2(new SlowStrikeRegister(
- max_entries, current_time, window, kOrbit));
+ scoped_ptr<StrikeRegister> s1(
+ new StrikeRegister(max_entries, current_time, window, kOrbit));
+ scoped_ptr<SlowStrikeRegister> s2(
+ new SlowStrikeRegister(max_entries, current_time, window, kOrbit));
uint64 i;
// When making changes it's worth removing the limit on this test and running
@@ -231,8 +231,8 @@ TEST(StrikeRegisterStressTest, Stress) {
current_time = rand() % 10000;
window = rand() % 500;
s1.reset(new StrikeRegister(max_entries, current_time, window, kOrbit));
- s2.reset(new SlowStrikeRegister(max_entries, current_time, window,
- kOrbit));
+ s2.reset(
+ new SlowStrikeRegister(max_entries, current_time, window, kOrbit));
}
int32 time_delta = rand() % (window * 4);
« no previous file with comments | « net/quic/crypto/strike_register.cc ('k') | net/quic/quic_client_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698