From d6e8ca4c54f080412eca97ddac7d3d158c128997 Mon Sep 17 00:00:00 2001 From: Leonardo Alt Date: Tue, 3 Dec 2019 21:44:06 +0100 Subject: [PATCH] Fix SMTChecker tests in 060 --- .../functions/constructor_hierarchy_3.sol | 4 ++-- .../functions/constructor_hierarchy_4.sol | 6 +++--- .../functions/constructor_hierarchy_diamond.sol | 6 +++--- .../functions/constructor_hierarchy_diamond_2.sol | 6 +++--- .../functions/constructor_hierarchy_diamond_3.sol | 12 ++++++------ ...constructor_hierarchy_mixed_chain_with_params.sol | 10 +++++----- ...nstructor_hierarchy_mixed_chain_with_params_2.sol | 10 +++++----- ...constructor_hierarchy_mixed_chain_with_params.sol | 10 +++++----- ...constructor_state_variable_init_chain_run_all.sol | 8 ++++---- ...nstructor_state_variable_init_chain_run_all_2.sol | 6 +++--- .../smtCheckerTests/inheritance/fallback.sol | 2 +- .../smtCheckerTests/inheritance/fallback_receive.sol | 2 +- .../smtCheckerTests/inheritance/receive.sol | 2 +- .../smtCheckerTests/inheritance/receive_fallback.sol | 2 +- 14 files changed, 43 insertions(+), 43 deletions(-) diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_3.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_3.sol index 4db811ee2..79acf49d7 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_3.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_3.sol @@ -6,7 +6,7 @@ contract C { } } -contract B is C { +abstract contract B is C { constructor(uint x) public { a = x; } @@ -19,4 +19,4 @@ contract A is B { } } // ---- -// Warning: (244-262): Assertion violation happens here +// Warning: (253-271): Assertion violation happens here diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_4.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_4.sol index 63a229614..69a7f5ec9 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_4.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_4.sol @@ -6,7 +6,7 @@ contract C { } } -contract B is C { +abstract contract B is C { constructor(uint x) public { a = x; } @@ -18,6 +18,6 @@ contract A is B { } } // ---- +// Warning: (221-226): Overflow (resulting value larger than 2**256 - 1) happens here // Warning: (212-217): Overflow (resulting value larger than 2**256 - 1) happens here -// Warning: (203-208): Overflow (resulting value larger than 2**256 - 1) happens here -// Warning: (242-247): Overflow (resulting value larger than 2**256 - 1) happens here +// Warning: (251-256): Overflow (resulting value larger than 2**256 - 1) happens here diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond.sol index 44e600a0d..5b339e004 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond.sol @@ -6,7 +6,7 @@ contract C { } } -contract B1 is C { +abstract contract B1 is C { constructor(uint x) public { a = x; } @@ -25,5 +25,5 @@ contract A is B2, B1 { } } // ---- -// Warning: (205-210): Overflow (resulting value larger than 2**256 - 1) happens here -// Warning: (321-339): Assertion violation happens here +// Warning: (214-219): Overflow (resulting value larger than 2**256 - 1) happens here +// Warning: (330-348): Assertion violation happens here diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_2.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_2.sol index 03922d16e..c0bf299f8 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_2.sol @@ -6,7 +6,7 @@ contract C { } } -contract B1 is C { +abstract contract B1 is C { constructor(uint x) public { a = x; } @@ -25,5 +25,5 @@ contract A is B2, B1 { } } // ---- -// Warning: (205-210): Overflow (resulting value larger than 2**256 - 1) happens here -// Warning: (321-339): Assertion violation happens here +// Warning: (214-219): Overflow (resulting value larger than 2**256 - 1) happens here +// Warning: (330-348): Assertion violation happens here diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_3.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_3.sol index 429b5d135..4ad9083fa 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_3.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_3.sol @@ -6,7 +6,7 @@ contract C { } } -contract B1 is C { +abstract contract B1 is C { uint b1; constructor(uint x) public { b1 = x + a; @@ -27,8 +27,8 @@ contract A is B2, B1 { } } // ---- -// Warning: (165-170): Underflow (resulting value less than 0) happens here -// Warning: (165-170): Overflow (resulting value larger than 2**256 - 1) happens here -// Warning: (230-235): Overflow (resulting value larger than 2**256 - 1) happens here -// Warning: (253-258): Overflow (resulting value larger than 2**256 - 1) happens here -// Warning: (353-369): Assertion violation happens here +// Warning: (174-179): Underflow (resulting value less than 0) happens here +// Warning: (174-179): Overflow (resulting value larger than 2**256 - 1) happens here +// Warning: (239-244): Overflow (resulting value larger than 2**256 - 1) happens here +// Warning: (262-267): Overflow (resulting value larger than 2**256 - 1) happens here +// Warning: (362-378): Assertion violation happens here diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params.sol index 66380328d..6959f6c88 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params.sol @@ -6,13 +6,13 @@ contract F { } } -contract E is F {} -contract D is E { +abstract contract E is F {} +abstract contract D is E { constructor() public { a = 3; } } -contract C is D {} +abstract contract C is D {} contract B is C { constructor(uint x) F(x + 1) public { } @@ -25,5 +25,5 @@ contract A is B { } } // ---- -// Warning: (234-239): Overflow (resulting value larger than 2**256 - 1) happens here -// Warning: (329-343): Assertion violation happens here +// Warning: (261-266): Overflow (resulting value larger than 2**256 - 1) happens here +// Warning: (356-370): Assertion violation happens here diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params_2.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params_2.sol index 12890009a..835949ada 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params_2.sol @@ -6,13 +6,13 @@ contract F { } } -contract E is F {} -contract D is E { +abstract contract E is F {} +abstract contract D is E { constructor() public { a = 3; } } -contract C is D {} +abstract contract C is D {} contract B is C { constructor() F(1) public { assert(a == 3); @@ -23,5 +23,5 @@ contract B is C { contract A is B { } // ---- -// Warning: (260-274): Assertion violation happens here -// Warning: (260-274): Assertion violation happens here +// Warning: (287-301): Assertion violation happens here +// Warning: (287-301): Assertion violation happens here diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_mixed_chain_with_params.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_mixed_chain_with_params.sol index 66380328d..6959f6c88 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_mixed_chain_with_params.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_mixed_chain_with_params.sol @@ -6,13 +6,13 @@ contract F { } } -contract E is F {} -contract D is E { +abstract contract E is F {} +abstract contract D is E { constructor() public { a = 3; } } -contract C is D {} +abstract contract C is D {} contract B is C { constructor(uint x) F(x + 1) public { } @@ -25,5 +25,5 @@ contract A is B { } } // ---- -// Warning: (234-239): Overflow (resulting value larger than 2**256 - 1) happens here -// Warning: (329-343): Assertion violation happens here +// Warning: (261-266): Overflow (resulting value larger than 2**256 - 1) happens here +// Warning: (356-370): Assertion violation happens here diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all.sol index edc6eeb33..82d411e47 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all.sol @@ -6,7 +6,7 @@ contract C { } } -contract B is C { +abstract contract B is C { uint b; constructor(uint x) public { b = a + x; @@ -22,6 +22,6 @@ contract A is B { } // ---- -// Warning: (162-167): Underflow (resulting value less than 0) happens here -// Warning: (162-167): Overflow (resulting value larger than 2**256 - 1) happens here -// Warning: (287-305): Assertion violation happens here +// Warning: (171-176): Underflow (resulting value less than 0) happens here +// Warning: (171-176): Overflow (resulting value larger than 2**256 - 1) happens here +// Warning: (296-314): Assertion violation happens here diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all_2.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all_2.sol index 7efffde55..fc6643a42 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all_2.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all_2.sol @@ -6,7 +6,7 @@ contract C { } } -contract B is C { +abstract contract B is C { uint b; constructor(uint x) public { b = x + 10; @@ -22,5 +22,5 @@ contract A is B { } // ---- -// Warning: (162-168): Overflow (resulting value larger than 2**256 - 1) happens here -// Warning: (285-303): Assertion violation happens here +// Warning: (171-177): Overflow (resulting value larger than 2**256 - 1) happens here +// Warning: (294-312): Assertion violation happens here diff --git a/test/libsolidity/smtCheckerTests/inheritance/fallback.sol b/test/libsolidity/smtCheckerTests/inheritance/fallback.sol index 6dee30436..c1319be28 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/fallback.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/fallback.sol @@ -17,7 +17,7 @@ contract B is A { uint y; fallback () external override { - assert(x == 0); + assert(x == 1); } } // ---- diff --git a/test/libsolidity/smtCheckerTests/inheritance/fallback_receive.sol b/test/libsolidity/smtCheckerTests/inheritance/fallback_receive.sol index 5b66c1cb1..4a78ac268 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/fallback_receive.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/fallback_receive.sol @@ -17,7 +17,7 @@ contract B is A { uint y; receive () external payable { - assert(x == 0); + assert(x == 1); } } // ---- diff --git a/test/libsolidity/smtCheckerTests/inheritance/receive.sol b/test/libsolidity/smtCheckerTests/inheritance/receive.sol index e46c8a5c2..8372db502 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/receive.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/receive.sol @@ -17,7 +17,7 @@ contract B is A { uint y; receive () external payable override { - assert(x == 0); + assert(x == 1); } } // ---- diff --git a/test/libsolidity/smtCheckerTests/inheritance/receive_fallback.sol b/test/libsolidity/smtCheckerTests/inheritance/receive_fallback.sol index ff6c19e77..277912227 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/receive_fallback.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/receive_fallback.sol @@ -17,7 +17,7 @@ contract B is A { uint y; fallback () external { - assert(x == 0); + assert(x == 1); } } // ----