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;
diff --git a/test/cpp/src/StressTestNonBlocking.cpp b/test/cpp/src/StressTestNonBlocking.cpp
index e94ecb2..d9d9ae6 100644
--- a/test/cpp/src/StressTestNonBlocking.cpp
+++ b/test/cpp/src/StressTestNonBlocking.cpp
@@ -152,7 +152,7 @@
       loopEchoString();
       break;
     default:
-      cerr << "Unexpected loop type" << _loopType << endl;
+      cerr << "Unexpected loop type" << _loopType << '\n';
       break;
     }
 
@@ -253,24 +253,20 @@
 
   usage << argv[0] << " [--port=<port number>] [--server] [--server-type=<server-type>] "
                       "[--protocol-type=<protocol-type>] [--workers=<worker-count>] "
-                      "[--clients=<client-count>] [--loop=<loop-count>]" << endl
+                      "[--clients=<client-count>] [--loop=<loop-count>]" << '\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 << "\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 << "\tworkers        Number of thread pools workers.  Only valid "
-                                     "for thread-pool server type.  Default is " << workerCount
-        << 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 << '\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 << '\n';
 
   map<string, string> args;
 
@@ -338,7 +334,7 @@
     }
 
   } catch (std::exception& e) {
-    cerr << e.what() << endl;
+    cerr << e.what() << '\n';
     cerr << usage.str();
   }
 
@@ -416,7 +412,7 @@
           new TNonblockingServer(serviceProcessor, protocolFactory, nbSocket2, threadManager)));
     }
 
-    cerr << "Starting the server on port " << port << " and " << (port + 1) << endl;
+    cerr << "Starting the server on port " << port << " and " << (port + 1) << '\n';
     serverThread->start();
     serverThread2->start();
 
@@ -475,7 +471,7 @@
       Synchronized s(monitor);
       threadCount = clientCount;
 
-      cerr << "Launch " << clientCount << " client threads" << endl;
+      cerr << "Launch " << clientCount << " client threads" << '\n';
 
       time00 = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
 
@@ -528,14 +524,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;
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
index fd04ed8..c15281a 100644
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -98,7 +98,7 @@
                 ss << "ERROR: send request with seqid " << m_last_seqid << " and got reply with seqid " << seqid;
                 throw std::logic_error(ss.str());
             } /* else {
-                std::cout << "verified seqid " << m_last_seqid << " round trip OK" << std::endl;
+                std::cout << "verified seqid " << m_last_seqid << " round trip OK" << '\n';
             } */
             return result;
         }
@@ -127,9 +127,9 @@
     std::ostringstream os;
     os << "test" << testNr;
     const bool ok = (s == os.str());
-    cout << "testString: " << s << " " << ((ok) ? "ok" : "failed") << endl;
+    cout << "testString: " << s << " " << ((ok) ? "ok" : "failed") << '\n';
   } catch (TException& exn) {
-    cout << "Error: " << exn.what() << endl;
+    cout << "Error: " << exn.what() << '\n';
   }
 
   if (testNr == 9)
@@ -139,7 +139,7 @@
 static void testVoid_clientReturn(event_base* base, ThriftTestCobClient* client) {
   try {
     client->recv_testVoid();
-    cout << "testVoid" << endl;
+    cout << "testVoid" << '\n';
 
     for (int testNr = 0; testNr < 10; ++testNr) {
       std::ostringstream os;
@@ -151,16 +151,16 @@
                        os.str());
     }
   } catch (TException& exn) {
-    cout << "Error: " << exn.what() << endl;
+    cout << "Error: " << exn.what() << '\n';
   }
 }
 
 // Workaround for absense of C++11 "auto" keyword.
 template <typename T>
 bool print_eq(T expected, T actual) {
-  cout << "(" << actual << ")" << endl;
+  cout << "(" << actual << ")" << '\n';
   if (expected != actual) {
-    cout << "*** FAILED ***" << endl << "Expected: " << expected << " but got: " << actual << endl;
+    cout << "*** FAILED ***" << '\n' << "Expected: " << expected << " but got: " << actual << '\n';
     return false;
   }
   return true;
@@ -174,7 +174,7 @@
   } catch (TTransportException&) {                                                                 \
     throw;                                                                                         \
   } catch (exception & ex) {                                                                       \
-    cout << "*** FAILED ***" << endl << ex.what() << endl;                                         \
+    cout << "*** FAILED ***" << '\n' << ex.what() << '\n';                                         \
     return_code |= ERR_BASETYPES;                                                                  \
   }
 
