Skip to content

Commit 9a02781

Browse files
fanquakePastaPastaPasta
authored andcommitted
Merge bitcoin#21228: test: Avoid comparision of integers with different signs
bedb8d8 Avoid comparision of integers with different signs (Jonas Schnelli) Pull request description: Fixes an integer comparison of different signs (which errors out on `-Werror,-Wsign-compare`). Introduced in bitcoin#21121. See https://bitcoinbuilds.org/index.php?ansilog=982c61cf-6969-4001-bebc-dc215e5d29a4.log ACKs for top commit: MarcoFalke: review ACK bedb8d8 amitiuttarwar: ACK bedb8d8 vasild: ACK bedb8d8 Tree-SHA512: cb22a6239a1fc9d0be5573bf6ae4ec379eb7398c88edc8fa2ae4fd721f37f9ca3724896c1ac16de14a5286888a0b631813da32cb62d177ffbf9b2c31e716a7aa
1 parent 0ad1066 commit 9a02781

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test/miner_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void MinerTestingSetup::TestPackageSelection(const CChainParams& chainparams, co
137137
m_node.mempool->addUnchecked(entry.Fee(50000).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));
138138

139139
std::unique_ptr<CBlockTemplate> pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey);
140-
BOOST_REQUIRE_EQUAL(pblocktemplate->block.vtx.size(), 4);
140+
BOOST_REQUIRE_EQUAL(pblocktemplate->block.vtx.size(), 4U);
141141
BOOST_CHECK(pblocktemplate->block.vtx[1]->GetHash() == hashParentTx);
142142
BOOST_CHECK(pblocktemplate->block.vtx[2]->GetHash() == hashHighFeeTx);
143143
BOOST_CHECK(pblocktemplate->block.vtx[3]->GetHash() == hashMediumFeeTx);
@@ -172,7 +172,7 @@ void MinerTestingSetup::TestPackageSelection(const CChainParams& chainparams, co
172172
hashLowFeeTx = tx.GetHash();
173173
m_node.mempool->addUnchecked(entry.Fee(feeToUse+2).FromTx(tx));
174174
pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey);
175-
BOOST_REQUIRE_EQUAL(pblocktemplate->block.vtx.size(), 6);
175+
BOOST_REQUIRE_EQUAL(pblocktemplate->block.vtx.size(), 6U);
176176
BOOST_CHECK(pblocktemplate->block.vtx[4]->GetHash() == hashFreeTx);
177177
BOOST_CHECK(pblocktemplate->block.vtx[5]->GetHash() == hashLowFeeTx);
178178

@@ -207,7 +207,7 @@ void MinerTestingSetup::TestPackageSelection(const CChainParams& chainparams, co
207207
tx.vout[0].nValue = 100000000 - 10000; // 10k satoshi fee
208208
m_node.mempool->addUnchecked(entry.Fee(10000).FromTx(tx));
209209
pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey);
210-
BOOST_REQUIRE_EQUAL(pblocktemplate->block.vtx.size(), 9);
210+
BOOST_REQUIRE_EQUAL(pblocktemplate->block.vtx.size(), 9U);
211211
BOOST_CHECK(pblocktemplate->block.vtx[8]->GetHash() == hashLowFeeTx2);
212212
}
213213

0 commit comments

Comments
 (0)