Fix incorrect test data in 5 negative tests and 1 positive test#2
Open
paddybyers wants to merge 1 commit intomainfrom
Open
Fix incorrect test data in 5 negative tests and 1 positive test#2paddybyers wants to merge 1 commit intomainfrom
paddybyers wants to merge 1 commit intomainfrom
Conversation
Fix delta binaries and metadata for targeted-negative tests that had incorrect bytes, causing decoders to reject them for the wrong reason (or accept them when they should be rejected): - invalid_magic_0/delta.vcdiff: changed 3rd magic byte from 0xC4 to 0xC5 so the magic is actually invalid - invalid_magic_0/metadata.json: updated description to match fix - invalid_version/delta.vcdiff: swapped bytes 3 and 4 so the version byte (0x01) is in the correct position after valid magic - truncated_source_length/delta.vcdiff: fixed to have valid header with a window that truncates during source segment length - truncated_source_position/delta.vcdiff: fixed to have valid header with a window that truncates during source segment position - truncated_magic_3_bytes/metadata.json: changed expected error from ErrInvalidMagic to ErrInvalidFormat (3 valid magic bytes followed by EOF is a format error, not a magic error); updated description - empty-files/metadata.json: corrected window_count from 0 to 1 (the delta contains one window that produces zero target bytes) Verified all four implementations still pass after these fixes: - vcdiff-go: all tests pass - vcdiff-py: all tests pass - vcdiff-dart: all tests pass - vcdiff-kotlin: all tests pass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Five targeted-negative test cases had incorrect delta binaries that caused decoders to reject them for the wrong reason (or accept them when they should be rejected). One targeted-positive test had incorrect metadata.
Changes
Delta binary fixes
Metadata fixes
ErrInvalidMagictoErrInvalidFormat. Three valid magic bytes followed by EOF is a format/truncation error, not a magic error — the magic itself is valid.window_countfrom 0 to 1. The delta contains one window that produces zero target bytes.Verification
All four existing implementations pass after these fixes: