mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-25 18:51:47 +02:00
test: refactor: Rename extra_txn to const empty_extra_txn as it is empty in all test cases
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#include <boost/test/unit_test.hpp>
|
#include <boost/test/unit_test.hpp>
|
||||||
|
|
||||||
std::vector<CTransactionRef> extra_txn;
|
const std::vector<CTransactionRef> empty_extra_txn;
|
||||||
|
|
||||||
BOOST_FIXTURE_TEST_SUITE(blockencodings_tests, RegTestingSetup)
|
BOOST_FIXTURE_TEST_SUITE(blockencodings_tests, RegTestingSetup)
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ BOOST_AUTO_TEST_CASE(SimpleRoundTripTest)
|
|||||||
stream >> shortIDs2;
|
stream >> shortIDs2;
|
||||||
|
|
||||||
PartiallyDownloadedBlock partialBlock(&pool);
|
PartiallyDownloadedBlock partialBlock(&pool);
|
||||||
BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);
|
BOOST_CHECK(partialBlock.InitData(shortIDs2, empty_extra_txn) == READ_STATUS_OK);
|
||||||
BOOST_CHECK( partialBlock.IsTxAvailable(0));
|
BOOST_CHECK( partialBlock.IsTxAvailable(0));
|
||||||
BOOST_CHECK(!partialBlock.IsTxAvailable(1));
|
BOOST_CHECK(!partialBlock.IsTxAvailable(1));
|
||||||
BOOST_CHECK( partialBlock.IsTxAvailable(2));
|
BOOST_CHECK( partialBlock.IsTxAvailable(2));
|
||||||
@@ -165,7 +165,7 @@ BOOST_AUTO_TEST_CASE(NonCoinbasePreforwardRTTest)
|
|||||||
stream >> shortIDs2;
|
stream >> shortIDs2;
|
||||||
|
|
||||||
PartiallyDownloadedBlock partialBlock(&pool);
|
PartiallyDownloadedBlock partialBlock(&pool);
|
||||||
BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);
|
BOOST_CHECK(partialBlock.InitData(shortIDs2, empty_extra_txn) == READ_STATUS_OK);
|
||||||
BOOST_CHECK(!partialBlock.IsTxAvailable(0));
|
BOOST_CHECK(!partialBlock.IsTxAvailable(0));
|
||||||
BOOST_CHECK( partialBlock.IsTxAvailable(1));
|
BOOST_CHECK( partialBlock.IsTxAvailable(1));
|
||||||
BOOST_CHECK( partialBlock.IsTxAvailable(2));
|
BOOST_CHECK( partialBlock.IsTxAvailable(2));
|
||||||
@@ -235,7 +235,7 @@ BOOST_AUTO_TEST_CASE(SufficientPreforwardRTTest)
|
|||||||
stream >> shortIDs2;
|
stream >> shortIDs2;
|
||||||
|
|
||||||
PartiallyDownloadedBlock partialBlock(&pool);
|
PartiallyDownloadedBlock partialBlock(&pool);
|
||||||
BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);
|
BOOST_CHECK(partialBlock.InitData(shortIDs2, empty_extra_txn) == READ_STATUS_OK);
|
||||||
BOOST_CHECK( partialBlock.IsTxAvailable(0));
|
BOOST_CHECK( partialBlock.IsTxAvailable(0));
|
||||||
BOOST_CHECK( partialBlock.IsTxAvailable(1));
|
BOOST_CHECK( partialBlock.IsTxAvailable(1));
|
||||||
BOOST_CHECK( partialBlock.IsTxAvailable(2));
|
BOOST_CHECK( partialBlock.IsTxAvailable(2));
|
||||||
@@ -290,7 +290,7 @@ BOOST_AUTO_TEST_CASE(EmptyBlockRoundTripTest)
|
|||||||
stream >> shortIDs2;
|
stream >> shortIDs2;
|
||||||
|
|
||||||
PartiallyDownloadedBlock partialBlock(&pool);
|
PartiallyDownloadedBlock partialBlock(&pool);
|
||||||
BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);
|
BOOST_CHECK(partialBlock.InitData(shortIDs2, empty_extra_txn) == READ_STATUS_OK);
|
||||||
BOOST_CHECK(partialBlock.IsTxAvailable(0));
|
BOOST_CHECK(partialBlock.IsTxAvailable(0));
|
||||||
|
|
||||||
CBlock block2;
|
CBlock block2;
|
||||||
|
Reference in New Issue
Block a user