barelymusician/common/random_test.cpp
// Tests that the uniform random generation always returns a value within the
// given range.
Tests that the uniform random generation always returns a value within the
given range.
Tests that the uniform random generation always returns a value within the given range .
TEST(RandomTest, DrawUniformMinMax) {
  const int kNumValues = 1000;
  const int kMin = -7;
  const int kMax = 35;
  Random random;
  for (int i = 0; i < kNumValues; ++i) {
    const int value = random.DrawUniform(kMin, kMax);
    EXPECT_GE(value, kMin);
    EXPECT_LE(value, kMax);
  }
}
TEST ( RandomTest , DrawUniformMinMax ) { const int kNumValues = 1000 ; const int kMin = -7 ; const int kMax = 35 ; Random random ; for ( int i = 0 ; i < kNumValues ; ++ i ) { const int value = random . DrawUniform ( kMin , kMax ) ; EXPECT_GE ( value , kMin ) ; EXPECT_LE ( value , kMax ) ; } }
Tests that the uniform random generation always returns a value within the
given range.
Tests that the uniform random generation always returns a value within the given range .