mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2026-07-09 02:16:24 +00:00
Regression tests for the error handling improvements in fix/flac-error-handling (PR #23). The fix changed decode/encode to return 0 instead of (size_t)-1 on failure, added NULL allocation checks, and fixed a decoder memory leak on init failure. Tests added (flacErrors suite): - decode_garbage_returns_zero: random non-FLAC data - decode_truncated_flac_returns_zero: valid magic, truncated stream - decode_empty_input_returns_zero: NULL source buffer - decode_zero_length_returns_zero: non-NULL but zero-length source - encode_zero_length_no_crash: NULL source, verifies no crash/leak - encode_garbage_roundtrip_fails_cleanly: non-PCM encode + decode - decode_dst_too_small_returns_zero: undersized output buffer All tests are self-contained (no fixture files needed) and pass under AddressSanitizer.
8.1 KiB
8.1 KiB