mirror of
https://github.com/boostorg/beast.git
synced 2025-08-02 22:34:32 +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);
|
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
|
void
|
||||||
run() override
|
run() override
|
||||||
{
|
{
|
||||||
@@ -381,6 +401,7 @@ public:
|
|||||||
testDeflate();
|
testDeflate();
|
||||||
testInvalidSettings();
|
testInvalidSettings();
|
||||||
testWriteAfterFinish();
|
testWriteAfterFinish();
|
||||||
|
testFlushPartial();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user