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:
Carl Dong
2022-03-21 21:42:40 -04:00
parent 213457e170
commit 86e732def3
4 changed files with 12 additions and 12 deletions

View File

@@ -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;