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:
		
				
					committed by
					
						
						Benjamin Sergeant
					
				
			
			
				
	
			
			
			
						parent
						
							be2aee3354
						
					
				
				
					commit
					27bf1684cb
				
			@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user