Commit 138f44b3 authored by Wez Furlong's avatar Wez Furlong Committed by Facebook Github Bot 9

folly: fixup folly::Random FixedSeed test expectations on macOS

Summary:
uniform_int_distribution is implemented differently on this system and
always returns the generated number from our constant random number generator.

Reviewed By: yfeldblum

Differential Revision: D3585418

fbshipit-source-id: 754076599ba77b49c17f03bb0c92264a3bed4ab0
parent c2691bc6
...@@ -65,12 +65,14 @@ TEST(Random, FixedSeed) { ...@@ -65,12 +65,14 @@ TEST(Random, FixedSeed) {
// clang-format on // clang-format on
ConstantRNG gen; ConstantRNG gen;
// Pick a constant random number...
auto value = Random::rand32(10, gen);
// Loop to make sure it really is constant. // Loop to make sure it really is constant.
for (int i = 0; i < 1024; ++i) { for (int i = 0; i < 1024; ++i) {
auto result = Random::rand32(10, gen); auto result = Random::rand32(10, gen);
// TODO: This is a little bit brittle; standard library changes could break EXPECT_EQ(value, result);
// it, if it starts implementing distribution types differently.
EXPECT_EQ(0, result);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment