From a521843f6b0bf019a19d9a377f4bbbc473083151 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 13 Oct 2015 16:55:59 +0200 Subject: 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. --- test/libsolidity/SolidityEndToEndTest.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'test/libsolidity') 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) -- cgit v1.2.3