AU: Don't use sparse holes as scratch space in the delta generator.
This patch fixes a number of bugs related to handling of sparse holes
in the context of scratch space in the delta diff generator and adds
appropriate unit tests. Most notably:
- Ignore sparse holes for the purposes of ExtentRanges. This prevents
the generator from using sparse holes as scratch.
- Adds two unit tests to catch using sparse holes as scratch in a more
deterministric way.
- Handle correctly sparse holes in
GraphUtils::AppendBlockToExtents. For example, previously, if one
adds block 0 to a single-block kSparseHole extent, the extent would
have been simply extended.
BUG=chromium:238440
TEST=unit tests, trybots
Change-Id: I3fedcc93af319ee741821ad9d1a2a57b7a7d5de2
Reviewed-on: https://gerrit.chromium.org/gerrit/50448
Commit-Queue: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
6 files changed