Use time(0) as an initial seed for rand_r() in pvector/pdeque tests
This commit is contained in:
parent
f8c0c02cb0
commit
eda25e77a4
2 changed files with 2 additions and 2 deletions
|
@ -71,7 +71,7 @@ static void driver(unsigned max_sz, unsigned max_val, unsigned num_ops, double u
|
||||||
std::deque<int> q1;
|
std::deque<int> q1;
|
||||||
pdeque<int> q2;
|
pdeque<int> q2;
|
||||||
pdeque<int> q3;
|
pdeque<int> q3;
|
||||||
unsigned int seed;
|
unsigned int seed = static_cast<unsigned int>(time(0));
|
||||||
std::vector<pdeque<int>> copies;
|
std::vector<pdeque<int>> copies;
|
||||||
for (unsigned i = 0; i < num_ops; i++) {
|
for (unsigned i = 0; i < num_ops; i++) {
|
||||||
double f = static_cast<double>(rand_r(&seed) % 10000) / 10000.0;
|
double f = static_cast<double>(rand_r(&seed) % 10000) / 10000.0;
|
||||||
|
|
|
@ -66,7 +66,7 @@ static void driver(unsigned max_sz, unsigned max_val, unsigned num_ops, double u
|
||||||
std::vector<int> v1;
|
std::vector<int> v1;
|
||||||
pvector<int> v2;
|
pvector<int> v2;
|
||||||
pvector<int> v3;
|
pvector<int> v3;
|
||||||
unsigned int seed;
|
unsigned int seed = static_cast<unsigned int>(time(0));
|
||||||
std::vector<pvector<int>> copies;
|
std::vector<pvector<int>> copies;
|
||||||
for (unsigned i = 0; i < num_ops; i++) {
|
for (unsigned i = 0; i < num_ops; i++) {
|
||||||
double f = static_cast<double>(rand_r(&seed) % 10000) / 10000.0;
|
double f = static_cast<double>(rand_r(&seed) % 10000) / 10000.0;
|
||||||
|
|
Loading…
Reference in a new issue