Skip to content

Commit b308854

Browse files
author
timemarkovqtum
committed
Fix unit tests
1 parent c27e646 commit b308854

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

src/test/data/script_tests.json

Lines changed: 6 additions & 10 deletions
Large diffs are not rendered by default.

src/test/data/tx_valid.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@
321321

322322
["Valid CHECKSEQUENCEVERIFY even with negative tx version number"],
323323
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x7c17aff532f22beb54069942f9bf567a66133eaf EQUAL"]],
324-
"ffffffff01000100000000000000000000000000000000000000000000000000000000000000000000030251b2010000000100000000000000000000000000", "NONE"],
324+
"ffffffff01000100000000000000000000000000000000000000000000000000000000000000000000030251b2010000000100001000000000000000000000", "NONE"],
325325

326326
["Valid P2WPKH (Private key of segwit tests is L5AQtV2HDm4xGsseLokK2VAT2EtYKcTm3c7HwqnJBFt9LdaQULsM)"],
327327
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f", 1000]],

src/test/disconnected_transactions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ BOOST_AUTO_TEST_CASE(disconnectpool_memory_limits)
1616
// transactions would realistically be in a block together, they just need distinct txids and
1717
// uniform size for this test to work.
1818
std::vector<CTransactionRef> block_vtx(m_coinbase_txns);
19-
BOOST_CHECK_EQUAL(block_vtx.size(), 100);
19+
BOOST_CHECK_EQUAL(block_vtx.size(), 2000);
2020

2121
// Roughly estimate sizes to sanity check that DisconnectedBlockTransactions::DynamicMemoryUsage
2222
// is within an expected range.
@@ -25,7 +25,7 @@ BOOST_AUTO_TEST_CASE(disconnectpool_memory_limits)
2525
std::unordered_map<uint256, CTransaction*, SaltedTxidHasher> temp_map;
2626
temp_map.reserve(1);
2727
const size_t MAP_1{memusage::DynamicUsage(temp_map)};
28-
temp_map.reserve(100);
28+
temp_map.reserve(2000);
2929
const size_t MAP_100{memusage::DynamicUsage(temp_map)};
3030

3131
const size_t TX_USAGE{RecursiveDynamicUsage(block_vtx.front())};
@@ -63,7 +63,7 @@ BOOST_AUTO_TEST_CASE(disconnectpool_memory_limits)
6363
// Record usage so we can check size limiting in the next test.
6464
size_t usage_full{0};
6565
{
66-
const size_t USAGE_100_OVERESTIMATE{MAP_100 + ENTRY_USAGE_ESTIMATE * 100};
66+
const size_t USAGE_100_OVERESTIMATE{MAP_100 + ENTRY_USAGE_ESTIMATE * 2000};
6767
DisconnectedBlockTransactions disconnectpool{USAGE_100_OVERESTIMATE};
6868
auto evicted_txns{disconnectpool.AddTransactionsFromBlock(block_vtx)};
6969
BOOST_CHECK_EQUAL(evicted_txns.size(), 0);

src/test/net_peer_connection_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ BOOST_AUTO_TEST_CASE(test_addnode_getaddednodeinfo_and_connection_detection)
9090

9191
// Connect a localhost peer.
9292
{
93-
ASSERT_DEBUG_LOG("Added connection to 127.0.0.1:8333 peer=1");
93+
ASSERT_DEBUG_LOG("Added connection to 127.0.0.1:3888 peer=1");
9494
AddPeer(id, nodes, *peerman, *connman, ConnectionType::MANUAL, /*onion_peer=*/false, /*address=*/"127.0.0.1");
9595
BOOST_REQUIRE(nodes.back() != nullptr);
9696
}
@@ -99,7 +99,7 @@ BOOST_AUTO_TEST_CASE(test_addnode_getaddednodeinfo_and_connection_detection)
9999
// address that resolves to multiple IPs, including that of the connected peer.
100100
// The connection attempt should consistently fail due to the check in ConnectNode().
101101
for (int i = 0; i < 10; ++i) {
102-
ASSERT_DEBUG_LOG("Not opening a connection to localhost, already connected to 127.0.0.1:8333");
102+
ASSERT_DEBUG_LOG("Not opening a connection to localhost, already connected to 127.0.0.1:3888");
103103
BOOST_CHECK(!connman->ConnectNodePublic(*peerman, "localhost", ConnectionType::MANUAL));
104104
}
105105

0 commit comments

Comments
 (0)