Skip to content
Permalink
Browse files

Actually run the random generator tests

  • Loading branch information...
horenmar committed Aug 9, 2019
1 parent ebe6a07 commit e2d863b090f54b648147df1ffd084babc94a5e99
Showing with 5 additions and 3 deletions.
  1. +5 −3 projects/SelfTest/UsageTests/Generators.tests.cpp
@@ -180,16 +180,18 @@ TEST_CASE("Generators -- adapters", "[generators][generic]") {

// Note that because of the non-reproducibility of distributions,
// anything involving the random generators cannot be part of approvals
TEST_CASE("Random generator", "[generators][.][approvals]") {
TEST_CASE("Random generator", "[generators][approvals]") {
SECTION("Infer int from integral arguments") {
auto val = GENERATE(take(4, random(0, 1)));
STATIC_REQUIRE(std::is_same<decltype(val), int>::value);
static_cast<void>(val); // Silence VS 2015 unused variable warning
REQUIRE(0 <= val);
REQUIRE(val <= 1);
}
SECTION("Infer double from double arguments") {
auto val = GENERATE(take(4, random(0., 1.)));
STATIC_REQUIRE(std::is_same<decltype(val), double>::value);
static_cast<void>(val); // Silence VS 2015 unused variable warning
REQUIRE(0. <= val);
REQUIRE(val < 1);
}
}

0 comments on commit e2d863b

Please sign in to comment.
You can’t perform that action at this time.