From de27651f809256cd601bdc5d8015e5fe5fdd3556 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Fri, 10 May 2019 14:09:11 +0000 Subject: use crypto::rand instead of libc rand in a few tests We don't need secure randomness here, but it should shut coverity up --- tests/unit_tests/output_selection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/unit_tests/output_selection.cpp') diff --git a/tests/unit_tests/output_selection.cpp b/tests/unit_tests/output_selection.cpp index 0094fc765..e89805dc3 100644 --- a/tests/unit_tests/output_selection.cpp +++ b/tests/unit_tests/output_selection.cpp @@ -138,7 +138,7 @@ TEST(select_outputs, density) static const size_t NPICKS = 1000000; std::vector offsets; - MKOFFSETS(300000, 1 + (rand() & 0x1f)); + MKOFFSETS(300000, 1 + (crypto::rand() & 0x1f)); tools::gamma_picker picker(offsets); std::vector picks(/*n_outs*/offsets.size(), 0); @@ -181,7 +181,7 @@ TEST(select_outputs, same_distribution) static const size_t NPICKS = 1000000; std::vector offsets; - MKOFFSETS(300000, 1 + (rand() & 0x1f)); + MKOFFSETS(300000, 1 + (crypto::rand() & 0x1f)); tools::gamma_picker picker(offsets); std::vector chain_picks(offsets.size(), 0); -- cgit v1.2.3