mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-23 07:15:29 +01:00
test: Address outstanding versionbits_test feedback
* https://github.com/bitcoin/bitcoin/pull/21377#discussion_r609585080 * https://github.com/bitcoin/bitcoin/pull/21377#discussion_r613702341
This commit is contained in:
parent
fad4167871
commit
faec1e9ee1
1 changed files with 2 additions and 4 deletions
|
@ -81,11 +81,9 @@ class VersionBitsTester
|
||||||
TestNeverActiveConditionChecker checker_never[CHECKERS];
|
TestNeverActiveConditionChecker checker_never[CHECKERS];
|
||||||
|
|
||||||
// Test counter (to identify failures)
|
// Test counter (to identify failures)
|
||||||
int num;
|
int num{1000};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
VersionBitsTester() : num(1000) {}
|
|
||||||
|
|
||||||
VersionBitsTester& Reset() {
|
VersionBitsTester& Reset() {
|
||||||
// Have each group of tests be counted by the 1000s part, starting at 1000
|
// Have each group of tests be counted by the 1000s part, starting at 1000
|
||||||
num = num - (num % 1000) + 1000;
|
num = num - (num % 1000) + 1000;
|
||||||
|
@ -300,7 +298,7 @@ static void check_computeblockversion(const Consensus::Params& params, Consensus
|
||||||
BOOST_REQUIRE(0 <= bit && bit < 32);
|
BOOST_REQUIRE(0 <= bit && bit < 32);
|
||||||
BOOST_REQUIRE(((1 << bit) & VERSIONBITS_TOP_MASK) == 0);
|
BOOST_REQUIRE(((1 << bit) & VERSIONBITS_TOP_MASK) == 0);
|
||||||
BOOST_REQUIRE(min_activation_height >= 0);
|
BOOST_REQUIRE(min_activation_height >= 0);
|
||||||
BOOST_REQUIRE_EQUAL(min_activation_height % params.nMinerConfirmationWindow, 0);
|
BOOST_REQUIRE_EQUAL(min_activation_height % params.nMinerConfirmationWindow, 0U);
|
||||||
|
|
||||||
// In the first chain, test that the bit is set by CBV until it has failed.
|
// In the first chain, test that the bit is set by CBV until it has failed.
|
||||||
// In the second chain, test the bit is set by CBV while STARTED and
|
// In the second chain, test the bit is set by CBV while STARTED and
|
||||||
|
|
Loading…
Add table
Reference in a new issue