Add a dynamic array push() test

This commit is contained in:
Lefteris Karapetsas 2015-10-12 09:57:18 +02:00
parent e11e10f817
commit 763b544822

View File

@ -3452,6 +3452,7 @@ BOOST_AUTO_TEST_CASE(array_copy_target_leftover2)
asString(fromHex("0000000000000000"))
));
}
BOOST_AUTO_TEST_CASE(array_copy_storage_storage_struct)
{
char const* sourceCode = R"(
@ -3476,6 +3477,22 @@ BOOST_AUTO_TEST_CASE(array_copy_storage_storage_struct)
BOOST_CHECK(m_state.storage(m_contractAddress).empty());
}
BOOST_AUTO_TEST_CASE(array_push)
{
char const* sourceCode = R"(
contract c {
int[] data;
function test() returns (uint) {
data.push(5);
data.push(4);
return data.push(3);
}
}
)";
compileAndRun(sourceCode);
BOOST_CHECK(callContractFunction("test()") == encodeArgs(3));
}
BOOST_AUTO_TEST_CASE(external_array_args)
{
char const* sourceCode = R"(