mirror of
https://github.com/boostorg/beast.git
synced 2025-08-02 14:24:31 +02:00
Test for match length exceeding lookahead in deflate stream
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
committed by
Vinnie Falco
parent
3d9ee6acee
commit
fd57b0a73d
@@ -441,6 +441,29 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
testRLEMatchLengthExceedLookahead()
|
||||
{
|
||||
z_params zp;
|
||||
deflate_stream ds;
|
||||
std::vector<std::uint8_t> in;
|
||||
in.resize(300);
|
||||
|
||||
|
||||
ds.reset(8, 15, 1, Strategy::rle);
|
||||
std::fill_n(in.begin(), 4, 'a');
|
||||
std::string out;
|
||||
out.resize(in.size() * 2);
|
||||
zp.next_in = in.data();
|
||||
zp.avail_in = in.size();
|
||||
zp.next_out = &out.front();
|
||||
zp.avail_out = out.size();
|
||||
|
||||
error_code ec;
|
||||
ds.write(zp, Flush::sync, ec);
|
||||
BEAST_EXPECT(!ec);
|
||||
}
|
||||
|
||||
void
|
||||
run() override
|
||||
{
|
||||
@@ -453,6 +476,7 @@ public:
|
||||
testWriteAfterFinish();
|
||||
testFlushPartial();
|
||||
testFlushAtLiteralBufferFull();
|
||||
testRLEMatchLengthExceedLookahead();
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user