mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add uncovered test and replace uncovered tests by asserts
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract C {
|
||||
function f() public pure returns (byte) {
|
||||
return (~byte(0xFF));
|
||||
}
|
||||
function f() public pure {
|
||||
// ffff0000 in bytes4
|
||||
bytes4 x = ~bytes4(hex"ffff");
|
||||
assert(x == 0xffff0000); // should fail
|
||||
assert(x == 0x0000ffff); // should hold
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 6328: (175-198): CHC: Assertion violation happens here.
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract D {
|
||||
function f(uint x) public pure {
|
||||
assert(x**2 == 4);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 5188: (88-92): Assertion checker does not yet implement this operator.
|
||||
// Warning 6328: (81-98): CHC: Assertion violation happens here.
|
||||
// Warning 5188: (88-92): Assertion checker does not yet implement this operator.
|
||||
@@ -0,0 +1,15 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract D {
|
||||
function f() public pure {
|
||||
assert(1000000000000000000 wei == 1 ether);
|
||||
assert(100000000000000000 wei == 1 ether);
|
||||
assert(1000000000 wei == 1 gwei);
|
||||
assert(100000000 wei == 1 gwei);
|
||||
assert(1000000000 gwei == 1 ether);
|
||||
assert(100000000 gwei == 1 ether);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 6328: (121-162): CHC: Assertion violation happens here.
|
||||
// Warning 6328: (202-233): CHC: Assertion violation happens here.
|
||||
// Warning 6328: (275-308): CHC: Assertion violation happens here.
|
||||
@@ -0,0 +1,21 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract D {
|
||||
function f() public pure {
|
||||
assert(1 == 1 seconds);
|
||||
assert(2 == 1 seconds);
|
||||
assert(2 minutes == 120 seconds);
|
||||
assert(3 minutes == 120 seconds);
|
||||
assert(2 hours == 120 minutes);
|
||||
assert(3 hours == 120 minutes);
|
||||
assert(2 days == 48 hours);
|
||||
assert(4 days == 48 hours);
|
||||
assert(2 weeks == 14 days);
|
||||
assert(25 weeks == 14 days);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 6328: (101-123): CHC: Assertion violation happens here.
|
||||
// Warning 6328: (163-195): CHC: Assertion violation happens here.
|
||||
// Warning 6328: (233-263): CHC: Assertion violation happens here.
|
||||
// Warning 6328: (297-323): CHC: Assertion violation happens here.
|
||||
// Warning 6328: (357-384): CHC: Assertion violation happens here.
|
||||
Reference in New Issue
Block a user