mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 15:16:12 -04:00
Signed-off-by: Alexey Polyudov <apolyudov@google.com> Change-Id: I8936b527079074d5c3af5531b9245063767cc4a7
28 lines
714 B
C++
28 lines
714 B
C++
#include "platform_v2/base/prng.h"
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
namespace location {
|
|
namespace nearby {
|
|
|
|
TEST(PrngTest, NextInt32) {
|
|
std::int32_t i = Prng().NextInt32();
|
|
EXPECT_LE(i, std::numeric_limits<std::int32_t>::max());
|
|
EXPECT_GE(i, std::numeric_limits<std::int32_t>::min());
|
|
}
|
|
|
|
TEST(PrngTest, NextUInt32) {
|
|
std::uint32_t i = Prng().NextUint32();
|
|
EXPECT_LE(i, std::numeric_limits<std::uint32_t>::max());
|
|
EXPECT_GE(i, std::numeric_limits<std::uint32_t>::min());
|
|
}
|
|
|
|
TEST(PrngTest, NextInt64) {
|
|
std::int64_t i = Prng().NextInt64();
|
|
EXPECT_LE(i, std::numeric_limits<std::int64_t>::max());
|
|
EXPECT_GE(i, std::numeric_limits<std::int64_t>::min());
|
|
}
|
|
|
|
} // namespace nearby
|
|
} // namespace location
|