aboutsummaryrefslogtreecommitdiff
path: root/src/test/coins_tests.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-06-07 11:34:58 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-06-07 11:35:13 -0700
commit5f0b04eedc5bbdb9319c9f1f1a6c599337f5bbe3 (patch)
tree793fc19101574c742e5066481014a9f4738d08bb /src/test/coins_tests.cpp
parent3ecabae36364e905e7821fba3e60aa7f8418de6c (diff)
downloadbitcoin-5f0b04eedc5bbdb9319c9f1f1a6c599337f5bbe3.tar.xz
Replace rand() & ((1 << N) - 1) with randbits(N)
Diffstat (limited to 'src/test/coins_tests.cpp')
-rw-r--r--src/test/coins_tests.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp
index c923f8df28..27d8db8b9e 100644
--- a/src/test/coins_tests.cpp
+++ b/src/test/coins_tests.cpp
@@ -155,11 +155,11 @@ BOOST_AUTO_TEST_CASE(coins_cache_simulation_test)
newcoin.out.nValue = insecure_rand();
newcoin.nHeight = 1;
if (insecure_randrange(16) == 0 && coin.IsSpent()) {
- newcoin.out.scriptPubKey.assign(1 + (insecure_rand() & 0x3F), OP_RETURN);
+ newcoin.out.scriptPubKey.assign(1 + insecure_randbits(6), OP_RETURN);
BOOST_CHECK(newcoin.out.scriptPubKey.IsUnspendable());
added_an_unspendable_entry = true;
} else {
- newcoin.out.scriptPubKey.assign(insecure_rand() & 0x3F, 0); // Random sizes so we can test memory usage accounting
+ newcoin.out.scriptPubKey.assign(insecure_randbits(6), 0); // Random sizes so we can test memory usage accounting
(coin.IsSpent() ? added_an_entry : updated_an_entry) = true;
coin = newcoin;
}