diff options
author | Gav Wood <g@ethdev.com> | 2015-04-21 23:32:01 +0800 |
---|---|---|
committer | Gav Wood <g@ethdev.com> | 2015-04-21 23:32:01 +0800 |
commit | 60d364540e438e3f7d4f82a44c62babbbcf4da28 (patch) | |
tree | 98803618aac792867ed46061544b96ff6dac7e16 /libsolidity/SolidityEndToEndTest.cpp | |
parent | 6122aedb9088271c838dceb051584c1c033ff42c (diff) | |
parent | 3190c9ec0932aec2270b8e720b72e2c482e59469 (diff) | |
download | dexon-solidity-60d364540e438e3f7d4f82a44c62babbbcf4da28.tar.gz dexon-solidity-60d364540e438e3f7d4f82a44c62babbbcf4da28.tar.zst dexon-solidity-60d364540e438e3f7d4f82a44c62babbbcf4da28.zip |
Merge pull request #1699 from chriseth/sol_fix_contractTypesAsArguments
Fix for Contract and Enum types as external function arguments.
Diffstat (limited to 'libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r-- | libsolidity/SolidityEndToEndTest.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libsolidity/SolidityEndToEndTest.cpp b/libsolidity/SolidityEndToEndTest.cpp index d5e6cc03..a77dcecd 100644 --- a/libsolidity/SolidityEndToEndTest.cpp +++ b/libsolidity/SolidityEndToEndTest.cpp @@ -3764,6 +3764,25 @@ BOOST_AUTO_TEST_CASE(packed_storage_signed) BOOST_CHECK( callContractFunction("test()") == encodeArgs(u256(-2), u256(4), u256(-112), u256(0))); } +BOOST_AUTO_TEST_CASE(external_types_in_calls) +{ + char const* sourceCode = R"( + contract C1 { C1 public bla; function C1(C1 x) { bla = x; } } + contract C { + function test() returns (C1 x, C1 y) { + C1 c = new C1(C1(9)); + x = c.bla(); + y = this.t1(C1(7)); + } + function t1(C1 a) returns (C1) { return a; } + function() returns (C1) { return C1(9); } + } + )"; + compileAndRun(sourceCode, 0, "C"); + BOOST_CHECK(callContractFunction("test()") == encodeArgs(u256(9), u256(7))); + BOOST_CHECK(callContractFunction("nonexisting") == encodeArgs(u256(9))); +} + BOOST_AUTO_TEST_SUITE_END() } |