@@ -186,7 +186,7 @@
   } catch (TTransportException&) {                                                                 \
     throw;                                                                                         \
   } catch (exception & ex) {                                                                       \
-    cout << "*** FAILED ***" << endl << ex.what() << endl;                                         \
+    cout << "*** FAILED ***" << '\n' << ex.what() << '\n';                                         \
     return_code |= ERR_BASETYPES;                                                                  \
   }
 
@@ -258,7 +258,7 @@
   boost::program_options::notify(vm);
 
   if (vm.count("help")) {
-    cout << desc << endl;
+    cout << desc << '\n';
     return ERR_UNKNOWN;
   }
 
@@ -290,8 +290,8 @@
     }
 
   } catch (exception& e) {
-    cerr << e.what() << endl;
-    cout << desc << endl;
+    cerr << e.what() << '\n';
+    cout << desc << '\n';
     return ERR_UNKNOWN;
   }
 
@@ -319,9 +319,9 @@
   std::shared_ptr<TProtocol> protocol2;  // SecondService for multiplexed
 
   if (ssl) {
-    cout << "Client Certificate File: " << certPath << endl;
-    cout << "Client Key         File: " << keyPath << endl;
-    cout << "CA                 File: " << caPath << endl;
+    cout << "Client Certificate File: " << certPath << '\n';
+    cout << "Client Key         File: " << keyPath << '\n';
+    cout << "CA                 File: " << caPath << '\n';
 
     factory = std::shared_ptr<TSSLSocketFactory>(new TSSLSocketFactory());
     factory->ciphers("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
@@ -386,14 +386,14 @@
   if (port != 0) {
     cout << host << ":" << port;
   }
-  cout << endl;
+  cout << '\n';
 
   if (transport_type.compare("evhttp") == 0) {
     event_base* base = event_base_new();
-    cout << "Libevent Version: " << event_get_version() << endl;
-    cout << "Libevent Method: " << event_base_get_method(base) << endl;
+    cout << "Libevent Version: " << event_get_version() << '\n';
+    cout << "Libevent Method: " << event_base_get_method(base) << '\n';
 #if LIBEVENT_VERSION_NUMBER >= 0x02000000
-    cout << "Libevent Features: 0x" << hex << event_base_get_features(base) << endl;
+    cout << "Libevent Features: 0x" << hex << event_base_get_features(base) << '\n';
 #endif
 
     std::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
@@ -421,7 +421,7 @@
     try {
       transport->open();
     } catch (TTransportException& ex) {
-      cout << "Connect failed: " << ex.what() << endl;
+      cout << "Connect failed: " << ex.what() << '\n';
       return ERR_UNKNOWN;
     }
 
@@ -438,12 +438,12 @@
     try {
       cout << "testVoid()" << flush;
       testClient.testVoid();
-      cout << " = void" << endl;
+      cout << " = void" << '\n';
     } catch (TTransportException&) {
       // Stop here if transport got broken
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_BASETYPES;
     }
 
@@ -453,9 +453,9 @@
     cout << "testString(\"Test\")" << flush;
     string s;
     testClient.testString(s, "Test");
-    cout << " = " << s << endl;
+    cout << " = " << s << '\n';
     if (s != "Test") {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_BASETYPES;
     }
 
@@ -471,9 +471,9 @@
           cout << "secondService.secondTestString(\"foo\") => " << flush;
         std::string result;
       ssc.secondtestString(result, "foo");
-      cout << "{" << result << "}" << endl;
+      cout << "{" << result << "}" << '\n';
       } catch (std::exception& e) {
-      cout << "  *** FAILED *** " << e.what() << endl;
+      cout << "  *** FAILED *** " << e.what() << '\n';
       return_code |= ERR_EXCEPTIONS;
     }
     }
@@ -514,16 +514,16 @@
 #endif
       cout << "testString(" << str << ") = " << flush;
       testClient.testString(s, str);
-      cout << s << endl;
+      cout << s << '\n';
       if (s != str) {
         cout.imbue(locale("en_US.UTF8"));
-        cout << "*** FAILED ***" << endl << "Expected string: " << str << " but got: " << s << endl << "CLEAR";
+        cout << "*** FAILED ***" << '\n' << "Expected string: " << str << " but got: " << s << '\n' << "CLEAR";
         return_code |= ERR_BASETYPES;
       }
     } catch (TTransportException&) {
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_BASETYPES;
       return return_code;
     }
