aboutsummaryrefslogtreecommitdiff
path: root/src/bench/checkblock.cpp
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2018-06-26 17:19:31 +0200
committerpracticalswift <practicalswift@users.noreply.github.com>2018-07-07 10:08:49 +0200
commit6ad0328f1c3e145d3224197eafd0f66b17cc1a1c (patch)
tree882c1e7bb5c90609063a05e642b4efb8cf2c1660 /src/bench/checkblock.cpp
parent0212187fc624ea4a02fc99bc57ebd413499a9ee1 (diff)
Don't assert(foo()) where foo has side effects
Diffstat (limited to 'src/bench/checkblock.cpp')
-rw-r--r--src/bench/checkblock.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/bench/checkblock.cpp b/src/bench/checkblock.cpp
index fac7e079a7..387ae1769c 100644
--- a/src/bench/checkblock.cpp
+++ b/src/bench/checkblock.cpp
@@ -28,7 +28,8 @@ static void DeserializeBlockTest(benchmark::State& state)
while (state.KeepRunning()) {
CBlock block;
stream >> block;
- assert(stream.Rewind(sizeof(block_bench::block413567)));
+ bool rewound = stream.Rewind(sizeof(block_bench::block413567));
+ assert(rewound);
}
}
@@ -45,10 +46,12 @@ static void DeserializeAndCheckBlockTest(benchmark::State& state)
while (state.KeepRunning()) {
CBlock block; // Note that CBlock caches its checked state, so we need to recreate it here
stream >> block;
- assert(stream.Rewind(sizeof(block_bench::block413567)));
+ bool rewound = stream.Rewind(sizeof(block_bench::block413567));
+ assert(rewound);
CValidationState validationState;
- assert(CheckBlock(block, validationState, chainParams->GetConsensus()));
+ bool checked = CheckBlock(block, validationState, chainParams->GetConsensus());
+ assert(checked);
}
}