diff --git a/lib/c_glib/test/testthrifttestclient.cpp b/lib/c_glib/test/testthrifttestclient.cpp
index 77daf3d..5e0c894 100644
--- a/lib/c_glib/test/testthrifttestclient.cpp
+++ b/lib/c_glib/test/testthrifttestclient.cpp
@@ -51,7 +51,6 @@
 using namespace thrift::test;
 
 using std::cout;
-using std::endl;
 using std::fixed;
 using std::make_pair;
 using std::map;
@@ -76,51 +75,51 @@
   TestHandler() = default;
 
   void testVoid() override {
-    cout << "[C -> C++] testVoid()" << endl;
+    cout << "[C -> C++] testVoid()" << '\n';
   }
 
   void testString(string& out, const string &thing) override {
-    cout << "[C -> C++] testString(\"" << thing << "\")" << endl;
+    cout << "[C -> C++] testString(\"" << thing << "\")" << '\n';
     out = thing;
   }
 
   bool testBool(const bool thing) override {
-    cout << "[C -> C++] testBool(" << (thing ? "true" : "false") << ")" << endl;
+    cout << "[C -> C++] testBool(" << (thing ? "true" : "false") << ")" << '\n';
     return thing;
   }
   int8_t testByte(const int8_t thing) override {
-    cout << "[C -> C++] testByte(" << (int)thing << ")" << endl;
+    cout << "[C -> C++] testByte(" << (int)thing << ")" << '\n';
     return thing;
   }
   int32_t testI32(const int32_t thing) override {
-    cout << "[C -> C++] testI32(" << thing << ")" << endl;
+    cout << "[C -> C++] testI32(" << thing << ")" << '\n';
     return thing;
   }
 
   int64_t testI64(const int64_t thing) override {
-    cout << "[C -> C++] testI64(" << thing << ")" << endl;
+    cout << "[C -> C++] testI64(" << thing << ")" << '\n';
     return thing;
   }
 
   double testDouble(const double thing) override {
     cout.precision(6);
-    cout << "[C -> C++] testDouble(" << fixed << thing << ")" << endl;
+    cout << "[C -> C++] testDouble(" << fixed << thing << ")" << '\n';
     return thing;
   }
 
   void testBinary(string& out, const string &thing) override {
-    cout << "[C -> C++] testBinary(\"" << thing << "\")" << endl;
+    cout << "[C -> C++] testBinary(\"" << thing << "\")" << '\n';
     out = thing;
   }
 
   void testStruct(Xtruct& out, const Xtruct &thing) override {
-    cout << "[C -> C++] testStruct({\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "})" << endl;
+    cout << "[C -> C++] testStruct({\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "})" << '\n';
     out = thing;
   }
 
   void testNest(Xtruct2& out, const Xtruct2& nest) override {
     const Xtruct &thing = nest.struct_thing;
-    cout << "[C -> C++] testNest({" << (int)nest.byte_thing << ", {\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "}, " << nest.i32_thing << "})" << endl;
+    cout << "[C -> C++] testNest({" << (int)nest.byte_thing << ", {\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "}, " << nest.i32_thing << "})" << '\n';
     out = nest;
   }
 
@@ -136,7 +135,7 @@
       }
       cout << m_iter->first << " => " << m_iter->second;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -152,7 +151,7 @@
       }
       cout << "\"" << m_iter->first << "\" => \"" << m_iter->second << "\"";
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -169,7 +168,7 @@
       }
       cout << *s_iter;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -185,21 +184,21 @@
       }
       cout << *l_iter;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
   Numberz::type testEnum(const Numberz::type thing) override {
-    cout << "[C -> C++] testEnum(" << thing << ")" << endl;
+    cout << "[C -> C++] testEnum(" << thing << ")" << '\n';
     return thing;
   }
 
   UserId testTypedef(const UserId thing) override {
-    cout << "[C -> C++] testTypedef(" << thing << ")" << endl;
+    cout << "[C -> C++] testTypedef(" << thing << ")" << '\n';
     return thing;  }
 
   void testMapMap(map<int32_t, map<int32_t,int32_t> > &mapmap, const int32_t hello) override {
-    cout << "[C -> C++] testMapMap(" << hello << ")" << endl;
+    cout << "[C -> C++] testMapMap(" << hello << ")" << '\n';
 
     map<int32_t,int32_t> pos;
     map<int32_t,int32_t> neg;
@@ -216,7 +215,7 @@
   void testInsanity(map<UserId, map<Numberz::type,Insanity> > &insane, const Insanity &argument) override {
     THRIFT_UNUSED_VARIABLE (argument);
 
-    cout << "[C -> C++] testInsanity()" << endl;
+    cout << "[C -> C++] testInsanity()" << '\n';
 
     Xtruct hello;
     hello.string_thing = "Hello2";
@@ -278,7 +277,7 @@
       }
       cout << "}, ";
     }
-    cout << "}" << endl;
+    cout << "}" << '\n';
 
 
   }
@@ -288,7 +287,7 @@
     THRIFT_UNUSED_VARIABLE (arg4);
     THRIFT_UNUSED_VARIABLE (arg5);
 
-    cout << "[C -> C++] testMulti()" << endl;
+    cout << "[C -> C++] testMulti()" << '\n';
 
     hello.string_thing = "Hello2";
     hello.byte_thing = arg0;
