Use time(0) as an initial seed for rand_r() in pvector/pdeque tests

This commit is contained in:
Soonho Kong 2013-09-13 20:28:15 -07:00
parent f8c0c02cb0
commit eda25e77a4
2 changed files with 2 additions and 2 deletions

View file

@ -71,7 +71,7 @@ static void driver(unsigned max_sz, unsigned max_val, unsigned num_ops, double u
std::deque<int> q1;
pdeque<int> q2;
pdeque<int> q3;
unsigned int seed;
unsigned int seed = static_cast<unsigned int>(time(0));
std::vector<pdeque<int>> copies;
for (unsigned i = 0; i < num_ops; i++) {
double f = static_cast<double>(rand_r(&seed) % 10000) / 10000.0;

View file

@ -66,7 +66,7 @@ static void driver(unsigned max_sz, unsigned max_val, unsigned num_ops, double u
std::vector<int> v1;
pvector<int> v2;
pvector<int> v3;
unsigned int seed;
unsigned int seed = static_cast<unsigned int>(time(0));
std::vector<pvector<int>> copies;
for (unsigned i = 0; i < num_ops; i++) {
double f = static_cast<double>(rand_r(&seed) % 10000) / 10000.0;