mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-11 08:07:33 +02:00
refactor(test): Only specify TestChain100Setup in test cases
Reduces risk for accidental use of costly TestChain100Setup in later added test cases.
This commit is contained in:
@@ -7,10 +7,10 @@
|
||||
#include <kernel/disconnected_transactions.h>
|
||||
#include <test/util/setup_common.h>
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(disconnected_transactions, TestChain100Setup)
|
||||
BOOST_AUTO_TEST_SUITE(disconnected_transactions)
|
||||
|
||||
//! Tests that DisconnectedBlockTransactions limits its own memory properly
|
||||
BOOST_AUTO_TEST_CASE(disconnectpool_memory_limits)
|
||||
BOOST_FIXTURE_TEST_CASE(disconnectpool_memory_limits, TestChain100Setup)
|
||||
{
|
||||
// Use the coinbase transactions from TestChain100Setup. It doesn't matter whether these
|
||||
// transactions would realistically be in a block together, they just need distinct txids and
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
|
||||
using interfaces::FoundBlock;
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(interfaces_tests, TestChain100Setup)
|
||||
BOOST_AUTO_TEST_SUITE(interfaces_tests)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(findBlock)
|
||||
BOOST_FIXTURE_TEST_CASE(findBlock, TestChain100Setup)
|
||||
{
|
||||
LOCK(Assert(m_node.chainman)->GetMutex());
|
||||
auto& chain = m_node.chain;
|
||||
@@ -61,7 +61,7 @@ BOOST_AUTO_TEST_CASE(findBlock)
|
||||
BOOST_CHECK(!chain->findBlock({}, FoundBlock()));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(findFirstBlockWithTimeAndHeight)
|
||||
BOOST_FIXTURE_TEST_CASE(findFirstBlockWithTimeAndHeight, TestChain100Setup)
|
||||
{
|
||||
LOCK(Assert(m_node.chainman)->GetMutex());
|
||||
auto& chain = m_node.chain;
|
||||
@@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE(findFirstBlockWithTimeAndHeight)
|
||||
BOOST_CHECK(!chain->findFirstBlockWithTimeAndHeight(/* min_time= */ active.Tip()->GetBlockTimeMax() + 1, /* min_height= */ 0));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(findAncestorByHeight)
|
||||
BOOST_FIXTURE_TEST_CASE(findAncestorByHeight, TestChain100Setup)
|
||||
{
|
||||
LOCK(Assert(m_node.chainman)->GetMutex());
|
||||
auto& chain = m_node.chain;
|
||||
@@ -85,7 +85,7 @@ BOOST_AUTO_TEST_CASE(findAncestorByHeight)
|
||||
BOOST_CHECK(!chain->findAncestorByHeight(active[10]->GetBlockHash(), 20));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(findAncestorByHash)
|
||||
BOOST_FIXTURE_TEST_CASE(findAncestorByHash, TestChain100Setup)
|
||||
{
|
||||
LOCK(Assert(m_node.chainman)->GetMutex());
|
||||
auto& chain = m_node.chain;
|
||||
@@ -96,7 +96,7 @@ BOOST_AUTO_TEST_CASE(findAncestorByHash)
|
||||
BOOST_CHECK(!chain->findAncestorByHash(active[10]->GetBlockHash(), active[20]->GetBlockHash()));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(findCommonAncestor)
|
||||
BOOST_FIXTURE_TEST_CASE(findCommonAncestor, TestChain100Setup)
|
||||
{
|
||||
auto& chain = m_node.chain;
|
||||
const CChain& active{*WITH_LOCK(Assert(m_node.chainman)->GetMutex(), return &Assert(m_node.chainman)->ActiveChain())};
|
||||
@@ -126,7 +126,7 @@ BOOST_AUTO_TEST_CASE(findCommonAncestor)
|
||||
BOOST_CHECK_EQUAL(orig_hash, orig_tip->GetBlockHash());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(hasBlocks)
|
||||
BOOST_FIXTURE_TEST_CASE(hasBlocks, TestChain100Setup)
|
||||
{
|
||||
LOCK(::cs_main);
|
||||
auto& chain = m_node.chain;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(txdownload_tests, TestingSetup)
|
||||
BOOST_AUTO_TEST_SUITE(txdownload_tests)
|
||||
|
||||
struct Behaviors {
|
||||
bool m_txid_in_rejects;
|
||||
|
||||
Reference in New Issue
Block a user