projects
/
awesomized
/
libmemcached
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (from parent 1:
c27e726
)
testing: fix rnd
author
Michael Wallner
<mike@php.net>
Fri, 23 Oct 2020 16:17:33 +0000
(18:17 +0200)
committer
Michael Wallner
<mike@php.net>
Fri, 23 Oct 2020 16:17:33 +0000
(18:17 +0200)
test/lib/random.hpp
patch
|
blob
|
history
diff --git
a/test/lib/random.hpp
b/test/lib/random.hpp
index 1d7f7a6f7973d7ae2496b5c882d1e8926d177f89..723146a9acd07a31e24f9b2deb1c77d522d7eb92 100644
(file)
--- a/
test/lib/random.hpp
+++ b/
test/lib/random.hpp
@@
-30,11
+30,11
@@
using kv_pair = pair<string, string>;
template<typename T>
enable_if_t<is_integral_v<T>, T> random_num(T min, T max) {
using namespace chrono;
template<typename T>
enable_if_t<is_integral_v<T>, T> random_num(T min, T max) {
using namespace chrono;
- using rnd = mt19937;
- using dst = uniform_int_distribution<
T
>;
+ using rnd = mt19937
_64
;
+ using dst = uniform_int_distribution<
uintmax_t
>;
static auto time = duration_cast<nanoseconds>(system_clock::now().time_since_epoch());
static auto time = duration_cast<nanoseconds>(system_clock::now().time_since_epoch());
- static auto seed = static_cast<rnd::result_type>(time.count()
% numeric_limits<T>::max()
);
+ static auto seed = static_cast<rnd::result_type>(time.count());
static auto rgen = rnd{seed};
return dst(min, max)(rgen);
static auto rgen = rnd{seed};
return dst(min, max)(rgen);