@@ -299,7 +298,7 @@
   void testException(const std::string &arg)
     noexcept(false)  override
   {
-    cout << "[C -> C++] testException(" << arg << ")" << endl;
+    cout << "[C -> C++] testException(" << arg << ")" << '\n';
     if (arg.compare("Xception") == 0) {
       Xception e;
       e.errorCode = 1001;
@@ -317,7 +316,7 @@
 
   void testMultiException(Xtruct &result, const std::string &arg0, const std::string &arg1) noexcept(false) override {
 
-    cout << "[C -> C++] testMultiException(" << arg0 << ", " << arg1 << ")" << endl;
+    cout << "[C -> C++] testMultiException(" << arg0 << ", " << arg1 << ")" << '\n';
 
     if (arg0.compare("Xception") == 0) {
       Xception e;
@@ -336,9 +335,9 @@
   }
 
   void testOneway(int sleepFor) override {
-    cout << "testOneway(" << sleepFor << "): Sleeping..." << endl;
+    cout << "testOneway(" << sleepFor << "): Sleeping..." << '\n';
     sleep(sleepFor);
-    cout << "testOneway(" << sleepFor << "): done sleeping!" << endl;
+    cout << "testOneway(" << sleepFor << "): done sleeping!" << '\n';
   }
 };
 
diff --git a/lib/c_glib/test/testthrifttestzlibclient.cpp b/lib/c_glib/test/testthrifttestzlibclient.cpp
index 5c4b931..307fd4f 100644
--- a/lib/c_glib/test/testthrifttestzlibclient.cpp
+++ b/lib/c_glib/test/testthrifttestzlibclient.cpp
@@ -46,7 +46,6 @@
 using namespace thrift::test;
 
 using std::cout;
-using std::endl;
 using std::fixed;
 using std::make_pair;
 using std::map;
@@ -71,51 +70,51 @@
   TestHandler() = default;
 
   void testVoid() override {
-    cout << "[C -> C++] testVoid()" << endl;
+    cout << "[C -> C++] testVoid()" << '\n';
   }
 
   void testString(string& out, const string &thing) override {
-    cout << "[C -> C++] testString(\"" << thing << "\")" << endl;
+    cout << "[C -> C++] testString(\"" << thing << "\")" << '\n';
     out = thing;
   }
 
   bool testBool(const bool thing) override {
-    cout << "[C -> C++] testBool(" << (thing ? "true" : "false") << ")" << endl;
+    cout << "[C -> C++] testBool(" << (thing ? "true" : "false") << ")" << '\n';
     return thing;
   }
   int8_t testByte(const int8_t thing) override {
-    cout << "[C -> C++] testByte(" << (int)thing << ")" << endl;
+    cout << "[C -> C++] testByte(" << (int)thing << ")" << '\n';
     return thing;
   }
   int32_t testI32(const int32_t thing) override {
-    cout << "[C -> C++] testI32(" << thing << ")" << endl;
+    cout << "[C -> C++] testI32(" << thing << ")" << '\n';
     return thing;
   }
 
   int64_t testI64(const int64_t thing) override {
-    cout << "[C -> C++] testI64(" << thing << ")" << endl;
+    cout << "[C -> C++] testI64(" << thing << ")" << '\n';
     return thing;
   }
 
   double testDouble(const double thing) override {
     cout.precision(6);
-    cout << "[C -> C++] testDouble(" << fixed << thing << ")" << endl;
+    cout << "[C -> C++] testDouble(" << fixed << thing << ")" << '\n';
     return thing;
   }
 
   void testBinary(string& out, const string &thing) override {
-    cout << "[C -> C++] testBinary(\"" << thing << "\")" << endl;
+    cout << "[C -> C++] testBinary(\"" << thing << "\")" << '\n';
     out = thing;
   }
 
   void testStruct(Xtruct& out, const Xtruct &thing) override {
-    cout << "[C -> C++] testStruct({\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "})" << endl;
+    cout << "[C -> C++] testStruct({\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "})" << '\n';
     out = thing;
   }
 
   void testNest(Xtruct2& out, const Xtruct2& nest) override {
     const Xtruct &thing = nest.struct_thing;
-    cout << "[C -> C++] testNest({" << (int)nest.byte_thing << ", {\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "}, " << nest.i32_thing << "})" << endl;
+    cout << "[C -> C++] testNest({" << (int)nest.byte_thing << ", {\"" << thing.string_thing << "\", " << (int)thing.byte_thing << ", " << thing.i32_thing << ", " << thing.i64_thing << "}, " << nest.i32_thing << "})" << '\n';
     out = nest;
   }
 
@@ -131,7 +130,7 @@
       }
       cout << m_iter->first << " => " << m_iter->second;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -147,7 +146,7 @@
       }
       cout << "\"" << m_iter->first << "\" => \"" << m_iter->second << "\"";
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -164,7 +163,7 @@
       }
       cout << *s_iter;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
@@ -180,21 +179,21 @@
       }
       cout << *l_iter;
     }
-    cout << "})" << endl;
+    cout << "})" << '\n';
     out = thing;
   }
 
   Numberz::type testEnum(const Numberz::type thing) override {
-    cout << "[C -> C++] testEnum(" << thing << ")" << endl;
+    cout << "[C -> C++] testEnum(" << thing << ")" << '\n';
     return thing;
   }
 
   UserId testTypedef(const UserId thing) override {
-    cout << "[C -> C++] testTypedef(" << thing << ")" << endl;
+    cout << "[C -> C++] testTypedef(" << thing << ")" << '\n';
     return thing;  }
 
   void testMapMap(map<int32_t, map<int32_t,int32_t> > &mapmap, const int32_t hello) override {
-    cout << "[C -> C++] testMapMap(" << hello << ")" << endl;
+    cout << "[C -> C++] testMapMap(" << hello << ")" << '\n';
 
     map<int32_t,int32_t> pos;
     map<int32_t,int32_t> neg;
@@ -211,7 +210,7 @@
   void testInsanity(map<UserId, map<Numberz::type,Insanity> > &insane, const Insanity &argument) override {
     THRIFT_UNUSED_VARIABLE (argument);
 
-    cout << "[C -> C++] testInsanity()" << endl;
+    cout << "[C -> C++] testInsanity()" << '\n';
 
     Xtruct hello;
     hello.string_thing = "Hello2";
@@ -273,7 +272,7 @@
       }
       cout << "}, ";
     }
-    cout << "}" << endl;
+    cout << "}" << '\n';
 
 
   }
@@ -283,7 +282,7 @@
     THRIFT_UNUSED_VARIABLE (arg4);
     THRIFT_UNUSED_VARIABLE (arg5);
 
-    cout << "[C -> C++] testMulti()" << endl;
+    cout << "[C -> C++] testMulti()" << '\n';
 
     hello.string_thing = "Hello2";
     hello.byte_thing = arg0;
