diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-02-10 21:37:06 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-02-11 06:44:29 +0800 |
commit | 30cfad35484e9b903bf90bb723382aebc832d560 (patch) | |
tree | 7e4996a56d20aa24b93aa93d887a1dcc91b6d157 /test | |
parent | f26fe5bc1c835302af27981e96d0ebbf31c80389 (diff) | |
download | dexon-solidity-30cfad35484e9b903bf90bb723382aebc832d560.tar dexon-solidity-30cfad35484e9b903bf90bb723382aebc832d560.tar.gz dexon-solidity-30cfad35484e9b903bf90bb723382aebc832d560.tar.bz2 dexon-solidity-30cfad35484e9b903bf90bb723382aebc832d560.tar.lz dexon-solidity-30cfad35484e9b903bf90bb723382aebc832d560.tar.xz dexon-solidity-30cfad35484e9b903bf90bb723382aebc832d560.tar.zst dexon-solidity-30cfad35484e9b903bf90bb723382aebc832d560.zip |
Check for state changes in revert() tests
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 8c0e29fd..92c1a9a1 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -9100,10 +9100,13 @@ BOOST_AUTO_TEST_CASE(revert) { char const* sourceCode = R"( contract C { + uint public a = 42; function f() { + a = 1; revert(); } function g() { + a = 1; assembly { revert(0, 0) } @@ -9112,7 +9115,9 @@ BOOST_AUTO_TEST_CASE(revert) )"; compileAndRun(sourceCode, 0, "C"); BOOST_CHECK(callContractFunction("f()") == encodeArgs()); + BOOST_CHECK(callContractFunction("a()") == encodeArgs(u256(42))); BOOST_CHECK(callContractFunction("g()") == encodeArgs()); + BOOST_CHECK(callContractFunction("a()") == encodeArgs(u256(42))); } BOOST_AUTO_TEST_SUITE_END() |