@@ -537,11 +537,11 @@
           " char-to-test-json-parsing: ]] \"]] \\\" }}}{ [[[ ");
       cout << "testString(" << str << ") = " << flush;
       testClient.testString(s, str);
-      cout << s << endl;
+      cout << s << '\n';
       if (s != str) {
         cout.imbue(locale("en_US.UTF8"));
-        cout << "*** FAILED ***" << endl
-             << "Expected string: " << str << " but got: " << s << endl
+        cout << "*** FAILED ***" << '\n'
+             << "Expected string: " << str << " but got: " << s << '\n'
              << "CLEAR";
         ;
         return_code |= ERR_BASETYPES;
@@ -549,7 +549,7 @@
     } catch (TTransportException&) {
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_BASETYPES;
       return return_code;
     }
@@ -614,15 +614,15 @@
       double expected = pow(static_cast<double>(10), 307);
       cout << "testDouble(" << expected << ") = " << flush;
       double actual = testClient.testDouble(expected);
-      cout << "(" << actual << ")" << endl;
+      cout << "(" << actual << ")" << '\n';
       if (expected - actual > pow(static_cast<double>(10), 292)) {
-        cout << "*** FAILED ***" << endl
-             << "Expected: " << expected << " but got: " << actual << endl;
+        cout << "*** FAILED ***" << '\n'
+             << "Expected: " << expected << " but got: " << actual << '\n';
       }
     } catch (TTransportException&) {
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_BASETYPES;
     }
 
@@ -630,15 +630,15 @@
       double expected = pow(static_cast<double>(10), -292);
       cout << "testDouble(" << expected << ") = " << flush;
       double actual = testClient.testDouble(expected);
-      cout << "(" << actual << ")" << endl;
+      cout << "(" << actual << ")" << '\n';
       if (expected - actual > pow(static_cast<double>(10), -307)) {
-        cout << "*** FAILED ***" << endl
-             << "Expected: " << expected << " but got: " << actual << endl;
+        cout << "*** FAILED ***" << '\n'
+             << "Expected: " << expected << " but got: " << actual << '\n';
       }
     } catch (TTransportException&) {
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_BASETYPES;
     }
 
@@ -677,7 +677,7 @@
            in.i32_thing,
            in.i64_thing);
     if (in != out) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_STRUCTS;
     }
 
@@ -700,7 +700,7 @@
            in.i64_thing,
            in2.i32_thing);
     if (in2 != out2) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_STRUCTS;
     }
 
@@ -735,9 +735,9 @@
       }
       cout << m_iter->first << " => " << m_iter->second;
     }
-    cout << "}" << endl;
+    cout << "}" << '\n';
     if (mapin != mapout) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_CONTAINERS;
     }
 
