diff options
author | Christian <c@ethdev.com> | 2015-01-26 17:13:34 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-01-26 17:23:39 +0800 |
commit | 2b2da431bc52610e8528ce83e5b59d2588fc7f2c (patch) | |
tree | c580e984435710e723481dd4b6cfeb446a974598 /SolidityEndToEndTest.cpp | |
parent | c657fe9611f556bd991e038badd723cbdcb82c2b (diff) | |
download | dexon-solidity-2b2da431bc52610e8528ce83e5b59d2588fc7f2c.tar dexon-solidity-2b2da431bc52610e8528ce83e5b59d2588fc7f2c.tar.gz dexon-solidity-2b2da431bc52610e8528ce83e5b59d2588fc7f2c.tar.bz2 dexon-solidity-2b2da431bc52610e8528ce83e5b59d2588fc7f2c.tar.lz dexon-solidity-2b2da431bc52610e8528ce83e5b59d2588fc7f2c.tar.xz dexon-solidity-2b2da431bc52610e8528ce83e5b59d2588fc7f2c.tar.zst dexon-solidity-2b2da431bc52610e8528ce83e5b59d2588fc7f2c.zip |
Call modifiers on constructor.
Diffstat (limited to 'SolidityEndToEndTest.cpp')
-rw-r--r-- | SolidityEndToEndTest.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/SolidityEndToEndTest.cpp b/SolidityEndToEndTest.cpp index c06a37dd..ebde773c 100644 --- a/SolidityEndToEndTest.cpp +++ b/SolidityEndToEndTest.cpp @@ -1754,6 +1754,23 @@ BOOST_AUTO_TEST_CASE(function_modifier_calling_functions_in_creation_context) BOOST_CHECK(callContractFunction("getData()") == encodeArgs(0x4300)); } +BOOST_AUTO_TEST_CASE(function_modifier_for_constructor) +{ + char const* sourceCode = R"( + contract A { + uint data; + function A() mod1 { data |= 2; } + modifier mod1 { data |= 1; _ } + function getData() returns (uint r) { return data; } + } + contract C is A { + modifier mod1 { data |= 4; _ } + } + )"; + compileAndRun(sourceCode); + BOOST_CHECK(callContractFunction("getData()") == encodeArgs(4 | 2)); +} + BOOST_AUTO_TEST_SUITE_END() } |