mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #623 from chriseth/sol_constructorChecks
Checks for the constructor and ability to call functions
This commit is contained in:
commit
8e87e85937
@ -1112,6 +1112,23 @@ BOOST_AUTO_TEST_CASE(constructor_arguments)
|
||||
BOOST_REQUIRE(callContractFunction(1) == bytes({'a', 'b', 'c'}));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(functions_called_by_constructor)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract Test {
|
||||
string3 name;
|
||||
bool flag;
|
||||
function Test() {
|
||||
setName("abc");
|
||||
}
|
||||
function getName() returns (string3 ret) { return name; }
|
||||
private:
|
||||
function setName(string3 _name) { name = _name; }
|
||||
})";
|
||||
compileAndRun(sourceCode);
|
||||
BOOST_REQUIRE(callContractFunction(0) == bytes({'a', 'b', 'c'}));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user