save timepoints after connect and not in contructor, adjusted tests (#72)

* save timepoints after connect and not in contructor, adjusted tests

* move call into setReadyState

* more time to detect client close in test
This commit is contained in:
Kumamon38
2019-05-13 18:08:46 +02:00
committed by Benjamin Sergeant
parent be2aee3354
commit 27bf1684cb
4 changed files with 30 additions and 12 deletions

View File

@ -350,7 +350,7 @@ TEST_CASE("Websocket_no_ping_but_timeout", "[setPingTimeout]")
REQUIRE(server.getClients().size() == 1);
ix::msleep(2700);
ix::msleep(2900);
// Here we test ping timeout, no timeout yet
REQUIRE(serverReceivedPingMessages == 0);
@ -359,7 +359,7 @@ TEST_CASE("Websocket_no_ping_but_timeout", "[setPingTimeout]")
REQUIRE(webSocketClient.isClosed() == false);
REQUIRE(webSocketClient.closedDueToPingTimeout() == false);
ix::msleep(400);
ix::msleep(200);
// Here we test ping timeout, timeout
REQUIRE(serverReceivedPingMessages == 0);
@ -410,7 +410,7 @@ TEST_CASE("Websocket_ping_timeout", "[setPingTimeout]")
REQUIRE(serverReceivedPingMessages == 1);
REQUIRE(webSocketClient.getReceivedPongMessages() == 0);
ix::msleep(1000);
ix::msleep(1100);
// Here we test ping timeout, timeout
REQUIRE(serverReceivedPingMessages == 1);