summaryrefslogtreecommitdiff
path: root/chromium/net/quic/test_tools/mock_random.cc
blob: 19a2832bbaa2bd2d5dc67108e825454d9c5b3954 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "net/quic/test_tools/mock_random.h"

namespace net {

MockRandom::MockRandom()
    : increment_(0) {
}

void MockRandom::RandBytes(void* data, size_t len) {
  memset(data, 'r' + increment_, len);
}

uint64 MockRandom::RandUint64() {
  return 0xDEADBEEF + increment_;
}

bool MockRandom::RandBool() {
  return false;
}

void MockRandom::Reseed(const void* additional_entropy, size_t entropy_len) {
}

void MockRandom::ChangeValue() {
  increment_++;
}

}  // namespace net