tests/block_cloning: rename and document get_same_blocks helper #15181
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
get_same_blocks
is a helper to compare two files and return a list of the blocks that are clones of each other. Its very necessary for block cloning tests.Previously it was incorrectly called
unique_blocks
, which is the inverse of what it does (an early version did list unique blocks; it was changed but the name was not). So if nothing else, it should be calledduplicate_blocks
.But, keeping the details of a clone operation in your head is actually quite difficult, without the additional overhead of wondering how the tools work. So I've renamed it to better describe what it does, added a usage note, and changed it to return block indexes from 0 instead of 1, to match how L0 blocks are normally counted.
How Has This Been Tested?
Test suite continues to pass locally.
Types of changes
Checklist:
Signed-off-by
.