Skip to content

Commit

Permalink
Add missing test cases in script_tests.cpp
Browse files Browse the repository at this point in the history
Summary: Some tests case were present in script_tests.json but missing from script_tests.cpp . This is fixing that error.

Test Plan:
  make check

Reviewers: #bitcoin_abc, schancel

Reviewed By: #bitcoin_abc, schancel

Subscribers: teamcity

Differential Revision: https://reviews.bitcoinabc.org/D1197
  • Loading branch information
deadalnix committed Mar 15, 2018
1 parent ce813ee commit baa5745
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/script_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,24 @@ BOOST_AUTO_TEST_CASE(script_build) {
"BIP66 example 4, with DERSIG",
SCRIPT_VERIFY_DERSIG)
.Num(0));
tests.push_back(
TestBuilder(
CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG << OP_NOT,
"BIP66 example 4, with DERSIG, non-null DER-compliant signature",
SCRIPT_VERIFY_DERSIG)
.Push("300602010102010101"));
tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C)
<< OP_CHECKSIG << OP_NOT,
"BIP66 example 4, with DERSIG and NULLFAIL",
SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_NULLFAIL)
.Num(0));
tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C)
<< OP_CHECKSIG << OP_NOT,
"BIP66 example 4, with DERSIG and NULLFAIL, "
"non-null DER-compliant signature",
SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_NULLFAIL)
.Push("300602010102010101")
.ScriptError(SCRIPT_ERR_SIG_NULLFAIL));
tests.push_back(
TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG,
"BIP66 example 5, without DERSIG", 0)
Expand Down

0 comments on commit baa5745

Please sign in to comment.