| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/quic/test_tools/mock_random.h" | 5 #include "net/quic/test_tools/mock_random.h" |
| 6 | 6 |
| 7 namespace net { | 7 namespace net { |
| 8 namespace test { | 8 namespace test { |
| 9 | 9 |
| 10 MockRandom::MockRandom() : base_(0xDEADBEEF), increment_(0) {} | 10 MockRandom::MockRandom() : base_(0xDEADBEEF), increment_(0) {} |
| 11 | 11 |
| 12 MockRandom::MockRandom(uint32 base) : base_(base), increment_(0) {} | 12 MockRandom::MockRandom(uint32_t base) : base_(base), increment_(0) {} |
| 13 | 13 |
| 14 void MockRandom::RandBytes(void* data, size_t len) { | 14 void MockRandom::RandBytes(void* data, size_t len) { |
| 15 memset(data, 'r' + increment_, len); | 15 memset(data, 'r' + increment_, len); |
| 16 } | 16 } |
| 17 | 17 |
| 18 uint64 MockRandom::RandUint64() { | 18 uint64_t MockRandom::RandUint64() { |
| 19 return base_ + increment_; | 19 return base_ + increment_; |
| 20 } | 20 } |
| 21 | 21 |
| 22 void MockRandom::Reseed(const void* additional_entropy, size_t entropy_len) {} | 22 void MockRandom::Reseed(const void* additional_entropy, size_t entropy_len) {} |
| 23 | 23 |
| 24 void MockRandom::ChangeValue() { | 24 void MockRandom::ChangeValue() { |
| 25 increment_++; | 25 increment_++; |
| 26 } | 26 } |
| 27 | 27 |
| 28 } // namespace test | 28 } // namespace test |
| 29 } // namespace net | 29 } // namespace net |
| OLD | NEW |