Skip to content

Commit a260c22

Browse files
committed
[test] Check for invalid flag combinations
1 parent a7098a2 commit a260c22

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/test/transaction_tests.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ BOOST_AUTO_TEST_CASE(tx_valid)
222222
PrecomputedTransactionData txdata(tx);
223223
unsigned int verify_flags = ParseScriptFlags(test[2].get_str());
224224

225+
// Check that the test gives a valid combination of flags (otherwise VerifyScript will throw). Don't edit the flags.
226+
if (~verify_flags != FillFlags(~verify_flags)) {
227+
BOOST_ERROR("Bad test flags: " << strTest);
228+
}
229+
225230
if (!CheckTxScripts(tx, mapprevOutScriptPubKeys, mapprevOutValues, ~verify_flags, txdata, strTest, /* expect_valid */ true)) {
226231
BOOST_ERROR("Tx unexpectedly failed: " << strTest);
227232
}

0 commit comments

Comments
 (0)