diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2018-02-23 08:10:42 +0100 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2018-02-23 08:10:42 +0100 |
commit | 2736c9e05ebd71f2eeab490de7f9fba9ea8b4169 (patch) | |
tree | 2288814a29ae4c38f18fdd8e594e82541879db47 /src/test/scheduler_tests.cpp | |
parent | aae64a21ba25ca86fe2bbb581681dc20d613fb44 (diff) |
Avoid unintentional unsigned integer wraparounds in tests
Diffstat (limited to 'src/test/scheduler_tests.cpp')
-rw-r--r-- | src/test/scheduler_tests.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/scheduler_tests.cpp b/src/test/scheduler_tests.cpp index 760f933abc..179df7dd38 100644 --- a/src/test/scheduler_tests.cpp +++ b/src/test/scheduler_tests.cpp @@ -56,8 +56,8 @@ BOOST_AUTO_TEST_CASE(manythreads) int counter[10] = { 0 }; FastRandomContext rng(42); auto zeroToNine = [](FastRandomContext& rc) -> int { return rc.randrange(10); }; // [0, 9] - auto randomMsec = [](FastRandomContext& rc) -> int { return -11 + rc.randrange(1012); }; // [-11, 1000] - auto randomDelta = [](FastRandomContext& rc) -> int { return -1000 + rc.randrange(2001); }; // [-1000, 1000] + auto randomMsec = [](FastRandomContext& rc) -> int { return -11 + (int)rc.randrange(1012); }; // [-11, 1000] + auto randomDelta = [](FastRandomContext& rc) -> int { return -1000 + (int)rc.randrange(2001); }; // [-1000, 1000] boost::chrono::system_clock::time_point start = boost::chrono::system_clock::now(); boost::chrono::system_clock::time_point now = start; |