(unittest) fix silly compile error with renaming of Logger to TLogger

This commit is contained in:
Benjamin Sergeant 2020-03-12 11:15:54 -07:00
parent cb1ec7dc96
commit 7642ccc99e
10 changed files with 52 additions and 52 deletions

View File

@ -218,7 +218,7 @@ namespace
} }
else if (eventType == ix::CobraConnection_EventType_Published) else if (eventType == ix::CobraConnection_EventType_Published)
{ {
Logger() << "Subscriber: published message acked: " << msgId; TLogger() << "Subscriber: published message acked: " << msgId;
} }
}); });

View File

@ -79,7 +79,7 @@ namespace
CobraConnection::MsgId msgId) { CobraConnection::MsgId msgId) {
if (eventType == ix::CobraConnection_EventType_Open) if (eventType == ix::CobraConnection_EventType_Open)
{ {
Logger() << "Subscriber connected:"; TLogger() << "Subscriber connected:";
for (auto&& it : headers) for (auto&& it : headers)
{ {
log("Headers " + it.first + " " + it.second); log("Headers " + it.first + " " + it.second);
@ -87,7 +87,7 @@ namespace
} }
if (eventType == ix::CobraConnection_EventType_Error) if (eventType == ix::CobraConnection_EventType_Error)
{ {
Logger() << "Subscriber error:" << errMsg; TLogger() << "Subscriber error:" << errMsg;
} }
else if (eventType == ix::CobraConnection_EventType_Authenticated) else if (eventType == ix::CobraConnection_EventType_Authenticated)
{ {
@ -107,27 +107,27 @@ namespace
} }
else if (eventType == ix::CobraConnection_EventType_Subscribed) else if (eventType == ix::CobraConnection_EventType_Subscribed)
{ {
Logger() << "Subscriber: subscribed to channel " << subscriptionId; TLogger() << "Subscriber: subscribed to channel " << subscriptionId;
if (subscriptionId == CHANNEL) if (subscriptionId == CHANNEL)
{ {
gSubscriberConnectedAndSubscribed = true; gSubscriberConnectedAndSubscribed = true;
} }
else else
{ {
Logger() << "Subscriber: unexpected channel " << subscriptionId; TLogger() << "Subscriber: unexpected channel " << subscriptionId;
} }
} }
else if (eventType == ix::CobraConnection_EventType_UnSubscribed) else if (eventType == ix::CobraConnection_EventType_UnSubscribed)
{ {
Logger() << "Subscriber: ununexpected from channel " << subscriptionId; TLogger() << "Subscriber: ununexpected from channel " << subscriptionId;
if (subscriptionId != CHANNEL) if (subscriptionId != CHANNEL)
{ {
Logger() << "Subscriber: unexpected channel " << subscriptionId; TLogger() << "Subscriber: unexpected channel " << subscriptionId;
} }
} }
else if (eventType == ix::CobraConnection_EventType_Published) else if (eventType == ix::CobraConnection_EventType_Published)
{ {
Logger() << "Subscriber: published message acked: " << msgId; TLogger() << "Subscriber: published message acked: " << msgId;
} }
}); });

View File

@ -29,17 +29,17 @@ namespace ix
makeCancellationRequestWithTimeout(timeoutSecs, requestInitCancellation); makeCancellationRequestWithTimeout(timeoutSecs, requestInitCancellation);
bool success = socket->connect(host, port, errMsg, isCancellationRequested); bool success = socket->connect(host, port, errMsg, isCancellationRequested);
Logger() << "errMsg: " << errMsg; TLogger() << "errMsg: " << errMsg;
REQUIRE(success); REQUIRE(success);
Logger() << "Sending request: " << request << "to " << host << ":" << port; TLogger() << "Sending request: " << request << "to " << host << ":" << port;
REQUIRE(socket->writeBytes(request, isCancellationRequested)); REQUIRE(socket->writeBytes(request, isCancellationRequested));
auto lineResult = socket->readLine(isCancellationRequested); auto lineResult = socket->readLine(isCancellationRequested);
auto lineValid = lineResult.first; auto lineValid = lineResult.first;
auto line = lineResult.second; auto line = lineResult.second;
Logger() << "read error: " << strerror(Socket::getErrno()); TLogger() << "read error: " << strerror(Socket::getErrno());
REQUIRE(lineValid); REQUIRE(lineValid);

View File

