aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-06-01 18:28:08 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-06-02 13:47:59 -0700
commit9aa215bff9ce2107d386f0f49f255a9e9d7cb0f0 (patch)
tree563e50c1339de67d6364c7814d85428ba07120e4
parent7cc2c670e3d7cf26454ac8547a94ec2c8ca90b34 (diff)
Bugfixes: missing == 0 after randrange
-rw-r--r--src/test/coins_tests.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp
index 4a4e551695..0ed71b96fc 100644
--- a/src/test/coins_tests.cpp
+++ b/src/test/coins_tests.cpp
@@ -173,7 +173,7 @@ BOOST_AUTO_TEST_CASE(coins_cache_simulation_test)
}
// One every 10 iterations, remove a random entry from the cache
- if (insecure_rand() % 10) {
+ if (insecure_rand() % 10 == 0) {
COutPoint out(txids[insecure_rand() % txids.size()], 0);
int cacheid = insecure_rand() % stack.size();
stack[cacheid]->Uncache(out);
@@ -422,13 +422,13 @@ BOOST_AUTO_TEST_CASE(updatecoins_simulation_test)
}
// One every 10 iterations, remove a random entry from the cache
- if (utxoset.size() > 1 && insecure_rand() % 30) {
+ if (utxoset.size() > 1 && insecure_rand() % 30 == 0) {
stack[insecure_rand() % stack.size()]->Uncache(FindRandomFrom(utxoset)->first);
}
- if (disconnected_coins.size() > 1 && insecure_rand() % 30) {
+ if (disconnected_coins.size() > 1 && insecure_rand() % 30 == 0) {
stack[insecure_rand() % stack.size()]->Uncache(FindRandomFrom(disconnected_coins)->first);
}
- if (duplicate_coins.size() > 1 && insecure_rand() % 30) {
+ if (duplicate_coins.size() > 1 && insecure_rand() % 30 == 0) {
stack[insecure_rand() % stack.size()]->Uncache(FindRandomFrom(duplicate_coins)->first);
}