Skip to content

Commit

Permalink
Update test_cinatra_websocket.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
helintongh committed Apr 17, 2024
1 parent 1e7e0c1 commit 4bfe1e7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test_cinatra_websocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ TEST_CASE("test client quit after send msg") {
async_simple::coro::syncAwait(test_websocket());
}

#ifdef CINATRA_ENABLE_GZIP
TEST_CASE("test websocket permessage defalte") {
coro_http_server server(1, 8090);
server.set_http_handler<cinatra::GET>(
Expand All @@ -303,7 +304,7 @@ TEST_CASE("test websocket permessage defalte") {

if (result.type == ws_frame_type::WS_TEXT_FRAME ||
result.type == ws_frame_type::WS_BINARY_FRAME) {
CHECK(result.data == "test")
CHECK(result.data == "test");
}
else if (result.type == ws_frame_type::WS_PING_FRAME ||
result.type == ws_frame_type::WS_PONG_FRAME) {
Expand All @@ -323,6 +324,7 @@ TEST_CASE("test websocket permessage defalte") {
}
}
});

server.async_start();

coro_http_client client{};
Expand All @@ -348,4 +350,5 @@ TEST_CASE("test websocket permessage defalte") {

server.stop();
client.close();
}
}
#endif

0 comments on commit 4bfe1e7

Please sign in to comment.