diff options
author | Tim Schumacher <timschumi@gmx.de> | 2023-03-30 13:16:40 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-03-30 14:38:47 +0200 |
commit | 726963edc7330e8e8862e54fcabbddf788852113 (patch) | |
tree | 7eee551b0d5437acb5b84a6ee5dcd790c7831f41 /Tests/LibCompress/TestXz.cpp | |
parent | 00332c9b7d52d444c4c84af49d542c983a0231ac (diff) | |
download | serenity-726963edc7330e8e8862e54fcabbddf788852113.zip |
LibCompress: Implement support for multiple concatenated XZ streams
Diffstat (limited to 'Tests/LibCompress/TestXz.cpp')
-rw-r--r-- | Tests/LibCompress/TestXz.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Tests/LibCompress/TestXz.cpp b/Tests/LibCompress/TestXz.cpp index ec8dc31f1f..548511a3e9 100644 --- a/Tests/LibCompress/TestXz.cpp +++ b/Tests/LibCompress/TestXz.cpp @@ -39,8 +39,8 @@ TEST_CASE(xz_utils_bad_0cat_alone) auto stream = MUST(try_make<FixedMemoryStream>(compressed)); auto decompressor = MUST(Compress::XzDecompressor::create(move(stream))); - // TODO: We currently don't support XZ files with multiple concatenated streams, so we don't check for trailing garbage either. - (void)decompressor->read_until_eof(PAGE_SIZE); + auto buffer_or_error = decompressor->read_until_eof(PAGE_SIZE); + EXPECT(buffer_or_error.is_error()); } TEST_CASE(xz_utils_bad_0cat_header_magic) @@ -56,8 +56,8 @@ TEST_CASE(xz_utils_bad_0cat_header_magic) auto stream = MUST(try_make<FixedMemoryStream>(compressed)); auto decompressor = MUST(Compress::XzDecompressor::create(move(stream))); - // TODO: We currently don't support XZ files with multiple concatenated streams, so we don't check for the second header magic. - (void)decompressor->read_until_eof(PAGE_SIZE); + auto buffer_or_error = decompressor->read_until_eof(PAGE_SIZE); + EXPECT(buffer_or_error.is_error()); } TEST_CASE(xz_utils_bad_0catpad_empty) @@ -74,8 +74,8 @@ TEST_CASE(xz_utils_bad_0catpad_empty) auto stream = MUST(try_make<FixedMemoryStream>(compressed)); auto decompressor = MUST(Compress::XzDecompressor::create(move(stream))); - // TODO: We currently don't support XZ files with multiple concatenated streams, so we don't check for the stream padding. - (void)decompressor->read_until_eof(PAGE_SIZE); + auto buffer_or_error = decompressor->read_until_eof(PAGE_SIZE); + EXPECT(buffer_or_error.is_error()); } TEST_CASE(xz_utils_bad_0_empty_truncated) @@ -151,8 +151,8 @@ TEST_CASE(xz_utils_bad_0pad_empty) auto stream = MUST(try_make<FixedMemoryStream>(compressed)); auto decompressor = MUST(Compress::XzDecompressor::create(move(stream))); - // TODO: We currently don't support XZ files with multiple concatenated streams, so we don't check for the stream padding. - (void)decompressor->read_until_eof(PAGE_SIZE); + auto buffer_or_error = decompressor->read_until_eof(PAGE_SIZE); + EXPECT(buffer_or_error.is_error()); } TEST_CASE(xz_utils_bad_1_block_header_1) |