aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/rolling_median.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-05-10 14:09:11 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-05-10 14:15:35 +0000
commitde27651f809256cd601bdc5d8015e5fe5fdd3556 (patch)
tree641a91a3704c2791cdae00dcc1010cfa74999343 /tests/unit_tests/rolling_median.cpp
parentMerge pull request #5509 (diff)
downloadmonero-de27651f809256cd601bdc5d8015e5fe5fdd3556.tar.xz
use crypto::rand instead of libc rand in a few tests
We don't need secure randomness here, but it should shut coverity up
Diffstat (limited to 'tests/unit_tests/rolling_median.cpp')
-rw-r--r--tests/unit_tests/rolling_median.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit_tests/rolling_median.cpp b/tests/unit_tests/rolling_median.cpp
index 6d6adcc7d..547fe092f 100644
--- a/tests/unit_tests/rolling_median.cpp
+++ b/tests/unit_tests/rolling_median.cpp
@@ -69,7 +69,7 @@ TEST(rolling_median, series)
v.reserve(100);
for (int i = 0; i < 10000; ++i)
{
- uint64_t r = rand();
+ uint64_t r = crypto::rand<uint64_t>();
v.push_back(r);
if (v.size() > 100)
v.erase(v.begin());
@@ -87,7 +87,7 @@ TEST(rolling_median, clear_whole)
median.reserve(10000);
for (int i = 0; i < 10000; ++i)
{
- random.push_back(rand());
+ random.push_back(crypto::rand<uint64_t>());
m.insert(random.back());
median.push_back(m.median());
}
@@ -107,7 +107,7 @@ TEST(rolling_median, clear_partway)
median.reserve(10000);
for (int i = 0; i < 10000; ++i)
{
- random.push_back(rand());
+ random.push_back(crypto::rand<uint64_t>());
m.insert(random.back());
median.push_back(m.median());
}
@@ -126,7 +126,7 @@ TEST(rolling_median, order)
random.reserve(1000);
for (int i = 0; i < 1000; ++i)
{
- random.push_back(rand());
+ random.push_back(crypto::rand<uint64_t>());
m.insert(random.back());
}
const uint64_t med = m.median();