@@ -760,15 +760,15 @@
           first = false;
         cout << it->first << " => " << it->second;
       }
-      cout << "}" << endl;
+      cout << "}" << '\n';
       if (smapin != smapout) {
-        cout << "*** FAILED ***" << endl;
+        cout << "*** FAILED ***" << '\n';
         return_code |= ERR_CONTAINERS;
       }
     } catch (TTransportException&) {
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_CONTAINERS;
     }
 
@@ -803,9 +803,9 @@
       }
       cout << *s_iter;
     }
-    cout << "}" << endl;
+    cout << "}" << '\n';
     if (setin != setout) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_CONTAINERS;
     }
 
@@ -817,14 +817,14 @@
       vector<int32_t> listout;
       testClient.testList(listout, vector<int32_t>());
       if (!listout.empty()) {
-        cout << "*** FAILED ***" << endl;
-        cout << "invalid length: " << listout.size() << endl;
+        cout << "*** FAILED ***" << '\n';
+        cout << "invalid length: " << listout.size() << '\n';
         return_code |= ERR_CONTAINERS;
       }
     } catch (TTransportException&) {
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_CONTAINERS;
     }
     try {
@@ -856,15 +856,15 @@
         }
         cout << *l_iter;
       }
-      cout << "}" << endl;
+      cout << "}" << '\n';
       if (listin != listout) {
-        cout << "*** FAILED ***" << endl;
+        cout << "*** FAILED ***" << '\n';
         return_code |= ERR_CONTAINERS;
       }
     } catch (TTransportException&) {
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_CONTAINERS;
     }
 
@@ -873,41 +873,41 @@
      */
     cout << "testEnum(ONE)" << flush;
     Numberz::type ret = testClient.testEnum(Numberz::ONE);
-    cout << " = " << ret << endl;
+    cout << " = " << ret << '\n';
     if (ret != Numberz::ONE) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_STRUCTS;
     }
 
     cout << "testEnum(TWO)" << flush;
     ret = testClient.testEnum(Numberz::TWO);
-    cout << " = " << ret << endl;
+    cout << " = " << ret << '\n';
     if (ret != Numberz::TWO) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_STRUCTS;
     }
 
     cout << "testEnum(THREE)" << flush;
     ret = testClient.testEnum(Numberz::THREE);
-    cout << " = " << ret << endl;
+    cout << " = " << ret << '\n';
     if (ret != Numberz::THREE) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_STRUCTS;
     }
 
     cout << "testEnum(FIVE)" << flush;
     ret = testClient.testEnum(Numberz::FIVE);
-    cout << " = " << ret << endl;
+    cout << " = " << ret << '\n';
     if (ret != Numberz::FIVE) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_STRUCTS;
     }
 
     cout << "testEnum(EIGHT)" << flush;
     ret = testClient.testEnum(Numberz::EIGHT);
-    cout << " = " << ret << endl;
+    cout << " = " << ret << '\n';
     if (ret != Numberz::EIGHT) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_STRUCTS;
     }
 
@@ -916,9 +916,9 @@
      */
     cout << "testTypedef(309858235082523)" << flush;
     UserId uid = testClient.testTypedef(309858235082523LL);
-    cout << " = " << uid << endl;
+    cout << " = " << uid << '\n';
     if (uid != 309858235082523LL) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_STRUCTS;
     }
 
@@ -938,7 +938,7 @@
       }
       cout << "}, ";
     }
-    cout << "}" << endl;
+    cout << "}" << '\n';
     if (mm.size() != 2 ||
         mm[-4][-4] != -4 ||
         mm[-4][-3] != -3 ||
@@ -948,7 +948,7 @@
         mm[4][3] != 3 ||
         mm[4][2] != 2 ||
         mm[4][1] != 1) {
-      cout << "*** FAILED ***" << endl;
+      cout << "*** FAILED ***" << '\n';
       return_code |= ERR_CONTAINERS;
     }
 
