mirror of
https://github.com/boostorg/beast.git
synced 2025-08-02 14:24:31 +02:00
Add test for partial flush in deflate stream
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
committed by
Vinnie Falco
parent
01c200d2ef
commit
85ab7a3fd0
@@ -371,6 +371,26 @@ public:
|
||||
BEAST_EXPECT(ec == error::need_buffers);
|
||||
}
|
||||
|
||||
void
|
||||
testFlushPartial()
|
||||
{
|
||||
z_params zp;
|
||||
deflate_stream ds;
|
||||
ds.reset();
|
||||
std::string out;
|
||||
out.resize(1024);
|
||||
string_view s = "Hello";
|
||||
zp.next_in = s.data();
|
||||
zp.avail_in = s.size();
|
||||
zp.next_out = &out.front();
|
||||
zp.avail_out = out.size();
|
||||
error_code ec;
|
||||
ds.write(zp, Flush::none, ec);
|
||||
BEAST_EXPECT(!ec);
|
||||
ds.write(zp, Flush::partial, ec);
|
||||
BEAST_EXPECT(!ec);
|
||||
}
|
||||
|
||||
void
|
||||
run() override
|
||||
{
|
||||
@@ -381,6 +401,7 @@ public:
|
||||
testDeflate();
|
||||
testInvalidSettings();
|
||||
testWriteAfterFinish();
|
||||
testFlushPartial();
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user