diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-05-21 19:45:32 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-06-01 19:06:12 +0800 |
commit | f1c042df8c66f13ba102bdfae03337c45173a248 (patch) | |
tree | a9fa6b1da06f356919f35ed871dd4e672a4838e9 /libsolidity | |
parent | 82dc10d492d74fc1a9e07549f39d5ef2230822cc (diff) | |
download | dexon-solidity-f1c042df8c66f13ba102bdfae03337c45173a248.tar.gz dexon-solidity-f1c042df8c66f13ba102bdfae03337c45173a248.tar.zst dexon-solidity-f1c042df8c66f13ba102bdfae03337c45173a248.zip |
test for constructor (out of band exception)
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/SolidityEndToEndTest.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/libsolidity/SolidityEndToEndTest.cpp b/libsolidity/SolidityEndToEndTest.cpp index 76952c67..c150a488 100644 --- a/libsolidity/SolidityEndToEndTest.cpp +++ b/libsolidity/SolidityEndToEndTest.cpp @@ -4161,7 +4161,7 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_when_calling_non_existing_function) BOOST_CHECK(callContractFunction("test()") == encodeArgs(0)); } -BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor) +BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_call_fail) { char const* sourceCode = R"( contract A { @@ -4169,7 +4169,25 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor) function A() { this.call("123"); - test = 1; + ++test; + } + } + )"; + compileAndRun(sourceCode, 0, "A"); + + BOOST_CHECK(callContractFunction("test()") == encodeArgs(1)); +} + +BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_out_of_band) +{ + char const* sourceCode = R"( + contract A { + uint public test = 0; + uint[3] arr; + function A() + { + test = arr[5]; + ++test; } } )"; |