aboutsummaryrefslogtreecommitdiffstats
path: root/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2015-02-07 19:06:41 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2015-02-07 19:06:41 +0800
commita7feb5e689ea00338e73da8a5e22cc1c7f5740ea (patch)
tree2dc4747c56fb3db76252f9b15ac70fb9a7ef729a /SolidityEndToEndTest.cpp
parent360f479143aeb13bd8db66d0db499ed56c0c66b5 (diff)
parent86729f9eeed4b2ea83949d29fa5d704de70c9d5e (diff)
downloaddexon-solidity-a7feb5e689ea00338e73da8a5e22cc1c7f5740ea.tar
dexon-solidity-a7feb5e689ea00338e73da8a5e22cc1c7f5740ea.tar.gz
dexon-solidity-a7feb5e689ea00338e73da8a5e22cc1c7f5740ea.tar.bz2
dexon-solidity-a7feb5e689ea00338e73da8a5e22cc1c7f5740ea.tar.lz
dexon-solidity-a7feb5e689ea00338e73da8a5e22cc1c7f5740ea.tar.xz
dexon-solidity-a7feb5e689ea00338e73da8a5e22cc1c7f5740ea.tar.zst
dexon-solidity-a7feb5e689ea00338e73da8a5e22cc1c7f5740ea.zip
Merge branch 'develop' into jsonrpcstub
Diffstat (limited to 'SolidityEndToEndTest.cpp')
-rw-r--r--SolidityEndToEndTest.cpp18
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"