@@ -1005,7 +1005,7 @@
         }
         cout << "}, ";
       }
-      cout << "}" << endl;
+      cout << "}" << '\n';
       bool failed = false;
       map<UserId, map<Numberz::type, Insanity> >::const_iterator it1 = whoa.find(UserId(1));
       if (whoa.size() != 2) {
@@ -1033,7 +1033,7 @@
         }
       }
       if (failed) {
-        cout << "*** FAILED ***" << endl;
+        cout << "*** FAILED ***" << '\n';
         return_code |= ERR_STRUCTS;
       }
     }
@@ -1041,7 +1041,7 @@
     /**
      * MULTI TEST
      */
-    cout << "testMulti()" << endl;
+    cout << "testMulti()" << '\n';
     try {
       map<int16_t, string> mul_map;
       Xtruct mul_result;
@@ -1054,13 +1054,13 @@
       xxs.i32_thing = 4242;
       xxs.i64_thing = 424242;
       if (mul_result != xxs) {
-        cout << "*** FAILED ***" << endl;
+        cout << "*** FAILED ***" << '\n';
         return_code |= ERR_STRUCTS;
       }
     } catch (TTransportException&) {
       throw;
     } catch (exception& ex) {
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_STRUCTS;
     }
 
@@ -1069,7 +1069,7 @@
     try {
       cout << "testClient.testException(\"Xception\") =>" << flush;
       testClient.testException("Xception");
-      cout << "  void\n*** FAILED ***" << endl;
+      cout << "  void\n*** FAILED ***" << '\n';
       return_code |= ERR_EXCEPTIONS;
 
     } catch (Xception& e) {
@@ -1079,19 +1079,19 @@
     try {
       cout << "testClient.testException(\"TException\") =>" << flush;
       testClient.testException("TException");
-      cout << "  void\n*** FAILED ***" << endl;
+      cout << "  void\n*** FAILED ***" << '\n';
       return_code |= ERR_EXCEPTIONS;
 
     } catch (const TException&) {
-      cout << "  Caught TException" << endl;
+      cout << "  Caught TException" << '\n';
     }
 
     try {
       cout << "testClient.testException(\"success\") =>" << flush;
       testClient.testException("success");
-      cout << "  void" << endl;
+      cout << "  void" << '\n';
     } catch (exception & ex) {                                                                       \
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_EXCEPTIONS;
     }
 
@@ -1101,7 +1101,7 @@
       cout << "testClient.testMultiException(\"Xception\", \"test 1\") =>" << flush;
       Xtruct result;
       testClient.testMultiException(result, "Xception", "test 1");
-      cout << "  result\n*** FAILED ***" << endl;
+      cout << "  result\n*** FAILED ***" << '\n';
       return_code |= ERR_EXCEPTIONS;
     } catch (Xception& e) {
       printf("  {%u, \"%s\"}\n", e.errorCode, e.message.c_str());
@@ -1111,7 +1111,7 @@
       cout << "testClient.testMultiException(\"Xception2\", \"test 2\") =>" << flush;
       Xtruct result;
       testClient.testMultiException(result, "Xception2", "test 2");
-      cout << "  result\n*** FAILED ***" << endl;
+      cout << "  result\n*** FAILED ***" << '\n';
       return_code |= ERR_EXCEPTIONS;
 
     } catch (Xception2& e) {
@@ -1124,7 +1124,7 @@
       testClient.testMultiException(result, "success", "test 3");
       printf("  {{\"%s\"}}\n", result.string_thing.c_str());
     } catch (exception & ex) {                                                                       \
-      cout << "*** FAILED ***" << endl << ex.what() << endl;
+      cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
       return_code |= ERR_EXCEPTIONS;
     }
 
@@ -1155,16 +1155,16 @@
      */
     cout << "re-test testI32(-1)" << flush;
     int i32 = testClient.testI32(-1);
