diff --git a/test/examples/dispatch/Revert.json b/test/examples/dispatch/Revert.json index a82bdee2..b971e27f 100644 --- a/test/examples/dispatch/Revert.json +++ b/test/examples/dispatch/Revert.json @@ -5,6 +5,7 @@ "tests": [ { "input": { + "comment": "constructor()", "calldata": "", "value": "0" }, @@ -12,7 +13,7 @@ }, { "input": { - "text-calldata": "noAnswer()", + "comment": "noAnswer()", "calldata": "08ad856f", "value": "0" }, @@ -24,7 +25,7 @@ }, { "input": { - "text-calldata": "answer()(uint256)", + "comment": "answer()(uint256)", "calldata": "85bb7d69", "value": "0" }, diff --git a/test/examples/dispatch/basic.json b/test/examples/dispatch/basic.json index 3e60ff04..8ca54c78 100644 --- a/test/examples/dispatch/basic.json +++ b/test/examples/dispatch/basic.json @@ -5,6 +5,7 @@ "tests": [ { "input": { + "comment": "constructor()", "calldata": "", "value": "0" }, @@ -12,7 +13,7 @@ }, { "input": { - "text-calldata": "nothing()", + "comment": "nothing()", "calldata": "448f30a3", "value": "0" }, @@ -24,7 +25,7 @@ }, { "input": { - "text-calldata": "something()(uint256)", + "comment": "something()(uint256)", "calldata": "a7a0d537", "value": "0" }, @@ -36,7 +37,7 @@ }, { "input": { - "text-calldata": "add2(uint256,uint256)(uint256) 2 3", + "comment": "add2(uint256,uint256)(uint256) 2 3", "calldata": "0x29fcda3300000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003", "value": "0" }, @@ -48,7 +49,7 @@ }, { "input": { - "text-calldata": "add3(uint256,uint256,uint256)(uint256) 2 3 4", + "comment": "add3(uint256,uint256,uint256)(uint256) 2 3 4", "calldata": "0x3faee853000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000004", "value": "0" }, @@ -60,19 +61,19 @@ }, { "input": { - "text-calldata": "id_bytes32(bytes32) -> (bytes32)", - "calldata":"0x10a4b2d4deadbeefcafebabe000000000000000000000000000000000000000000000000", + "comment": "id_bytes32(bytes32) -> (bytes32)", + "calldata": "0x10a4b2d4deadbeefcafebabe000000000000000000000000000000000000000000000000", "value": "0" }, "kind": "call", "output": { - "returndata":"deadbeefcafebabe000000000000000000000000000000000000000000000000", + "returndata": "deadbeefcafebabe000000000000000000000000000000000000000000000000", "status": "success" } }, { "input": { - "text-calldata": "id_pair()(uint256,uint256)", + "comment": "id_pair()(uint256,uint256)", "calldata": "5880a1a0", "value": "0" }, @@ -84,121 +85,121 @@ }, { "input": { - "text-calldata": "id_bytes(bytes) -> (bytes)", - "calldata":"0xbb1ec80900000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000", + "comment": "id_bytes(bytes) -> (bytes)", + "calldata": "0xbb1ec80900000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000", "value": "0" }, "kind": "call", "output": { - "returndata":"00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000", + "returndata": "00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000", "status": "success" } }, { "input": { - "text-calldata": "id_string(string) -> (string)", - "calldata":"0x145ef75500000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000", + "comment": "id_string(string) -> (string)", + "calldata": "0x145ef75500000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000", "value": "0" }, "kind": "call", "output": { - "returndata":"00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000", + "returndata": "00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000", "status": "success" } }, { "input": { - "text-calldata": "id_bytes(bytes) with offset but no length/content (head OK, tail truncated)", - "calldata":"0xbb1ec8090000000000000000000000000000000000000000000000000000000000000020", + "comment": "id_bytes(bytes) with offset but no length/content (head OK, tail truncated)", + "calldata": "0xbb1ec8090000000000000000000000000000000000000000000000000000000000000020", "value": "0" }, "kind": "call", "output": { - "returndata":"00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000", + "returndata": "00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000", "status": "success" } }, { "input": { - "text-calldata": "id_string(string) with offset+length=4 but content truncated", - "calldata":"0x145ef75500000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004", + "comment": "id_string(string) with offset+length=4 but content truncated", + "calldata": "0x145ef75500000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004", "value": "0" }, "kind": "call", "output": { - "returndata":"000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000", + "returndata": "000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000", "status": "success" } }, { "input": { - "text-calldata": "selector too short (same error as missing fallback)", - "calldata":"c0de", + "comment": "selector too short (same error as missing fallback)", + "calldata": "c0de", "value": "0" }, "kind": "call", "output": { - "returndata":"4924aef0", + "returndata": "4924aef0", "status": "failure" } }, { "input": { - "text-calldata": "empty calldata (cdsz == 0) -- the 'plain ETH transfer' shape", - "calldata":"", + "comment": "empty calldata (cdsz == 0) -- the 'plain ETH transfer' shape", + "calldata": "", "value": "0" }, "kind": "call", "output": { - "returndata":"4924aef0", + "returndata": "4924aef0", "status": "failure" } }, { "input": { - "text-calldata": "abi data too short -- using id_string(string)", - "calldata":"145ef755", + "comment": "abi data too short -- using id_string(string)", + "calldata": "145ef755", "value": "0" }, "kind": "call", "output": { - "returndata":"08638556", + "returndata": "08638556", "status": "failure" } }, { "input": { - "text-calldata": "value sent for non-payable function", - "calldata":"a7a0d537", + "comment": "value sent for non-payable function", + "calldata": "a7a0d537", "value": "42" }, "kind": "call", "output": { - "returndata":"b5988ea3", + "returndata": "b5988ea3", "status": "failure" } }, { "input": { - "text-calldata": "missing fallback", - "calldata":"deadc0de", + "comment": "missing fallback", + "calldata": "deadc0de", "value": "0" }, "kind": "call", "output": { - "returndata":"4924aef0", + "returndata": "4924aef0", "status": "failure" } }, { "input": { - "text-calldata": "non-public hidden() must not be dispatched", - "calldata":"aef6d4b1", + "comment": "non-public hidden() must not be dispatched", + "calldata": "aef6d4b1", "value": "0" }, "kind": "call", "output": { - "returndata":"4924aef0", + "returndata": "4924aef0", "status": "failure" } } diff --git a/test/examples/dispatch/concat.json b/test/examples/dispatch/concat.json index 72f55105..322a6d9e 100644 --- a/test/examples/dispatch/concat.json +++ b/test/examples/dispatch/concat.json @@ -5,6 +5,7 @@ "tests": [ { "input": { + "comment": "constructor()", "calldata": "", "value": "0" }, @@ -12,7 +13,7 @@ }, { "input": { - "text-calldata": "concat_b32_b32(bytes32,bytes32) -> (bytes)", + "comment": "concat_b32_b32(bytes32,bytes32) -> (bytes)", "calldata": "edfc70fd11111111111111111111111111111111111111111111111111111111111111112222222222222222222222222222222222222222222222222222222222222222", "value": "0" }, @@ -24,7 +25,7 @@ }, { "input": { - "text-calldata": "concat_b32_bytes(bytes32,bytes) -> (bytes) with 0xaa..aa and 0xdeadbeef", + "comment": "concat_b32_bytes(bytes32,bytes) -> (bytes) with 0xaa..aa and 0xdeadbeef", "calldata": "6a43d85aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -36,7 +37,7 @@ }, { "input": { - "text-calldata": "concat_b32_bytes(bytes32,bytes) -> (bytes) with 0xaa..aa and 33 bytes of 0xdd", + "comment": "concat_b32_bytes(bytes32,bytes) -> (bytes) with 0xaa..aa and 33 bytes of 0xdd", "calldata": "6a43d85aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000021dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd00000000000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -48,7 +49,7 @@ }, { "input": { - "text-calldata": "concat_b32_bytes(bytes32,bytes) -> (bytes) with 0xaa..aa and 64 bytes of 0xee", + "comment": "concat_b32_bytes(bytes32,bytes) -> (bytes) with 0xaa..aa and 64 bytes of 0xee", "calldata": "6a43d85aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "value": "0" }, @@ -60,7 +61,7 @@ }, { "input": { - "text-calldata": "concat_bytes_bytes(bytes,bytes) -> (bytes) with 0xdeadbeef and 0xcafebabe", + "comment": "concat_bytes_bytes(bytes,bytes) -> (bytes) with 0xdeadbeef and 0xcafebabe", "calldata": "3ccf57db000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000004deadbeef000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004cafebabe00000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -72,7 +73,7 @@ }, { "input": { - "text-calldata": "concat_bytes_bytes(bytes,bytes) -> (bytes) with 33 bytes of 0x11 and 64 bytes of 0x22", + "comment": "concat_bytes_bytes(bytes,bytes) -> (bytes) with 33 bytes of 0x11 and 64 bytes of 0x22", "calldata": "3ccf57db000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000002111111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004022222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222", "value": "0" }, @@ -84,7 +85,7 @@ }, { "input": { - "text-calldata": "to_bytes_b32(bytes32) -> (bytes) with 0xcc..cc", + "comment": "to_bytes_b32(bytes32) -> (bytes) with 0xcc..cc", "calldata": "1b08db15cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "value": "0" }, @@ -96,7 +97,7 @@ }, { "input": { - "text-calldata": "to_bytes_bytes(bytes) -> (bytes) with 0xdeadbeef", + "comment": "to_bytes_bytes(bytes) -> (bytes) with 0xdeadbeef", "calldata": "6be8c51100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -108,7 +109,7 @@ }, { "input": { - "text-calldata": "to_bytes_bytes(bytes) -> (bytes) with 32 bytes of 0x33", + "comment": "to_bytes_bytes(bytes) -> (bytes) with 32 bytes of 0x33", "calldata": "6be8c511000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000203333333333333333333333333333333333333333333333333333333333333333", "value": "0" }, @@ -120,7 +121,7 @@ }, { "input": { - "text-calldata": "to_bytes_bytes(bytes) -> (bytes) with 33 bytes of 0x11", + "comment": "to_bytes_bytes(bytes) -> (bytes) with 33 bytes of 0x11", "calldata": "6be8c5110000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002111111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -132,7 +133,7 @@ }, { "input": { - "text-calldata": "to_bytes_bytes(bytes) -> (bytes) with 64 bytes of 0x22", + "comment": "to_bytes_bytes(bytes) -> (bytes) with 64 bytes of 0x22", "calldata": "6be8c5110000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004022222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222", "value": "0" }, @@ -144,7 +145,7 @@ }, { "input": { - "text-calldata": "empty_area(uint256) -> (bytes) with n=8", + "comment": "empty_area(uint256) -> (bytes) with n=8", "calldata": "5defe8dc0000000000000000000000000000000000000000000000000000000000000008", "value": "0" }, @@ -156,7 +157,7 @@ }, { "input": { - "text-calldata": "empty_area(uint256) -> (bytes) with n=0", + "comment": "empty_area(uint256) -> (bytes) with n=0", "calldata": "5defe8dc0000000000000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -168,7 +169,7 @@ }, { "input": { - "text-calldata": "concat_b32_empty(bytes32,uint256) -> (bytes) with 0xbb..bb and n=16", + "comment": "concat_b32_empty(bytes32,uint256) -> (bytes) with 0xbb..bb and n=16", "calldata": "002a099abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0000000000000000000000000000000000000000000000000000000000000010", "value": "0" }, @@ -180,7 +181,7 @@ }, { "input": { - "text-calldata": "concat_b32_empty(bytes32,uint256) -> (bytes) with 0xbb..bb and n=1", + "comment": "concat_b32_empty(bytes32,uint256) -> (bytes) with 0xbb..bb and n=1", "calldata": "002a099abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0000000000000000000000000000000000000000000000000000000000000001", "value": "0" }, @@ -192,7 +193,7 @@ }, { "input": { - "text-calldata": "concat_b32_empty(bytes32,uint256) -> (bytes) with 0xbb..bb and n=32", + "comment": "concat_b32_empty(bytes32,uint256) -> (bytes) with 0xbb..bb and n=32", "calldata": "002a099abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0000000000000000000000000000000000000000000000000000000000000020", "value": "0" }, @@ -204,7 +205,7 @@ }, { "input": { - "text-calldata": "concat_b32_empty(bytes32,uint256) -> (bytes) with 0xbb..bb and n=33", + "comment": "concat_b32_empty(bytes32,uint256) -> (bytes) with 0xbb..bb and n=33", "calldata": "002a099abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0000000000000000000000000000000000000000000000000000000000000021", "value": "0" }, @@ -216,7 +217,7 @@ }, { "input": { - "text-calldata": "concat_b32_empty(bytes32,uint256) -> (bytes) with 0xbb..bb and n=64", + "comment": "concat_b32_empty(bytes32,uint256) -> (bytes) with 0xbb..bb and n=64", "calldata": "002a099abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0000000000000000000000000000000000000000000000000000000000000040", "value": "0" }, @@ -228,7 +229,7 @@ }, { "input": { - "text-calldata": "concat_nested_b32(bytes32,bytes32,bytes32) -> (bytes) with 0x11.., 0x22.., 0x33..", + "comment": "concat_nested_b32(bytes32,bytes32,bytes32) -> (bytes) with 0x11.., 0x22.., 0x33..", "calldata": "fb6e9fc2111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222223333333333333333333333333333333333333333333333333333333333333333", "value": "0" }, @@ -240,7 +241,7 @@ }, { "input": { - "text-calldata": "concat_nested_empty(bytes32,uint256,bytes32) -> (bytes) with 0x11.., n=8, 0x33..", + "comment": "concat_nested_empty(bytes32,uint256,bytes32) -> (bytes) with 0x11.., n=8, 0x33..", "calldata": "dc7e53eb111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000083333333333333333333333333333333333333333333333333333333333333333", "value": "0" }, diff --git a/test/examples/dispatch/ecrecover.json b/test/examples/dispatch/ecrecover.json index 8d39fff0..b0df3f2c 100644 --- a/test/examples/dispatch/ecrecover.json +++ b/test/examples/dispatch/ecrecover.json @@ -5,6 +5,7 @@ "tests": [ { "input": { + "comment": "constructor()", "calldata": "", "value": "0" }, @@ -12,7 +13,7 @@ }, { "input": { - "text-calldata": "recover()(address)", + "comment": "recover()(address)", "calldata": "ce746024", "value": "0" }, @@ -24,7 +25,7 @@ }, { "input": { - "text-calldata": "recoverFail()(address)", + "comment": "recoverFail()(address)", "calldata": "75ebe7ac", "value": "0" }, diff --git a/test/examples/dispatch/fallback.json b/test/examples/dispatch/fallback.json index 5053ede0..1eece7cb 100644 --- a/test/examples/dispatch/fallback.json +++ b/test/examples/dispatch/fallback.json @@ -5,6 +5,7 @@ "tests": [ { "input": { + "comment": "constructor()", "calldata": "", "value": "0" }, @@ -12,7 +13,7 @@ }, { "input": { - "text-calldata": "answer()(uint256)", + "comment": "answer()(uint256)", "calldata": "85bb7d69", "value": "0" }, @@ -24,7 +25,7 @@ }, { "input": { - "text-calldata": "no selector -- user-defined fallback runs and reverts", + "comment": "no selector -- user-defined fallback runs and reverts", "calldata": "", "value": "0" }, @@ -36,7 +37,7 @@ }, { "input": { - "text-calldata": "unknown selector -- user-defined fallback runs and reverts", + "comment": "unknown selector -- user-defined fallback runs and reverts", "calldata": "deadc0de", "value": "0" }, @@ -48,7 +49,7 @@ }, { "input": { - "text-calldata": "unknown selector with value -- payable fallback runs and reverts", + "comment": "unknown selector with value -- payable fallback runs and reverts", "calldata": "deadc0de", "value": "42" }, diff --git a/test/examples/dispatch/generic_product.json b/test/examples/dispatch/generic_product.json index b1cb49c4..9eba976e 100644 --- a/test/examples/dispatch/generic_product.json +++ b/test/examples/dispatch/generic_product.json @@ -12,7 +12,7 @@ }, { "input": { - "text-calldata": "encodeX(3, 7) -> 3", + "comment": "encodeX(3, 7) -> 3", "calldata": "0x0dbc6e9b00000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000007", "value": "0" }, @@ -24,7 +24,7 @@ }, { "input": { - "text-calldata": "encodeY(3, 7) -> 7", + "comment": "encodeY(3, 7) -> 7", "calldata": "0xe9c28f9600000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000007", "value": "0" }, @@ -36,7 +36,7 @@ }, { "input": { - "text-calldata": "decodeX(10, 20) -> 10", + "comment": "decodeX(10, 20) -> 10", "calldata": "0x0e3fc16f000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000014", "value": "0" }, diff --git a/test/examples/dispatch/generic_sum.json b/test/examples/dispatch/generic_sum.json index acd99eca..fcf51aa8 100644 --- a/test/examples/dispatch/generic_sum.json +++ b/test/examples/dispatch/generic_sum.json @@ -12,7 +12,7 @@ }, { "input": { - "text-calldata": "encodeNone() -> 0", + "comment": "encodeNone() -> 0", "calldata": "cc5ae1e8", "value": "0" }, @@ -24,7 +24,7 @@ }, { "input": { - "text-calldata": "encodeSomeTag(42) -> 1", + "comment": "encodeSomeTag(42) -> 1", "calldata": "0xef5d5c21000000000000000000000000000000000000000000000000000000000000002a", "value": "0" }, @@ -36,7 +36,7 @@ }, { "input": { - "text-calldata": "encodePayload(99) -> 99", + "comment": "encodePayload(99) -> 99", "calldata": "0x342242e80000000000000000000000000000000000000000000000000000000000000063", "value": "0" }, @@ -48,7 +48,7 @@ }, { "input": { - "text-calldata": "decodeAndGet(tag=1, value=77) -> 77", + "comment": "decodeAndGet(tag=1, value=77) -> 77", "calldata": "0xc222f3f50000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004d", "value": "0" }, @@ -60,7 +60,7 @@ }, { "input": { - "text-calldata": "decodeAndGet(tag=0, value=0) -> 0 (None)", + "comment": "decodeAndGet(tag=0, value=0) -> 0 (None)", "calldata": "0xc222f3f500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "value": "0" }, diff --git a/test/examples/dispatch/hashes.json b/test/examples/dispatch/hashes.json index c7ef7297..01f31483 100644 --- a/test/examples/dispatch/hashes.json +++ b/test/examples/dispatch/hashes.json @@ -5,6 +5,7 @@ "tests": [ { "input": { + "comment": "constructor()", "calldata": "", "value": "0" }, @@ -12,7 +13,7 @@ }, { "input": { - "text-calldata": "keccak()(bytes32)", + "comment": "keccak()(bytes32)", "calldata": "775dec49", "value": "0" }, @@ -24,7 +25,7 @@ }, { "input": { - "text-calldata": "sha()(bytes32)", + "comment": "sha()(bytes32)", "calldata": "65707d6f", "value": "0" }, @@ -36,7 +37,7 @@ }, { "input": { - "text-calldata": "ripemd()(bytes32)", + "comment": "ripemd()(bytes32)", "calldata": "a1e754ea", "value": "0" }, diff --git a/test/examples/dispatch/memory.json b/test/examples/dispatch/memory.json index 622f63db..15535880 100644 --- a/test/examples/dispatch/memory.json +++ b/test/examples/dispatch/memory.json @@ -5,6 +5,7 @@ "tests": [ { "input": { + "comment": "constructor()", "calldata": "", "value": "0" }, @@ -12,7 +13,7 @@ }, { "input": { - "text-calldata": "dirty_allocate() -> (bytes)", + "comment": "dirty_allocate() -> (bytes)", "calldata": "9abc6cd9", "value": "0" }, @@ -24,7 +25,7 @@ }, { "input": { - "text-calldata": "clear_allocate() -> (bytes)", + "comment": "clear_allocate() -> (bytes)", "calldata": "a33a0cf7", "value": "0" }, diff --git a/test/examples/dispatch/miniERC20.json b/test/examples/dispatch/miniERC20.json index 5a751462..2e802994 100644 --- a/test/examples/dispatch/miniERC20.json +++ b/test/examples/dispatch/miniERC20.json @@ -1,17 +1,16 @@ { "miniERC20": { "bytecode": "_CODE", - "contract": "MiniERC20", + "contract": "MiniERC20", "tests": [ { - "input": { + "input": { "comment": "'constructor(string,string,uint)' Argot ARG 1000", "calldata": "000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000000000054172676f7400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034152470000000000000000000000000000000000000000000000000000000000", "value": "0" }, "kind": "constructor" }, - { "input": { "comment": "transfer(address,uint)(bool) $ANVIL1 958", @@ -24,12 +23,11 @@ "status": "success" } }, - { "input": { - "comment": "getMyBalance()", - "calldata": "0x4c738909", - "value": "0" + "comment": "getMyBalance()", + "calldata": "0x4c738909", + "value": "0" }, "kind": "call", "output": { @@ -38,6 +36,5 @@ } } ] - } } diff --git a/test/examples/dispatch/neg.json b/test/examples/dispatch/neg.json index c92c13a4..0263f53b 100644 --- a/test/examples/dispatch/neg.json +++ b/test/examples/dispatch/neg.json @@ -5,6 +5,7 @@ "tests": [ { "input": { + "comment": "constructor()", "calldata": "", "value": "0" }, @@ -12,9 +13,9 @@ }, { "input": { - "text-calldata": "negPair()", - "calldata": "ce61a134", - "value": "0" + "comment": "negPair()", + "calldata": "ce61a134", + "value": "0" }, "kind": "call", "output": { diff --git a/test/examples/dispatch/nonpayable_ctor.json b/test/examples/dispatch/nonpayable_ctor.json index 6a046aea..ae124993 100644 --- a/test/examples/dispatch/nonpayable_ctor.json +++ b/test/examples/dispatch/nonpayable_ctor.json @@ -5,7 +5,7 @@ "tests": [ { "input": { - "text-calldata": "non-payable constructor rejects incoming value", + "comment": "non-payable constructor rejects incoming value", "calldata": "", "value": "42" }, diff --git a/test/examples/dispatch/payable.json b/test/examples/dispatch/payable.json index 61379398..703dfe1f 100644 --- a/test/examples/dispatch/payable.json +++ b/test/examples/dispatch/payable.json @@ -5,7 +5,7 @@ "tests": [ { "input": { - "text-calldata": "non-payable constructor accepts zero value", + "comment": "non-payable constructor accepts zero value", "calldata": "", "value": "0" }, @@ -16,7 +16,7 @@ }, { "input": { - "text-calldata": "deposit()(uint256)", + "comment": "deposit()(uint256)", "calldata": "d0e30db0", "value": "42" }, @@ -28,7 +28,7 @@ }, { "input": { - "text-calldata": "deposit()(uint256)", + "comment": "deposit()(uint256)", "calldata": "d0e30db0", "value": "0" }, @@ -40,7 +40,7 @@ }, { "input": { - "text-calldata": "balance()(uint256)", + "comment": "balance()(uint256)", "calldata": "b69ef8a8", "value": "0" }, @@ -52,7 +52,7 @@ }, { "input": { - "text-calldata": "balance()(uint256)", + "comment": "balance()(uint256)", "calldata": "b69ef8a8", "value": "42" }, @@ -64,7 +64,7 @@ }, { "input": { - "text-calldata": "fallback with value", + "comment": "fallback with value", "calldata": "deadc0de", "value": "42" }, @@ -76,7 +76,7 @@ }, { "input": { - "text-calldata": "fallback without value should fail", + "comment": "fallback without value should fail", "calldata": "deadc0de", "value": "0" }, @@ -88,7 +88,7 @@ }, { "input": { - "text-calldata": "balance()(uint256)", + "comment": "balance()(uint256)", "calldata": "b69ef8a8", "value": "0" }, diff --git a/test/examples/dispatch/payable_ctor.json b/test/examples/dispatch/payable_ctor.json index 883d560f..05293f8f 100644 --- a/test/examples/dispatch/payable_ctor.json +++ b/test/examples/dispatch/payable_ctor.json @@ -5,7 +5,7 @@ "tests": [ { "input": { - "text-calldata": "payable constructor accepts value", + "comment": "payable constructor accepts value", "calldata": "", "value": "42" }, @@ -16,7 +16,7 @@ }, { "input": { - "text-calldata": "balance()(uint256) -- value sent at deploy was retained", + "comment": "balance()(uint256) -- value sent at deploy was retained", "calldata": "b69ef8a8", "value": "0" }, diff --git a/test/examples/dispatch/slices.json b/test/examples/dispatch/slices.json index 75381c9c..7eb70770 100644 --- a/test/examples/dispatch/slices.json +++ b/test/examples/dispatch/slices.json @@ -5,6 +5,7 @@ "tests": [ { "input": { + "comment": "constructor()", "calldata": "", "value": "0" }, @@ -12,7 +13,7 @@ }, { "input": { - "text-calldata": "slice_bytes: drop 4 of deadbeefcafebabe -> cafebabe", + "comment": "slice_bytes: drop 4 of deadbeefcafebabe -> cafebabe", "calldata": "3b613aed000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008deadbeefcafebabe000000000000000000000000000000000000000000000000", "value": "0" }, @@ -24,7 +25,7 @@ }, { "input": { - "text-calldata": "slice_bytes: drop 1 of 33x11 -> 32x11 (crosses word)", + "comment": "slice_bytes: drop 1 of 33x11 -> 32x11 (crosses word)", "calldata": "3b613aed00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002111111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -36,7 +37,7 @@ }, { "input": { - "text-calldata": "slice_bytes: start=0 identity", + "comment": "slice_bytes: start=0 identity", "calldata": "3b613aed000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -48,7 +49,7 @@ }, { "input": { - "text-calldata": "slice_bytes: start=len -> empty", + "comment": "slice_bytes: start=len -> empty", "calldata": "3b613aed000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -60,7 +61,7 @@ }, { "input": { - "text-calldata": "slice_bytes: start>len reverts OutOfBounds", + "comment": "slice_bytes: start>len reverts OutOfBounds", "calldata": "3b613aed000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -72,7 +73,7 @@ }, { "input": { - "text-calldata": "truncate_bytes: keep 4 of deadbeefcafebabe -> deadbeef", + "comment": "truncate_bytes: keep 4 of deadbeefcafebabe -> deadbeef", "calldata": "3fa275ea000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008deadbeefcafebabe000000000000000000000000000000000000000000000000", "value": "0" }, @@ -84,7 +85,7 @@ }, { "input": { - "text-calldata": "truncate_bytes: keep 33 of 64x22", + "comment": "truncate_bytes: keep 33 of 64x22", "calldata": "3fa275ea00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000021000000000000000000000000000000000000000000000000000000000000004022222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222", "value": "0" }, @@ -96,7 +97,7 @@ }, { "input": { - "text-calldata": "truncate_bytes: end=len identity", + "comment": "truncate_bytes: end=len identity", "calldata": "3fa275ea000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -108,7 +109,7 @@ }, { "input": { - "text-calldata": "truncate_bytes: end=0 -> empty", + "comment": "truncate_bytes: end=0 -> empty", "calldata": "3fa275ea000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -120,7 +121,7 @@ }, { "input": { - "text-calldata": "truncate_bytes: end>len reverts OutOfBounds", + "comment": "truncate_bytes: end>len reverts OutOfBounds", "calldata": "3fa275ea000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -132,7 +133,7 @@ }, { "input": { - "text-calldata": "slice_of_concat: drop first word -> 32x22", + "comment": "slice_of_concat: drop first word -> 32x22", "calldata": "dabdb8e2111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222220000000000000000000000000000000000000000000000000000000000000020", "value": "0" }, @@ -144,7 +145,7 @@ }, { "input": { - "text-calldata": "slice_of_concat: drop 16 -> 16x11 ++ 32x22", + "comment": "slice_of_concat: drop 16 -> 16x11 ++ 32x22", "calldata": "dabdb8e2111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222220000000000000000000000000000000000000000000000000000000000000010", "value": "0" }, @@ -156,7 +157,7 @@ }, { "input": { - "text-calldata": "slice_of_concat: start=0 identity (64B)", + "comment": "slice_of_concat: start=0 identity (64B)", "calldata": "dabdb8e2111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222220000000000000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -168,7 +169,7 @@ }, { "input": { - "text-calldata": "truncate_of_concat: keep first word -> 32x11", + "comment": "truncate_of_concat: keep first word -> 32x11", "calldata": "b785ff09111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222220000000000000000000000000000000000000000000000000000000000000020", "value": "0" }, @@ -180,7 +181,7 @@ }, { "input": { - "text-calldata": "truncate_of_concat: keep 48 -> 32x11 ++ 16x22", + "comment": "truncate_of_concat: keep 48 -> 32x11 ++ 16x22", "calldata": "b785ff09111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222220000000000000000000000000000000000000000000000000000000000000030", "value": "0" }, @@ -192,7 +193,7 @@ }, { "input": { - "text-calldata": "truncate_of_concat: end=len identity", + "comment": "truncate_of_concat: end=len identity", "calldata": "b785ff09111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222220000000000000000000000000000000000000000000000000000000000000040", "value": "0" }, @@ -204,7 +205,7 @@ }, { "input": { - "text-calldata": "window_of_concat: [16:48] straddles word -> 16x11 ++ 16x22", + "comment": "window_of_concat: [16:48] straddles word -> 16x11 ++ 16x22", "calldata": "35a3368f1111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222200000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020", "value": "0" }, @@ -216,7 +217,7 @@ }, { "input": { - "text-calldata": "window_of_concat: [24:40] sub-word -> 8x11 ++ 8x22", + "comment": "window_of_concat: [24:40] sub-word -> 8x11 ++ 8x22", "calldata": "35a3368f1111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000010", "value": "0" }, @@ -228,7 +229,7 @@ }, { "input": { - "text-calldata": "window_of_concat: full identity 64B", + "comment": "window_of_concat: full identity 64B", "calldata": "35a3368f1111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040", "value": "0" }, @@ -240,7 +241,7 @@ }, { "input": { - "text-calldata": "window_of_concat: empty window", + "comment": "window_of_concat: empty window", "calldata": "35a3368f1111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222200000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -252,7 +253,7 @@ }, { "input": { - "text-calldata": "window_of_concat: end>remaining(24) reverts", + "comment": "window_of_concat: end>remaining(24) reverts", "calldata": "35a3368f1111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222200000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000020", "value": "0" }, @@ -264,7 +265,7 @@ }, { "input": { - "text-calldata": "concat_slice_b32: cafebabe ++ 32x33", + "comment": "concat_slice_b32: cafebabe ++ 32x33", "calldata": "37dc96340000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000433333333333333333333333333333333333333333333333333333333333333330000000000000000000000000000000000000000000000000000000000000008deadbeefcafebabe000000000000000000000000000000000000000000000000", "value": "0" }, @@ -276,7 +277,7 @@ }, { "input": { - "text-calldata": "concat_slice_b32: 32xaa ++ 32x33", + "comment": "concat_slice_b32: 32xaa ++ 32x33", "calldata": "37dc96340000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000033333333333333333333333333333333333333333333333333333333333333330000000000000000000000000000000000000000000000000000000000000020aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "value": "0" }, @@ -288,7 +289,7 @@ }, { "input": { - "text-calldata": "concat_two_slices: cafebabe ++ 00112233", + "comment": "concat_two_slices: cafebabe ++ 00112233", "calldata": "5ff7af890000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008deadbeefcafebabe00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080011223344556677000000000000000000000000000000000000000000000000", "value": "0" }, @@ -300,7 +301,7 @@ }, { "input": { - "text-calldata": "concat_two_slices: 32x11 ++ 33x22 (65B)", + "comment": "concat_two_slices: 32x11 ++ 33x22 (65B)", "calldata": "5ff7af890000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000021000000000000000000000000000000000000000000000000000000000000002111111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004022222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222", "value": "0" }, @@ -312,7 +313,7 @@ }, { "input": { - "text-calldata": "slice_of_slice: 0..15 drop 4 then 4 -> 08..0f", + "comment": "slice_of_slice: 0..15 drop 4 then 4 -> 08..0f", "calldata": "ca2704250000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000010000102030405060708090a0b0c0d0e0f00000000000000000000000000000000", "value": "0" }, @@ -324,7 +325,7 @@ }, { "input": { - "text-calldata": "slice_of_slice: 33x11 drop 1 then 0 -> 32x11", + "comment": "slice_of_slice: 33x11 drop 1 then 0 -> 32x11", "calldata": "ca270425000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002111111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -336,7 +337,7 @@ }, { "input": { - "text-calldata": "keccak_slice: drop 3 of 000000abc -> keccak(\"abc\")", + "comment": "keccak_slice: drop 3 of 000000abc -> keccak(\"abc\")", "calldata": "35c4751b0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000060000006162630000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -348,7 +349,7 @@ }, { "input": { - "text-calldata": "keccak_slice: start=0 -> keccak(\"abc\")", + "comment": "keccak_slice: start=0 -> keccak(\"abc\")", "calldata": "35c4751b0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036162630000000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -360,7 +361,7 @@ }, { "input": { - "text-calldata": "keccak_slice: start=len -> keccak(\"\")", + "comment": "keccak_slice: start=len -> keccak(\"\")", "calldata": "35c4751b0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000036162630000000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -372,7 +373,7 @@ }, { "input": { - "text-calldata": "sha_truncate: keep 3 of abcffffff -> sha256(\"abc\")", + "comment": "sha_truncate: keep 3 of abcffffff -> sha256(\"abc\")", "calldata": "ef6356a6000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000006616263ffffff0000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -384,7 +385,7 @@ }, { "input": { - "text-calldata": "sha_truncate: end=0 -> sha256(\"\")", + "comment": "sha_truncate: end=0 -> sha256(\"\")", "calldata": "ef6356a60000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036162630000000000000000000000000000000000000000000000000000000000", "value": "0" }, @@ -396,7 +397,7 @@ }, { "input": { - "text-calldata": "keccak_window_concat: window [0:3] of \"abc\"-word||b -> keccak(\"abc\")", + "comment": "keccak_window_concat: window [0:3] of \"abc\"-word||b -> keccak(\"abc\")", "calldata": "061f505a6162630000000000000000000000000000000000000000000000000000000000222222222222222222222222222222222222222222222222222222222222222200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003", "value": "0" }, @@ -408,7 +409,7 @@ }, { "input": { - "text-calldata": "keccak_window_concat: window [30:34] straddles concat -> keccak(0x11112222)", + "comment": "keccak_window_concat: window [30:34] straddles concat -> keccak(0x11112222)", "calldata": "061f505a11111111111111111111111111111111111111111111111111111111111111112222222222222222222222222222222222222222222222222222222222222222000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000004", "value": "0" }, diff --git a/test/examples/dispatch/template.json b/test/examples/dispatch/template.json index 32875968..23a74e1b 100644 --- a/test/examples/dispatch/template.json +++ b/test/examples/dispatch/template.json @@ -5,6 +5,7 @@ "tests": [ { "input": { + "comment": "constructor()", "calldata": "", "value": "0" }, @@ -12,6 +13,7 @@ }, { "input": { + "comment": "f()", "calldata": "26121ff0", "value": "0" }, diff --git a/test/testrunner/testrunner.cpp b/test/testrunner/testrunner.cpp index 01d79d35..5c2c8565 100644 --- a/test/testrunner/testrunner.cpp +++ b/test/testrunner/testrunner.cpp @@ -96,6 +96,15 @@ int main(int argc, char** argv) message.sender = EVMHost::convertToEVMC(sender); message.value = EVMHost::convertToEVMC(u256(test["input"]["value"].get())); auto kind = test["kind"].get(); + + // Human-readable description of the call, shown when the test fails. + std::string const comment = test["input"].value("comment", std::string{}); + auto reportFailure = [&](std::string const& _reason) { + std::cerr << _reason; + if (!comment.empty()) + std::cerr << " (comment: " << comment << ")"; + std::cerr << std::endl; + }; if (kind == "constructor") { input = bytecode + input; @@ -116,7 +125,7 @@ int main(int argc, char** argv) } else { - std::cerr << "Unrecognized kind: " << kind << std::endl; + reportFailure("Unrecognized kind: " + kind); hasTestFailure = true; resultRecorder.record(filename, "Unrecognized kind of test", kind, R"("constructor" or "call")", 0, 0); continue; @@ -153,7 +162,7 @@ int main(int argc, char** argv) { if (status) { - std::cerr << "Expected creation failure but got success" << std::endl; + reportFailure("Expected creation failure but got success"); resultRecorder.record(filename, "Expected constructor status failure but got success.", "success", expectedStatus, gasUsed, gasUsedForDeposit); hasTestFailure = true; continue; @@ -163,7 +172,7 @@ int main(int argc, char** argv) { if (!status) { - std::cerr << "Expected creation success but got failure" << std::endl; + reportFailure("Expected creation success but got failure"); resultRecorder.record(filename, "Expected constructor status success but got failure.", "failure", expectedStatus, gasUsed, gasUsedForDeposit); hasTestFailure = true; continue; @@ -171,7 +180,7 @@ int main(int argc, char** argv) } else { - std::cerr << "Unsupported expectedStatus: " << expectedStatus << std::endl; + reportFailure("Unsupported expectedStatus: " + expectedStatus); resultRecorder.record(filename, "Unsupported constructor status expectation.", "failure", expectedStatus, gasUsed, gasUsedForDeposit); hasTestFailure = true; continue; @@ -181,7 +190,7 @@ int main(int argc, char** argv) auto expectedOutput = test["output"]["returndata"].get(); if (output != fromHex(expectedOutput)) { - std::cerr << "Expected " << expectedOutput << " but got " << toHex(output) << std::endl; + reportFailure("Expected " + expectedOutput + " but got " + toHex(output)); resultRecorder.record(filename, "Expected different constructor output.", toHex(output), expectedOutput, gasUsed, gasUsedForDeposit); hasTestFailure = true; continue; @@ -193,7 +202,7 @@ int main(int argc, char** argv) { if (!status) { - std::cerr << "Creation failed." << std::endl; + reportFailure("Creation failed."); resultRecorder.record(filename, "Creation failed for constructor test.", "", "", gasUsed, gasUsedForDeposit); hasTestFailure = true; continue; @@ -208,7 +217,7 @@ int main(int argc, char** argv) { if (status) { - std::cerr << "Expected failure but got success" << std::endl; + reportFailure("Expected failure but got success"); resultRecorder.record(filename, "Expected test status failure but got success.", "success", expectedStatus, gasUsed, gasUsedForDeposit); hasTestFailure = true; continue; @@ -218,7 +227,7 @@ int main(int argc, char** argv) { if (!status) { - std::cerr << "Expected success but got failure" << std::endl; + reportFailure("Expected success but got failure"); resultRecorder.record(filename, "Expected test status success but got failure.", "failure", expectedStatus, gasUsed, gasUsedForDeposit); hasTestFailure = true; continue; @@ -226,7 +235,7 @@ int main(int argc, char** argv) } else { - std::cerr << "Unsupported expectedStatus: " << expectedStatus << std::endl; + reportFailure("Unsupported expectedStatus: " + expectedStatus); resultRecorder.record(filename, "Unsupported status expectation.", "failure", expectedStatus, gasUsed, gasUsedForDeposit); hasTestFailure = true; continue; @@ -234,7 +243,7 @@ int main(int argc, char** argv) auto expectedOutput = test["output"]["returndata"].get(); if (output != fromHex(expectedOutput)) { - std::cerr << "Expected " << expectedOutput << " but got " << toHex(output) << std::endl; + reportFailure("Expected " + expectedOutput + " but got " + toHex(output)); resultRecorder.record(filename, "Expected different output.", toHex(output), expectedOutput, gasUsed, gasUsedForDeposit); hasTestFailure = true; continue;