From 2358b3ff26ac22e25e95aaf1e1665bcbf6bee51f Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Thu, 21 Mar 2019 13:50:59 -0700 Subject: [PATCH] minor cleanup --- ixwebsocket/IXConnectionState.cpp | 6 +----- test/IXWebSocketHeartBeatTest.cpp | 4 ++++ test/run.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ixwebsocket/IXConnectionState.cpp b/ixwebsocket/IXConnectionState.cpp index 18a575e0..73449020 100644 --- a/ixwebsocket/IXConnectionState.cpp +++ b/ixwebsocket/IXConnectionState.cpp @@ -6,8 +6,6 @@ #include "IXConnectionState.h" -#include - namespace ix { std::atomic ConnectionState::_globalId(0); @@ -19,9 +17,7 @@ namespace ix void ConnectionState::computeId() { - std::stringstream ss; - ss << _globalId++; - _id = ss.str(); + _id = std::to_string(_globalId++); } const std::string& ConnectionState::getId() const diff --git a/test/IXWebSocketHeartBeatTest.cpp b/test/IXWebSocketHeartBeatTest.cpp index f6425563..f69af5af 100644 --- a/test/IXWebSocketHeartBeatTest.cpp +++ b/test/IXWebSocketHeartBeatTest.cpp @@ -212,6 +212,10 @@ TEST_CASE("Websocket_heartbeat", "[heartbeat]") webSocketClientA.stop(); webSocketClientB.stop(); + + // Here we test heart beat period exceeded for clientA + // but it should not be exceeded for clientB which has sent data. + // -> expected ping messages == 2, but add a small buffer to make this more reliable. REQUIRE(serverReceivedPingMessages >= 2); REQUIRE(serverReceivedPingMessages <= 4); diff --git a/test/run.py b/test/run.py index c18b5631..decdc261 100644 --- a/test/run.py +++ b/test/run.py @@ -27,7 +27,7 @@ class Command(object): thread.join(timeout) if thread.is_alive(): - print 'Command timeout, kill it: ' + self.cmd + print('Command timeout, kill it: ' + self.cmd) self.process.terminate() thread.join() return False, 255