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

Don't reseed std::srand when resetting rng state

We no longer use `std::rand` anywhere, so there is no point,
and it might even interfere with our users use of `std::(s)rand`.
Commit
6044f021cf53ac51c307566dd9b5c13054b097d6
Author
Martin Hořeňovský ·
Parents
5d7883b55167

Files · Download .tar.gz

Changes

 src/catch2/internal/catch_run_context.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp
index 7da8f714..de75ab4a 100644
--- a/src/catch2/internal/catch_run_context.cpp
+++ b/src/catch2/internal/catch_run_context.cpp
@@ -599,7 +599,6 @@ namespace Catch {
 
     void seedRng(IConfig const& config) {
         if (config.rngSeed() != 0) {
-            std::srand(config.rngSeed());
             rng().seed(config.rngSeed());
         }
     }