mock_random.cc revision c2e0dbddbe15c98d52c4786dac06cb8952a8ae6d
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
7namespace net {
8
9MockRandom::MockRandom()
10    : increment_(0) {
11}
12
13void MockRandom::RandBytes(void* data, size_t len) {
14  memset(data, 'r' + increment_, len);
15}
16
17uint64 MockRandom::RandUint64() {
18  return 0xDEADBEEF + increment_;
19}
20
21bool MockRandom::RandBool() {
22  return false;
23}
24
25void MockRandom::Reseed(const void* additional_entropy, size_t entropy_len) {
26  increment_++;
27}
28
29}  // namespace net
30