Fix JSON report tests

pull/688/head
Dominik Muhs 6 years ago
parent c9fdcee29a
commit ce8c82f0f2
  1. 1
      tests/report_test.py
  2. 2
      tests/testdata/outputs_expected/ether_send.sol.o.json
  3. 2
      tests/testdata/outputs_expected/overflow.sol.o.json

@ -100,6 +100,7 @@ def _assert_empty_json(changed_files):
if not ordered(output_expected.items()) == ordered(output_current.items()): if not ordered(output_expected.items()) == ordered(output_current.items()):
expected.append(output_expected) expected.append(output_expected)
actual.append(output_current) actual.append(output_current)
print("Found difference in {}".format(str(input_file)))
assert expected == actual assert expected == actual

@ -1 +1 @@
{"error": null, "issues": [{"address": 722, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "It seems that an attacker is able to execute an call instruction, this can mean that the attacker is able to extract funds out of the contract.", "function": "_function_0x6c343ffe", "swc-id": "105", "title": "Ether send", "type": "Warning"}, {"address": 883, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This binary add operation can result in integer overflow.\n", "function": "_function_0xe8b5e51f", "swc-id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} {"error":null,"issues":[{"address":722,"contract":"Unknown","debug":"<DEBUG-DATA>","description":"It seems that an attacker is able to execute an call instruction, this can mean that the attacker is able to extract funds out of the contract.","function":"withdrawfunds()","swc-id":"105","title":"Ether send","type":"Warning"},{"address":883,"contract":"Unknown","debug":"<DEBUG-DATA>","description":"This binary add operation can result in integer overflow.\n","function":"invest()","swc-id":"101","title":"Integer Overflow","type":"Warning"}],"success":true}

@ -1 +1 @@
{"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The subtraction can result in an integer underflow.\n", "function": "_function_0xa3210e87", "swc-id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 649, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The subtraction can result in an integer underflow.\n", "function": "_function_0xa3210e87", "swc-id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 725, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This binary add operation can result in integer overflow.\n", "function": "_function_0xa3210e87", "swc-id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} {"error":null,"issues":[{"address":567,"contract":"Unknown","debug":"<DEBUG-DATA>","description":"The subtraction can result in an integer underflow.\n","function":"sendeth(address,uint256)","swc-id":"101","title":"Integer Underflow","type":"Warning"},{"address":649,"contract":"Unknown","debug":"<DEBUG-DATA>","description":"The subtraction can result in an integer underflow.\n","function":"sendeth(address,uint256)","swc-id":"101","title":"Integer Underflow","type":"Warning"},{"address":725,"contract":"Unknown","debug":"<DEBUG-DATA>","description":"This binary add operation can result in integer overflow.\n","function":"sendeth(address,uint256)","swc-id":"101","title":"Integer Overflow","type":"Warning"}],"success":true}
Loading…
Cancel
Save