diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-05-19 20:55:12 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-06-01 19:06:12 +0800 |
commit | 042491e0ccae9600b6d513c9e9023d35c9184feb (patch) | |
tree | 480723f4c77d4e1bb6311f23212e285d927a8fb3 /libsolidity | |
parent | 8967476a8d5371e81e224ec284fb9100816242c7 (diff) | |
download | dexon-solidity-042491e0ccae9600b6d513c9e9023d35c9184feb.tar dexon-solidity-042491e0ccae9600b6d513c9e9023d35c9184feb.tar.gz dexon-solidity-042491e0ccae9600b6d513c9e9023d35c9184feb.tar.bz2 dexon-solidity-042491e0ccae9600b6d513c9e9023d35c9184feb.tar.lz dexon-solidity-042491e0ccae9600b6d513c9e9023d35c9184feb.tar.xz dexon-solidity-042491e0ccae9600b6d513c9e9023d35c9184feb.tar.zst dexon-solidity-042491e0ccae9600b6d513c9e9023d35c9184feb.zip |
added test to check evm exception
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/SolidityEndToEndTest.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libsolidity/SolidityEndToEndTest.cpp b/libsolidity/SolidityEndToEndTest.cpp index f8d20d70..faa5dad4 100644 --- a/libsolidity/SolidityEndToEndTest.cpp +++ b/libsolidity/SolidityEndToEndTest.cpp @@ -4111,6 +4111,30 @@ BOOST_AUTO_TEST_CASE(struct_delete_struct_in_mapping) BOOST_CHECK(callContractFunction("deleteIt()") == encodeArgs(0)); } +BOOST_AUTO_TEST_CASE(evm_exceptions) +{ + char const* sourceCode = R"( + contract A { + uint[3] arr; + bool public test = false; + function getElement(uint i) returns (uint) + { + return arr[i]; + } + function testIt() returns (bool) + { + uint i = this.getElement(5); + test = true; + return true; + } + } + )"; + compileAndRun(sourceCode, 0, "A"); + BOOST_CHECK(callContractFunction("test()") == encodeArgs(false)); + BOOST_CHECK(callContractFunction("testIt()") == encodeArgs()); + BOOST_CHECK(callContractFunction("test()") == encodeArgs(false)); +} + BOOST_AUTO_TEST_SUITE_END() } |