aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-11-30 23:05:02 +0800
committerchriseth <c@ethdev.com>2015-11-30 23:05:02 +0800
commita3801be40c264296a6530d62141d96546b884190 (patch)
treed41d0990f034d218d53fea10486cc493be008ca2 /test
parentc806b9bcdb26fe031da94b8cdb270cb3c75b8af9 (diff)
parent6796afc2f8b441803a2c03f28271a1421935e536 (diff)
downloaddexon-solidity-a3801be40c264296a6530d62141d96546b884190.tar
dexon-solidity-a3801be40c264296a6530d62141d96546b884190.tar.gz
dexon-solidity-a3801be40c264296a6530d62141d96546b884190.tar.bz2
dexon-solidity-a3801be40c264296a6530d62141d96546b884190.tar.lz
dexon-solidity-a3801be40c264296a6530d62141d96546b884190.tar.xz
dexon-solidity-a3801be40c264296a6530d62141d96546b884190.tar.zst
dexon-solidity-a3801be40c264296a6530d62141d96546b884190.zip
Merge pull request #257 from chriseth/fixConstructorFixedArray
Bugfix for constructor unpacking with fixed-size arrays.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 0b356145..5782e6c8 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -4671,6 +4671,23 @@ BOOST_AUTO_TEST_CASE(arrays_in_constructors)
);
}
+BOOST_AUTO_TEST_CASE(fixed_arrays_in_constructors)
+{
+ char const* sourceCode = R"(
+ contract Creator {
+ uint public r;
+ address public ch;
+ function Creator(address[3] s, uint x) {
+ r = x;
+ ch = s[2];
+ }
+ }
+ )";
+ compileAndRun(sourceCode, 0, "Creator", encodeArgs(u256(1), u256(2), u256(3), u256(4)));
+ BOOST_REQUIRE(callContractFunction("r()") == encodeArgs(u256(4)));
+ BOOST_REQUIRE(callContractFunction("ch()") == encodeArgs(u256(3)));
+}
+
BOOST_AUTO_TEST_CASE(arrays_from_and_to_storage)
{
char const* sourceCode = R"(