Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Test for expected return values when calling functions returning a success code #2464

Merged
merged 1 commit into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/test/dos_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans)
CKey key;
key.MakeNewKey(true);
CBasicKeyStore keystore;
keystore.AddKey(key);
BOOST_CHECK(keystore.AddKey(key));

// 50 orphan transactions:
for (int i = 0; i < 50; i++)
Expand Down Expand Up @@ -165,7 +165,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans)
tx.vout.resize(1);
tx.vout[0].nValue = 1*CENT;
tx.vout[0].scriptPubKey.SetDestination(key.GetPubKey().GetID());
SignSignature(keystore, txPrev, tx, 0);
BOOST_CHECK(SignSignature(keystore, txPrev, tx, 0));
AddOrphanTx(tx);
}

Expand All @@ -184,7 +184,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans)
tx.vin[j].prevout.n = j;
tx.vin[j].prevout.hash = txPrev.GetHash();
}
SignSignature(keystore, txPrev, tx, 0);
BOOST_CHECK(SignSignature(keystore, txPrev, tx, 0));
// Re-use same signature for other inputs
// (they don't have to be valid for this test)
for (unsigned int j = 1; j < tx.vin.size(); j++)
Expand All @@ -210,7 +210,7 @@ BOOST_AUTO_TEST_CASE(DoS_checkSig)
CKey key;
key.MakeNewKey(true);
CBasicKeyStore keystore;
keystore.AddKey(key);
BOOST_CHECK(keystore.AddKey(key));

// 100 orphan transactions:
static const int NPREV=100;
Expand Down
2 changes: 1 addition & 1 deletion src/test/multisig_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ BOOST_AUTO_TEST_CASE(multisig_Sign)
for (int i = 0; i < 4; i++)
{
key[i].MakeNewKey(true);
keystore.AddKey(key[i]);
BOOST_CHECK(keystore.AddKey(key[i]));
}

CScript a_and_b;
Expand Down