@@ -294,7 +293,7 @@
   void testException(const std::string &arg)
     throw(Xception, apache::thrift::TException) override
   {
-    cout << "[C -> C++] testException(" << arg << ")" << endl;
+    cout << "[C -> C++] testException(" << arg << ")" << '\n';
     if (arg.compare("Xception") == 0) {
       Xception e;
       e.errorCode = 1001;
@@ -312,7 +311,7 @@
 
   void testMultiException(Xtruct &result, const std::string &arg0, const std::string &arg1) throw(Xception, Xception2) override {
 
-    cout << "[C -> C++] testMultiException(" << arg0 << ", " << arg1 << ")" << endl;
+    cout << "[C -> C++] testMultiException(" << arg0 << ", " << arg1 << ")" << '\n';
 
     if (arg0.compare("Xception") == 0) {
       Xception e;
@@ -331,9 +330,9 @@
   }
 
   void testOneway(int sleepFor) override {
-    cout << "testOneway(" << sleepFor << "): Sleeping..." << endl;
+    cout << "testOneway(" << sleepFor << "): Sleeping..." << '\n';
     sleep(sleepFor);
-    cout << "testOneway(" << sleepFor << "): done sleeping!" << endl;
+    cout << "testOneway(" << sleepFor << "): done sleeping!" << '\n';
   }
 };
 
diff --git a/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp b/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
index 7656596..43d4034 100644
--- a/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
+++ b/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
@@ -147,8 +147,7 @@
     self->finish(req);
   } catch (std::exception& e) {
     // don't propagate a C++ exception in C code (e.g. libevent)
-    std::cerr << "TEvhttpClientChannel::response exception thrown (ignored): " << e.what()
-              << std::endl;
+    std::cerr << "TEvhttpClientChannel::response exception thrown (ignored): " << e.what() << '\n';
   }
 }
 }
diff --git a/lib/cpp/src/thrift/async/TEvhttpServer.cpp b/lib/cpp/src/thrift/async/TEvhttpServer.cpp
index 7d2cf21..bea9001 100644
--- a/lib/cpp/src/thrift/async/TEvhttpServer.cpp
+++ b/lib/cpp/src/thrift/async/TEvhttpServer.cpp
@@ -127,13 +127,13 @@
   int rv = evhttp_add_header(ctx->req->output_headers, "Content-Type", "application/x-thrift");
   if (rv != 0) {
     // TODO: Log an error.
-    std::cerr << "evhttp_add_header failed " << __FILE__ << ":" << __LINE__ << std::endl;
+    std::cerr << "evhttp_add_header failed " << __FILE__ << ":" << __LINE__ << '\n';
   }
 
   struct evbuffer* buf = evbuffer_new();
   if (buf == nullptr) {
     // TODO: Log an error.
-    std::cerr << "evbuffer_new failed " << __FILE__ << ":" << __LINE__ << std::endl;
+    std::cerr << "evbuffer_new failed " << __FILE__ << ":" << __LINE__ << '\n';
   } else {
     uint8_t* obuf;
     uint32_t sz;
@@ -141,8 +141,7 @@
     int ret = evbuffer_add(buf, obuf, sz);
     if (ret != 0) {
       // TODO: Log an error.
-      std::cerr << "evhttp_add failed with " << ret << " " << __FILE__ << ":" << __LINE__
-                << std::endl;
+      std::cerr << "evhttp_add failed with " << ret << " " << __FILE__ << ":" << __LINE__ << '\n';
     }
   }
 
diff --git a/lib/cpp/src/thrift/transport/TFileTransport.cpp b/lib/cpp/src/thrift/transport/TFileTransport.cpp
index dd7d229..3f4d812 100644
--- a/lib/cpp/src/thrift/transport/TFileTransport.cpp
+++ b/lib/cpp/src/thrift/transport/TFileTransport.cpp
@@ -55,8 +55,6 @@
 
 using std::shared_ptr;
 using std::cerr;
-using std::cout;
-using std::endl;
 using std::string;
 using namespace apache::thrift::protocol;
 using namespace apache::thrift::concurrency;
@@ -1032,7 +1030,7 @@
         break;
       }
     } catch (TException& te) {
-      cerr << te.what() << endl;
+      cerr << te.what() << '\n';
       break;
     }
   }
@@ -1060,7 +1058,7 @@
     } catch (TEOFException&) {
       break;
     } catch (TException& te) {
-      cerr << te.what() << endl;
+      cerr << te.what() << '\n';
       break;
     }
   }
diff --git a/lib/cpp/test/Benchmark.cpp b/lib/cpp/test/Benchmark.cpp
index 97a5317..ba8c345 100644
--- a/lib/cpp/test/Benchmark.cpp
+++ b/lib/cpp/test/Benchmark.cpp
@@ -53,7 +53,6 @@
   using namespace apache::thrift::transport;
   using namespace apache::thrift::protocol;
   using std::cout;
-  using std::endl;
 
   OneOfEach ooe;
   ooe.im_true = true;
@@ -84,7 +83,7 @@
       ooe.write(&prot);
     }
     elapsed = timer.frame();
-    cout << "Write big endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << "Write big endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   buf->getBuffer(&data, &datasize);
@@ -100,7 +99,7 @@
       ooe2.read(&prot);
     }
     elapsed = timer.frame();
-    cout << " Read big endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << " Read big endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   {
@@ -113,7 +112,7 @@
       ooe.write(&prot);
     }
     elapsed = timer.frame();
-    cout << "Write little endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << "Write little endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   {
@@ -127,7 +126,7 @@
       ooe2.read(&prot);
     }
     elapsed = timer.frame();
-    cout << " Read little endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << " Read little endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   {
@@ -140,7 +139,7 @@
       ooe.write(&prot);
     }
     elapsed = timer.frame();
-    cout << "Write big endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << "Write big endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   {
@@ -154,7 +153,7 @@
       ooe2.read(&prot);
     }
     elapsed = timer.frame();
-    cout << " Read big endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << " Read big endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
 
@@ -177,7 +176,7 @@
 
     listDoublePerf.write(&prot);
     elapsed = timer.frame();
-    cout << "Double write big endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << "Double write big endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   buf->getBuffer(&data, &datasize);
@@ -191,7 +190,7 @@
 
     listDoublePerf2.read(&prot);
     elapsed = timer.frame();
