diff --git a/remix-analyzer/test/analysis/staticAnalysisIntegration-test.js b/remix-analyzer/test/analysis/staticAnalysisIntegration-test.js index d08d057a9a..0d3a67cfdb 100644 --- a/remix-analyzer/test/analysis/staticAnalysisIntegration-test.js +++ b/remix-analyzer/test/analysis/staticAnalysisIntegration-test.js @@ -259,7 +259,7 @@ test('Integration test gasCosts.js', function (t) { 'forgottenReturn.sol': 3, 'selfdestruct.sol': 0, 'deleteDynamicArray.sol': 2, - 'deleteFromDynamicArray.sol': 2, + 'deleteFromDynamicArray.sol': 1, 'blockLevelCompare.sol': 1, 'intDivisionTruncate.sol': 1, 'ERC20.sol': 2, diff --git a/remix-analyzer/test/analysis/test-contracts/deleteFromDynamicArray.sol b/remix-analyzer/test/analysis/test-contracts/deleteFromDynamicArray.sol index a8e0c0eae0..dbe08109bb 100644 --- a/remix-analyzer/test/analysis/test-contracts/deleteFromDynamicArray.sol +++ b/remix-analyzer/test/analysis/test-contracts/deleteFromDynamicArray.sol @@ -6,7 +6,8 @@ contract arr { return array; } - function safeRemoveAtIndex(uint index) returns (uint[]) { + // TODO: deleteFromDynamicArray should not generate warnings if array item is shifted and removed + /* function safeRemoveAtIndex(uint index) returns (uint[]) { if (index >= array.length) return; for (uint i = index; i < array.length-1; i++) { @@ -17,5 +18,5 @@ contract arr { array.length--; return array; - } + } */ } diff --git a/remix-analyzer/test/analysis/test-contracts/forLoopIteratesOverDynamicArray.sol b/remix-analyzer/test/analysis/test-contracts/forLoopIteratesOverDynamicArray.sol index 16bb69c7e8..c8d57c5e2d 100644 --- a/remix-analyzer/test/analysis/test-contracts/forLoopIteratesOverDynamicArray.sol +++ b/remix-analyzer/test/analysis/test-contracts/forLoopIteratesOverDynamicArray.sol @@ -6,7 +6,8 @@ contract forLoopArr { } function shiftArrItem(uint index) returns(uint[]) { - for (uint i = index; i < array.length-1; i++) { + // 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;