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;
     }
 
