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

Unified Diff: net/quic/test_tools/mock_random.cc

Issue 14411004: Land Recent QUIC Changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use CONFIG_VERSION insteaf of VERSION Created 7 years, 8 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/test_tools/mock_random.cc
diff --git a/net/quic/test_tools/mock_random.cc b/net/quic/test_tools/mock_random.cc
index f7b8ea0cb41d9a3f43911ec598a16f5e03134845..a8b89565348a3ef7f4f0678bb5c8673637f1f7c1 100644
--- a/net/quic/test_tools/mock_random.cc
+++ b/net/quic/test_tools/mock_random.cc
@@ -6,12 +6,16 @@
namespace net {
+MockRandom::MockRandom()
+ : increment_(0) {
+}
+
void MockRandom::RandBytes(void* data, size_t len) {
- memset(data, 'r', len);
+ memset(data, 'r' + increment_, len);
}
uint64 MockRandom::RandUint64() {
- return 0xDEADBEEF;
+ return 0xDEADBEEF + increment_;
}
bool MockRandom::RandBool() {
@@ -19,6 +23,7 @@ bool MockRandom::RandBool() {
}
void MockRandom::Reseed(const void* additional_entropy, size_t entropy_len) {
+ increment_++;
}
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698