From eda25e77a46770030c8ae8365ffb932f0252918d Mon Sep 17 00:00:00 2001 From: Soonho Kong Date: Fri, 13 Sep 2013 20:28:15 -0700 Subject: [PATCH] Use time(0) as an initial seed for rand_r() in pvector/pdeque tests --- src/tests/util/pdeque.cpp | 2 +- src/tests/util/pvector.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/util/pdeque.cpp b/src/tests/util/pdeque.cpp index 2e8b1df96..1e5021ae1 100644 --- a/src/tests/util/pdeque.cpp +++ b/src/tests/util/pdeque.cpp @@ -71,7 +71,7 @@ static void driver(unsigned max_sz, unsigned max_val, unsigned num_ops, double u std::deque q1; pdeque q2; pdeque q3; - unsigned int seed; + unsigned int seed = static_cast(time(0)); std::vector> copies; for (unsigned i = 0; i < num_ops; i++) { double f = static_cast(rand_r(&seed) % 10000) / 10000.0; diff --git a/src/tests/util/pvector.cpp b/src/tests/util/pvector.cpp index f8ed02774..55194a9e8 100644 --- a/src/tests/util/pvector.cpp +++ b/src/tests/util/pvector.cpp @@ -66,7 +66,7 @@ static void driver(unsigned max_sz, unsigned max_val, unsigned num_ops, double u std::vector v1; pvector v2; pvector v3; - unsigned int seed; + unsigned int seed = static_cast(time(0)); std::vector> copies; for (unsigned i = 0; i < num_ops; i++) { double f = static_cast(rand_r(&seed) % 10000) / 10000.0;