1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-09 09:34:57 +09:00

AK: Remove the fallible constructor from LittleEndianInputBitStream

This commit is contained in:
Tim Schumacher 2023-01-30 11:04:23 +01:00 committed by Linus Groh
parent fa09152e23
commit 261d62438f
Notes: sideshowbarker 2024-07-17 00:41:54 +09:00
4 changed files with 18 additions and 23 deletions

View file

@ -29,10 +29,10 @@ TEST_CASE(canonical_code_simple)
auto const huffman = Compress::CanonicalCode::from_bytes(code).value();
auto memory_stream = MUST(FixedMemoryStream::construct(input));
auto bit_stream = MUST(LittleEndianInputBitStream::construct(move(memory_stream)));
LittleEndianInputBitStream bit_stream { move(memory_stream) };
for (size_t idx = 0; idx < 9; ++idx)
EXPECT_EQ(MUST(huffman.read_symbol(*bit_stream)), output[idx]);
EXPECT_EQ(MUST(huffman.read_symbol(bit_stream)), output[idx]);
}
TEST_CASE(canonical_code_complex)
@ -49,10 +49,10 @@ TEST_CASE(canonical_code_complex)
auto const huffman = Compress::CanonicalCode::from_bytes(code).value();
auto memory_stream = MUST(FixedMemoryStream::construct(input));
auto bit_stream = MUST(LittleEndianInputBitStream::construct(move(memory_stream)));
LittleEndianInputBitStream bit_stream { move(memory_stream) };
for (size_t idx = 0; idx < 12; ++idx)
EXPECT_EQ(MUST(huffman.read_symbol(*bit_stream)), output[idx]);
EXPECT_EQ(MUST(huffman.read_symbol(bit_stream)), output[idx]);
}
TEST_CASE(deflate_decompress_compressed_block)