• Denis Solonkov's avatar
    Zeroes the [l, r) range in virtual memory and update tests. · 2d8e56aa
    Denis Solonkov authored
    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: default avatarBoris Sazonov <bsazonov@chromium.org>
    Reviewed-by: default avatarAlex Ilin <alexilin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#697190}
    2d8e56aa
compression_script_test.py 5.11 KB