aboutsummaryrefslogtreecommitdiff
path: root/src/test/mempool_tests.cpp
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2022-03-21 21:42:40 -0400
committerCarl Dong <contact@carldong.me>2022-06-15 17:28:55 -0400
commit86e732def3983f99ec84b59375615bedcdc0e664 (patch)
tree662d9afcfe20ad883661be3db3b90f6f971c25e3 /src/test/mempool_tests.cpp
parent213457e170ce41a0b26c644aa010111df36414a6 (diff)
downloadbitcoin-86e732def3983f99ec84b59375615bedcdc0e664.tar.xz
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-
Diffstat (limited to 'src/test/mempool_tests.cpp')
-rw-r--r--src/test/mempool_tests.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/test/mempool_tests.cpp b/src/test/mempool_tests.cpp
index 5f7c4470fd..bc63122025 100644
--- a/src/test/mempool_tests.cpp
+++ b/src/test/mempool_tests.cpp
@@ -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;