Skip to content
This repository has been archived by the owner on Mar 3, 2021. It is now read-only.

tests for #1314 #1317

Merged
merged 1 commit into from
Oct 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ test('Integration test gasCosts.js', function (t) {
'ERC20.sol': 2,
'stringBytesLength.sol': 1,
'etherTransferInLoop.sol': 3,
'forLoopIteratesOverDynamicArray.sol': 1
'forLoopIteratesOverDynamicArray.sol': 2
}

runModuleOnFiles(module, t, (file, report) => {
Expand Down Expand Up @@ -898,7 +898,7 @@ test('Integration test forLoopIteratesOverDynamicArray.js', function (t) {
'ERC20.sol': 0,
'stringBytesLength.sol': 0,
'etherTransferInLoop.sol': 0,
'forLoopIteratesOverDynamicArray.sol': 1
'forLoopIteratesOverDynamicArray.sol': 2
}

runModuleOnFiles(module, t, (file, report) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ test('Integration test gasCosts.js', function (t) {
'ERC20.sol': 2,
'stringBytesLength.sol': 1,
'etherTransferInLoop.sol': 3,
'forLoopIteratesOverDynamicArray.sol': 1
'forLoopIteratesOverDynamicArray.sol': 2
}

runModuleOnFiles(module, t, (file, report) => {
Expand Down Expand Up @@ -902,7 +902,7 @@ test('Integration test forLoopIteratesOverDynamicArray.js', function (t) {
'ERC20.sol': 0,
'stringBytesLength.sol': 0,
'etherTransferInLoop.sol': 0,
'forLoopIteratesOverDynamicArray.sol': 1
'forLoopIteratesOverDynamicArray.sol': 2
}

runModuleOnFiles(module, t, (file, report) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ contract forLoopArr {
}

function shiftArrItem(uint index) returns(uint[]) {
// TODO: for (uint i = index; i < array.length-1; i++) should also generate warning
for (uint i = index; i < array.length; i++) {
array[i] = array[i+1];
}
return array;
}

function shiftArrItem2(uint index) returns(uint[]) {
for (uint i = index; i < array.length - 1; i++) {
array[i] = array[i+1];
}
return array;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ contract forLoopArr {
}

function shiftArrItem(uint index) public returns(uint[] memory) {
// TODO: for (uint i = index; i < array.length-1; i++) should also generate warning
for (uint i = index; i < array.length; i++) {
array[i] = array[i+1];
}
return array;
}

function shiftArrItem2(uint index) public returns(uint[] memory) {
for (uint i = index; i < array.length - 1; i++) {
array[i] = array[i+1];
}
return array;
}
}