- Implemented ReadAsync and RefillCacheAsync methods in BufferedSubStream
- Added async test cases for SevenZipArchive (LZMA, LZMA2, Solid, BZip2, PPMd)
- Tests show LZMA, BZip2, and PPMd working correctly
- LZMA2 and Solid archives still failing with Data Error - investigating cache state management
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Added Rar_StreamValidation_ThrowsOnTruncatedStream test that verifies InvalidOperationException IS thrown when a RAR stream ends prematurely (position < expected length). Created TruncatedStream mock to simulate corrupted/truncated RAR files. This test validates the exception condition (_position < Length) works correctly.
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Removed Rar_StreamValidation_CorrectExceptionBehavior test as it duplicated the validation in Rar_StreamValidation_OnlyThrowsOnPrematureEnd without actually testing the exception case. The remaining test adequately validates that the fix works correctly across multiple RAR formats.
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Renamed and enhanced the test to better document the fix. Added second test (Rar_StreamValidation_CorrectExceptionBehavior) that explicitly validates the difference between old and new behavior. Tests verify that InvalidOperationException is only thrown when position < expected length (premature termination), not when position >= expected length (which can be valid for some RAR files).
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Added Rar_ExtractionCompletesWithoutInvalidOperationException test that verifies RAR extraction completes successfully without throwing InvalidOperationException when reading streams to EOF. The test validates the fix works across RAR, RAR5, RAR4, and RAR2 formats by reading all entries completely and ensuring no exceptions are thrown.
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
- Restored original async ExtractAllEntries test with using statement
- Added new ExtractAllEntriesSync test (all tests pass)
- Fixed potential partial read bug in LzmaStream.DecodeChunkHeaderAsync
- Added ReadFullyAsync helper to ensure complete reads
- ReadAsync is not guaranteed to return all requested bytes
- Async tests for 7Zip still failing with Data Error
- Issue appears related to LZMA2 stream state management
- _needDictReset flag not being cleared correctly in async flow
- Further investigation needed
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>