1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:57:46 +00:00

AK: Move bit streams from LibCore

This commit is contained in:
Tim Schumacher 2023-01-25 20:06:16 +01:00 committed by Andrew Kaster
parent 94f139c111
commit 2470dd3bb5
14 changed files with 167 additions and 158 deletions

View file

@ -7,9 +7,9 @@
#include <LibTest/TestCase.h>
#include <AK/Array.h>
#include <AK/BitStream.h>
#include <AK/Random.h>
#include <LibCompress/Deflate.h>
#include <LibCore/BitStream.h>
#include <LibCore/MemoryStream.h>
#include <cstring>
@ -29,7 +29,7 @@ TEST_CASE(canonical_code_simple)
auto const huffman = Compress::CanonicalCode::from_bytes(code).value();
auto memory_stream = MUST(Core::Stream::FixedMemoryStream::construct(input));
auto bit_stream = MUST(Core::Stream::LittleEndianInputBitStream::construct(move(memory_stream)));
auto bit_stream = MUST(LittleEndianInputBitStream::construct(move(memory_stream)));
for (size_t idx = 0; idx < 9; ++idx)
EXPECT_EQ(MUST(huffman.read_symbol(*bit_stream)), output[idx]);
@ -49,7 +49,7 @@ TEST_CASE(canonical_code_complex)
auto const huffman = Compress::CanonicalCode::from_bytes(code).value();
auto memory_stream = MUST(Core::Stream::FixedMemoryStream::construct(input));
auto bit_stream = MUST(Core::Stream::LittleEndianInputBitStream::construct(move(memory_stream)));
auto bit_stream = MUST(LittleEndianInputBitStream::construct(move(memory_stream)));
for (size_t idx = 0; idx < 12; ++idx)
EXPECT_EQ(MUST(huffman.read_symbol(*bit_stream)), output[idx]);