diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e5ef0e0..b8226948 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Version 223: * Add test::stream::service * Add websocket service +* Pausation abandoning test -------------------------------------------------------------------------------- diff --git a/test/beast/websocket/write.cpp b/test/beast/websocket/write.cpp index 8a14a66e..372e3979 100644 --- a/test/beast/websocket/write.cpp +++ b/test/beast/websocket/write.cpp @@ -262,6 +262,38 @@ public: }); } + void + testPausationAbandoning() + { + struct test_op + { + std::shared_ptr> s_; + + void operator()( + boost::system::error_code = {}, + std::size_t = 0) + { + BEAST_FAIL(); + } + }; + + std::weak_ptr> weak_ws; + { + echo_server es{log}; + net::io_context ioc; + auto ws = std::make_shared>(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 testWriteSuspend() { @@ -647,6 +679,7 @@ public: run() override { testWrite(); + testPausationAbandoning(); testWriteSuspend(); testAsyncWriteFrame(); testIssue300();