-    cout << " Double read big endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << " Double read big endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   {
@@ -202,7 +201,7 @@
 
     listDoublePerf.write(&prot);
     elapsed = timer.frame();
-    cout << "Double write little endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << "Double write little endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   {
@@ -214,7 +213,7 @@
 
     listDoublePerf2.read(&prot);
     elapsed = timer.frame();
-    cout << " Double read little endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << " Double read little endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   {
@@ -225,7 +224,7 @@
 
     listDoublePerf.write(&prot);
     elapsed = timer.frame();
-    cout << "Double write big endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << "Double write big endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
   {
@@ -237,7 +236,7 @@
 
     listDoublePerf2.read(&prot);
     elapsed = timer.frame();
-    cout << " Double read big endian: " << num / (1000 * elapsed) << " kHz" << endl;
+    cout << " Double read big endian: " << num / (1000 * elapsed) << " kHz" << '\n';
   }
 
 
diff --git a/lib/cpp/test/OneWayHTTPTest.cpp b/lib/cpp/test/OneWayHTTPTest.cpp
index 7823482..8789c2c 100644
--- a/lib/cpp/test/OneWayHTTPTest.cpp
+++ b/lib/cpp/test/OneWayHTTPTest.cpp
@@ -55,9 +55,6 @@
 using apache::thrift::transport::TSocket;
 using apache::thrift::transport::TTransportException;
 using std::shared_ptr;
-using std::cout;
-using std::cerr;
-using std::endl;
 using std::string;
 namespace utf = boost::unit_test;
 
@@ -70,12 +67,12 @@
 
   void roundTripRPC() override {
 #ifdef ENABLE_STDERR_LOGGING
-    cerr << "roundTripRPC()" << endl;
+    cerr << "roundTripRPC()" << '\n';
 #endif
   }
   void oneWayRPC() override {
 #ifdef ENABLE_STDERR_LOGGING
-    cerr << "oneWayRPC()" << std::endl ;
+    cerr << "oneWayRPC()" << '\n';
 #endif
  }
 };
@@ -201,7 +198,7 @@
 
   int port = ss->getPort() ;
 #ifdef ENABLE_STDERR_LOGGING
-  cerr << "port " << port << endl ;
+  cerr << "port " << port << '\n';
 #endif
 
   {
diff --git a/lib/cpp/test/TMemoryBufferTest.cpp b/lib/cpp/test/TMemoryBufferTest.cpp
index 2f1aea6..53e5d15 100644
--- a/lib/cpp/test/TMemoryBufferTest.cpp
+++ b/lib/cpp/test/TMemoryBufferTest.cpp
@@ -36,8 +36,6 @@
 using apache::thrift::transport::TMemoryBuffer;
 using apache::thrift::transport::TTransportException;
 using std::shared_ptr;
-using std::cout;
-using std::endl;
 using std::string;
 
 BOOST_AUTO_TEST_CASE(test_read_write_grow) {
diff --git a/lib/cpp/test/TServerSocketTest.cpp b/lib/cpp/test/TServerSocketTest.cpp
index 929defa..0860242 100644
--- a/lib/cpp/test/TServerSocketTest.cpp
+++ b/lib/cpp/test/TServerSocketTest.cpp
@@ -43,7 +43,7 @@
   accepted->close();
   sock1.close();
 
-  std::cout << "An error message from getaddrinfo on the console is expected:" << std::endl;
+  std::cout << "An error message from getaddrinfo on the console is expected:" << '\n';
   TServerSocket sock2("257.258.259.260", 0);
   BOOST_CHECK_THROW(sock2.listen(), TTransportException);
   sock2.close();
diff --git a/lib/cpp/test/ThrifttReadCheckTests.cpp b/lib/cpp/test/ThrifttReadCheckTests.cpp
index eb4ca01..481185e 100644
--- a/lib/cpp/test/ThrifttReadCheckTests.cpp
+++ b/lib/cpp/test/ThrifttReadCheckTests.cpp
@@ -55,8 +55,6 @@
 using apache::thrift::transport::TBufferedTransport;
 using apache::thrift::transport::TFramedTransport;
 using std::shared_ptr;
-using std::cout;
-using std::endl;
 using std::string;
 using std::memset;
 using namespace apache::thrift;
diff --git a/lib/cpp/test/concurrency/Tests.cpp b/lib/cpp/test/concurrency/Tests.cpp
index 45054a9..67de789 100644
--- a/lib/cpp/test/concurrency/Tests.cpp
+++ b/lib/cpp/test/concurrency/Tests.cpp
@@ -51,52 +51,52 @@
 
     ThreadFactoryTests threadFactoryTests;
 
-    std::cout << "ThreadFactory tests..." << std::endl;
+    std::cout << "ThreadFactory tests..." << '\n';
 
     const int reapLoops = 2 * WEIGHT;
     const int reapCount = 100 * WEIGHT;
     const size_t floodLoops = 3;
     const size_t floodCount = 500 * WEIGHT;
 
-    std::cout << "\t\tThreadFactory reap N threads test: N = " << reapLoops << "x" << reapCount << std::endl;
+    std::cout << "\t\tThreadFactory reap N threads test: N = " << reapLoops << "x" << reapCount << '\n';
 
     if (!threadFactoryTests.reapNThreads(reapLoops, reapCount)) {
-      std::cerr << "\t\ttThreadFactory reap N threads FAILED" << std::endl;
+      std::cerr << "\t\ttThreadFactory reap N threads FAILED" << '\n';
       return 1;
     }
 
-    std::cout << "\t\tThreadFactory flood N threads test: N = " << floodLoops << "x" << floodCount << std::endl;
+    std::cout << "\t\tThreadFactory flood N threads test: N = " << floodLoops << "x" << floodCount << '\n';
 
     if (!threadFactoryTests.floodNTest(floodLoops, floodCount)) {
-      std::cerr << "\t\ttThreadFactory flood N threads FAILED" << std::endl;
+      std::cerr << "\t\ttThreadFactory flood N threads FAILED" << '\n';
       return 1;
     }
 
-    std::cout << "\t\tThreadFactory synchronous start test" << std::endl;
+    std::cout << "\t\tThreadFactory synchronous start test" << '\n';
 
     if (!threadFactoryTests.synchStartTest()) {
-      std::cerr << "\t\ttThreadFactory synchronous start FAILED" << std::endl;
+      std::cerr << "\t\ttThreadFactory synchronous start FAILED" << '\n';
       return 1;
     }
 
-    std::cout << "\t\tThreadFactory monitor timeout test" << std::endl;
+    std::cout << "\t\tThreadFactory monitor timeout test" << '\n';
 
     if (!threadFactoryTests.monitorTimeoutTest()) {
-      std::cerr << "\t\ttThreadFactory monitor timeout FAILED" << std::endl;
+      std::cerr << "\t\ttThreadFactory monitor timeout FAILED" << '\n';
       return 1;
     }
   }
 
   if (runAll || args[0].compare("util") == 0) {
 
-    std::cout << "Util tests..." << std::endl;
+    std::cout << "Util tests..." << '\n';
 
-    std::cout << "\t\tUtil minimum time" << std::endl;
+    std::cout << "\t\tUtil minimum time" << '\n';
 
     int64_t time00 = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
     int64_t time01 = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
 
-    std::cout << "\t\t\tMinimum time: " << time01 - time00 << "ms" << std::endl;
+    std::cout << "\t\t\tMinimum time: " << time01 - time00 << "ms" << '\n';
 
     time00 = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
     time01 = time00;
@@ -107,54 +107,54 @@
       time01 = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
     }
 
-    std::cout << "\t\t\tscall per ms: " << count / (time01 - time00) << std::endl;
+    std::cout << "\t\t\tscall per ms: " << count / (time01 - time00) << '\n';
   }
 
   if (runAll || args[0].compare("timer-manager") == 0) {
 
-    std::cout << "TimerManager tests..." << std::endl;
+    std::cout << "TimerManager tests..." << '\n';
 
-    std::cout << "\t\tTimerManager test00" << std::endl;
+    std::cout << "\t\tTimerManager test00" << '\n';
 
     TimerManagerTests timerManagerTests;
 
     if (!timerManagerTests.test00()) {
-      std::cerr << "\t\tTimerManager tests FAILED" << std::endl;
+      std::cerr << "\t\tTimerManager tests FAILED" << '\n';
       return 1;
     }
 
-    std::cout << "\t\tTimerManager test01" << std::endl;
+    std::cout << "\t\tTimerManager test01" << '\n';
 
     if (!timerManagerTests.test01()) {
-      std::cerr << "\t\tTimerManager tests FAILED" << std::endl;
+      std::cerr << "\t\tTimerManager tests FAILED" << '\n';
       return 1;
     }
 
-    std::cout << "\t\tTimerManager test02" << std::endl;
+    std::cout << "\t\tTimerManager test02" << '\n';
 
     if (!timerManagerTests.test02()) {
-      std::cerr << "\t\tTimerManager tests FAILED" << std::endl;
+      std::cerr << "\t\tTimerManager tests FAILED" << '\n';
       return 1;
     }
 
-    std::cout << "\t\tTimerManager test03" << std::endl;
+    std::cout << "\t\tTimerManager test03" << '\n';
 
     if (!timerManagerTests.test03()) {
-      std::cerr << "\t\tTimerManager tests FAILED" << std::endl;
+      std::cerr << "\t\tTimerManager tests FAILED" << '\n';
       return 1;
     }
 
-    std::cout << "\t\tTimerManager test04" << std::endl;
+    std::cout << "\t\tTimerManager test04" << '\n';
 
     if (!timerManagerTests.test04()) {
-      std::cerr << "\t\tTimerManager tests FAILED" << std::endl;
+      std::cerr << "\t\tTimerManager tests FAILED" << '\n';
       return 1;
     }
   }
 
   if (runAll || args[0].compare("thread-manager") == 0) {
 
-    std::cout << "ThreadManager tests..." << std::endl;
+    std::cout << "ThreadManager tests..." << '\n';
 
     {
       size_t workerCount = 10 * WEIGHT;
@@ -163,26 +163,26 @@
 
       ThreadManagerTests threadManagerTests;
 
-      std::cout << "\t\tThreadManager api test:" << std::endl;
+      std::cout << "\t\tThreadManager api test:" << '\n';
 
       if (!threadManagerTests.apiTest()) {
-        std::cerr << "\t\tThreadManager apiTest FAILED" << std::endl;
+        std::cerr << "\t\tThreadManager apiTest FAILED" << '\n';
         return 1;
       }
 
       std::cout << "\t\tThreadManager load test: worker count: " << workerCount
-                << " task count: " << taskCount << " delay: " << delay << std::endl;
+                << " task count: " << taskCount << " delay: " << delay << '\n';
 
       if (!threadManagerTests.loadTest(taskCount, delay, workerCount)) {
-        std::cerr << "\t\tThreadManager loadTest FAILED" << std::endl;
+        std::cerr << "\t\tThreadManager loadTest FAILED" << '\n';
         return 1;
       }
 
       std::cout << "\t\tThreadManager block test: worker count: " << workerCount
-                << " delay: " << delay << std::endl;
+                << " delay: " << delay << '\n';
 
       if (!threadManagerTests.blockTest(delay, workerCount)) {
-        std::cerr << "\t\tThreadManager blockTest FAILED" << std::endl;
+        std::cerr << "\t\tThreadManager blockTest FAILED" << '\n';
         return 1;
       }
     }
@@ -190,7 +190,7 @@
 
   if (runAll || args[0].compare("thread-manager-benchmark") == 0) {
 
-    std::cout << "ThreadManager benchmark tests..." << std::endl;
+    std::cout << "ThreadManager benchmark tests..." << '\n';
 
     {
 
@@ -207,19 +207,19 @@
         size_t taskCount = workerCount * tasksPerWorker;
 
         std::cout << "\t\tThreadManager load test: worker count: " << workerCount
-                  << " task count: " << taskCount << " delay: " << delay << std::endl;
+                  << " task count: " << taskCount << " delay: " << delay << '\n';
 
         ThreadManagerTests threadManagerTests;
 
         if (!threadManagerTests.loadTest(taskCount, delay, workerCount))
         {
-          std::cerr << "\t\tThreadManager loadTest FAILED" << std::endl;
+          std::cerr << "\t\tThreadManager loadTest FAILED" << '\n';
           return 1;
         }
       }
     }
   }
 
-  std::cout << "ALL TESTS PASSED" << std::endl;
+  std::cout << "ALL TESTS PASSED" << '\n';
   return 0;
 }
diff --git a/lib/cpp/test/concurrency/ThreadFactoryTests.h b/lib/cpp/test/concurrency/ThreadFactoryTests.h
index 23e46e3..a2d55fe 100644
--- a/lib/cpp/test/concurrency/ThreadFactoryTests.h
+++ b/lib/cpp/test/concurrency/ThreadFactoryTests.h
@@ -53,7 +53,7 @@
 
     void run() override {
       Synchronized s(_monitor);
-      
+
       if (--_count == 0) {
         _monitor.notify();
       }
@@ -82,7 +82,7 @@
               threadFactory.newThread(shared_ptr<Runnable>(new ReapNTask(*monitor, activeCount))));
         } catch (SystemResourceException& e) {
           std::cout << "\t\t\tfailed to create " << lix* count + tix << " thread " << e.what()
-                    << std::endl;
+                    << '\n';
           throw;
         }
       }
