Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-05-03 19:01:21 +0200
committerMartin Hořeňovský2020-05-03 19:01:21 +0200
commit0c223bb751ceb0c5d02e66ca2cb1d2a72bd3ba43 (patch)
treee2e0d488667bb4784156326491e0c77aba9d5cd5
parent19ecad6f68154df2ba182c93224bdda8d7527b34 (diff)
downloadcatch3-0c223bb751ceb0c5d02e66ca2cb1d2a72bd3ba43.tar.gz
Decrease chance of false positive in random generator testing
-rw-r--r--tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp b/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp
index 81fb4ebc..81f5a811 100644
--- a/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp
+++ b/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp
@@ -341,8 +341,9 @@ TEST_CASE("Multiple random generators in one test case output different values",
same += random1.get() == random2.get();
random1.next(); random2.next();
}
- // 0.5% seems like a sane bound for random identical elements within 1000 runs
- REQUIRE(same < 5);
+ // Because the previous low bound failed CI couple of times,
+ // we use a very high threshold of 20% before failure is reported.
+ REQUIRE(same < 200);
}
SECTION("Float") {
auto random1 = Catch::Generators::random(0., 1000.);
@@ -352,7 +353,8 @@ TEST_CASE("Multiple random generators in one test case output different values",
same += random1.get() == random2.get();
random1.next(); random2.next();
}
- // 0.5% seems like a sane bound for random identical elements within 1000 runs
- REQUIRE(same < 5);
+ // Because the previous low bound failed CI couple of times,
+ // we use a very high threshold of 20% before failure is reported.
+ REQUIRE(same < 200);
}
}