mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Extract more SMTChecker division tests
This commit is contained in:
parent
b870e4ea31
commit
ae6cdc3442
@ -59,60 +59,6 @@ protected:
|
|||||||
|
|
||||||
BOOST_FIXTURE_TEST_SUITE(SMTChecker, SMTCheckerFramework)
|
BOOST_FIXTURE_TEST_SUITE(SMTChecker, SMTCheckerFramework)
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(division_truncates_correctly)
|
|
||||||
{
|
|
||||||
string text = R"(
|
|
||||||
contract C {
|
|
||||||
function f(uint x, uint y) public pure {
|
|
||||||
x = 7;
|
|
||||||
y = 2;
|
|
||||||
assert(x / y == 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)";
|
|
||||||
CHECK_SUCCESS_NO_WARNINGS(text);
|
|
||||||
text = R"(
|
|
||||||
contract C {
|
|
||||||
function f(int x, int y) public pure {
|
|
||||||
x = 7;
|
|
||||||
y = 2;
|
|
||||||
assert(x / y == 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)";
|
|
||||||
CHECK_SUCCESS_NO_WARNINGS(text);
|
|
||||||
text = R"(
|
|
||||||
contract C {
|
|
||||||
function f(int x, int y) public pure {
|
|
||||||
x = -7;
|
|
||||||
y = 2;
|
|
||||||
assert(x / y == -3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)";
|
|
||||||
CHECK_SUCCESS_NO_WARNINGS(text);
|
|
||||||
text = R"(
|
|
||||||
contract C {
|
|
||||||
function f(int x, int y) public pure {
|
|
||||||
x = 7;
|
|
||||||
y = -2;
|
|
||||||
assert(x / y == -3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)";
|
|
||||||
CHECK_SUCCESS_NO_WARNINGS(text);
|
|
||||||
text = R"(
|
|
||||||
contract C {
|
|
||||||
function f(int x, int y) public pure {
|
|
||||||
x = -7;
|
|
||||||
y = -2;
|
|
||||||
assert(x / y == 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)";
|
|
||||||
CHECK_SUCCESS_NO_WARNINGS(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(compound_assignment_division)
|
BOOST_AUTO_TEST_CASE(compound_assignment_division)
|
||||||
{
|
{
|
||||||
string text = R"(
|
string text = R"(
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
pragma experimental SMTChecker;
|
||||||
|
contract C {
|
||||||
|
function f(uint x, uint y) public pure {
|
||||||
|
x = 7;
|
||||||
|
y = 2;
|
||||||
|
assert(x / y == 3);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
pragma experimental SMTChecker;
|
||||||
|
contract C {
|
||||||
|
function f(int x, int y) public pure {
|
||||||
|
x = 7;
|
||||||
|
y = 2;
|
||||||
|
assert(x / y == 3);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
pragma experimental SMTChecker;
|
||||||
|
contract C {
|
||||||
|
function f(int x, int y) public pure {
|
||||||
|
x = -7;
|
||||||
|
y = 2;
|
||||||
|
assert(x / y == -3);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
pragma experimental SMTChecker;
|
||||||
|
contract C {
|
||||||
|
function f(int x, int y) public pure {
|
||||||
|
x = 7;
|
||||||
|
y = -2;
|
||||||
|
assert(x / y == -3);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
pragma experimental SMTChecker;
|
||||||
|
contract C {
|
||||||
|
function f(int x, int y) public pure {
|
||||||
|
x = -7;
|
||||||
|
y = -2;
|
||||||
|
assert(x / y == 3);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user