Skip to content

Commit

Permalink
CS Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed Oct 24, 2023
1 parent c9b3cee commit 4f7f1d1
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,6 @@

final class RLEBitPackedHybridTest extends TestCase
{
public function test_flushing_buffers_when_they_are_dividable_by_8() : void
{
$values = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1];
$buffer = '';
(new RLEBitPackedHybrid())->encodeHybrid(new BinaryBufferWriter($buffer), $values);

$this->assertSame(
$values,
(new RLEBitPackedHybrid())->decodeHybrid(
new BinaryBufferReader($buffer),
BitWidth::fromArray($values),
\count($values)
)
);
}

public function test_bit_packing_reading_with_extra_bytes_in_the_buffer() : void
{
$values = [3, 3, 3, 3];
Expand Down Expand Up @@ -129,6 +113,22 @@ public function test_encoding_bit_pack_before_encoding_rle() : void
);
}

public function test_flushing_buffers_when_they_are_dividable_by_8() : void
{
$values = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1];
$buffer = '';
(new RLEBitPackedHybrid())->encodeHybrid(new BinaryBufferWriter($buffer), $values);

$this->assertSame(
$values,
(new RLEBitPackedHybrid())->decodeHybrid(
new BinaryBufferReader($buffer),
BitWidth::fromArray($values),
\count($values)
)
);
}

public function test_plain_rle_with_two_sequences() : void
{
$values = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
Expand Down

0 comments on commit 4f7f1d1

Please sign in to comment.