diff options
author | chriseth <chris@ethereum.org> | 2017-01-25 00:37:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-25 00:37:22 +0800 |
commit | 3dc83aa34e83d668cde82953f9efa94ebb7de8ed (patch) | |
tree | 06013ebd774f99584be9ca09c22feac010ebc2c7 /test | |
parent | 29dab03ec8b595fc25e010bd8b60b2e280d0ebed (diff) | |
parent | 7e6f1b3f0008d03e6cdfa186b8f9976570865d4e (diff) | |
download | dexon-solidity-3dc83aa34e83d668cde82953f9efa94ebb7de8ed.tar.gz dexon-solidity-3dc83aa34e83d668cde82953f9efa94ebb7de8ed.tar.zst dexon-solidity-3dc83aa34e83d668cde82953f9efa94ebb7de8ed.zip |
Merge pull request #1588 from ethereum/fixrecursivestructs
Introduce low-level functions
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index da7adbbf..e8e5ced1 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -8992,6 +8992,28 @@ BOOST_AUTO_TEST_CASE(contracts_separated_with_comment) compileAndRun(sourceCode, 0, "C2"); } +BOOST_AUTO_TEST_CASE(recursive_structs) +{ + char const* sourceCode = R"( + contract C { + struct S { + S[] x; + } + S sstorage; + function f() returns (uint) { + S memory s; + s.x = new S[](10); + delete s; + sstorage.x.length++; + delete sstorage; + return 1; + } + } + )"; + compileAndRun(sourceCode, 0, "C"); + BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(1))); +} + BOOST_AUTO_TEST_SUITE_END() } |