summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2023-01-30 11:04:48 +0100
committerLinus Groh <mail@linusgroh.de>2023-02-08 17:44:32 +0000
commit0fee97916b5471cd42e6c00f2809476eeacc6d73 (patch)
tree4074b13b71f7572c611df34ec8929ef2776fdc39 /Tests
parent261d62438f7aa3aca95613560ddb4d5bcf86756f (diff)
downloadserenity-0fee97916b5471cd42e6c00f2809476eeacc6d73.zip
AK: Remove the fallbile constructor from `BigEndianOutputBitStream`
Diffstat (limited to 'Tests')
-rw-r--r--Tests/AK/TestBitStream.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Tests/AK/TestBitStream.cpp b/Tests/AK/TestBitStream.cpp
index 1e48050bc7..5e99f61bd2 100644
--- a/Tests/AK/TestBitStream.cpp
+++ b/Tests/AK/TestBitStream.cpp
@@ -71,21 +71,21 @@ TEST_CASE(big_endian_bit_stream_input_output_match)
// Note: The bit stream only ever reads from/writes to the underlying stream in one byte chunks,
// so testing with sizes that will not trigger a write will yield unexpected results.
- auto bit_write_stream = MUST(BigEndianOutputBitStream::construct(MaybeOwned<AK::Stream>(*memory_stream)));
+ BigEndianOutputBitStream bit_write_stream { MaybeOwned<AK::Stream>(*memory_stream) };
BigEndianInputBitStream bit_read_stream { MaybeOwned<AK::Stream>(*memory_stream) };
// Test two mirrored chunks of a fully mirrored pattern to check that we are not dropping bits.
{
- MUST(bit_write_stream->write_bits(0b1111u, 4));
- MUST(bit_write_stream->write_bits(0b1111u, 4));
+ MUST(bit_write_stream.write_bits(0b1111u, 4));
+ MUST(bit_write_stream.write_bits(0b1111u, 4));
auto result = MUST(bit_read_stream.read_bits(4));
EXPECT_EQ(0b1111u, result);
result = MUST(bit_read_stream.read_bits(4));
EXPECT_EQ(0b1111u, result);
}
{
- MUST(bit_write_stream->write_bits(0b0000u, 4));
- MUST(bit_write_stream->write_bits(0b0000u, 4));
+ MUST(bit_write_stream.write_bits(0b0000u, 4));
+ MUST(bit_write_stream.write_bits(0b0000u, 4));
auto result = MUST(bit_read_stream.read_bits(4));
EXPECT_EQ(0b0000u, result);
result = MUST(bit_read_stream.read_bits(4));
@@ -94,8 +94,8 @@ TEST_CASE(big_endian_bit_stream_input_output_match)
// Test two mirrored chunks of a non-mirrored pattern to check that we are writing bits within a pattern in the correct order.
{
- MUST(bit_write_stream->write_bits(0b1000u, 4));
- MUST(bit_write_stream->write_bits(0b1000u, 4));
+ MUST(bit_write_stream.write_bits(0b1000u, 4));
+ MUST(bit_write_stream.write_bits(0b1000u, 4));
auto result = MUST(bit_read_stream.read_bits(4));
EXPECT_EQ(0b1000u, result);
result = MUST(bit_read_stream.read_bits(4));
@@ -104,8 +104,8 @@ TEST_CASE(big_endian_bit_stream_input_output_match)
// Test two different chunks to check that we are not confusing their order.
{
- MUST(bit_write_stream->write_bits(0b1000u, 4));
- MUST(bit_write_stream->write_bits(0b0100u, 4));
+ MUST(bit_write_stream.write_bits(0b1000u, 4));
+ MUST(bit_write_stream.write_bits(0b0100u, 4));
auto result = MUST(bit_read_stream.read_bits(4));
EXPECT_EQ(0b1000u, result);
result = MUST(bit_read_stream.read_bits(4));
@@ -114,7 +114,7 @@ TEST_CASE(big_endian_bit_stream_input_output_match)
// Test a pattern that spans multiple bytes.
{
- MUST(bit_write_stream->write_bits(0b1101001000100001u, 16));
+ MUST(bit_write_stream.write_bits(0b1101001000100001u, 16));
auto result = MUST(bit_read_stream.read_bits(16));
EXPECT_EQ(0b1101001000100001u, result);
}