On 2026-08-08T00:44:32, Aristo Chen <[email protected]> wrote:
> test: cmd: Add gzwrite chunk boundary regression test
>
> Add a deterministic regression test for the gzwrite() case where a
> decompression input chunk is exhausted at exactly the same time as
> the write buffer fills up. Build a gzip file by hand from two 1 KiB
> stored deflate blocks and pick a chunk size that covers exactly the
> first block header plus its payload, so that with a 1 KiB write
> buffer the first input chunk runs out precisely when the write buffer
> is full.
>
> Unlike the existing random data test, which only hits this corner
> case for rare byte patterns (about 1 percent of runs on sandbox64),
> this test fails 20 out of 20 runs without the preceding gunzip fix:
>
>   Error: inflate() returned -5
>
> and passed 100 out of 100 runs with it.
>
> Signed-off-by: Aristo Chen <[email protected]>
>
> test/cmd/unzip.c | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 116 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <[email protected]>

Reply via email to