1 // Copyright 2018 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 #ifndef MEDIA_LEARNING_IMPL_TEST_RANDOM_NUMBER_GENERATOR_H_ 6 #define MEDIA_LEARNING_IMPL_TEST_RANDOM_NUMBER_GENERATOR_H_ 7 8 #include "media/learning/impl/random_number_generator.h" 9 10 namespace media { 11 12 // RandomGenerator implementation that provides repeatable (given a seed) 13 // sequences of numbers that is also platform agnostic. 14 class TestRandomNumberGenerator : public RandomNumberGenerator { 15 public: 16 explicit TestRandomNumberGenerator(uint32_t seed); 17 ~TestRandomNumberGenerator() override; 18 19 // RandomGenerator 20 uint64_t Generate() override; 21 22 static const uint64_t M = 2147483647L; // 2^32-1 23 int32_t seed_; 24 }; 25 26 } // namespace media 27 28 #endif // MEDIA_LEARNING_IMPL_TEST_RANDOM_NUMBER_GENERATOR_H_ 29