diff options
author | chriseth <c@ethdev.com> | 2014-12-17 22:18:49 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2014-12-17 22:18:49 +0800 |
commit | 8e87e85937d6ca6992f48dd5d8e6a0db276af205 (patch) | |
tree | 47a3cdfb93c25be5915f7b0629fcd1bd67d0b848 | |
parent | 9ef4fbe2d0c5acaad996f107c17a891558cc21b0 (diff) | |
parent | ff143b06c42e134ee0d49f425556113143b5694c (diff) | |
download | dexon-solidity-8e87e85937d6ca6992f48dd5d8e6a0db276af205.tar.gz dexon-solidity-8e87e85937d6ca6992f48dd5d8e6a0db276af205.tar.zst dexon-solidity-8e87e85937d6ca6992f48dd5d8e6a0db276af205.zip |
Merge pull request #623 from chriseth/sol_constructorChecks
Checks for the constructor and ability to call functions
-rw-r--r-- | solidityEndToEndTest.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/solidityEndToEndTest.cpp b/solidityEndToEndTest.cpp index ad277a38..26f5528a 100644 --- a/solidityEndToEndTest.cpp +++ b/solidityEndToEndTest.cpp @@ -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() } |