Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Actually run the random generator tests

Commit
e2d863b090f54b648147df1ffd084babc94a5e99
Author
Martin Hořeňovský ·
Parents
ebe6a07c2330

Files · Download .tar.gz

Changes

 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<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);
     }
 }