Fix SMTChecker tests on breaking

This commit is contained in:
Leonardo Alt 2020-12-15 19:49:57 +01:00
parent 3881d223b0
commit 59428b8f76
2 changed files with 7 additions and 7 deletions

View File

@ -9,8 +9,8 @@ contract C {
assert(b[length - 1] == 0);
assert(b[length - 1] == b[length - 2]);
// Fails
assert(b[length - 1] == byte(uint8(1)));
assert(b[length - 1] == bytes1(uint8(1)));
}
}
// ----
// Warning 6328: (236-275): CHC: Assertion violation happens here.\nCounterexample:\nb = [0, 0]\n\n\n\nTransaction trace:\nconstructor()\nState: b = []\nf()
// Warning 6328: (236-277): CHC: Assertion violation happens here.\nCounterexample:\nb = [0, 0]\n\n\n\nTransaction trace:\nconstructor()\nState: b = []\nf()

View File

@ -5,18 +5,18 @@ contract C {
function f() public {
require(b.length == 0);
b.push() = byte(uint8(1));
assert(b[0] == byte(uint8(1)));
b.push() = bytes1(uint8(1));
assert(b[0] == bytes1(uint8(1)));
}
function g() public {
byte one = byte(uint8(1));
bytes1 one = bytes1(uint8(1));
b.push() = one;
assert(b[b.length - 1] == one);
// Fails
assert(b[b.length - 1] == byte(uint8(100)));
assert(b[b.length - 1] == bytes1(uint8(100)));
}
}
// ----
// Warning 6328: (290-333): CHC: Assertion violation happens here.\nCounterexample:\nb = [1]\n\n\n\nTransaction trace:\nconstructor()\nState: b = []\ng()
// Warning 6328: (298-343): CHC: Assertion violation happens here.\nCounterexample:\nb = [1]\n\n\n\nTransaction trace:\nconstructor()\nState: b = []\ng()