@@ -96,7 +96,7 @@
           (*thread)->start();
         } catch (SystemResourceException& e) {
           std::cout << "\t\t\tfailed to start  " << lix* count + tix << " thread " << e.what()
-                    << std::endl;
+                    << '\n';
           throw;
         }
       }
@@ -107,11 +107,11 @@
           monitor->wait(1000);
         }
       }
-      
-      std::cout << "\t\t\treaped " << lix* count << " threads" << std::endl;
+
+      std::cout << "\t\t\treaped " << lix* count << " threads" << '\n';
     }
 
-    std::cout << "\t\t\tSuccess!" << std::endl;
+    std::cout << "\t\t\tSuccess!" << '\n';
     return true;
   }
 
@@ -202,7 +202,7 @@
 
     bool success = true;
 
-    std::cout << "\t\t\t" << (success ? "Success" : "Failure") << "!" << std::endl;
+    std::cout << "\t\t\t" << (success ? "Success" : "Failure") << "!" << '\n';
 
     return true;
   }
@@ -239,7 +239,7 @@
     std::cout << "\t\t\t" << (success ? "Success" : "Failure")
               << ": minimum required time to elapse " << count * timeout
               << "ms; actual elapsed time " << endTime - startTime << "ms"
-              << std::endl;
+              << '\n';
 
     return success;
   }