@ -199,13 +199,13 @@ namespace
[webSocket, connectionState, &server](const ix::WebSocketMessagePtr& msg) { [webSocket, connectionState, &server](const ix::WebSocketMessagePtr& msg) {
if (msg->type == ix::WebSocketMessageType::Open) if (msg->type == ix::WebSocketMessageType::Open)
{ {
Logger() << "New connection"; TLogger() << "New connection";
Logger() << "id: " << connectionState->getId(); TLogger() << "id: " << connectionState->getId();
Logger() << "Uri: " << msg->openInfo.uri; TLogger() << "Uri: " << msg->openInfo.uri;
Logger() << "Headers:"; TLogger() << "Headers:";
for (auto it : msg->openInfo.headers) for (auto it : msg->openInfo.headers)
{ {
Logger() << it.first << ": " << it.second; TLogger() << it.first << ": " << it.second;
} }
} }
else if (msg->type == ix::WebSocketMessageType::Close) else if (msg->type == ix::WebSocketMessageType::Close)

View File

@ -180,13 +180,13 @@ namespace
&mutexWrite](const ix::WebSocketMessagePtr& msg) { &mutexWrite](const ix::WebSocketMessagePtr& msg) {
if (msg->type == ix::WebSocketMessageType::Open) if (msg->type == ix::WebSocketMessageType::Open)
{ {
Logger() << "New server connection"; TLogger() << "New server connection";
Logger() << "id: " << connectionState->getId(); TLogger() << "id: " << connectionState->getId();
Logger() << "Uri: " << msg->openInfo.uri; TLogger() << "Uri: " << msg->openInfo.uri;
Logger() << "Headers:"; TLogger() << "Headers:";
for (auto it : msg->openInfo.headers) for (auto it : msg->openInfo.headers)
{ {
Logger() << it.first << ": " << it.second; TLogger() << it.first << ": " << it.second;
} }
} }
else if (msg->type == ix::WebSocketMessageType::Close) else if (msg->type == ix::WebSocketMessageType::Close)

View File

@ -23,23 +23,23 @@ namespace
[connectionState, &server](const WebSocketMessagePtr& msg) { [connectionState, &server](const WebSocketMessagePtr& msg) {
if (msg->type == ix::WebSocketMessageType::Open) if (msg->type == ix::WebSocketMessageType::Open)
{ {
Logger() << "New connection"; TLogger() << "New connection";
connectionState->computeId(); connectionState->computeId();
Logger() << "id: " << connectionState->getId(); TLogger() << "id: " << connectionState->getId();
Logger() << "Uri: " << msg->openInfo.uri; TLogger() << "Uri: " << msg->openInfo.uri;
Logger() << "Headers:"; TLogger() << "Headers:";
for (auto&& it : msg->openInfo.headers) for (auto&& it : msg->openInfo.headers)
{ {
Logger() << it.first << ": " << it.second; TLogger() << it.first << ": " << it.second;
} }
} }
else if (msg->type == ix::WebSocketMessageType::Close) else if (msg->type == ix::WebSocketMessageType::Close)
{ {
Logger() << "Closed connection"; TLogger() << "Closed connection";
} }
else if (msg->type == ix::WebSocketMessageType::Message) else if (msg->type == ix::WebSocketMessageType::Message)
{ {
Logger() << "Message received: " << msg->str; TLogger() << "Message received: " << msg->str;
for (auto&& client : server.getClients()) for (auto&& client : server.getClients())
{ {
@ -52,7 +52,7 @@ namespace
auto res = server.listen(); auto res = server.listen();
if (!res.first) if (!res.first)
{ {
Logger() << res.second; TLogger() << res.second;
return false; return false;
} }

View File

@ -140,13 +140,13 @@ namespace
const ix::WebSocketCloseInfo& closeInfo) { const ix::WebSocketCloseInfo& closeInfo) {
if (messageType == ix::WebSocketMessageType::Open) if (messageType == ix::WebSocketMessageType::Open)
{ {
Logger() << "New server connection"; TLogger() << "New server connection";
Logger() << "id: " << connectionState->getId(); TLogger() << "id: " << connectionState->getId();
Logger() << "Uri: " << openInfo.uri; TLogger() << "Uri: " << openInfo.uri;
Logger() << "Headers:"; TLogger() << "Headers:";
for (auto it : openInfo.headers) for (auto it : openInfo.headers)
{ {
Logger() << it.first << ": " << it.second; TLogger() << it.first << ": " << it.second;
} }
} }
else if (messageType == ix::WebSocketMessageType::Close) else if (messageType == ix::WebSocketMessageType::Close)

View File

@ -169,13 +169,13 @@ namespace
const ix::WebSocketCloseInfo& closeInfo) { const ix::WebSocketCloseInfo& closeInfo) {
if (messageType == ix::WebSocketMessageType::Open) if (messageType == ix::WebSocketMessageType::Open)
{ {
Logger() << "New server connection"; TLogger() << "New server connection";
Logger() << "id: " << connectionState->getId(); TLogger() << "id: " << connectionState->getId();
Logger() << "Uri: " << openInfo.uri; TLogger() << "Uri: " << openInfo.uri;
Logger() << "Headers:"; TLogger() << "Headers:";
for (auto it : openInfo.headers) for (auto it : openInfo.headers)
{ {
Logger() << it.first << ": " << it.second; TLogger() << it.first << ": " << it.second;
} }
} }
else if (messageType == ix::WebSocketMessageType::Close) else if (messageType == ix::WebSocketMessageType::Close)

View File

@ -40,21 +40,21 @@ namespace ix
const ix::WebSocketMessagePtr& msg) { const ix::WebSocketMessagePtr& msg) {
if (msg->type == ix::WebSocketMessageType::Open) if (msg->type == ix::WebSocketMessageType::Open)
{ {
Logger() << "New connection"; TLogger() << "New connection";
connectionState->computeId(); connectionState->computeId();
Logger() << "id: " << connectionState->getId(); TLogger() << "id: " << connectionState->getId();
Logger() << "Uri: " << msg->openInfo.uri; TLogger() << "Uri: " << msg->openInfo.uri;
Logger() << "Headers:"; TLogger() << "Headers:";
for (auto it : msg->openInfo.headers) for (auto it : msg->openInfo.headers)
{ {
Logger() << it.first << ": " << it.second; TLogger() << it.first << ": " << it.second;
} }
connectionId = connectionState->getId(); connectionId = connectionState->getId();
} }
else if (msg->type == ix::WebSocketMessageType::Close) else if (msg->type == ix::WebSocketMessageType::Close)
{ {
Logger() << "Closed connection"; TLogger() << "Closed connection";
} }
else if (msg->type == ix::WebSocketMessageType::Message) else if (msg->type == ix::WebSocketMessageType::Message)
{ {
@ -72,7 +72,7 @@ namespace ix
auto res = server.listen(); auto res = server.listen();
if (!res.first) if (!res.first)
{ {
Logger() << res.second; TLogger() << res.second;
return false; return false;
} }
@ -133,7 +133,7 @@ TEST_CASE("Websocket_server", "[websocket_server]")
bool success = socket->connect(host, port, errMsg, isCancellationRequested); bool success = socket->connect(host, port, errMsg, isCancellationRequested);
REQUIRE(success); REQUIRE(success);
Logger() << "writeBytes"; TLogger() << "writeBytes";
socket->writeBytes("GET /\r\n", isCancellationRequested); socket->writeBytes("GET /\r\n", isCancellationRequested);
auto lineResult = socket->readLine(isCancellationRequested); auto lineResult = socket->readLine(isCancellationRequested);

View File

@ -23,13 +23,13 @@ bool startServer(ix::WebSocketServer& server, std::string& subProtocols)
const ix::WebSocketMessagePtr& msg) { const ix::WebSocketMessagePtr& msg) {
if (msg->type == ix::WebSocketMessageType::Open) if (msg->type == ix::WebSocketMessageType::Open)
{ {
Logger() << "New connection"; TLogger() << "New connection";
Logger() << "id: " << connectionState->getId(); TLogger() << "id: " << connectionState->getId();
Logger() << "Uri: " << msg->openInfo.uri; TLogger() << "Uri: " << msg->openInfo.uri;
Logger() << "Headers:"; TLogger() << "Headers:";
for (auto it : msg->openInfo.headers) for (auto it : msg->openInfo.headers)
{ {
Logger() << it.first << ": " << it.second; TLogger() << it.first << ": " << it.second;
} }
subProtocols = msg->openInfo.headers["Sec-WebSocket-Protocol"]; subProtocols = msg->openInfo.headers["Sec-WebSocket-Protocol"];