mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
test: Make bloom tests deterministic
This commit is contained in:
parent
3e38d40873
commit
fae169c95e
4 changed files with 26 additions and 11 deletions
|
|
@ -514,9 +514,11 @@ void GetRandBytes(unsigned char* buf, int num) noexcept { ProcRand(buf, num, RNG
|
|||
void GetStrongRandBytes(unsigned char* buf, int num) noexcept { ProcRand(buf, num, RNGLevel::SLOW); }
|
||||
void RandAddSeedSleep() { ProcRand(nullptr, 0, RNGLevel::SLEEP); }
|
||||
|
||||
bool g_mock_deterministic_tests{false};
|
||||
|
||||
uint64_t GetRand(uint64_t nMax) noexcept
|
||||
{
|
||||
return FastRandomContext().randrange(nMax);
|
||||
return FastRandomContext(g_mock_deterministic_tests).randrange(nMax);
|
||||
}
|
||||
|
||||
int GetRandInt(int nMax) noexcept
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue