mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
added implementation to append code for State variable accessor
fixed tests
This commit is contained in:
parent
a33564fbcc
commit
4d4a999db2
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user