@@ -250,14 +250,14 @@
     ~FloodTask() override {
       if (_id % 10000 == 0) {
 		Synchronized sync(_mon);
-        std::cout << "\t\tthread " << _id << " done" << std::endl;
+        std::cout << "\t\tthread " << _id << " done" << '\n';
       }
     }
 
     void run() override {
       if (_id % 10000 == 0) {
 		Synchronized sync(_mon);
-        std::cout << "\t\tthread " << _id << " started" << std::endl;
+        std::cout << "\t\tthread " << _id << " started" << '\n';
       }
     }
     const size_t _id;
@@ -270,7 +270,7 @@
 
     bool success = false;
     Monitor mon;
-	
+
     for (size_t lix = 0; lix < loop; lix++) {
 
       ThreadFactory threadFactory = ThreadFactory();
@@ -287,14 +287,14 @@
         } catch (TException& e) {
 
           std::cout << "\t\t\tfailed to start  " << lix* count + tix << " thread " << e.what()
-                    << std::endl;
+                    << '\n';
 
           return success;
         }
       }
 
       Synchronized sync(mon);
-      std::cout << "\t\t\tflooded " << (lix + 1) * count << " threads" << std::endl;
+      std::cout << "\t\t\tflooded " << (lix + 1) * count << " threads" << '\n';
       success = true;
     }
 
diff --git a/lib/cpp/test/concurrency/ThreadManagerTests.h b/lib/cpp/test/concurrency/ThreadManagerTests.h
index fee7c7c..b33fc27 100644
--- a/lib/cpp/test/concurrency/ThreadManagerTests.h
+++ b/lib/cpp/test/concurrency/ThreadManagerTests.h
@@ -76,7 +76,7 @@
       {
         Synchronized s(_monitor);
 
-        // std::cout << "Thread " << _count << " completed " << std::endl;
+        // std::cout << "Thread " << _count << " completed " << '\n';
 
         _count--;
         if (_count % 10000 == 0) {
@@ -131,13 +131,13 @@
       threadManager->add(*ix);
     }
 
-    std::cout << "\t\t\t\tloaded " << count << " tasks to execute" << std::endl;
+    std::cout << "\t\t\t\tloaded " << count << " tasks to execute" << '\n';
 
     {
       Synchronized s(monitor);
 
       while (activeCount > 0) {
-        std::cout << "\t\t\t\tactiveCount = " << activeCount << std::endl;
+        std::cout << "\t\t\t\tactiveCount = " << activeCount << '\n';
         monitor.wait();
       }
     }
@@ -184,13 +184,13 @@
 
     std::cout << "\t\t\tfirst start: " << firstTime << " Last end: " << lastTime
               << " min: " << minTime << "ms max: " << maxTime << "ms average: " << averageTime
-              << "ms" << std::endl;
+              << "ms" << '\n';
 
     bool success = (time01 - time00) >= ((int64_t)count * timeout) / (int64_t)workerCount;
 
     std::cout << "\t\t\t" << (success ? "Success" : "Failure")
               << "! expected time: " << ((int64_t)count * timeout) / (int64_t)workerCount << "ms elapsed time: " << time01 - time00
-              << "ms" << std::endl;
+              << "ms" << '\n';
 
     return success;
   }
@@ -307,7 +307,7 @@
       }
 
       std::cout << "\t\t\t"
-                << "Pending tasks " << threadManager->pendingTaskCount() << std::endl;
+                << "Pending tasks " << threadManager->pendingTaskCount() << '\n';
 
       {
         Synchronized s(blockMonitor);
@@ -323,18 +323,18 @@
       }
 
       std::cout << "\t\t\t"
-                << "Pending tasks " << threadManager->pendingTaskCount() << std::endl;
+                << "Pending tasks " << threadManager->pendingTaskCount() << '\n';
 
       try {
         threadManager->add(extraTask, 1);
       } catch (TimedOutException&) {
         std::cout << "\t\t\t"
-                  << "add timed out unexpectedly" << std::endl;
+                  << "add timed out unexpectedly" << '\n';
         throw TException("Unexpected timeout adding task");
 
       } catch (TooManyPendingTasksException&) {
         std::cout << "\t\t\t"
-                  << "add encountered too many pending exepctions" << std::endl;
+                  << "add encountered too many pending exepctions" << '\n';
         throw TException("Unexpected timeout adding task");
       }
 
