X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=test%2Flib%2Frandom.cpp;h=76c049710432ffbc4b0be42d43aaee59a265c370;hb=6b7d2bf0319e0bd48bd6aa4ad8c56a935f98b0d2;hp=6aab887597f087e75b823f24773cf0515845c11d;hpb=a1b265e9eba018e9ea510c9224953c27fc271bc9;p=awesomized%2Flibmemcached diff --git a/test/lib/random.cpp b/test/lib/random.cpp index 6aab8875..76c04971 100644 --- a/test/lib/random.cpp +++ b/test/lib/random.cpp @@ -1,7 +1,18 @@ #include "test/lib/random.hpp" #include "test/lib/Connection.hpp" -#include // getpid() +#if HAVE_UNISTD_H +# include // getpid() +#endif +mt19937_64 rnd_eng; +mutex rnd_mtx; + +void random_setup() { + using namespace chrono; + + auto time = duration_cast(system_clock::now().time_since_epoch()); + rnd_eng.seed(static_cast(time.count())); +} unsigned random_port() { do {