THRIFT-5766 Replace std::endl with "\n"
Patch: Carel Combrink
This closes #2943
diff --git a/test/cpp/src/StressTest.cpp b/test/cpp/src/StressTest.cpp
index 79a708e..a424620 100644
--- a/test/cpp/src/StressTest.cpp
+++ b/test/cpp/src/StressTest.cpp
@@ -155,7 +155,7 @@
loopEchoString();
break;
default:
- cerr << "Unexpected loop type" << _loopType << endl;
+ cerr << "Unexpected loop type" << _loopType << '\n';
break;
}
@@ -280,23 +280,23 @@
usage << argv[0] << " [--port=<port number>] [--server] [--server-type=<server-type>] "
"[--protocol-type=<protocol-type>] [--workers=<worker-count>] "
"[--clients=<client-count>] [--loop=<loop-count>] "
- "[--client-type=<client-type>]" << endl
+ "[--client-type=<client-type>]" << '\n'
<< "\tclients Number of client threads to create - 0 implies no clients, i.e. "
- "server only. Default is " << clientCount << endl
- << "\thelp Prints this help text." << endl
- << "\tcall Service method to call. Default is " << callName << endl
- << "\tloop The number of remote thrift calls each client makes. Default is " << loopCount << endl
+ "server only. Default is " << clientCount << '\n'
+ << "\thelp Prints this help text." << '\n'
+ << "\tcall Service method to call. Default is " << callName << '\n'
+ << "\tloop The number of remote thrift calls each client makes. Default is " << loopCount << '\n'
<< "\tport The port the server and clients should bind to "
- "for thrift network connections. Default is " << port << endl
- << "\tserver Run the Thrift server in this process. Default is " << runServer << endl
- << "\tserver-type Type of server, \"simple\" or \"thread-pool\". Default is " << serverType << endl
- << "\tprotocol-type Type of protocol, \"binary\", \"ascii\", or \"xml\". Default is " << protocolType << endl
- << "\tlog-request Log all request to ./requestlog.tlog. Default is " << logRequests << endl
- << "\treplay-request Replay requests from log file (./requestlog.tlog) Default is " << replayRequests << endl
+ "for thrift network connections. Default is " << port << '\n'
+ << "\tserver Run the Thrift server in this process. Default is " << runServer << '\n'
+ << "\tserver-type Type of server, \"simple\" or \"thread-pool\". Default is " << serverType << '\n'
+ << "\tprotocol-type Type of protocol, \"binary\", \"ascii\", or \"xml\". Default is " << protocolType << '\n'
+ << "\tlog-request Log all request to ./requestlog.tlog. Default is " << logRequests << '\n'
+ << "\treplay-request Replay requests from log file (./requestlog.tlog) Default is " << replayRequests << '\n'
<< "\tworkers Number of thread pools workers. Only valid "
- "for thread-pool server type. Default is " << workerCount << endl
- << "\tclient-type Type of client, \"regular\" or \"concurrent\". Default is " << clientType << endl
- << endl;
+ "for thread-pool server type. Default is " << workerCount << '\n'
+ << "\tclient-type Type of client, \"regular\" or \"concurrent\". Default is " << clientType << '\n'
+ << '\n';
map<string, string> args;
@@ -386,7 +386,7 @@
}
} catch (std::exception& e) {
- cerr << e.what() << endl;
+ cerr << e.what() << '\n';
cerr << usage.str();
}
@@ -468,7 +468,7 @@
server->setServerEventHandler(observer);
std::shared_ptr<Thread> serverThread = threadFactory->newThread(server);
- cerr << "Starting the server on port " << port << endl;
+ cerr << "Starting the server on port " << port << '\n';
serverThread->start();
observer->waitForService();
@@ -538,7 +538,7 @@
Synchronized s(monitor);
threadCount = clientCount;
- cerr << "Launch " << clientCount << " " << clientType << " client threads" << endl;
+ cerr << "Launch " << clientCount << " " << clientType << " client threads" << '\n';
time00 = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
@@ -591,14 +591,14 @@
averageTime /= clientCount;
cout << "workers :" << workerCount << ", client : " << clientCount << ", loops : " << loopCount
- << ", rate : " << (clientCount * loopCount * 1000) / ((double)(time01 - time00)) << endl;
+ << ", rate : " << (clientCount * loopCount * 1000) / ((double)(time01 - time00)) << '\n';
count_map count = serviceHandler->getCount();
count_map::iterator iter;
for (iter = count.begin(); iter != count.end(); ++iter) {
printf("%s => %d\n", iter->first, iter->second);
}
- cerr << "done." << endl;
+ cerr << "done." << '\n';
}
return 0;