From 7642ccc99e3d701c22c4c309f9a6d5f273761dcc Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Thu, 12 Mar 2020 11:15:54 -0700 Subject: [PATCH] (unittest) fix silly compile error with renaming of Logger to TLogger --- test/IXCobraChatTest.cpp | 2 +- test/IXCobraMetricsPublisherTest.cpp | 14 +++++++------- test/IXSocketTest.cpp | 6 +++--- test/IXWebSocketChatTest.cpp | 10 +++++----- test/IXWebSocketCloseTest.cpp | 10 +++++----- test/IXWebSocketMessageQTest.cpp | 16 ++++++++-------- test/IXWebSocketPingTest.cpp | 10 +++++----- test/IXWebSocketPingTimeoutTest.cpp | 10 +++++----- test/IXWebSocketServerTest.cpp | 16 ++++++++-------- test/IXWebSocketSubProtocolTest.cpp | 10 +++++----- 10 files changed, 52 insertions(+), 52 deletions(-) diff --git a/test/IXCobraChatTest.cpp b/test/IXCobraChatTest.cpp index 0e8ed00b..e88c8f53 100644 --- a/test/IXCobraChatTest.cpp +++ b/test/IXCobraChatTest.cpp @@ -218,7 +218,7 @@ namespace } else if (eventType == ix::CobraConnection_EventType_Published) { - Logger() << "Subscriber: published message acked: " << msgId; + TLogger() << "Subscriber: published message acked: " << msgId; } }); diff --git a/test/IXCobraMetricsPublisherTest.cpp b/test/IXCobraMetricsPublisherTest.cpp index 9d08ae93..4075cac5 100644 --- a/test/IXCobraMetricsPublisherTest.cpp +++ b/test/IXCobraMetricsPublisherTest.cpp @@ -79,7 +79,7 @@ namespace CobraConnection::MsgId msgId) { if (eventType == ix::CobraConnection_EventType_Open) { - Logger() << "Subscriber connected:"; + TLogger() << "Subscriber connected:"; for (auto&& it : headers) { log("Headers " + it.first + " " + it.second); @@ -87,7 +87,7 @@ namespace } if (eventType == ix::CobraConnection_EventType_Error) { - Logger() << "Subscriber error:" << errMsg; + TLogger() << "Subscriber error:" << errMsg; } else if (eventType == ix::CobraConnection_EventType_Authenticated) { @@ -107,27 +107,27 @@ namespace } else if (eventType == ix::CobraConnection_EventType_Subscribed) { - Logger() << "Subscriber: subscribed to channel " << subscriptionId; + TLogger() << "Subscriber: subscribed to channel " << subscriptionId; if (subscriptionId == CHANNEL) { gSubscriberConnectedAndSubscribed = true; } else { - Logger() << "Subscriber: unexpected channel " << subscriptionId; + TLogger() << "Subscriber: unexpected channel " << subscriptionId; } } else if (eventType == ix::CobraConnection_EventType_UnSubscribed) { - Logger() << "Subscriber: ununexpected from channel " << subscriptionId; + TLogger() << "Subscriber: ununexpected from channel " << subscriptionId; if (subscriptionId != CHANNEL) { - Logger() << "Subscriber: unexpected channel " << subscriptionId; + TLogger() << "Subscriber: unexpected channel " << subscriptionId; } } else if (eventType == ix::CobraConnection_EventType_Published) { - Logger() << "Subscriber: published message acked: " << msgId; + TLogger() << "Subscriber: published message acked: " << msgId; } }); diff --git a/test/IXSocketTest.cpp b/test/IXSocketTest.cpp index b76dc0b3..ca423706 100644 --- a/test/IXSocketTest.cpp +++ b/test/IXSocketTest.cpp @@ -29,17 +29,17 @@ namespace ix makeCancellationRequestWithTimeout(timeoutSecs, requestInitCancellation); bool success = socket->connect(host, port, errMsg, isCancellationRequested); - Logger() << "errMsg: " << errMsg; + TLogger() << "errMsg: " << errMsg; REQUIRE(success); - Logger() << "Sending request: " << request << "to " << host << ":" << port; + TLogger() << "Sending request: " << request << "to " << host << ":" << port; REQUIRE(socket->writeBytes(request, isCancellationRequested)); auto lineResult = socket->readLine(isCancellationRequested); auto lineValid = lineResult.first; auto line = lineResult.second; - Logger() << "read error: " << strerror(Socket::getErrno()); + TLogger() << "read error: " << strerror(Socket::getErrno()); REQUIRE(lineValid); diff --git a/test/IXWebSocketChatTest.cpp b/test/IXWebSocketChatTest.cpp index 2bf6b456..8c531079 100644 --- a/test/IXWebSocketChatTest.cpp +++ b/test/IXWebSocketChatTest.cpp @@ -199,13 +199,13 @@ namespace [webSocket, connectionState, &server](const ix::WebSocketMessagePtr& msg) { if (msg->type == ix::WebSocketMessageType::Open) { - Logger() << "New connection"; - Logger() << "id: " << connectionState->getId(); - Logger() << "Uri: " << msg->openInfo.uri; - Logger() << "Headers:"; + TLogger() << "New connection"; + TLogger() << "id: " << connectionState->getId(); + TLogger() << "Uri: " << msg->openInfo.uri; + TLogger() << "Headers:"; for (auto it : msg->openInfo.headers) { - Logger() << it.first << ": " << it.second; + TLogger() << it.first << ": " << it.second; } } else if (msg->type == ix::WebSocketMessageType::Close) diff --git a/test/IXWebSocketCloseTest.cpp b/test/IXWebSocketCloseTest.cpp index e42cf7a0..b52ab2c5 100644 --- a/test/IXWebSocketCloseTest.cpp +++ b/test/IXWebSocketCloseTest.cpp @@ -180,13 +180,13 @@ namespace &mutexWrite](const ix::WebSocketMessagePtr& msg) { if (msg->type == ix::WebSocketMessageType::Open) { - Logger() << "New server connection"; - Logger() << "id: " << connectionState->getId(); - Logger() << "Uri: " << msg->openInfo.uri; - Logger() << "Headers:"; + TLogger() << "New server connection"; + TLogger() << "id: " << connectionState->getId(); + TLogger() << "Uri: " << msg->openInfo.uri; + TLogger() << "Headers:"; for (auto it : msg->openInfo.headers) { - Logger() << it.first << ": " << it.second; + TLogger() << it.first << ": " << it.second; } } else if (msg->type == ix::WebSocketMessageType::Close) diff --git a/test/IXWebSocketMessageQTest.cpp b/test/IXWebSocketMessageQTest.cpp index 56123363..ef6b808d 100644 --- a/test/IXWebSocketMessageQTest.cpp +++ b/test/IXWebSocketMessageQTest.cpp @@ -23,23 +23,23 @@ namespace [connectionState, &server](const WebSocketMessagePtr& msg) { if (msg->type == ix::WebSocketMessageType::Open) { - Logger() << "New connection"; + TLogger() << "New connection"; connectionState->computeId(); - Logger() << "id: " << connectionState->getId(); - Logger() << "Uri: " << msg->openInfo.uri; - Logger() << "Headers:"; + TLogger() << "id: " << connectionState->getId(); + TLogger() << "Uri: " << msg->openInfo.uri; + TLogger() << "Headers:"; for (auto&& it : msg->openInfo.headers) { - Logger() << it.first << ": " << it.second; + TLogger() << it.first << ": " << it.second; } } else if (msg->type == ix::WebSocketMessageType::Close) { - Logger() << "Closed connection"; + TLogger() << "Closed connection"; } else if (msg->type == ix::WebSocketMessageType::Message) { - Logger() << "Message received: " << msg->str; + TLogger() << "Message received: " << msg->str; for (auto&& client : server.getClients()) { @@ -52,7 +52,7 @@ namespace auto res = server.listen(); if (!res.first) { - Logger() << res.second; + TLogger() << res.second; return false; } diff --git a/test/IXWebSocketPingTest.cpp b/test/IXWebSocketPingTest.cpp index 9a5faa10..b19e4302 100644 --- a/test/IXWebSocketPingTest.cpp +++ b/test/IXWebSocketPingTest.cpp @@ -140,13 +140,13 @@ namespace const ix::WebSocketCloseInfo& closeInfo) { if (messageType == ix::WebSocketMessageType::Open) { - Logger() << "New server connection"; - Logger() << "id: " << connectionState->getId(); - Logger() << "Uri: " << openInfo.uri; - Logger() << "Headers:"; + TLogger() << "New server connection"; + TLogger() << "id: " << connectionState->getId(); + TLogger() << "Uri: " << openInfo.uri; + TLogger() << "Headers:"; for (auto it : openInfo.headers) { - Logger() << it.first << ": " << it.second; + TLogger() << it.first << ": " << it.second; } } else if (messageType == ix::WebSocketMessageType::Close) diff --git a/test/IXWebSocketPingTimeoutTest.cpp b/test/IXWebSocketPingTimeoutTest.cpp index 79a13210..a5f83018 100644 --- a/test/IXWebSocketPingTimeoutTest.cpp +++ b/test/IXWebSocketPingTimeoutTest.cpp @@ -169,13 +169,13 @@ namespace const ix::WebSocketCloseInfo& closeInfo) { if (messageType == ix::WebSocketMessageType::Open) { - Logger() << "New server connection"; - Logger() << "id: " << connectionState->getId(); - Logger() << "Uri: " << openInfo.uri; - Logger() << "Headers:"; + TLogger() << "New server connection"; + TLogger() << "id: " << connectionState->getId(); + TLogger() << "Uri: " << openInfo.uri; + TLogger() << "Headers:"; for (auto it : openInfo.headers) { - Logger() << it.first << ": " << it.second; + TLogger() << it.first << ": " << it.second; } } else if (messageType == ix::WebSocketMessageType::Close) diff --git a/test/IXWebSocketServerTest.cpp b/test/IXWebSocketServerTest.cpp index f96a87b6..c51304bf 100644 --- a/test/IXWebSocketServerTest.cpp +++ b/test/IXWebSocketServerTest.cpp @@ -40,21 +40,21 @@ namespace ix const ix::WebSocketMessagePtr& msg) { if (msg->type == ix::WebSocketMessageType::Open) { - Logger() << "New connection"; + TLogger() << "New connection"; connectionState->computeId(); - Logger() << "id: " << connectionState->getId(); - Logger() << "Uri: " << msg->openInfo.uri; - Logger() << "Headers:"; + TLogger() << "id: " << connectionState->getId(); + TLogger() << "Uri: " << msg->openInfo.uri; + TLogger() << "Headers:"; for (auto it : msg->openInfo.headers) { - Logger() << it.first << ": " << it.second; + TLogger() << it.first << ": " << it.second; } connectionId = connectionState->getId(); } else if (msg->type == ix::WebSocketMessageType::Close) { - Logger() << "Closed connection"; + TLogger() << "Closed connection"; } else if (msg->type == ix::WebSocketMessageType::Message) { @@ -72,7 +72,7 @@ namespace ix auto res = server.listen(); if (!res.first) { - Logger() << res.second; + TLogger() << res.second; return false; } @@ -133,7 +133,7 @@ TEST_CASE("Websocket_server", "[websocket_server]") bool success = socket->connect(host, port, errMsg, isCancellationRequested); REQUIRE(success); - Logger() << "writeBytes"; + TLogger() << "writeBytes"; socket->writeBytes("GET /\r\n", isCancellationRequested); auto lineResult = socket->readLine(isCancellationRequested); diff --git a/test/IXWebSocketSubProtocolTest.cpp b/test/IXWebSocketSubProtocolTest.cpp index 0615572c..ab9cb22d 100644 --- a/test/IXWebSocketSubProtocolTest.cpp +++ b/test/IXWebSocketSubProtocolTest.cpp @@ -23,13 +23,13 @@ bool startServer(ix::WebSocketServer& server, std::string& subProtocols) const ix::WebSocketMessagePtr& msg) { if (msg->type == ix::WebSocketMessageType::Open) { - Logger() << "New connection"; - Logger() << "id: " << connectionState->getId(); - Logger() << "Uri: " << msg->openInfo.uri; - Logger() << "Headers:"; + TLogger() << "New connection"; + TLogger() << "id: " << connectionState->getId(); + TLogger() << "Uri: " << msg->openInfo.uri; + TLogger() << "Headers:"; for (auto it : msg->openInfo.headers) { - Logger() << it.first << ": " << it.second; + TLogger() << it.first << ": " << it.second; } subProtocols = msg->openInfo.headers["Sec-WebSocket-Protocol"];