From 4117e859eb5780873177cf1c93eb8379e17ed247 Mon Sep 17 00:00:00 2001 From: Leonardo Alt Date: Mon, 30 Apr 2018 16:30:41 +0200 Subject: [SMTChecker] Declaring all state vars before any function is visited --- test/libsolidity/SMTChecker.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/libsolidity') 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) -- cgit v1.2.3