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 3 // found in the LICENSE file. 4 5 #include "net/quic/test_tools/mock_random.h" 6 7 namespace net { 8 9 MockRandom::MockRandom() 10 : increment_(0) { 11 } 12 13 void MockRandom::RandBytes(void* data, size_t len) { 14 memset(data, 'r' + increment_, len); 15 } 16 17 uint64 MockRandom::RandUint64() { 18 return 0xDEADBEEF + increment_; 19 } 20 21 bool MockRandom::RandBool() { 22 return false; 23 } 24 25 void MockRandom::Reseed(const void* additional_entropy, size_t entropy_len) { 26 } 27 28 void MockRandom::ChangeValue() { 29 increment_++; 30 } 31 32 } // namespace net 33