@@ -375,10 +375,10 @@
       }
 
     } catch (TException& e) {
-      std::cout << "ERROR: " << e.what() << std::endl;
+      std::cout << "ERROR: " << e.what() << '\n';
     }
 
-    std::cout << "\t\t\t" << (success ? "Success" : "Failure") << std::endl;
+    std::cout << "\t\t\t" << (success ? "Success" : "Failure") << '\n';
     return success;
   }
 
@@ -390,7 +390,7 @@
     sleep_(100);
     int64_t b = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
     if (b - a < 50 || b - a > 150) {
-      std::cerr << "\t\t\texpected 100ms gap, found " << (b-a) << "ms gap instead." << std::endl;
+      std::cerr << "\t\t\texpected 100ms gap, found " << (b-a) << "ms gap instead." << '\n';
       return false;
     }
 
@@ -403,18 +403,18 @@
     shared_ptr<ThreadManager> threadManager = ThreadManager::newSimpleThreadManager(1);
     threadManager->threadFactory(threadFactory);
 
-    std::cout << "\t\t\t\tstarting.. " << std::endl;
+    std::cout << "\t\t\t\tstarting.. " << '\n';
 
     threadManager->start();
     threadManager->setExpireCallback(expiredNotifier); // std::bind(&ThreadManagerTests::expiredNotifier, this));
 
-#define EXPECT(FUNC, COUNT) { size_t c = FUNC; if (c != COUNT) { std::cerr << "expected " #FUNC" to be " #COUNT ", but was " << c << std::endl; return false; } }
+#define EXPECT(FUNC, COUNT) { size_t c = FUNC; if (c != COUNT) { std::cerr << "expected " #FUNC" to be " #COUNT ", but was " << c << '\n'; return false; } }
 
     EXPECT(threadManager->workerCount(), 1);
     EXPECT(threadManager->idleWorkerCount(), 1);
     EXPECT(threadManager->pendingTaskCount(), 0);
 
-    std::cout << "\t\t\t\tadd 2nd worker.. " << std::endl;
+    std::cout << "\t\t\t\tadd 2nd worker.. " << '\n';
 
     threadManager->addWorker();
 
@@ -422,7 +422,7 @@
     EXPECT(threadManager->idleWorkerCount(), 2);
     EXPECT(threadManager->pendingTaskCount(), 0);
 
-    std::cout << "\t\t\t\tremove 2nd worker.. " << std::endl;
+    std::cout << "\t\t\t\tremove 2nd worker.. " << '\n';
 
     threadManager->removeWorker();
 
@@ -430,7 +430,7 @@
     EXPECT(threadManager->idleWorkerCount(), 1);
     EXPECT(threadManager->pendingTaskCount(), 0);
 
-    std::cout << "\t\t\t\tremove 1st worker.. " << std::endl;
+    std::cout << "\t\t\t\tremove 1st worker.. " << '\n';
 
     threadManager->removeWorker();
 
@@ -438,7 +438,7 @@
     EXPECT(threadManager->idleWorkerCount(), 0);
     EXPECT(threadManager->pendingTaskCount(), 0);
 
-    std::cout << "\t\t\t\tadd blocking task.. " << std::endl;
+    std::cout << "\t\t\t\tadd blocking task.. " << '\n';
 
     // We're going to throw a blocking task into the mix
     Monitor entryMonitor;   // signaled when task is running
@@ -454,7 +454,7 @@
     EXPECT(threadManager->idleWorkerCount(), 0);
     EXPECT(threadManager->pendingTaskCount(), 1);
 
-    std::cout << "\t\t\t\tadd other task.. " << std::endl;
+    std::cout << "\t\t\t\tadd other task.. " << '\n';
 
     shared_ptr<ThreadManagerTests::Task> otherTask(
       new ThreadManagerTests::Task(doneMonitor, activeCount, 0));
@@ -465,7 +465,7 @@
     EXPECT(threadManager->idleWorkerCount(), 0);
     EXPECT(threadManager->pendingTaskCount(), 2);
 
-    std::cout << "\t\t\t\tremove blocking task specifically.. " << std::endl;
+    std::cout << "\t\t\t\tremove blocking task specifically.. " << '\n';
 
     threadManager->remove(blockingTask);
 
@@ -473,11 +473,11 @@
     EXPECT(threadManager->idleWorkerCount(), 0);
     EXPECT(threadManager->pendingTaskCount(), 1);
 
-    std::cout << "\t\t\t\tremove next pending task.." << std::endl;
+    std::cout << "\t\t\t\tremove next pending task.." << '\n';
 
     shared_ptr<Runnable> nextTask = threadManager->removeNextPending();
     if (nextTask != otherTask) {
-      std::cerr << "\t\t\t\t\texpected removeNextPending to return otherTask" << std::endl;
+      std::cerr << "\t\t\t\t\texpected removeNextPending to return otherTask" << '\n';
       return false;
     }
 
@@ -485,15 +485,15 @@
     EXPECT(threadManager->idleWorkerCount(), 0);
     EXPECT(threadManager->pendingTaskCount(), 0);
 
-    std::cout << "\t\t\t\tremove next pending task (none left).." << std::endl;
+    std::cout << "\t\t\t\tremove next pending task (none left).." << '\n';
 
     nextTask = threadManager->removeNextPending();
     if (nextTask) {
-      std::cerr << "\t\t\t\t\texpected removeNextPending to return an empty Runnable" << std::endl;
+      std::cerr << "\t\t\t\t\texpected removeNextPending to return an empty Runnable" << '\n';
       return false;
     }
 
-    std::cout << "\t\t\t\tadd 2 expired tasks and 1 not.." << std::endl;
+    std::cout << "\t\t\t\tadd 2 expired tasks and 1 not.." << '\n';
 
     shared_ptr<ThreadManagerTests::Task> expiredTask(
       new ThreadManagerTests::Task(doneMonitor, activeCount, 0));
@@ -509,28 +509,28 @@
     EXPECT(threadManager->pendingTaskCount(), 3);
     EXPECT(threadManager->expiredTaskCount(), 0);
 
