pub fn check_incremental_contract<D: DecoderConfig>(
dec: D,
data: &[u8],
) -> ConformanceExpand description
Exercise a decoder’s IncrementalDecode
contract through the erased decoder callers receive
(dyn_incremental_decoder), against the one-shot pixels of data:
- driven from a slice with windows of 1, 7 and 64 bytes and the whole
file, the pixels, descriptor and
Donedimensions match one-shot, the sink is begun once and finished, and rows reach a final-only sink each exactly once in increasing order; - an input at an offset the decoder did not request is ignored without error (nothing taken, still asking);
- after
Done, further steps returnDoneagain and take nothing; - a stop that trips mid-decode yields
Cancelledwithin one step, thenFinished; - a sink that accepts provisional rows still gets every final row once
through
provide_next_buffer(never throughprovide_pass_buffer), reproducing the one-shot pixels; - truncated input (cut at a quarter and at half) behaves as the one-shot decoder does on the same bytes: a codec error where it fails (never a protocol violation), the same pixels where it succeeds;
- no drive exceeds a step budget, so a decoder that spins fails here instead of hanging.