aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-10-13 22:55:59 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-10-15 16:52:30 +0800
commita521843f6b0bf019a19d9a377f4bbbc473083151 (patch)
treeb8d2d294cccefceadc0c8582adbfcdee72b13ebc /test
parent3287cd464fc6b73ba5da2a94030ab202370f647a (diff)
downloaddexon-solidity-a521843f6b0bf019a19d9a377f4bbbc473083151.tar
dexon-solidity-a521843f6b0bf019a19d9a377f4bbbc473083151.tar.gz
dexon-solidity-a521843f6b0bf019a19d9a377f4bbbc473083151.tar.bz2
dexon-solidity-a521843f6b0bf019a19d9a377f4bbbc473083151.tar.lz
dexon-solidity-a521843f6b0bf019a19d9a377f4bbbc473083151.tar.xz
dexon-solidity-a521843f6b0bf019a19d9a377f4bbbc473083151.tar.zst
dexon-solidity-a521843f6b0bf019a19d9a377f4bbbc473083151.zip
Implement Dynamic array push and fix test
Still a work in progress. There is a disturbance in the stack at the moment and that's why there are some cout statements left for debugging.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index b78ea8ec..7ae97db2 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -3481,16 +3481,19 @@ BOOST_AUTO_TEST_CASE(array_push)
{
char const* sourceCode = R"(
contract c {
- int[] data;
- function test() returns (uint) {
+ uint[] data;
+ function test() returns (uint x, uint y, uint z, uint l) {
data.push(5);
+ x = data[0];
data.push(4);
- return data.push(3);
+ y = data[1];
+ l = data.push(3);
+ z = data[2];
}
}
)";
compileAndRun(sourceCode);
- BOOST_CHECK(callContractFunction("test()") == encodeArgs(3));
+ BOOST_CHECK(callContractFunction("test()") == encodeArgs(5, 4, 3, 2));
}
BOOST_AUTO_TEST_CASE(external_array_args)