1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:37:43 +00:00

Tests: Document input of the xz_utils_good_1_block_header_1 test case

This commit is contained in:
Tim Schumacher 2023-04-01 10:54:53 +02:00 committed by Andreas Kling
parent bc70d7bb77
commit b451964bbc

View file

@ -1283,11 +1283,51 @@ TEST_CASE(xz_utils_good_1_block_header_1)
// Size in the Block Header. This has also four extra bytes of Header
// Padding."
Array<u8, 72> const compressed {
0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x01, 0x69, 0x22, 0xDE, 0x36, 0x03, 0xC0, 0x11, 0x0D,
0x21, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xDE, 0x39, 0xEB, 0x01, 0x00, 0x0C, 0x48,
0x65, 0x6C, 0x6C, 0x6F, 0x0A, 0x57, 0x6F, 0x72, 0x6C, 0x64, 0x21, 0x0A, 0x00, 0x00, 0x00, 0x00,
0x43, 0xA3, 0xA2, 0x15, 0x00, 0x01, 0x25, 0x0D, 0x71, 0x19, 0xC4, 0xB6, 0x90, 0x42, 0x99, 0x0D,
0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x59, 0x5A
// Stream Header
0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, // Magic
0x00, 0x01, // Stream Flags
0x69, 0x22, 0xDE, 0x36, // CRC32
// Block Header
0x03, // Block Header Size
0xC0, // Block Flags (one filter, compressed size and uncompressed size present)
0x11, // Compressed Size
0x0D, // Uncompressed Size
// Filter 0 Flags
0x21, // Filter ID
0x01, // Size of Properties
0x08, // Filter Properties
0x00, 0x00, 0x00, 0x00, 0x00, // Header Padding
0x7F, 0xDE, 0x39, 0xEB, // CRC32
// Compressed Data (LZMA2)
// Uncompressed chunk with dictionary reset
0x01, // Control Byte
0x00, 0x0C, // 16-bit data size minus one (big-endian)
0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x0A, 0x57, 0x6F, 0x72, 0x6C, 0x64, 0x21, 0x0A,
// End of LZMA2 stream
0x00,
// Block Padding
0x00, 0x00, 0x00,
// Uncompressed Data Check (CRC32)
0x43, 0xA3, 0xA2, 0x15,
// Index
0x00, // Index Indicator
0x01, // Number of Records (multibyte integer)
// Record 0
0x25, // Unpadded Size (multibyte integer)
0x0D, // Uncompressed Size (multibyte integer)
// CRC32
0x71, 0x19, 0xC4, 0xB6,
// Stream Footer
0x90, 0x42, 0x99, 0x0D, // CRC32
0x01, 0x00, 0x00, 0x00, // Backward Size
0x00, 0x01, // Stream Flags
0x59, 0x5A, // Footer Magic Bytes
};
auto stream = MUST(try_make<FixedMemoryStream>(compressed));