|
|
@ -374,7 +374,7 @@ def test_basic_loop_phi(): |
|
|
|
verify_properties_hold(contract) |
|
|
|
verify_properties_hold(contract) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.skip(reason="Fails in current slither version. Fix in #1102.") |
|
|
|
@pytest.mark.xfail(strict=True, reason="Fails in current slither version. Fix in #1102.") |
|
|
|
def test_phi_propagation_loop(): |
|
|
|
def test_phi_propagation_loop(): |
|
|
|
contract = """ |
|
|
|
contract = """ |
|
|
|
pragma solidity ^0.8.11; |
|
|
|
pragma solidity ^0.8.11; |
|
|
@ -395,7 +395,7 @@ def test_phi_propagation_loop(): |
|
|
|
verify_properties_hold(contract) |
|
|
|
verify_properties_hold(contract) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.skip(reason="Fails in current slither version. Fix in #1102.") |
|
|
|
@pytest.mark.xfail(strict=True, reason="Fails in current slither version. Fix in #1102.") |
|
|
|
def test_free_function_properties(): |
|
|
|
def test_free_function_properties(): |
|
|
|
contract = """ |
|
|
|
contract = """ |
|
|
|
pragma solidity ^0.8.11; |
|
|
|
pragma solidity ^0.8.11; |
|
|
@ -459,7 +459,7 @@ def test_ssa_inter_transactional(): |
|
|
|
assert assign2.lvalue in phi.rvalues |
|
|
|
assert assign2.lvalue in phi.rvalues |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.skip(reason="Fails in current slither version. Fix in #1102.") |
|
|
|
@pytest.mark.xfail(strict=True, reason="Fails in current slither version. Fix in #1102.") |
|
|
|
def test_ssa_phi_callbacks(): |
|
|
|
def test_ssa_phi_callbacks(): |
|
|
|
source = """ |
|
|
|
source = """ |
|
|
|
pragma solidity ^0.8.11; |
|
|
|
pragma solidity ^0.8.11; |
|
|
@ -518,7 +518,7 @@ def test_ssa_phi_callbacks(): |
|
|
|
assert len(after_call_phi.rvalues) == 2 |
|
|
|
assert len(after_call_phi.rvalues) == 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.skip(reason="Fails in current slither version. Fix in #1102.") |
|
|
|
@pytest.mark.xfail(strict=True, reason="Fails in current slither version. Fix in #1102.") |
|
|
|
def test_storage_refers_to(): |
|
|
|
def test_storage_refers_to(): |
|
|
|
"""Test the storage aspects of the SSA IR |
|
|
|
"""Test the storage aspects of the SSA IR |
|
|
|
|
|
|
|
|
|
|
@ -585,7 +585,7 @@ def test_storage_refers_to(): |
|
|
|
assert phinodes[1].lvalue in entryphi[0].rvalues or entryphi[1].rvalues |
|
|
|
assert phinodes[1].lvalue in entryphi[0].rvalues or entryphi[1].rvalues |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.skip(reason="Fails in current slither version. Fix in #1102.") |
|
|
|
@pytest.mark.xfail(strict=True, reason="Fails in current slither version. Fix in #1102.") |
|
|
|
@pytest.mark.skipif( |
|
|
|
@pytest.mark.skipif( |
|
|
|
not valid_version("0.4.0"), reason="Solidity version 0.4.0 not available on this platform" |
|
|
|
not valid_version("0.4.0"), reason="Solidity version 0.4.0 not available on this platform" |
|
|
|
) |
|
|
|
) |
|
|
@ -622,7 +622,7 @@ def test_initial_version_exists_for_locals(): |
|
|
|
assert a_0.non_ssa_version == a_1.non_ssa_version |
|
|
|
assert a_0.non_ssa_version == a_1.non_ssa_version |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.skip(reason="Fails in current slither version. Fix in #1102.") |
|
|
|
@pytest.mark.xfail(strict=True, reason="Fails in current slither version. Fix in #1102.") |
|
|
|
@pytest.mark.skipif( |
|
|
|
@pytest.mark.skipif( |
|
|
|
not valid_version("0.4.0"), reason="Solidity version 0.4.0 not available on this platform" |
|
|
|
not valid_version("0.4.0"), reason="Solidity version 0.4.0 not available on this platform" |
|
|
|
) |
|
|
|
) |
|
|
@ -662,7 +662,7 @@ def test_initial_version_exists_for_state_variables(): |
|
|
|
assert len(get_ssa_of_type(f, Phi)) == 0 |
|
|
|
assert len(get_ssa_of_type(f, Phi)) == 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.skip(reason="Fails in current slither version. Fix in #1102.") |
|
|
|
@pytest.mark.xfail(strict=True, reason="Fails in current slither version. Fix in #1102.") |
|
|
|
def test_initial_version_exists_for_state_variables_function_assign(): |
|
|
|
def test_initial_version_exists_for_state_variables_function_assign(): |
|
|
|
""" |
|
|
|
""" |
|
|
|
In solidity you can write statements such as |
|
|
|
In solidity you can write statements such as |
|
|
@ -759,7 +759,7 @@ def test_shadow_local(): |
|
|
|
assert all(map(lambda x: x.lvalue.index == 1, get_ssa_of_type(f, Assignment))) |
|
|
|
assert all(map(lambda x: x.lvalue.index == 1, get_ssa_of_type(f, Assignment))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.skip(reason="Fails in current slither version. Fix in #1102.") |
|
|
|
@pytest.mark.xfail(strict=True, reason="Fails in current slither version. Fix in #1102.") |
|
|
|
def test_multiple_named_args_returns(): |
|
|
|
def test_multiple_named_args_returns(): |
|
|
|
"""Verifies that named arguments and return values have correct versions |
|
|
|
"""Verifies that named arguments and return values have correct versions |
|
|
|
|
|
|
|
|
|
|
@ -788,7 +788,7 @@ def test_multiple_named_args_returns(): |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.xfail(reason="Tests for wanted state of SSA IR, not current.") |
|
|
|
@pytest.mark.xfail(reason="Tests for wanted state of SSA IR, not current.", strict=True) |
|
|
|
def test_memory_array(): |
|
|
|
def test_memory_array(): |
|
|
|
src = """ |
|
|
|
src = """ |
|
|
|
contract MemArray { |
|
|
|
contract MemArray { |
|
|
@ -854,7 +854,7 @@ def test_memory_array(): |
|
|
|
assert len(phi_entry_b.rvalues) == len(b_args) + 1 |
|
|
|
assert len(phi_entry_b.rvalues) == len(b_args) + 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.xfail(reason="Tests for wanted state of SSA IR, not current.") |
|
|
|
@pytest.mark.xfail(reason="Tests for wanted state of SSA IR, not current.", strict=True) |
|
|
|
def test_storage_array(): |
|
|
|
def test_storage_array(): |
|
|
|
src = """ |
|
|
|
src = """ |
|
|
|
contract StorageArray { |
|
|
|
contract StorageArray { |
|
|
@ -909,7 +909,7 @@ def test_storage_array(): |
|
|
|
assert len(phi_entry_b.rvalues) == 3 # See comment in b above |
|
|
|
assert len(phi_entry_b.rvalues) == 3 # See comment in b above |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.skip(reason="Fails in current slither version. Fix in #1102.") |
|
|
|
@pytest.mark.xfail(strict=True, reason="Fails in current slither version. Fix in #1102.") |
|
|
|
def test_issue_468(): |
|
|
|
def test_issue_468(): |
|
|
|
""" |
|
|
|
""" |
|
|
|
Ensure issue 468 is corrected as per |
|
|
|
Ensure issue 468 is corrected as per |
|
|
@ -963,7 +963,7 @@ def test_issue_468(): |
|
|
|
assert phi_endif.lvalue in phi_entry.rvalues |
|
|
|
assert phi_endif.lvalue in phi_entry.rvalues |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.skip(reason="Fails in current slither version. Fix in #1102.") |
|
|
|
@pytest.mark.xfail(strict=True, reason="Fails in current slither version. Fix in #1102.") |
|
|
|
def test_issue_434(): |
|
|
|
def test_issue_434(): |
|
|
|
source = """ |
|
|
|
source = """ |
|
|
|
contract Contract { |
|
|
|
contract Contract { |
|
|
@ -1017,7 +1017,7 @@ def test_issue_434(): |
|
|
|
assert aftercall_phi.lvalue in (add_f.variable_left, add_f.variable_right) |
|
|
|
assert aftercall_phi.lvalue in (add_f.variable_left, add_f.variable_right) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.skip(reason="Fails in current slither version. Fix in #1102.") |
|
|
|
@pytest.mark.xfail(strict=True, reason="Fails in current slither version. Fix in #1102.") |
|
|
|
def test_issue_473(): |
|
|
|
def test_issue_473(): |
|
|
|
source = """ |
|
|
|
source = """ |
|
|
|
contract Contract { |
|
|
|
contract Contract { |
|
|
|