Skip to content

Commit

Permalink
Ensure MINIMALDATA invalid tests can only fail one way
Browse files Browse the repository at this point in the history
Removes the need for the 'negated' versions of the tests, and ensures
other failures don't mask what we're trying to test.
  • Loading branch information
petertodd authored and sipa committed Oct 25, 2014
1 parent 6004e77 commit 554147a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/data/script_invalid.json
Expand Up @@ -384,6 +384,18 @@ nSequences are max.

["0x00", "'00' EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"],

["0x01 0x81", "DROP 1", "MINIMALDATA", "direct push of 0x81 equals 1NEGATE"],
["0x01 0x05", "DROP 1", "MINIMALDATA", "direct push of 0x05 equals 5"],
["0x4c 0x48 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "DROP 1", "MINIMALDATA", "PUSHDATA1 of 72 bytes equals direct push of it"],
["0x4d 0xFF00 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "DROP 1", "MINIMALDATA", "PUSHDATA2 of 255 bytes equals PUSHDATA1 of it"],
["0x01 0x00", "NOT DROP 1", "MINIMALDATA", "0x00 numequals 0"],
["0x01 0x80", "NOT DROP 1", "MINIMALDATA", "0x80 (negative zero) numequals 0"],
["0x02 0x0080", "NOT DROP 1", "MINIMALDATA", "0x0080 numequals 0"],
["0x02 0x0500", "NOT DROP 1", "MINIMALDATA", "0x0500 numequals 5"],
["0x03 0xff7f80", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is ffff"],
["0x03 0xff7f00", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is ff7f"],
["0x04 0xffff7f80", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is ffffff"],
["0x04 0xffff7f00", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is ffff7f"],
["1 IF 0x01 0x81 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"],
["1 IF 0x01 0x05 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"],
["1 IF 0x4c 0x03 0x222222 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"],
Expand Down

0 comments on commit 554147a

Please sign in to comment.