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

Fixed RNG issue with pre C++14 compilers

Commit
1aa6c91e6428d3f25bc4329ef6eb7938cd53a157
Author
Phil Nash ·
Parents
ac220289a617

Files · Download .tar.gz

Changes

 include/internal/catch_test_case_registry_impl.hpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/internal/catch_test_case_registry_impl.hpp b/include/internal/catch_test_case_registry_impl.hpp
index 7f49d692..04bd37fc 100644
--- a/include/internal/catch_test_case_registry_impl.hpp
+++ b/include/internal/catch_test_case_registry_impl.hpp
@@ -37,10 +37,11 @@ namespace Catch {
 #endif
         template<typename V>
         static void shuffle( V& vector ) {
+            RandomNumberGenerator rng;
 #ifdef CATCH_CPP14_OR_GREATER
-            std::shuffle( vector.begin(), vector.end(), RandomNumberGenerator() );
+            std::shuffle( vector.begin(), vector.end(), rng );
 #else
-            std::random_shuffle( vector.begin(), vector.end(), RandomNumberGenerator() );
+            std::random_shuffle( vector.begin(), vector.end(), rng );
 #endif
         }
     };