-    std::cout << "\t\t\t\tremove expired tasks.." << std::endl;
+    std::cout << "\t\t\t\tremove expired tasks.." << '\n';
 
     if (!m_expired.empty()) {
-      std::cerr << "\t\t\t\t\texpected m_expired to be empty" << std::endl;
+      std::cerr << "\t\t\t\t\texpected m_expired to be empty" << '\n';
       return false;
     }
 
     threadManager->removeExpiredTasks();
 
     if (m_expired.size() != 2) {
-      std::cerr << "\t\t\t\t\texpected m_expired to be set" << std::endl;
+      std::cerr << "\t\t\t\t\texpected m_expired to be set" << '\n';
       return false;
     }
 
     if (m_expired.front() != expiredTask) {
-      std::cerr << "\t\t\t\t\texpected m_expired[0] to be the expired task" << std::endl;
+      std::cerr << "\t\t\t\t\texpected m_expired[0] to be the expired task" << '\n';
       return false;
     }
     m_expired.pop_front();
 
     if (m_expired.front() != expiredTask) {
-      std::cerr << "\t\t\t\t\texpected m_expired[1] to be the expired task" << std::endl;
+      std::cerr << "\t\t\t\t\texpected m_expired[1] to be the expired task" << '\n';
       return false;
     }
 
@@ -543,23 +543,23 @@
     EXPECT(threadManager->pendingTaskCount(), 0);
     EXPECT(threadManager->expiredTaskCount(), 2);
 
-    std::cout << "\t\t\t\tadd expired task (again).." << std::endl;
+    std::cout << "\t\t\t\tadd expired task (again).." << '\n';
 
     threadManager->add(expiredTask, 0, 1);  // expires in 1ms
     sleep_(50);  // make sure enough time elapses for it to expire - the shortest expiration time is 1ms
 
-    std::cout << "\t\t\t\tadd worker to consume expired task.." << std::endl;
+    std::cout << "\t\t\t\tadd worker to consume expired task.." << '\n';
 
     threadManager->addWorker();
     sleep_(100);  // make sure it has time to spin up and expire the task
 
     if (m_expired.empty()) {
-      std::cerr << "\t\t\t\t\texpected m_expired to be set" << std::endl;
+      std::cerr << "\t\t\t\t\texpected m_expired to be set" << '\n';
       return false;
     }
 
     if (m_expired.front() != expiredTask) {
-      std::cerr << "\t\t\t\t\texpected m_expired to be the expired task" << std::endl;
+      std::cerr << "\t\t\t\t\texpected m_expired to be the expired task" << '\n';
       return false;
     }
 
@@ -570,16 +570,16 @@
     EXPECT(threadManager->pendingTaskCount(), 0);
     EXPECT(threadManager->expiredTaskCount(), 3);
 
-    std::cout << "\t\t\t\ttry to remove too many workers" << std::endl;
+    std::cout << "\t\t\t\ttry to remove too many workers" << '\n';
     try {
       threadManager->removeWorker(2);
-      std::cerr << "\t\t\t\t\texpected InvalidArgumentException" << std::endl;
+      std::cerr << "\t\t\t\t\texpected InvalidArgumentException" << '\n';
       return false;
     } catch (const InvalidArgumentException&) {
       /* expected */
     }
 
-    std::cout << "\t\t\t\tremove worker.. " << std::endl;
+    std::cout << "\t\t\t\tremove worker.. " << '\n';
 
     threadManager->removeWorker();
 
@@ -588,7 +588,7 @@
     EXPECT(threadManager->pendingTaskCount(), 0);
     EXPECT(threadManager->expiredTaskCount(), 3);
 
-    std::cout << "\t\t\t\tadd blocking task.. " << std::endl;
+    std::cout << "\t\t\t\tadd blocking task.. " << '\n';
 
     threadManager->add(blockingTask);
 
@@ -596,7 +596,7 @@
     EXPECT(threadManager->idleWorkerCount(), 0);
     EXPECT(threadManager->pendingTaskCount(), 1);
 
-    std::cout << "\t\t\t\tadd worker.. " << std::endl;
+    std::cout << "\t\t\t\tadd worker.. " << '\n';
 
     threadManager->addWorker();
     {
@@ -610,7 +610,7 @@
     EXPECT(threadManager->idleWorkerCount(), 0);
     EXPECT(threadManager->pendingTaskCount(), 0);
 
-    std::cout << "\t\t\t\tunblock task and remove worker.. " << std::endl;
+    std::cout << "\t\t\t\tunblock task and remove worker.. " << '\n';
 
     {
       Synchronized s(blockMonitor);
@@ -623,7 +623,7 @@
     EXPECT(threadManager->idleWorkerCount(), 0);
     EXPECT(threadManager->pendingTaskCount(), 0);
 
-    std::cout << "\t\t\t\tcleanup.. " << std::endl;
+    std::cout << "\t\t\t\tcleanup.. " << '\n';
 
     blockingTask.reset();
     threadManager.reset();
diff --git a/lib/cpp/test/concurrency/TimerManagerTests.h b/lib/cpp/test/concurrency/TimerManagerTests.h
index 2d1a262..9a53232 100644
--- a/lib/cpp/test/concurrency/TimerManagerTests.h
+++ b/lib/cpp/test/concurrency/TimerManagerTests.h
@@ -46,7 +46,7 @@
         _success(false),
         _done(false) {}
 
-    ~Task() override { std::cerr << this << std::endl; }
+    ~Task() override { std::cerr << this << '\n'; }
 
     void run() override {
 
@@ -84,7 +84,7 @@
       timerManager.threadFactory(shared_ptr<ThreadFactory>(new ThreadFactory()));
       timerManager.start();
       if (timerManager.state() != TimerManager::STARTED) {
-        std::cerr << "timerManager is not in the STARTED state, but should be" << std::endl;
+        std::cerr << "timerManager is not in the STARTED state, but should be" << '\n';
         return false;
       }
 
@@ -104,15 +104,15 @@
       }
 
       if (!task->_done) {
-        std::cerr << "task is not done, but it should have executed" << std::endl;
+        std::cerr << "task is not done, but it should have executed" << '\n';
         return false;
       }
 
-      std::cout << "\t\t\t" << (task->_success ? "Success" : "Failure") << "!" << std::endl;
+      std::cout << "\t\t\t" << (task->_success ? "Success" : "Failure") << "!" << '\n';
     }
 
     if (orphanTask->_done) {
-      std::cerr << "orphan task is done, but it should not have executed" << std::endl;
+      std::cerr << "orphan task is done, but it should not have executed" << '\n';
       return false;
     }
 
