diff options
author | subtly <subtly@users.noreply.github.com> | 2015-02-07 11:58:53 +0800 |
---|---|---|
committer | subtly <subtly@users.noreply.github.com> | 2015-02-07 11:58:53 +0800 |
commit | 270a2d70945b383dcf4683c723ee4081e0775bdc (patch) | |
tree | f14f26ce4d8699dfc06c1b66ee978988e3149380 | |
parent | d1078b667ca0ab56b0a508e0dd6cb80780425551 (diff) | |
parent | 86729f9eeed4b2ea83949d29fa5d704de70c9d5e (diff) | |
download | dexon-solidity-270a2d70945b383dcf4683c723ee4081e0775bdc.tar dexon-solidity-270a2d70945b383dcf4683c723ee4081e0775bdc.tar.gz dexon-solidity-270a2d70945b383dcf4683c723ee4081e0775bdc.tar.bz2 dexon-solidity-270a2d70945b383dcf4683c723ee4081e0775bdc.tar.lz dexon-solidity-270a2d70945b383dcf4683c723ee4081e0775bdc.tar.xz dexon-solidity-270a2d70945b383dcf4683c723ee4081e0775bdc.tar.zst dexon-solidity-270a2d70945b383dcf4683c723ee4081e0775bdc.zip |
Merge branch 'develop' into p2p
-rw-r--r-- | SolidityEndToEndTest.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/SolidityEndToEndTest.cpp b/SolidityEndToEndTest.cpp index f248a5a0..301cc06e 100644 --- a/SolidityEndToEndTest.cpp +++ b/SolidityEndToEndTest.cpp @@ -959,6 +959,24 @@ BOOST_AUTO_TEST_CASE(complex_accessors) BOOST_CHECK(callContractFunction("to_multiple_map(uint256,uint256)", 42, 23) == encodeArgs(31)); } +BOOST_AUTO_TEST_CASE(struct_accessor) +{ + char const* sourceCode = R"( + contract test { + struct Data { uint a; uint8 b; mapping(uint => uint) c; bool d; } + mapping(uint => Data) public data; + function test() { + data[7].a = 1; + data[7].b = 2; + data[7].c[0] = 3; + data[7].d = true; + } + } + )"; + compileAndRun(sourceCode); + BOOST_CHECK(callContractFunction("data(uint256)", 7) == encodeArgs(1, 2, true)); +} + BOOST_AUTO_TEST_CASE(balance) { char const* sourceCode = "contract test {\n" |