mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
scripted-diff: test: Use CTxMemPool in TestingSetup
After this commit, there should be no explicit instantiation of
CTxMemPool in src/test other than those in fuzz/ and setup_common
-BEGIN VERIFY SCRIPT-
find_regex="CTxMemPool\s+([^;({]+)(|\(\)|\{\});" \
&& git grep -l -E "$find_regex" -- src/test \
| grep -v -e "^src/test/util/setup_common.cpp$" \
-e "^src/test/fuzz/" \
| xargs sed -i -E "s@$find_regex@CTxMemPool\& \1 = *Assert(m_node.mempool);@g"
-END VERIFY SCRIPT-
This commit is contained in:
@@ -56,7 +56,7 @@ BOOST_AUTO_TEST_CASE(MempoolRemoveTest)
|
||||
}
|
||||
|
||||
|
||||
CTxMemPool testPool;
|
||||
CTxMemPool& testPool = *Assert(m_node.mempool);
|
||||
LOCK2(cs_main, testPool.cs);
|
||||
|
||||
// Nothing in pool, remove should do nothing:
|
||||
@@ -121,7 +121,7 @@ static void CheckSort(CTxMemPool& pool, std::vector<std::string>& sortedOrder) E
|
||||
|
||||
BOOST_AUTO_TEST_CASE(MempoolIndexingTest)
|
||||
{
|
||||
CTxMemPool pool;
|
||||
CTxMemPool& pool = *Assert(m_node.mempool);
|
||||
LOCK2(cs_main, pool.cs);
|
||||
TestMemPoolEntryHelper entry;
|
||||
|
||||
@@ -294,7 +294,7 @@ BOOST_AUTO_TEST_CASE(MempoolIndexingTest)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest)
|
||||
{
|
||||
CTxMemPool pool;
|
||||
CTxMemPool& pool = *Assert(m_node.mempool);
|
||||
LOCK2(cs_main, pool.cs);
|
||||
TestMemPoolEntryHelper entry;
|
||||
|
||||
@@ -423,7 +423,7 @@ BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
|
||||
{
|
||||
CTxMemPool pool;
|
||||
CTxMemPool& pool = *Assert(m_node.mempool);
|
||||
LOCK2(cs_main, pool.cs);
|
||||
TestMemPoolEntryHelper entry;
|
||||
|
||||
@@ -594,7 +594,7 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTests)
|
||||
{
|
||||
size_t ancestors, descendants;
|
||||
|
||||
CTxMemPool pool;
|
||||
CTxMemPool& pool = *Assert(m_node.mempool);
|
||||
LOCK2(cs_main, pool.cs);
|
||||
TestMemPoolEntryHelper entry;
|
||||
|
||||
@@ -753,7 +753,7 @@ BOOST_AUTO_TEST_CASE(MempoolAncestryTestsDiamond)
|
||||
{
|
||||
size_t ancestors, descendants;
|
||||
|
||||
CTxMemPool pool;
|
||||
CTxMemPool& pool = *Assert(m_node.mempool);
|
||||
LOCK2(::cs_main, pool.cs);
|
||||
TestMemPoolEntryHelper entry;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user