Merge pull request #7298 from ethereum/smt_fix_division

[SMTChecker] Adapt division test for Z3 only
This commit is contained in:
Leonardo 2019-08-24 11:40:49 +02:00 committed by GitHub
commit bb104546e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -116,13 +116,15 @@ BOOST_AUTO_TEST_CASE(division)
if (a == 0) {
return 0;
}
// TODO remove when SMTChecker sees that this code is the `else` of the `return`.
require(a != 0);
uint256 c = a * b;
require(c / a == b);
return c;
}
}
)";
CHECK_WARNING(text, "Division by zero");
CHECK_SUCCESS_OR_WARNING(text, "might happen");
text = R"(
contract C {
function div(uint256 a, uint256 b) internal pure returns (uint256) {