From e2d863b090f54b648147df1ffd084babc94a5e99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Fri, 9 Aug 2019 11:21:05 +0200 Subject: [PATCH] Actually run the random generator tests --- projects/SelfTest/UsageTests/Generators.tests.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/projects/SelfTest/UsageTests/Generators.tests.cpp b/projects/SelfTest/UsageTests/Generators.tests.cpp index 903f6a03..e9b2f807 100644 --- a/projects/SelfTest/UsageTests/Generators.tests.cpp +++ b/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::value); - static_cast(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::value); - static_cast(val); // Silence VS 2015 unused variable warning + REQUIRE(0. <= val); + REQUIRE(val < 1); } }