-    cout << " = " << i32 << endl;
+    cout << " = " << i32 << '\n';
     if (i32 != -1)
       return_code |= ERR_BASETYPES;
 
-    cout << endl << "All tests done." << endl << flush;
+    cout << '\n' << "All tests done." << '\n' << flush;
 
     uint64_t stop = now();
     uint64_t tot = stop - start;
 
-    cout << "Total time: " << stop - start << " us" << endl;
+    cout << "Total time: " << stop - start << " us" << '\n';
 
     time_tot += tot;
     if (time_min == 0 || tot < time_min) {
@@ -1181,9 +1181,9 @@
 
   uint64_t time_avg = time_tot / numTests;
 
-  cout << "Min time: " << time_min << " us" << endl;
-  cout << "Max time: " << time_max << " us" << endl;
-  cout << "Avg time: " << time_avg << " us" << endl;
+  cout << "Min time: " << time_min << " us" << '\n';
+  cout << "Max time: " << time_max << " us" << '\n';
+  cout << "Avg time: " << time_avg << " us" << '\n';
 
   return return_code;
 }
@@ -1225,26 +1225,26 @@
     string bin_request;
     string bin_result;
 
-    cout << "testBinary(siz = " << siz << ")" << endl;
+    cout << "testBinary(siz = " << siz << ")" << '\n';
     binary_fill(bin_request, siz);
     try {
         testClient.testBinary(bin_result, bin_request);
 
         if (bin_request.size() != bin_result.size()) {
-            cout << "*** FAILED: request size " << bin_request.size() << "; result size " << bin_result.size() << endl;
+            cout << "*** FAILED: request size " << bin_request.size() << "; result size " << bin_result.size() << '\n';
             return ERR_BASETYPES;
         }
 
         for (string::size_type i = 0; i < siz; ++i) {
             if (bin_request.at(i) != bin_result.at(i)) {
-                cout << "*** FAILED: at position " << i << " request[i] is h" << hex << bin_request.at(i) << " result[i] is h" << hex << bin_result.at(i) << endl;
+                cout << "*** FAILED: at position " << i << " request[i] is h" << hex << bin_request.at(i) << " result[i] is h" << hex << bin_result.at(i) << '\n';
                 return ERR_BASETYPES;
             }
         }
     } catch (TTransportException&) {
         throw;
     } catch (exception& ex) {
-        cout << "*** FAILED ***" << endl << ex.what() << endl;
+        cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
         return ERR_BASETYPES;
     }
 
diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
index 6c61f40..afd2938 100644
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -394,7 +394,7 @@
   }
 
   void communicate(const char* event, void* ctx, const char* fn_name) {
-    std::cout << event << ": " << *static_cast<std::string*>(ctx) << " = " << fn_name << std::endl;
+    std::cout << event << ": " << *static_cast<std::string*>(ctx) << " = " << fn_name << '\n';
   }
 };
 
@@ -655,7 +655,7 @@
     }
 
   } catch (std::exception& e) {
-    cerr << e.what() << endl;
+    cerr << e.what() << '\n';
     cout << desc << "\n";
     return 1;
   }
@@ -767,7 +767,7 @@
   if (port != 0) {
     cout << port;
   }
-  cout << endl;
+  cout << '\n';
 
   // Multiplexed Processor if needed
   if (boost::starts_with(protocol_type, "multi")) {
@@ -823,7 +823,7 @@
               : new transport::TNonblockingServerSocket(port));
       server.reset(new TNonblockingServer(testProcessor, protocolFactory, nbSocket));
     } else {
-      cerr << "server-type nonblocking requires transport of http or framed" << endl;
+      cerr << "server-type nonblocking requires transport of http or framed" << '\n';
       exit(1);
     }
   }
@@ -857,6 +857,6 @@
     server.reset();
   }
 
-  cout << "done." << endl;
+  cout << "done." << '\n';
   return 0;
 }
