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

`RandomNumberGenerator::result_type` should be unsigned (#1050)

`result_type` must be unsigned:
http://en.cppreference.com/w/cpp/concept/UniformRandomBitGenerator

Using a signed type causes an infinite loop working with MS Visual Studio 2017, targetting: v140, WindowsTargetPlatformVersion 10.0.15063.0, Debug, x64
Commit
96c5de678d538e4e9b95c7f06afa03e3d0a0b15e
Author
Sebastian Grottel ·
Committer
Martin Hořeňovský
Parents
e68485e19664

Files · Download .tar.gz

Changes

 include/internal/catch_random_number_generator.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/internal/catch_random_number_generator.h b/include/internal/catch_random_number_generator.h
index 1a61202d..2395bd39 100644
--- a/include/internal/catch_random_number_generator.h
+++ b/include/internal/catch_random_number_generator.h
@@ -20,7 +20,7 @@ namespace Catch {
     unsigned int rngSeed();
 
     struct RandomNumberGenerator {
-        using result_type = std::ptrdiff_t;
+        using result_type = unsigned int;
 
         static constexpr result_type (min)() { return 0; }
         static constexpr result_type (max)() { return 1000000; }