use crypto::rand instead of libc rand in a few tests

We don't need secure randomness here, but it should shut coverity up
This commit is contained in:
moneromooo-monero 2019-05-10 14:09:11 +00:00
parent c0bc6d96cd
commit de27651f80
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
3 changed files with 8 additions and 8 deletions

View file

@ -138,7 +138,7 @@ TEST(select_outputs, density)
static const size_t NPICKS = 1000000;
std::vector<uint64_t> offsets;
MKOFFSETS(300000, 1 + (rand() & 0x1f));
MKOFFSETS(300000, 1 + (crypto::rand<size_t>() & 0x1f));
tools::gamma_picker picker(offsets);
std::vector<int> picks(/*n_outs*/offsets.size(), 0);
@ -181,7 +181,7 @@ TEST(select_outputs, same_distribution)
static const size_t NPICKS = 1000000;
std::vector<uint64_t> offsets;
MKOFFSETS(300000, 1 + (rand() & 0x1f));
MKOFFSETS(300000, 1 + (crypto::rand<size_t>() & 0x1f));
tools::gamma_picker picker(offsets);
std::vector<int> chain_picks(offsets.size(), 0);