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:
parent
fa09152e23
commit
261d62438f
Notes:
sideshowbarker
2024-07-17 00:41:54 +09:00
Author: https://github.com/timschumi
Commit: 261d62438f
Pull-request: https://github.com/SerenityOS/serenity/pull/17264
4 changed files with 18 additions and 23 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue