Skip to content

Commit

Permalink
Check for state changes in revert() tests
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Feb 10, 2017
1 parent 0c077b4 commit 37a518f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/libsolidity/SolidityEndToEndTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9081,10 +9081,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)
}
Expand All @@ -9093,7 +9096,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()
Expand Down

0 comments on commit 37a518f

Please sign in to comment.