aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLeonardo Alt <leo@ethereum.org>2018-04-30 22:30:41 +0800
committerchriseth <chris@ethereum.org>2018-05-15 20:28:08 +0800
commit4117e859eb5780873177cf1c93eb8379e17ed247 (patch)
tree037215fc1ac785a087ac3d9935b1c1aa37a187e1 /test
parent2dbb35d4a8fc4321d59a670343b439232c92eaa9 (diff)
downloaddexon-solidity-4117e859eb5780873177cf1c93eb8379e17ed247.tar.gz
dexon-solidity-4117e859eb5780873177cf1c93eb8379e17ed247.tar.zst
dexon-solidity-4117e859eb5780873177cf1c93eb8379e17ed247.zip
[SMTChecker] Declaring all state vars before any function is visited
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SMTChecker.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/libsolidity/SMTChecker.cpp b/test/libsolidity/SMTChecker.cpp
index ce3569f3..5f54db6d 100644
--- a/test/libsolidity/SMTChecker.cpp
+++ b/test/libsolidity/SMTChecker.cpp
@@ -531,6 +531,17 @@ BOOST_AUTO_TEST_CASE(storage_value_vars)
}
)";
CHECK_SUCCESS_NO_WARNINGS(text);
+ text = R"(
+ contract C
+ {
+ function f() public view {
+ assert(c > 0);
+ }
+ uint c;
+ }
+ )";
+ CHECK_WARNING(text, "Assertion violation happens here");
+
}
BOOST_AUTO_TEST_CASE(while_loop_simple)