diff --git a/src/bench/bench.cpp b/src/bench/bench.cpp --- a/src/bench/bench.cpp +++ b/src/bench/bench.cpp @@ -148,7 +148,7 @@ printer.header(); for (const auto &p : benchmarks()) { - TestingSetup test{CBaseChainParams::REGTEST}; + RegTestingSetup test{}; assert(::ChainActive().Height() == 0); if (!std::regex_match(p.first, baseMatch, reFilter)) { diff --git a/src/test/blockencodings_tests.cpp b/src/test/blockencodings_tests.cpp --- a/src/test/blockencodings_tests.cpp +++ b/src/test/blockencodings_tests.cpp @@ -17,11 +17,7 @@ static std::vector> extra_txn; -struct RegtestingSetup : public TestingSetup { - RegtestingSetup() : TestingSetup(CBaseChainParams::REGTEST) {} -}; - -BOOST_FIXTURE_TEST_SUITE(blockencodings_tests, RegtestingSetup) +BOOST_FIXTURE_TEST_SUITE(blockencodings_tests, RegTestingSetup) static COutPoint InsecureRandOutPoint() { return COutPoint(TxId(InsecureRand256()), 0); diff --git a/src/test/setup_common.h b/src/test/setup_common.h --- a/src/test/setup_common.h +++ b/src/test/setup_common.h @@ -98,6 +98,11 @@ ~TestingSetup(); }; +/** Identical to TestingSetup, but chain set to regtest */ +struct RegTestingSetup : public TestingSetup { + RegTestingSetup() : TestingSetup{CBaseChainParams::REGTEST} {} +}; + class CBlock; class CMutableTransaction; class CScript; @@ -106,7 +111,7 @@ // Testing fixture that pre-creates a // 100-block REGTEST-mode block chain // -struct TestChain100Setup : public TestingSetup { +struct TestChain100Setup : public RegTestingSetup { TestChain100Setup(); // Create a new block with just given transactions, coinbase paying to diff --git a/src/test/setup_common.cpp b/src/test/setup_common.cpp --- a/src/test/setup_common.cpp +++ b/src/test/setup_common.cpp @@ -149,8 +149,7 @@ pblocktree.reset(); } -TestChain100Setup::TestChain100Setup() - : TestingSetup(CBaseChainParams::REGTEST) { +TestChain100Setup::TestChain100Setup() { // Generate a 100-block chain: coinbaseKey.MakeNewKey(true); CScript scriptPubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) diff --git a/src/test/validation_block_tests.cpp b/src/test/validation_block_tests.cpp --- a/src/test/validation_block_tests.cpp +++ b/src/test/validation_block_tests.cpp @@ -19,11 +19,7 @@ #include -struct RegtestingSetup : public TestingSetup { - RegtestingSetup() : TestingSetup(CBaseChainParams::REGTEST) {} -}; - -BOOST_FIXTURE_TEST_SUITE(validation_block_tests, RegtestingSetup) +BOOST_FIXTURE_TEST_SUITE(validation_block_tests, RegTestingSetup) struct TestSubscriber : public CValidationInterface { uint256 m_expected_tip;