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.
This commit is contained in:
Lefteris Karapetsas
2015-10-15 10:52:30 +02:00
parent 3287cd464f
commit a521843f6b
4 changed files with 79 additions and 21 deletions
+7 -4
View File
@@ -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)