test for exception in constructor

This commit is contained in:
Liana Husikyan 2015-05-21 13:02:24 +02:00
parent 4a2f18b41a
commit 82dc10d492

View File

@ -4161,6 +4161,23 @@ 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)
{
char const* sourceCode = R"(
contract A {
uint public test = 0;
function A()
{
this.call("123");
test = 1;
}
}
)";
compileAndRun(sourceCode, 0, "A");
BOOST_CHECK(callContractFunction("test()") == encodeArgs(1));
}
BOOST_AUTO_TEST_SUITE_END()
}