Working implementation of arraypush

ByteArrayPush() gets a test but is ignored for now, since there are
still some issues with its implementation
This commit is contained in:
Lefteris Karapetsas
2015-10-15 13:54:59 +02:00
parent a521843f6b
commit 9224c1f712
2 changed files with 31 additions and 14 deletions
+21 -2
View File
@@ -3493,9 +3493,28 @@ BOOST_AUTO_TEST_CASE(array_push)
}
)";
compileAndRun(sourceCode);
BOOST_CHECK(callContractFunction("test()") == encodeArgs(5, 4, 3, 2));
BOOST_CHECK(callContractFunction("test()") == encodeArgs(5, 4, 3, 3));
}
#if 0 // reactivate once ByteArrayPush is properly implemented
BOOST_AUTO_TEST_CASE(byte_array_push)
{
char const* sourceCode = R"(
contract c {
bytes data;
function test() returns (byte x, byte y, byte z, uint l) {
data.push(5);
x = data[0];
data.push(4);
y = data[1];
l = data.push(3);
z = data[2];
}
}
)";
compileAndRun(sourceCode);
BOOST_CHECK(callContractFunction("test()") == encodeArgs(5, 4, 3, 3));
}
#endif
BOOST_AUTO_TEST_CASE(external_array_args)
{
char const* sourceCode = R"(