mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 12:57:31 +02:00
Pausation abandoning test
Check if paused operations are correctly abandoned when the ExecutionContext shuts down. Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
committed by
Vinnie Falco
parent
031e13c253
commit
72a99c43a7
@ -2,6 +2,7 @@ Version 223:
|
|||||||
|
|
||||||
* Add test::stream::service
|
* Add test::stream::service
|
||||||
* Add websocket service
|
* Add websocket service
|
||||||
|
* Pausation abandoning test
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -262,6 +262,38 @@ public:
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
testPausationAbandoning()
|
||||||
|
{
|
||||||
|
struct test_op
|
||||||
|
{
|
||||||
|
std::shared_ptr<stream<test::stream>> s_;
|
||||||
|
|
||||||
|
void operator()(
|
||||||
|
boost::system::error_code = {},
|
||||||
|
std::size_t = 0)
|
||||||
|
{
|
||||||
|
BEAST_FAIL();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
std::weak_ptr<stream<test::stream>> weak_ws;
|
||||||
|
{
|
||||||
|
echo_server es{log};
|
||||||
|
net::io_context ioc;
|
||||||
|
auto ws = std::make_shared<stream<test::stream>>(ioc);
|
||||||
|
test_op op{ws};
|
||||||
|
ws->next_layer().connect(es.stream());
|
||||||
|
ws->handshake("localhost", "/");
|
||||||
|
ws->async_ping("", op);
|
||||||
|
BEAST_EXPECT(ws->impl_->wr_block.is_locked());
|
||||||
|
ws->async_write(sbuf("*"), op);
|
||||||
|
weak_ws = ws;
|
||||||
|
ws->next_layer().close();
|
||||||
|
}
|
||||||
|
BEAST_EXPECT(weak_ws.expired());
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
testWriteSuspend()
|
testWriteSuspend()
|
||||||
{
|
{
|
||||||
@ -647,6 +679,7 @@ public:
|
|||||||
run() override
|
run() override
|
||||||
{
|
{
|
||||||
testWrite();
|
testWrite();
|
||||||
|
testPausationAbandoning();
|
||||||
testWriteSuspend();
|
testWriteSuspend();
|
||||||
testAsyncWriteFrame();
|
testAsyncWriteFrame();
|
||||||
testIssue300();
|
testIssue300();
|
||||||
|
Reference in New Issue
Block a user