added implementation to append code for State variable accessor

fixed tests
This commit is contained in:
Liana Husikyan 2015-04-01 14:22:42 +02:00
parent a33564fbcc
commit 4d4a999db2

View File

@ -970,8 +970,8 @@ BOOST_AUTO_TEST_CASE(array_accessor)
{
char const* sourceCode = R"(
contract test {
uint[8] data;
uint[] dynamicData;
uint[8] public data;
uint[] public dynamicData;
function test() {
data[2] = 8;
dynamicData.length = 3;
@ -980,6 +980,7 @@ BOOST_AUTO_TEST_CASE(array_accessor)
}
)";
compileAndRun(sourceCode);
auto res = callContractFunction("data(uint256)", 2) ;
BOOST_CHECK(callContractFunction("data(uint256)", 2) == encodeArgs(8));
BOOST_CHECK(callContractFunction("data(uint256)", 8) == encodeArgs());
BOOST_CHECK(callContractFunction("dynamicData(uint256)", 2) == encodeArgs(8));
@ -990,8 +991,8 @@ BOOST_AUTO_TEST_CASE(accessors_mapping_for_array)
{
char const* sourceCode = R"(
contract test {
mapping(uint => uint[8]) data;
mapping(uint => uint[]) dynamicData;
mapping(uint => uint[8]) public data;
mapping(uint => uint[]) public dynamicData;
function test() {
data[2][2] = 8;
dynamicData[2].length = 3;