Zeroes the [l, r) range in virtual memory and update tests.
We can't expect that the test array would be put in the same place in memory between test runs and since [l, r) is being rounded to the page size. Due to that we can't make any assumptions about the elements inside of the final range and can't calculate the resulting sum, since all elements inside of the range are zeroed. The tests were modified the following way: 1) All zeroes in the test array were replaced by one to be able to locate all zeroed elements in it. 2) GetSum method was replaced by GetZeroes method which is expected to return 4096. 3) The size of the array was set to 2*4096 - 1 to prevent unlikely case of array aligning perfectly on memory and having 2 pages cut out of it. Bug: 998082 Change-Id: Idde87569decd3a52ecd1a0c034ab638833d8e0b3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1795791 Commit-Queue: Denis Solonkov <solonkovda@google.com> Reviewed-by:Boris Sazonov <bsazonov@chromium.org> Reviewed-by:
Alex Ilin <alexilin@chromium.org> Cr-Commit-Position: refs/heads/master@{#697190}
Showing
This diff is collapsed.
Please register or sign in to comment