aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/output_selection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit_tests/output_selection.cpp')
-rw-r--r--tests/unit_tests/output_selection.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unit_tests/output_selection.cpp b/tests/unit_tests/output_selection.cpp
index 0094fc765..c98696fbd 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<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);
@@ -172,7 +172,7 @@ TEST(select_outputs, density)
float chain_ratio = count_chain / (float)n_outs;
MDEBUG(count_selected << "/" << NPICKS << " outputs selected in blocks of density " << d << ", " << 100.0f * selected_ratio << "%");
MDEBUG(count_chain << "/" << offsets.size() << " outputs in blocks of density " << d << ", " << 100.0f * chain_ratio << "%");
- ASSERT_LT(fabsf(selected_ratio - chain_ratio), 0.02f);
+ ASSERT_LT(fabsf(selected_ratio - chain_ratio), 0.025f);
}
}
@@ -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);