mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 07:36:10 -04:00
nearby: snapshot as of cl/296436629
Signed-off-by: Alexey Polyudov <apolyudov@google.com> Change-Id: I2cf5bf225b76f4c1541954651f3a7544a14e0cec
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#include "platform/prng.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace location {
|
||||
namespace nearby {
|
||||
|
||||
TEST(PrngTest, NextInt32) {
|
||||
std::int32_t i = Prng().nextInt32();
|
||||
ASSERT_LE(i, std::numeric_limits<std::int32_t>::max());
|
||||
ASSERT_GE(i, std::numeric_limits<std::int32_t>::min());
|
||||
}
|
||||
|
||||
TEST(PrngTest, NextUInt32) {
|
||||
std::uint32_t i = Prng().nextUInt32();
|
||||
ASSERT_LE(i, std::numeric_limits<std::uint32_t>::max());
|
||||
ASSERT_GE(i, std::numeric_limits<std::uint32_t>::min());
|
||||
}
|
||||
|
||||
TEST(PrngTest, NextInt64) {
|
||||
std::int64_t i = Prng().nextInt64();
|
||||
ASSERT_LE(i, std::numeric_limits<std::int64_t>::max());
|
||||
ASSERT_GE(i, std::numeric_limits<std::int64_t>::min());
|
||||
}
|
||||
|
||||
} // namespace nearby
|
||||
} // namespace location
|
||||
Reference in New Issue
Block a user