THRIFT-2729: C++ - .clang-format created and applied

Client: C++
Patch: Konrad Grochowski

make style command added
diff --git a/test/cpp/src/StressTest.cpp b/test/cpp/src/StressTest.cpp
index dfe8350..fa468a4 100644
--- a/test/cpp/src/StressTest.cpp
+++ b/test/cpp/src/StressTest.cpp
@@ -40,7 +40,7 @@
 #include <sstream>
 #include <map>
 #if _WIN32
-   #include <thrift/windows/TWinsockSingleton.h>
+#include <thrift/windows/TWinsockSingleton.h>
 #endif
 
 using namespace std;
@@ -54,23 +54,18 @@
 using namespace test::stress;
 
 struct eqstr {
-  bool operator()(const char* s1, const char* s2) const {
-    return strcmp(s1, s2) == 0;
-  }
+  bool operator()(const char* s1, const char* s2) const { return strcmp(s1, s2) == 0; }
 };
 
 struct ltstr {
-  bool operator()(const char* s1, const char* s2) const {
-    return strcmp(s1, s2) < 0;
-  }
+  bool operator()(const char* s1, const char* s2) const { return strcmp(s1, s2) < 0; }
 };
 
-
 // typedef hash_map<const char*, int, hash<const char*>, eqstr> count_map;
 typedef map<const char*, int, ltstr> count_map;
 
 class Server : public ServiceIf {
- public:
+public:
   Server() {}
 
   void count(const char* method) {
@@ -89,43 +84,46 @@
     return counts_;
   }
 
-  int8_t echoByte(const int8_t arg) {return arg;}
-  int32_t echoI32(const int32_t arg) {return arg;}
-  int64_t echoI64(const int64_t arg) {return arg;}
-  void echoString(string& out, const string &arg) {
+  int8_t echoByte(const int8_t arg) { return arg; }
+  int32_t echoI32(const int32_t arg) { return arg; }
+  int64_t echoI64(const int64_t arg) { return arg; }
+  void echoString(string& out, const string& arg) {
     if (arg != "hello") {
       T_ERROR_ABORT("WRONG STRING (%s)!!!!", arg.c_str());
     }
     out = arg;
   }
-  void echoList(vector<int8_t> &out, const vector<int8_t> &arg) { out = arg; }
-  void echoSet(set<int8_t> &out, const set<int8_t> &arg) { out = arg; }
-  void echoMap(map<int8_t, int8_t> &out, const map<int8_t, int8_t> &arg) { out = arg; }
+  void echoList(vector<int8_t>& out, const vector<int8_t>& arg) { out = arg; }
+  void echoSet(set<int8_t>& out, const set<int8_t>& arg) { out = arg; }
+  void echoMap(map<int8_t, int8_t>& out, const map<int8_t, int8_t>& arg) { out = arg; }
 
 private:
   count_map counts_;
   Mutex lock_;
-
 };
 
-class ClientThread: public Runnable {
+class ClientThread : public Runnable {
 public:
-
-  ClientThread(boost::shared_ptr<TTransport>transport, boost::shared_ptr<ServiceClient> client, Monitor& monitor, size_t& workerCount, size_t loopCount, TType loopType) :
-    _transport(transport),
-    _client(client),
-    _monitor(monitor),
-    _workerCount(workerCount),
-    _loopCount(loopCount),
-    _loopType(loopType)
-  {}
+  ClientThread(boost::shared_ptr<TTransport> transport,
+               boost::shared_ptr<ServiceClient> client,
+               Monitor& monitor,
+               size_t& workerCount,
+               size_t loopCount,
+               TType loopType)
+    : _transport(transport),
+      _client(client),
+      _monitor(monitor),
+      _workerCount(workerCount),
+      _loopCount(loopCount),
+      _loopType(loopType) {}
 
   void run() {
 
     // Wait for all worker threads to start
 
-    {Synchronized s(_monitor);
-      while(_workerCount == 0) {
+    {
+      Synchronized s(_monitor);
+      while (_workerCount == 0) {
         _monitor.wait();
       }
     }
@@ -134,13 +132,25 @@
 
     _transport->open();
 
-    switch(_loopType) {
-    case T_VOID: loopEchoVoid(); break;
-    case T_BYTE: loopEchoByte(); break;
-    case T_I32: loopEchoI32(); break;
-    case T_I64: loopEchoI64(); break;
-    case T_STRING: loopEchoString(); break;
-    default: cerr << "Unexpected loop type" << _loopType << endl; break;
+    switch (_loopType) {
+    case T_VOID:
+      loopEchoVoid();
+      break;
+    case T_BYTE:
+      loopEchoByte();
+      break;
+    case T_I32:
+      loopEchoI32();
+      break;
+    case T_I64:
+      loopEchoI64();
+      break;
+    case T_STRING:
+      loopEchoString();
+      break;
+    default:
+      cerr << "Unexpected loop type" << _loopType << endl;
+      break;
     }
 
     _endTime = Util::currentTime();
@@ -149,7 +159,8 @@
 
     _done = true;
 
-    {Synchronized s(_monitor);
+    {
+      Synchronized s(_monitor);
 
       _workerCount--;
 
@@ -170,7 +181,7 @@
     for (size_t ix = 0; ix < _loopCount; ix++) {
       int8_t arg = 1;
       int8_t result;
-      result =_client->echoByte(arg);
+      result = _client->echoByte(arg);
       (void)result;
       assert(result == arg);
     }
@@ -180,7 +191,7 @@
     for (size_t ix = 0; ix < _loopCount; ix++) {
       int32_t arg = 1;
       int32_t result;
-      result =_client->echoI32(arg);
+      result = _client->echoI32(arg);
       (void)result;
       assert(result == arg);
     }
@@ -190,7 +201,7 @@
     for (size_t ix = 0; ix < _loopCount; ix++) {
       int64_t arg = 1;
       int64_t result;
-      result =_client->echoI64(arg);
+      result = _client->echoI64(arg);
       (void)result;
       assert(result == arg);
     }
@@ -217,28 +228,26 @@
   Monitor _sleep;
 };
 
-class TStartObserver : public apache::thrift::server::TServerEventHandler
-{
+class TStartObserver : public apache::thrift::server::TServerEventHandler {
 public:
-   TStartObserver() : awake_(false) {}
-   virtual void preServe()
-   {
-      apache::thrift::concurrency::Synchronized s(m_);
-      awake_ = true;
-      m_.notifyAll();
-   }
-   void waitForService()
-   {
-      apache::thrift::concurrency::Synchronized s(m_);
-      while(!awake_)
-         m_.waitForever();
-   }
- private:
-   apache::thrift::concurrency::Monitor m_;
-   bool awake_;
+  TStartObserver() : awake_(false) {}
+  virtual void preServe() {
+    apache::thrift::concurrency::Synchronized s(m_);
+    awake_ = true;
+    m_.notifyAll();
+  }
+  void waitForService() {
+    apache::thrift::concurrency::Synchronized s(m_);
+    while (!awake_)
+      m_.waitForever();
+  }
+
+private:
+  apache::thrift::concurrency::Monitor m_;
+  bool awake_;
 };
 
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
 #if _WIN32
   transport::TWinsockSingleton::create();
 #endif
@@ -249,7 +258,7 @@
   size_t workerCount = 4;
   size_t clientCount = 20;
   size_t loopCount = 50000;
-  TType loopType  = T_VOID;
+  TType loopType = T_VOID;
   string callName = "echoVoid";
   bool runServer = true;
   bool logRequests = false;
@@ -258,28 +267,34 @@
 
   ostringstream usage;
 
-  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 <<
-    "\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;
+  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
+        << "\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;
 
-
-  map<string, string>  args;
+  map<string, string> args;
 
   for (int ix = 1; ix < argc; ix++) {
 
     string arg(argv[ix]);
 
-    if (arg.compare(0,2, "--") == 0) {
+    if (arg.compare(0, 2, "--") == 0) {
 
       size_t end = arg.find_first_of("=", 2);
 
@@ -291,7 +306,7 @@
         args[key] = "true";
       }
     } else {
-      throw invalid_argument("Unexcepted command line token: "+arg);
+      throw invalid_argument("Unexcepted command line token: " + arg);
     }
   }
 
@@ -341,7 +356,7 @@
 
       } else {
 
-        throw invalid_argument("Unknown server type "+serverType);
+        throw invalid_argument("Unknown server type " + serverType);
       }
     }
 
@@ -349,12 +364,13 @@
       workerCount = atoi(args["workers"].c_str());
     }
 
-  } catch(std::exception& e) {
+  } catch (std::exception& e) {
     cerr << e.what() << endl;
     cerr << usage.str();
   }
 
-  boost::shared_ptr<PlatformThreadFactory> threadFactory = boost::shared_ptr<PlatformThreadFactory>(new PlatformThreadFactory());
+  boost::shared_ptr<PlatformThreadFactory> threadFactory
+      = boost::shared_ptr<PlatformThreadFactory>(new PlatformThreadFactory());
 
   // Dispatcher
   boost::shared_ptr<Server> serviceHandler(new Server());
@@ -372,15 +388,12 @@
     // Protocol Factory
     boost::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
 
-    TFileProcessor fileProcessor(serviceProcessor,
-                                 protocolFactory,
-                                 fileTransport);
+    TFileProcessor fileProcessor(serviceProcessor, protocolFactory, fileTransport);
 
     fileProcessor.process(0, true);
     exit(0);
   }
 
-
   if (runServer) {
 
     boost::shared_ptr<ServiceProcessor> serviceProcessor(new ServiceProcessor(serviceHandler));
@@ -400,27 +413,34 @@
       fileTransport->setChunkSize(2 * 1024 * 1024);
       fileTransport->setMaxEventSize(1024 * 16);
 
-      transportFactory =
-        boost::shared_ptr<TTransportFactory>(new TPipedTransportFactory(fileTransport));
+      transportFactory
+          = boost::shared_ptr<TTransportFactory>(new TPipedTransportFactory(fileTransport));
     }
 
     boost::shared_ptr<TServer> server;
 
     if (serverType == "simple") {
 
-      server.reset(new TSimpleServer(serviceProcessor, serverSocket, transportFactory, protocolFactory));
+      server.reset(
+          new TSimpleServer(serviceProcessor, serverSocket, transportFactory, protocolFactory));
 
     } else if (serverType == "threaded") {
 
-      server.reset(new TThreadedServer(serviceProcessor, serverSocket, transportFactory, protocolFactory));
+      server.reset(
+          new TThreadedServer(serviceProcessor, serverSocket, transportFactory, protocolFactory));
 
     } else if (serverType == "thread-pool") {
 
-      boost::shared_ptr<ThreadManager> threadManager = ThreadManager::newSimpleThreadManager(workerCount);
+      boost::shared_ptr<ThreadManager> threadManager
+          = ThreadManager::newSimpleThreadManager(workerCount);
 
       threadManager->threadFactory(threadFactory);
       threadManager->start();
-      server.reset(new TThreadPoolServer(serviceProcessor, serverSocket, transportFactory, protocolFactory, threadManager));
+      server.reset(new TThreadPoolServer(serviceProcessor,
+                                         serverSocket,
+                                         transportFactory,
+                                         protocolFactory,
+                                         threadManager));
     }
 
     boost::shared_ptr<TStartObserver> observer(new TStartObserver);
@@ -446,12 +466,19 @@
 
     set<boost::shared_ptr<Thread> > clientThreads;
 
-    if (callName == "echoVoid") { loopType = T_VOID;}
-    else if (callName == "echoByte") { loopType = T_BYTE;}
-    else if (callName == "echoI32") { loopType = T_I32;}
-    else if (callName == "echoI64") { loopType = T_I64;}
-    else if (callName == "echoString") { loopType = T_STRING;}
-    else {throw invalid_argument("Unknown service call "+callName);}
+    if (callName == "echoVoid") {
+      loopType = T_VOID;
+    } else if (callName == "echoByte") {
+      loopType = T_BYTE;
+    } else if (callName == "echoI32") {
+      loopType = T_I32;
+    } else if (callName == "echoI64") {
+      loopType = T_I64;
+    } else if (callName == "echoString") {
+      loopType = T_STRING;
+    } else {
+      throw invalid_argument("Unknown service call " + callName);
+    }
 
     for (size_t ix = 0; ix < clientCount; ix++) {
 
@@ -460,30 +487,34 @@
       boost::shared_ptr<TProtocol> protocol(new TBinaryProtocol(bufferedSocket));
       boost::shared_ptr<ServiceClient> serviceClient(new ServiceClient(protocol));
 
-      clientThreads.insert(threadFactory->newThread(boost::shared_ptr<ClientThread>(new ClientThread(socket, serviceClient, monitor, threadCount, loopCount, loopType))));
+      clientThreads.insert(threadFactory->newThread(boost::shared_ptr<ClientThread>(
+          new ClientThread(socket, serviceClient, monitor, threadCount, loopCount, loopType))));
     }
 
-    for (std::set<boost::shared_ptr<Thread> >::const_iterator thread = clientThreads.begin(); thread != clientThreads.end(); thread++) {
+    for (std::set<boost::shared_ptr<Thread> >::const_iterator thread = clientThreads.begin();
+         thread != clientThreads.end();
+         thread++) {
       (*thread)->start();
     }
 
     int64_t time00;
     int64_t time01;
 
-    {Synchronized s(monitor);
+    {
+      Synchronized s(monitor);
       threadCount = clientCount;
 
-      cerr << "Launch "<< clientCount << " client threads" << endl;
+      cerr << "Launch " << clientCount << " client threads" << endl;
 
-      time00 =  Util::currentTime();
+      time00 = Util::currentTime();
 
       monitor.notifyAll();
 
-      while(threadCount > 0) {
+      while (threadCount > 0) {
         monitor.wait();
       }
 
-      time01 =  Util::currentTime();
+      time01 = Util::currentTime();
     }
 
     int64_t firstTime = 9223372036854775807LL;
@@ -493,9 +524,12 @@
     int64_t minTime = 9223372036854775807LL;
     int64_t maxTime = 0;
 
-    for (set<boost::shared_ptr<Thread> >::iterator ix = clientThreads.begin(); ix != clientThreads.end(); ix++) {
+    for (set<boost::shared_ptr<Thread> >::iterator ix = clientThreads.begin();
+         ix != clientThreads.end();
+         ix++) {
 
-      boost::shared_ptr<ClientThread> client = boost::dynamic_pointer_cast<ClientThread>((*ix)->runnable());
+      boost::shared_ptr<ClientThread> client
+          = boost::dynamic_pointer_cast<ClientThread>((*ix)->runnable());
 
       int64_t delta = client->_endTime - client->_startTime;
 
@@ -517,13 +551,13 @@
         maxTime = delta;
       }
 
-      averageTime+= delta;
+      averageTime += delta;
     }
 
     averageTime /= clientCount;
 
-
-    cout <<  "workers :" << workerCount << ", client : " << clientCount << ", loops : " << loopCount << ", rate : " << (clientCount * loopCount * 1000) / ((double)(time01 - time00)) << endl;
+    cout << "workers :" << workerCount << ", client : " << clientCount << ", loops : " << loopCount
+         << ", rate : " << (clientCount * loopCount * 1000) / ((double)(time01 - time00)) << endl;
 
     count_map count = serviceHandler->getCount();
     count_map::iterator iter;
diff --git a/test/cpp/src/StressTestNonBlocking.cpp b/test/cpp/src/StressTestNonBlocking.cpp
index 20320c7..8f161c0 100644
--- a/test/cpp/src/StressTestNonBlocking.cpp
+++ b/test/cpp/src/StressTestNonBlocking.cpp
@@ -43,7 +43,7 @@
 #include <sstream>
 #include <map>
 #if _WIN32
-   #include <thrift/windows/TWinsockSingleton.h>
+#include <thrift/windows/TWinsockSingleton.h>
 #endif
 
 using namespace std;
@@ -57,23 +57,18 @@
 using namespace test::stress;
 
 struct eqstr {
-  bool operator()(const char* s1, const char* s2) const {
-    return strcmp(s1, s2) == 0;
-  }
+  bool operator()(const char* s1, const char* s2) const { return strcmp(s1, s2) == 0; }
 };
 
 struct ltstr {
-  bool operator()(const char* s1, const char* s2) const {
-    return strcmp(s1, s2) < 0;
-  }
+  bool operator()(const char* s1, const char* s2) const { return strcmp(s1, s2) < 0; }
 };
 
-
 // typedef hash_map<const char*, int, hash<const char*>, eqstr> count_map;
 typedef map<const char*, int, ltstr> count_map;
 
 class Server : public ServiceIf {
- public:
+public:
   Server() {}
 
   void count(const char* method) {
@@ -94,58 +89,73 @@
     return counts_;
   }
 
-  int8_t echoByte(const int8_t arg) {return arg;}
-  int32_t echoI32(const int32_t arg) {return arg;}
-  int64_t echoI64(const int64_t arg) {return arg;}
-  void echoString(string& out, const string &arg) {
+  int8_t echoByte(const int8_t arg) { return arg; }
+  int32_t echoI32(const int32_t arg) { return arg; }
+  int64_t echoI64(const int64_t arg) { return arg; }
+  void echoString(string& out, const string& arg) {
     if (arg != "hello") {
       T_ERROR_ABORT("WRONG STRING (%s)!!!!", arg.c_str());
     }
     out = arg;
   }
-  void echoList(vector<int8_t> &out, const vector<int8_t> &arg) { out = arg; }
-  void echoSet(set<int8_t> &out, const set<int8_t> &arg) { out = arg; }
-  void echoMap(map<int8_t, int8_t> &out, const map<int8_t, int8_t> &arg) { out = arg; }
+  void echoList(vector<int8_t>& out, const vector<int8_t>& arg) { out = arg; }
+  void echoSet(set<int8_t>& out, const set<int8_t>& arg) { out = arg; }
+  void echoMap(map<int8_t, int8_t>& out, const map<int8_t, int8_t>& arg) { out = arg; }
 
 private:
   count_map counts_;
   Mutex lock_;
-
 };
 
-class ClientThread: public Runnable {
+class ClientThread : public Runnable {
 public:
-
-  ClientThread(boost::shared_ptr<TTransport>transport, boost::shared_ptr<ServiceClient> client, Monitor& monitor, size_t& workerCount, size_t loopCount, TType loopType) :
-    _transport(transport),
-    _client(client),
-    _monitor(monitor),
-    _workerCount(workerCount),
-    _loopCount(loopCount),
-    _loopType(loopType)
-  {}
+  ClientThread(boost::shared_ptr<TTransport> transport,
+               boost::shared_ptr<ServiceClient> client,
+               Monitor& monitor,
+               size_t& workerCount,
+               size_t loopCount,
+               TType loopType)
+    : _transport(transport),
+      _client(client),
+      _monitor(monitor),
+      _workerCount(workerCount),
+      _loopCount(loopCount),
+      _loopType(loopType) {}
 
   void run() {
 
     // Wait for all worker threads to start
 
-    {Synchronized s(_monitor);
-        while(_workerCount == 0) {
-          _monitor.wait();
-        }
+    {
+      Synchronized s(_monitor);
+      while (_workerCount == 0) {
+        _monitor.wait();
+      }
     }
 
     _startTime = Util::currentTime();
 
     _transport->open();
 
-    switch(_loopType) {
-    case T_VOID: loopEchoVoid(); break;
-    case T_BYTE: loopEchoByte(); break;
-    case T_I32: loopEchoI32(); break;
-    case T_I64: loopEchoI64(); break;
-    case T_STRING: loopEchoString(); break;
-    default: cerr << "Unexpected loop type" << _loopType << endl; break;
+    switch (_loopType) {
+    case T_VOID:
+      loopEchoVoid();
+      break;
+    case T_BYTE:
+      loopEchoByte();
+      break;
+    case T_I32:
+      loopEchoI32();
+      break;
+    case T_I64:
+      loopEchoI64();
+      break;
+    case T_STRING:
+      loopEchoString();
+      break;
+    default:
+      cerr << "Unexpected loop type" << _loopType << endl;
+      break;
     }
 
     _endTime = Util::currentTime();
@@ -154,7 +164,8 @@
 
     _done = true;
 
-    {Synchronized s(_monitor);
+    {
+      Synchronized s(_monitor);
 
       _workerCount--;
 
@@ -175,7 +186,7 @@
     for (size_t ix = 0; ix < _loopCount; ix++) {
       int8_t arg = 1;
       int8_t result;
-      result =_client->echoByte(arg);
+      result = _client->echoByte(arg);
       (void)result;
       assert(result == arg);
     }
@@ -185,7 +196,7 @@
     for (size_t ix = 0; ix < _loopCount; ix++) {
       int32_t arg = 1;
       int32_t result;
-      result =_client->echoI32(arg);
+      result = _client->echoI32(arg);
       (void)result;
       assert(result == arg);
     }
@@ -195,7 +206,7 @@
     for (size_t ix = 0; ix < _loopCount; ix++) {
       int64_t arg = 1;
       int64_t result;
-      result =_client->echoI64(arg);
+      result = _client->echoI64(arg);
       (void)result;
       assert(result == arg);
     }
@@ -222,8 +233,7 @@
   Monitor _sleep;
 };
 
-
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
 #if _WIN32
   transport::TWinsockSingleton::create();
 #endif
@@ -234,7 +244,7 @@
   uint32_t workerCount = 4;
   uint32_t clientCount = 20;
   uint32_t loopCount = 1000;
-  TType loopType  = T_VOID;
+  TType loopType = T_VOID;
   string callName = "echoVoid";
   bool runServer = true;
   bool logRequests = false;
@@ -243,28 +253,34 @@
 
   ostringstream usage;
 
-  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 <<
-    "\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;
+  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
+        << "\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;
 
-
-  map<string, string>  args;
+  map<string, string> args;
 
   for (int ix = 1; ix < argc; ix++) {
 
     string arg(argv[ix]);
 
-    if (arg.compare(0,2, "--") == 0) {
+    if (arg.compare(0, 2, "--") == 0) {
 
       size_t end = arg.find_first_of("=", 2);
 
@@ -276,7 +292,7 @@
         args[key] = "true";
       }
     } else {
-      throw invalid_argument("Unexcepted command line token: "+arg);
+      throw invalid_argument("Unexcepted command line token: " + arg);
     }
   }
 
@@ -323,12 +339,13 @@
       workerCount = atoi(args["workers"].c_str());
     }
 
-  } catch(std::exception& e) {
+  } catch (std::exception& e) {
     cerr << e.what() << endl;
     cerr << usage.str();
   }
 
-  boost::shared_ptr<PlatformThreadFactory> threadFactory = boost::shared_ptr<PlatformThreadFactory>(new PlatformThreadFactory());
+  boost::shared_ptr<PlatformThreadFactory> threadFactory
+      = boost::shared_ptr<PlatformThreadFactory>(new PlatformThreadFactory());
 
   // Dispatcher
   boost::shared_ptr<Server> serviceHandler(new Server());
@@ -346,15 +363,12 @@
     // Protocol Factory
     boost::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
 
-    TFileProcessor fileProcessor(serviceProcessor,
-                                 protocolFactory,
-                                 fileTransport);
+    TFileProcessor fileProcessor(serviceProcessor, protocolFactory, fileTransport);
 
     fileProcessor.process(0, true);
     exit(0);
   }
 
-
   if (runServer) {
 
     boost::shared_ptr<ServiceProcessor> serviceProcessor(new ServiceProcessor(serviceHandler));
@@ -363,7 +377,7 @@
     boost::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
 
     // Transport Factory
-    boost::shared_ptr<TTransportFactory>      transportFactory;
+    boost::shared_ptr<TTransportFactory> transportFactory;
 
     if (logRequests) {
       // initialize the log file
@@ -371,8 +385,8 @@
       fileTransport->setChunkSize(2 * 1024 * 1024);
       fileTransport->setMaxEventSize(1024 * 16);
 
-      transportFactory =
-        boost::shared_ptr<TTransportFactory>(new TPipedTransportFactory(fileTransport));
+      transportFactory
+          = boost::shared_ptr<TTransportFactory>(new TPipedTransportFactory(fileTransport));
     }
 
     boost::shared_ptr<Thread> serverThread;
@@ -380,17 +394,22 @@
 
     if (serverType == "simple") {
 
-      serverThread = threadFactory->newThread(boost::shared_ptr<TServer>(new TNonblockingServer(serviceProcessor, protocolFactory, port)));
-      serverThread2 = threadFactory->newThread(boost::shared_ptr<TServer>(new TNonblockingServer(serviceProcessor, protocolFactory, port+1)));
+      serverThread = threadFactory->newThread(boost::shared_ptr<TServer>(
+          new TNonblockingServer(serviceProcessor, protocolFactory, port)));
+      serverThread2 = threadFactory->newThread(boost::shared_ptr<TServer>(
+          new TNonblockingServer(serviceProcessor, protocolFactory, port + 1)));
 
     } else if (serverType == "thread-pool") {
 
-      boost::shared_ptr<ThreadManager> threadManager = ThreadManager::newSimpleThreadManager(workerCount);
+      boost::shared_ptr<ThreadManager> threadManager
+          = ThreadManager::newSimpleThreadManager(workerCount);
 
       threadManager->threadFactory(threadFactory);
       threadManager->start();
-      serverThread = threadFactory->newThread(boost::shared_ptr<TServer>(new TNonblockingServer(serviceProcessor, protocolFactory, port, threadManager)));
-      serverThread2 = threadFactory->newThread(boost::shared_ptr<TServer>(new TNonblockingServer(serviceProcessor, protocolFactory, port+1, threadManager)));
+      serverThread = threadFactory->newThread(boost::shared_ptr<TServer>(
+          new TNonblockingServer(serviceProcessor, protocolFactory, port, threadManager)));
+      serverThread2 = threadFactory->newThread(boost::shared_ptr<TServer>(
+          new TNonblockingServer(serviceProcessor, protocolFactory, port + 1, threadManager)));
     }
 
     cerr << "Starting the server on port " << port << " and " << (port + 1) << endl;
@@ -414,12 +433,19 @@
 
     set<boost::shared_ptr<Thread> > clientThreads;
 
-    if (callName == "echoVoid") { loopType = T_VOID;}
-    else if (callName == "echoByte") { loopType = T_BYTE;}
-    else if (callName == "echoI32") { loopType = T_I32;}
-    else if (callName == "echoI64") { loopType = T_I64;}
-    else if (callName == "echoString") { loopType = T_STRING;}
-    else {throw invalid_argument("Unknown service call "+callName);}
+    if (callName == "echoVoid") {
+      loopType = T_VOID;
+    } else if (callName == "echoByte") {
+      loopType = T_BYTE;
+    } else if (callName == "echoI32") {
+      loopType = T_I32;
+    } else if (callName == "echoI64") {
+      loopType = T_I64;
+    } else if (callName == "echoString") {
+      loopType = T_STRING;
+    } else {
+      throw invalid_argument("Unknown service call " + callName);
+    }
 
     for (uint32_t ix = 0; ix < clientCount; ix++) {
 
@@ -428,30 +454,34 @@
       boost::shared_ptr<TProtocol> protocol(new TBinaryProtocol(framedSocket));
       boost::shared_ptr<ServiceClient> serviceClient(new ServiceClient(protocol));
 
-      clientThreads.insert(threadFactory->newThread(boost::shared_ptr<ClientThread>(new ClientThread(socket, serviceClient, monitor, threadCount, loopCount, loopType))));
+      clientThreads.insert(threadFactory->newThread(boost::shared_ptr<ClientThread>(
+          new ClientThread(socket, serviceClient, monitor, threadCount, loopCount, loopType))));
     }
 
-    for (std::set<boost::shared_ptr<Thread> >::const_iterator thread = clientThreads.begin(); thread != clientThreads.end(); thread++) {
+    for (std::set<boost::shared_ptr<Thread> >::const_iterator thread = clientThreads.begin();
+         thread != clientThreads.end();
+         thread++) {
       (*thread)->start();
     }
 
     int64_t time00;
     int64_t time01;
 
-    {Synchronized s(monitor);
+    {
+      Synchronized s(monitor);
       threadCount = clientCount;
 
-      cerr << "Launch "<< clientCount << " client threads" << endl;
+      cerr << "Launch " << clientCount << " client threads" << endl;
 
-      time00 =  Util::currentTime();
+      time00 = Util::currentTime();
 
       monitor.notifyAll();
 
-      while(threadCount > 0) {
+      while (threadCount > 0) {
         monitor.wait();
       }
 
-      time01 =  Util::currentTime();
+      time01 = Util::currentTime();
     }
 
     int64_t firstTime = 9223372036854775807LL;
@@ -461,9 +491,12 @@
     int64_t minTime = 9223372036854775807LL;
     int64_t maxTime = 0;
 
-    for (set<boost::shared_ptr<Thread> >::iterator ix = clientThreads.begin(); ix != clientThreads.end(); ix++) {
+    for (set<boost::shared_ptr<Thread> >::iterator ix = clientThreads.begin();
+         ix != clientThreads.end();
+         ix++) {
 
-      boost::shared_ptr<ClientThread> client = boost::dynamic_pointer_cast<ClientThread>((*ix)->runnable());
+      boost::shared_ptr<ClientThread> client
+          = boost::dynamic_pointer_cast<ClientThread>((*ix)->runnable());
 
       int64_t delta = client->_endTime - client->_startTime;
 
@@ -485,13 +518,13 @@
         maxTime = delta;
       }
 
-      averageTime+= delta;
+      averageTime += delta;
     }
 
     averageTime /= clientCount;
 
-
-    cout <<  "workers :" << workerCount << ", client : " << clientCount << ", loops : " << loopCount << ", rate : " << (clientCount * loopCount * 1000) / ((double)(time01 - time00)) << endl;
+    cout << "workers :" << workerCount << ", client : " << clientCount << ", loops : " << loopCount
+         << ", rate : " << (clientCount * loopCount * 1000) / ((double)(time01 - time00)) << endl;
 
     count_map count = serviceHandler->getCount();
     count_map::iterator iter;
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
old mode 100755
new mode 100644
index 8c97dc0..a6069de
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -36,7 +36,7 @@
 #include <boost/filesystem.hpp>
 #include <thrift/cxxfunctional.h>
 #if _WIN32
-   #include <thrift/windows/TWinsockSingleton.h>
+#include <thrift/windows/TWinsockSingleton.h>
 #endif
 
 #include "ThriftTest.h"
@@ -51,24 +51,27 @@
 // Length of argv[0] - Length of script dir
 #define EXECUTABLE_FILE_NAME_LENGTH 19
 
-//extern uint32_t g_socket_syscalls;
+// extern uint32_t g_socket_syscalls;
 
 // Current time, microseconds since the epoch
-uint64_t now()
-{
+uint64_t now() {
   int64_t ret;
   struct timeval tv;
 
   THRIFT_GETTIMEOFDAY(&tv, NULL);
   ret = tv.tv_sec;
-  ret = ret*1000*1000 + tv.tv_usec;
+  ret = ret * 1000 * 1000 + tv.tv_usec;
   return ret;
 }
 
-static void testString_clientReturn(const char* host, int port, event_base *base, TProtocolFactory* protocolFactory, ThriftTestCobClient* client) {
-  (void) host;
-  (void) port;
-  (void) protocolFactory;
+static void testString_clientReturn(const char* host,
+                                    int port,
+                                    event_base* base,
+                                    TProtocolFactory* protocolFactory,
+                                    ThriftTestCobClient* client) {
+  (void)host;
+  (void)port;
+  (void)protocolFactory;
   try {
     string s;
     client->recv_testString(s);
@@ -80,7 +83,11 @@
   event_base_loopbreak(base); // end test
 }
 
-static void testVoid_clientReturn(const char* host, int port, event_base *base, TProtocolFactory* protocolFactory, ThriftTestCobClient* client) {
+static void testVoid_clientReturn(const char* host,
+                                  int port,
+                                  event_base* base,
+                                  TProtocolFactory* protocolFactory,
+                                  ThriftTestCobClient* client) {
   try {
     client->recv_testVoid();
     cout << "testVoid" << endl;
@@ -89,7 +96,13 @@
     delete client;
     boost::shared_ptr<TAsyncChannel> channel(new TEvhttpClientChannel(host, "/", host, port, base));
     client = new ThriftTestCobClient(channel, protocolFactory);
-    client->testString(tcxx::bind(testString_clientReturn, host, port, base, protocolFactory, tcxx::placeholders::_1), "Test");
+    client->testString(tcxx::bind(testString_clientReturn,
+                                  host,
+                                  port,
+                                  base,
+                                  protocolFactory,
+                                  tcxx::placeholders::_1),
+                       "Test");
   } catch (TException& exn) {
     cout << "Error: " << exn.what() << endl;
   }
@@ -97,7 +110,7 @@
 
 int main(int argc, char** argv) {
   string file_path = boost::filesystem::system_complete(argv[0]).string();
-  string dir_path = file_path.substr(0, file_path.size()-EXECUTABLE_FILE_NAME_LENGTH);
+  string dir_path = file_path.substr(0, file_path.size() - EXECUTABLE_FILE_NAME_LENGTH);
 #if _WIN32
   transport::TWinsockSingleton::create();
 #endif
@@ -111,17 +124,26 @@
   bool noinsane = false;
 
   boost::program_options::options_description desc("Allowed options");
-  desc.add_options()
-      ("help,h", "produce help message")
-      ("host", boost::program_options::value<string>(&host)->default_value(host), "Host to connect")
-      ("port", boost::program_options::value<int>(&port)->default_value(port), "Port number to connect")
-	  ("domain-socket", boost::program_options::value<string>(&domain_socket)->default_value(domain_socket), "Domain Socket (e.g. /tmp/ThriftTest.thrift), instead of host and port")
-      ("transport", boost::program_options::value<string>(&transport_type)->default_value(transport_type), "Transport: buffered, framed, http, evhttp")
-      ("protocol", boost::program_options::value<string>(&protocol_type)->default_value(protocol_type), "Protocol: binary, compact, json")
-	  ("ssl", "Encrypted Transport using SSL")
-      ("testloops,n", boost::program_options::value<int>(&numTests)->default_value(numTests), "Number of Tests")
-      ("noinsane", "Do not run insanity test")
-  ;
+  desc.add_options()("help,h",
+                     "produce help message")("host",
+                                             boost::program_options::value<string>(&host)
+                                                 ->default_value(host),
+                                             "Host to connect")("port",
+                                                                boost::program_options::value<int>(
+                                                                    &port)->default_value(port),
+                                                                "Port number to connect")(
+      "domain-socket",
+      boost::program_options::value<string>(&domain_socket)->default_value(domain_socket),
+      "Domain Socket (e.g. /tmp/ThriftTest.thrift), instead of host and port")(
+      "transport",
+      boost::program_options::value<string>(&transport_type)->default_value(transport_type),
+      "Transport: buffered, framed, http, evhttp")(
+      "protocol",
+      boost::program_options::value<string>(&protocol_type)->default_value(protocol_type),
+      "Protocol: binary, compact, json")("ssl", "Encrypted Transport using SSL")(
+      "testloops,n",
+      boost::program_options::value<int>(&numTests)->default_value(numTests),
+      "Number of Tests")("noinsane", "Do not run insanity test");
 
   boost::program_options::variables_map vm;
   boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
@@ -138,17 +160,17 @@
       } else if (protocol_type == "compact") {
       } else if (protocol_type == "json") {
       } else {
-          throw invalid_argument("Unknown protocol type "+protocol_type);
+        throw invalid_argument("Unknown protocol type " + protocol_type);
       }
     }
 
-	if (!transport_type.empty()) {
+    if (!transport_type.empty()) {
       if (transport_type == "buffered") {
       } else if (transport_type == "framed") {
       } else if (transport_type == "http") {
       } else if (transport_type == "evhttp") {
       } else {
-          throw invalid_argument("Unknown transport type "+transport_type);
+        throw invalid_argument("Unknown transport type " + transport_type);
       }
     }
 
@@ -182,8 +204,7 @@
     if (domain_socket != "") {
       socket = boost::shared_ptr<TSocket>(new TSocket(domain_socket));
       port = 0;
-    }
-    else {
+    } else {
       socket = boost::shared_ptr<TSocket>(new TSocket(host, port));
     }
   }
@@ -191,10 +212,10 @@
   if (transport_type.compare("http") == 0) {
     boost::shared_ptr<TTransport> httpSocket(new THttpClient(socket, host, "/service"));
     transport = httpSocket;
-  } else if (transport_type.compare("framed") == 0){
+  } else if (transport_type.compare("framed") == 0) {
     boost::shared_ptr<TFramedTransport> framedSocket(new TFramedTransport(socket));
     transport = framedSocket;
-  } else{
+  } else {
     boost::shared_ptr<TBufferedTransport> bufferedSocket(new TBufferedTransport(socket));
     transport = bufferedSocket;
   }
@@ -205,7 +226,7 @@
   } else if (protocol_type.compare("compact") == 0) {
     boost::shared_ptr<TProtocol> compactProtocol(new TCompactProtocol(transport));
     protocol = compactProtocol;
-  } else{
+  } else {
     boost::shared_ptr<TBinaryProtocol> binaryProtocol(new TBinaryProtocol(transport));
     protocol = binaryProtocol;
   }
@@ -218,7 +239,7 @@
   cout << endl;
 
   if (transport_type.compare("evhttp") == 0) {
-    event_base *base = event_base_new();
+    event_base* base = event_base_new();
     cout << "Libevent Version: " << event_get_version() << endl;
     cout << "Libevent Method: " << event_base_get_method(base) << endl;
 #if LIBEVENT_VERSION_NUMBER >= 0x02000000
@@ -227,15 +248,20 @@
 
     boost::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
 
-    boost::shared_ptr<TAsyncChannel> channel(new TEvhttpClientChannel(host.c_str(), "/", host.c_str(), port, base));
+    boost::shared_ptr<TAsyncChannel> channel(
+        new TEvhttpClientChannel(host.c_str(), "/", host.c_str(), port, base));
     ThriftTestCobClient* client = new ThriftTestCobClient(channel, protocolFactory.get());
-    client->testVoid(tcxx::bind(testVoid_clientReturn, host.c_str(), port, base, protocolFactory.get(), tcxx::placeholders::_1));
+    client->testVoid(tcxx::bind(testVoid_clientReturn,
+                                host.c_str(),
+                                port,
+                                base,
+                                protocolFactory.get(),
+                                tcxx::placeholders::_1));
 
     event_base_loop(base, 0);
     return 0;
   }
 
-
   ThriftTestClient testClient(protocol);
 
   uint64_t time_min = 0;
@@ -256,7 +282,7 @@
     /**
      * CONNECT TEST
      */
-    printf("Test #%d, connect %s:%d\n", test+1, host.c_str(), port);
+    printf("Test #%d, connect %s:%d\n", test + 1, host.c_str(), port);
 
     uint64_t start = now();
 
@@ -280,7 +306,7 @@
     testClient.testString(s, "Test");
     printf(" = \"%s\"\n", s.c_str());
     if (s != "Test")
-        failCount++;
+      failCount++;
 
     /**
      * BYTE TEST
@@ -289,7 +315,7 @@
     uint8_t u8 = testClient.testByte(1);
     printf(" = %d\n", (int)u8);
     if (u8 != 1)
-        failCount++;
+      failCount++;
 
     /**
      * I32 TEST
@@ -298,7 +324,7 @@
     int32_t i32 = testClient.testI32(-1);
     printf(" = %d\n", i32);
     if (i32 != -1)
-        failCount++;
+      failCount++;
 
     /**
      * I64 TEST
@@ -307,7 +333,7 @@
     int64_t i64 = testClient.testI64(-34359738368LL);
     printf(" = %" PRId64 "\n", i64);
     if (i64 != -34359738368LL)
-        failCount++;
+      failCount++;
     /**
      * DOUBLE TEST
      */
@@ -315,7 +341,7 @@
     double dub = testClient.testDouble(-5.2098523);
     printf(" = %f\n", dub);
     if ((dub - (-5.2098523)) > 0.001)
-        failCount++;
+      failCount++;
 
     /**
      * STRUCT TEST
@@ -334,7 +360,7 @@
            in.i32_thing,
            in.i64_thing);
     if (in != out)
-    	failCount++;
+      failCount++;
 
     /**
      * NESTED STRUCT TEST
@@ -355,14 +381,14 @@
            in.i64_thing,
            in2.i32_thing);
     if (in2 != out2)
-    	failCount++;
+      failCount++;
 
     /**
      * MAP TEST
      */
-    map<int32_t,int32_t> mapout;
+    map<int32_t, int32_t> mapout;
     for (int32_t i = 0; i < 5; ++i) {
-      mapout.insert(make_pair(i, i-10));
+      mapout.insert(make_pair(i, i - 10));
     }
     printf("testMap({");
     map<int32_t, int32_t>::const_iterator m_iter;
@@ -376,7 +402,7 @@
       printf("%d => %d", m_iter->first, m_iter->second);
     }
     printf("})");
-    map<int32_t,int32_t> mapin;
+    map<int32_t, int32_t> mapin;
     testClient.testMap(mapin, mapout);
     printf(" = {");
     first = true;
@@ -390,7 +416,7 @@
     }
     printf("}\n");
     if (mapin != mapout)
-    	failCount++;
+      failCount++;
 
     /**
      * STRING MAP TEST
@@ -430,7 +456,7 @@
     }
     printf("}\n");
     if (setin != setout)
-    	failCount++;
+      failCount++;
 
     /**
      * LIST TEST
@@ -465,7 +491,7 @@
     }
     printf("}\n");
     if (listin != listout)
-    	failCount++;
+      failCount++;
 
     /**
      * ENUM TEST
@@ -474,31 +500,31 @@
     Numberz::type ret = testClient.testEnum(Numberz::ONE);
     printf(" = %d\n", ret);
     if (ret != Numberz::ONE)
-    	failCount++;
+      failCount++;
 
     printf("testEnum(TWO)");
     ret = testClient.testEnum(Numberz::TWO);
     printf(" = %d\n", ret);
     if (ret != Numberz::TWO)
-    	failCount++;
+      failCount++;
 
     printf("testEnum(THREE)");
     ret = testClient.testEnum(Numberz::THREE);
     printf(" = %d\n", ret);
     if (ret != Numberz::THREE)
-    	failCount++;
+      failCount++;
 
     printf("testEnum(FIVE)");
     ret = testClient.testEnum(Numberz::FIVE);
     printf(" = %d\n", ret);
     if (ret != Numberz::FIVE)
-    	failCount++;
+      failCount++;
 
     printf("testEnum(EIGHT)");
     ret = testClient.testEnum(Numberz::EIGHT);
     printf(" = %d\n", ret);
     if (ret != Numberz::EIGHT)
-    	failCount++;
+      failCount++;
 
     /**
      * TYPEDEF TEST
@@ -507,7 +533,7 @@
     UserId uid = testClient.testTypedef(309858235082523LL);
     printf(" = %" PRId64 "\n", uid);
     if (uid != 309858235082523LL)
-    	failCount++;
+      failCount++;
 
     /**
      * NESTED MAP TEST
@@ -540,16 +566,14 @@
       truck.i64_thing = 8;
       insane.xtructs.push_back(truck);
       printf("testInsanity()");
-      map<UserId, map<Numberz::type,Insanity> > whoa;
+      map<UserId, map<Numberz::type, Insanity> > whoa;
       testClient.testInsanity(whoa, insane);
       printf(" = {");
-      map<UserId, map<Numberz::type,Insanity> >::const_iterator i_iter;
+      map<UserId, map<Numberz::type, Insanity> >::const_iterator i_iter;
       for (i_iter = whoa.begin(); i_iter != whoa.end(); ++i_iter) {
         printf("%" PRId64 " => {", i_iter->first);
-        map<Numberz::type,Insanity>::const_iterator i2_iter;
-        for (i2_iter = i_iter->second.begin();
-             i2_iter != i_iter->second.end();
-             ++i2_iter) {
+        map<Numberz::type, Insanity>::const_iterator i2_iter;
+        for (i2_iter = i_iter->second.begin(); i2_iter != i_iter->second.end(); ++i2_iter) {
           printf("%d => {", i2_iter->first);
           map<Numberz::type, UserId> userMap = i2_iter->second.userMap;
           map<Numberz::type, UserId>::const_iterator um;
@@ -585,25 +609,25 @@
       printf("  void\nFAILURE\n");
       failCount++;
 
-    } catch(Xception& e) {
+    } catch (Xception& e) {
       printf("  {%u, \"%s\"}\n", e.errorCode, e.message.c_str());
     }
 
     try {
-        printf("testClient.testException(\"TException\") =>");
-        testClient.testException("TException");
-        printf("  void\nFAILURE\n");
-        failCount++;
+      printf("testClient.testException(\"TException\") =>");
+      testClient.testException("TException");
+      printf("  void\nFAILURE\n");
+      failCount++;
 
-      } catch(const TException&) {
-        printf("  Caught TException\n");
-      }
+    } catch (const TException&) {
+      printf("  Caught TException\n");
+    }
 
     try {
       printf("testClient.testException(\"success\") =>");
       testClient.testException("success");
       printf("  void\n");
-    } catch(...) {
+    } catch (...) {
       printf("  exception\nFAILURE\n");
       failCount++;
     }
@@ -616,7 +640,7 @@
       testClient.testMultiException(result, "Xception", "test 1");
       printf("  result\nFAILURE\n");
       failCount++;
-    } catch(Xception& e) {
+    } catch (Xception& e) {
       printf("  {%u, \"%s\"}\n", e.errorCode, e.message.c_str());
     }
 
@@ -627,7 +651,7 @@
       printf("  result\nFAILURE\n");
       failCount++;
 
-    } catch(Xception2& e) {
+    } catch (Xception2& e) {
       printf("  {%u, {\"%s\"}}\n", e.errorCode, e.struct_thing.string_thing.c_str());
     }
 
@@ -636,23 +660,23 @@
       Xtruct result;
       testClient.testMultiException(result, "success", "test 3");
       printf("  {{\"%s\"}}\n", result.string_thing.c_str());
-    } catch(...) {
+    } catch (...) {
       printf("  exception\nFAILURE\n");
       failCount++;
     }
 
     /* test oneway void */
     {
-        printf("testClient.testOneway(1) =>");
-        uint64_t startOneway = now();
-        testClient.testOneway(1);
-        uint64_t elapsed = now() - startOneway;
-        if (elapsed > 200 * 1000) { // 0.2 seconds
-            printf("  FAILURE - took %.2f ms\n", (double)elapsed/1000.0);
-            failCount++;
-        } else {
-            printf("  success - took %.2f ms\n", (double)elapsed/1000.0);
-        }
+      printf("testClient.testOneway(1) =>");
+      uint64_t startOneway = now();
+      testClient.testOneway(1);
+      uint64_t elapsed = now() - startOneway;
+      if (elapsed > 200 * 1000) { // 0.2 seconds
+        printf("  FAILURE - took %.2f ms\n", (double)elapsed / 1000.0);
+        failCount++;
+      } else {
+        printf("  success - took %.2f ms\n", (double)elapsed / 1000.0);
+      }
     }
 
     /**
@@ -670,13 +694,12 @@
     i32 = testClient.testI32(-1);
     printf(" = %d\n", i32);
     if (i32 != -1)
-        failCount++;
-
+      failCount++;
 
     uint64_t stop = now();
-    uint64_t tot = stop-start;
+    uint64_t tot = stop - start;
 
-    printf("Total time: %" PRIu64 " us\n", stop-start);
+    printf("Total time: %" PRIu64 " us\n", stop - start);
 
     time_tot += tot;
     if (time_min == 0 || tot < time_min) {
diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
old mode 100755
new mode 100644
index a343221..6d2a260
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -50,7 +50,7 @@
 
 #include <signal.h>
 #if _WIN32
-   #include <thrift/windows/TWinsockSingleton.h>
+#include <thrift/windows/TWinsockSingleton.h>
 #endif
 
 using namespace std;
@@ -68,14 +68,12 @@
 #define EXECUTABLE_FILE_NAME_LENGTH 19
 
 class TestHandler : public ThriftTestIf {
- public:
+public:
   TestHandler() {}
 
-  void testVoid() {
-    printf("testVoid()\n");
-  }
+  void testVoid() { printf("testVoid()\n"); }
 
-  void testString(string& out, const string &thing) {
+  void testString(string& out, const string& thing) {
     printf("testString(\"%s\")\n", thing.c_str());
     out = thing;
   }
@@ -100,18 +98,28 @@
     return thing;
   }
 
-  void testStruct(Xtruct& out, const Xtruct &thing) {
-    printf("testStruct({\"%s\", %d, %d, %" PRId64 "})\n", thing.string_thing.c_str(), (int)thing.byte_thing, thing.i32_thing, thing.i64_thing);
+  void testStruct(Xtruct& out, const Xtruct& thing) {
+    printf("testStruct({\"%s\", %d, %d, %" PRId64 "})\n",
+           thing.string_thing.c_str(),
+           (int)thing.byte_thing,
+           thing.i32_thing,
+           thing.i64_thing);
     out = thing;
   }
 
   void testNest(Xtruct2& out, const Xtruct2& nest) {
-    const Xtruct &thing = nest.struct_thing;
-    printf("testNest({%d, {\"%s\", %d, %d, %" PRId64 "}, %d})\n", (int)nest.byte_thing, thing.string_thing.c_str(), (int)thing.byte_thing, thing.i32_thing, thing.i64_thing, nest.i32_thing);
+    const Xtruct& thing = nest.struct_thing;
+    printf("testNest({%d, {\"%s\", %d, %d, %" PRId64 "}, %d})\n",
+           (int)nest.byte_thing,
+           thing.string_thing.c_str(),
+           (int)thing.byte_thing,
+           thing.i32_thing,
+           thing.i64_thing,
+           nest.i32_thing);
     out = nest;
   }
 
-  void testMap(map<int32_t, int32_t> &out, const map<int32_t, int32_t> &thing) {
+  void testMap(map<int32_t, int32_t>& out, const map<int32_t, int32_t>& thing) {
     printf("testMap({");
     map<int32_t, int32_t>::const_iterator m_iter;
     bool first = true;
@@ -127,7 +135,8 @@
     out = thing;
   }
 
-  void testStringMap(map<std::string, std::string> &out, const map<std::string, std::string> &thing) {
+  void testStringMap(map<std::string, std::string>& out,
+                     const map<std::string, std::string>& thing) {
     printf("testMap({");
     map<std::string, std::string>::const_iterator m_iter;
     bool first = true;
@@ -143,7 +152,7 @@
     out = thing;
   }
 
-  void testSet(set<int32_t> &out, const set<int32_t> &thing) {
+  void testSet(set<int32_t>& out, const set<int32_t>& thing) {
     printf("testSet({");
     set<int32_t>::const_iterator s_iter;
     bool first = true;
@@ -159,7 +168,7 @@
     out = thing;
   }
 
-  void testList(vector<int32_t> &out, const vector<int32_t> &thing) {
+  void testList(vector<int32_t>& out, const vector<int32_t>& thing) {
     printf("testList({");
     vector<int32_t>::const_iterator l_iter;
     bool first = true;
@@ -185,23 +194,22 @@
     return thing;
   }
 
-  void testMapMap(map<int32_t, map<int32_t,int32_t> > &mapmap, const int32_t hello) {
+  void testMapMap(map<int32_t, map<int32_t, int32_t> >& mapmap, const int32_t hello) {
     printf("testMapMap(%d)\n", hello);
 
-    map<int32_t,int32_t> pos;
-    map<int32_t,int32_t> neg;
+    map<int32_t, int32_t> pos;
+    map<int32_t, int32_t> neg;
     for (int i = 1; i < 5; i++) {
-      pos.insert(make_pair(i,i));
-      neg.insert(make_pair(-i,-i));
+      pos.insert(make_pair(i, i));
+      neg.insert(make_pair(-i, -i));
     }
 
     mapmap.insert(make_pair(4, pos));
     mapmap.insert(make_pair(-4, neg));
-
   }
 
-  void testInsanity(map<UserId, map<Numberz::type,Insanity> > &insane, const Insanity &argument) {
-    (void) argument;
+  void testInsanity(map<UserId, map<Numberz::type, Insanity> >& insane, const Insanity& argument) {
+    (void)argument;
     printf("testInsanity()\n");
 
     Xtruct hello;
@@ -237,13 +245,11 @@
 
     printf("return");
     printf(" = {");
-    map<UserId, map<Numberz::type,Insanity> >::const_iterator i_iter;
+    map<UserId, map<Numberz::type, Insanity> >::const_iterator i_iter;
     for (i_iter = insane.begin(); i_iter != insane.end(); ++i_iter) {
       printf("%" PRId64 " => {", i_iter->first);
-      map<Numberz::type,Insanity>::const_iterator i2_iter;
-      for (i2_iter = i_iter->second.begin();
-           i2_iter != i_iter->second.end();
-           ++i2_iter) {
+      map<Numberz::type, Insanity>::const_iterator i2_iter;
+      for (i2_iter = i_iter->second.begin(); i2_iter != i_iter->second.end(); ++i2_iter) {
         printf("%d => {", i2_iter->first);
         map<Numberz::type, UserId> userMap = i2_iter->second.userMap;
         map<Numberz::type, UserId>::const_iterator um;
@@ -257,7 +263,11 @@
         vector<Xtruct>::const_iterator x;
         printf("{");
         for (x = xtructs.begin(); x != xtructs.end(); ++x) {
-          printf("{\"%s\", %d, %d, %" PRId64 "}, ", x->string_thing.c_str(), (int)x->byte_thing, x->i32_thing, x->i64_thing);
+          printf("{\"%s\", %d, %d, %" PRId64 "}, ",
+                 x->string_thing.c_str(),
+                 (int)x->byte_thing,
+                 x->i32_thing,
+                 x->i64_thing);
         }
         printf("}");
 
@@ -266,14 +276,18 @@
       printf("}, ");
     }
     printf("}\n");
-
-
   }
 
-  void testMulti(Xtruct &hello, const int8_t arg0, const int32_t arg1, const int64_t arg2, const std::map<int16_t, std::string>  &arg3, const Numberz::type arg4, const UserId arg5) {
-    (void) arg3;
-    (void) arg4;
-    (void) arg5;
+  void testMulti(Xtruct& hello,
+                 const int8_t arg0,
+                 const int32_t arg1,
+                 const int64_t arg2,
+                 const std::map<int16_t, std::string>& arg3,
+                 const Numberz::type arg4,
+                 const UserId arg5) {
+    (void)arg3;
+    (void)arg4;
+    (void)arg5;
 
     printf("testMulti()\n");
 
@@ -283,9 +297,7 @@
     hello.i64_thing = (int64_t)arg2;
   }
 
-  void testException(const std::string &arg)
-    throw(Xception, apache::thrift::TException)
-  {
+  void testException(const std::string& arg) throw(Xception, apache::thrift::TException) {
     printf("testException(%s)\n", arg.c_str());
     if (arg.compare("Xception") == 0) {
       Xception e;
@@ -302,7 +314,9 @@
     }
   }
 
-  void testMultiException(Xtruct &result, const std::string &arg0, const std::string &arg1) throw(Xception, Xception2) {
+  void testMultiException(Xtruct& result,
+                          const std::string& arg0,
+                          const std::string& arg1) throw(Xception, Xception2) {
 
     printf("testMultiException(%s, %s)\n", arg0.c_str(), arg1.c_str());
 
@@ -329,28 +343,23 @@
   }
 };
 
-
 class TestProcessorEventHandler : public TProcessorEventHandler {
   virtual void* getContext(const char* fn_name, void* serverContext) {
-    (void) serverContext;
+    (void)serverContext;
     return new std::string(fn_name);
   }
   virtual void freeContext(void* ctx, const char* fn_name) {
-    (void) fn_name;
+    (void)fn_name;
     delete static_cast<std::string*>(ctx);
   }
-  virtual void preRead(void* ctx, const char* fn_name) {
-    communicate("preRead", ctx, fn_name);
-  }
+  virtual void preRead(void* ctx, const char* fn_name) { communicate("preRead", ctx, fn_name); }
   virtual void postRead(void* ctx, const char* fn_name, uint32_t bytes) {
-    (void) bytes;
+    (void)bytes;
     communicate("postRead", ctx, fn_name);
   }
-  virtual void preWrite(void* ctx, const char* fn_name) {
-    communicate("preWrite", ctx, fn_name);
-  }
+  virtual void preWrite(void* ctx, const char* fn_name) { communicate("preWrite", ctx, fn_name); }
   virtual void postWrite(void* ctx, const char* fn_name, uint32_t bytes) {
-    (void) bytes;
+    (void)bytes;
     communicate("postWrite", ctx, fn_name);
   }
   virtual void asyncComplete(void* ctx, const char* fn_name) {
@@ -365,7 +374,6 @@
   }
 };
 
-
 class TestHandlerAsync : public ThriftTestCobSvIf {
 public:
   TestHandlerAsync(boost::shared_ptr<TestHandler>& handler) : _delegate(handler) {}
@@ -376,7 +384,8 @@
     cob();
   }
 
-  virtual void testString(tcxx::function<void(std::string const& _return)> cob, const std::string& thing) {
+  virtual void testString(tcxx::function<void(std::string const& _return)> cob,
+                          const std::string& thing) {
     std::string res;
     _delegate->testString(res, thing);
     cob(res);
@@ -414,31 +423,37 @@
     cob(res);
   }
 
-  virtual void testMap(tcxx::function<void(std::map<int32_t, int32_t>  const& _return)> cob, const std::map<int32_t, int32_t> & thing) {
+  virtual void testMap(tcxx::function<void(std::map<int32_t, int32_t> const& _return)> cob,
+                       const std::map<int32_t, int32_t>& thing) {
     std::map<int32_t, int32_t> res;
     _delegate->testMap(res, thing);
     cob(res);
   }
 
-  virtual void testStringMap(tcxx::function<void(std::map<std::string, std::string>  const& _return)> cob, const std::map<std::string, std::string> & thing) {
+  virtual void testStringMap(
+      tcxx::function<void(std::map<std::string, std::string> const& _return)> cob,
+      const std::map<std::string, std::string>& thing) {
     std::map<std::string, std::string> res;
     _delegate->testStringMap(res, thing);
     cob(res);
   }
 
-  virtual void testSet(tcxx::function<void(std::set<int32_t>  const& _return)> cob, const std::set<int32_t> & thing) {
+  virtual void testSet(tcxx::function<void(std::set<int32_t> const& _return)> cob,
+                       const std::set<int32_t>& thing) {
     std::set<int32_t> res;
     _delegate->testSet(res, thing);
     cob(res);
   }
 
-  virtual void testList(tcxx::function<void(std::vector<int32_t>  const& _return)> cob, const std::vector<int32_t> & thing) {
+  virtual void testList(tcxx::function<void(std::vector<int32_t> const& _return)> cob,
+                        const std::vector<int32_t>& thing) {
     std::vector<int32_t> res;
     _delegate->testList(res, thing);
     cob(res);
   }
 
-  virtual void testEnum(tcxx::function<void(Numberz::type const& _return)> cob, const Numberz::type thing) {
+  virtual void testEnum(tcxx::function<void(Numberz::type const& _return)> cob,
+                        const Numberz::type thing) {
     Numberz::type res = _delegate->testEnum(thing);
     cob(res);
   }
@@ -448,39 +463,56 @@
     cob(res);
   }
 
-  virtual void testMapMap(tcxx::function<void(std::map<int32_t, std::map<int32_t, int32_t> >  const& _return)> cob, const int32_t hello) {
+  virtual void testMapMap(
+      tcxx::function<void(std::map<int32_t, std::map<int32_t, int32_t> > const& _return)> cob,
+      const int32_t hello) {
     std::map<int32_t, std::map<int32_t, int32_t> > res;
     _delegate->testMapMap(res, hello);
     cob(res);
   }
 
-  virtual void testInsanity(tcxx::function<void(std::map<UserId, std::map<Numberz::type, Insanity> >  const& _return)> cob, const Insanity& argument) {
+  virtual void testInsanity(
+      tcxx::function<void(std::map<UserId, std::map<Numberz::type, Insanity> > const& _return)> cob,
+      const Insanity& argument) {
     std::map<UserId, std::map<Numberz::type, Insanity> > res;
     _delegate->testInsanity(res, argument);
     cob(res);
- }
+  }
 
-  virtual void testMulti(tcxx::function<void(Xtruct const& _return)> cob, const int8_t arg0, const int32_t arg1, const int64_t arg2, const std::map<int16_t, std::string> & arg3, const Numberz::type arg4, const UserId arg5) {
+  virtual void testMulti(tcxx::function<void(Xtruct const& _return)> cob,
+                         const int8_t arg0,
+                         const int32_t arg1,
+                         const int64_t arg2,
+                         const std::map<int16_t, std::string>& arg3,
+                         const Numberz::type arg4,
+                         const UserId arg5) {
     Xtruct res;
     _delegate->testMulti(res, arg0, arg1, arg2, arg3, arg4, arg5);
     cob(res);
   }
 
-  virtual void testException(tcxx::function<void()> cob, tcxx::function<void(::apache::thrift::TDelayedException* _throw)> exn_cob, const std::string& arg) {
+  virtual void testException(
+      tcxx::function<void()> cob,
+      tcxx::function<void(::apache::thrift::TDelayedException* _throw)> exn_cob,
+      const std::string& arg) {
     try {
       _delegate->testException(arg);
-    } catch(const apache::thrift::TException& e) {
+    } catch (const apache::thrift::TException& e) {
       exn_cob(apache::thrift::TDelayedException::delayException(e));
       return;
     }
     cob();
   }
 
-  virtual void testMultiException(tcxx::function<void(Xtruct const& _return)> cob, tcxx::function<void(::apache::thrift::TDelayedException* _throw)> exn_cob, const std::string& arg0, const std::string& arg1) {
+  virtual void testMultiException(
+      tcxx::function<void(Xtruct const& _return)> cob,
+      tcxx::function<void(::apache::thrift::TDelayedException* _throw)> exn_cob,
+      const std::string& arg0,
+      const std::string& arg1) {
     Xtruct res;
     try {
       _delegate->testMultiException(res, arg0, arg1);
-    } catch(const apache::thrift::TException& e) {
+    } catch (const apache::thrift::TException& e) {
       exn_cob(apache::thrift::TDelayedException::delayException(e));
       return;
     }
@@ -496,13 +528,12 @@
   boost::shared_ptr<TestHandler> _delegate;
 };
 
-
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
 
   string file_path = boost::filesystem::system_complete(argv[0]).string();
-  string dir_path = file_path.substr(0, file_path.size()-EXECUTABLE_FILE_NAME_LENGTH);
+  string dir_path = file_path.substr(0, file_path.size() - EXECUTABLE_FILE_NAME_LENGTH);
 
-  #if _WIN32
+#if _WIN32
   transport::TWinsockSingleton::create();
 #endif
   int port = 9090;
@@ -513,32 +544,35 @@
   string domain_socket = "";
   size_t workers = 4;
 
-
   boost::program_options::options_description desc("Allowed options");
-  desc.add_options()
-      ("help,h", "produce help message")
-      ("port", boost::program_options::value<int>(&port)->default_value(port), "Port number to listen")
-	  ("domain-socket", boost::program_options::value<string>(&domain_socket)->default_value(domain_socket),
-	    "Unix Domain Socket (e.g. /tmp/ThriftTest.thrift)")
-      ("server-type", boost::program_options::value<string>(&server_type)->default_value(server_type),
-        "type of server, \"simple\", \"thread-pool\", \"threaded\", or \"nonblocking\"")
-      ("transport", boost::program_options::value<string>(&transport_type)->default_value(transport_type),
-        "transport: buffered, framed, http")
-      ("protocol", boost::program_options::value<string>(&protocol_type)->default_value(protocol_type),
-        "protocol: binary, compact, json")
-	  ("ssl", "Encrypted Transport using SSL")
-	  ("processor-events", "processor-events")
-      ("workers,n", boost::program_options::value<size_t>(&workers)->default_value(workers),
-        "Number of thread pools workers. Only valid for thread-pool server type")
-  ;
+  desc.add_options()("help,h", "produce help message")(
+      "port",
+      boost::program_options::value<int>(&port)->default_value(port),
+      "Port number to listen")("domain-socket",
+                               boost::program_options::value<string>(&domain_socket)
+                                   ->default_value(domain_socket),
+                               "Unix Domain Socket (e.g. /tmp/ThriftTest.thrift)")(
+      "server-type",
+      boost::program_options::value<string>(&server_type)->default_value(server_type),
+      "type of server, \"simple\", \"thread-pool\", \"threaded\", or \"nonblocking\"")(
+      "transport",
+      boost::program_options::value<string>(&transport_type)->default_value(transport_type),
+      "transport: buffered, framed, http")(
+      "protocol",
+      boost::program_options::value<string>(&protocol_type)->default_value(protocol_type),
+      "protocol: binary, compact, json")("ssl", "Encrypted Transport using SSL")(
+      "processor-events",
+      "processor-events")("workers,n",
+                          boost::program_options::value<size_t>(&workers)->default_value(workers),
+                          "Number of thread pools workers. Only valid for thread-pool server type");
 
   boost::program_options::variables_map vm;
   boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
   boost::program_options::notify(vm);
 
   if (vm.count("help")) {
-      cout << desc << "\n";
-      return 1;
+    cout << desc << "\n";
+    return 1;
   }
 
   try {
@@ -548,7 +582,7 @@
       } else if (server_type == "threaded") {
       } else if (server_type == "nonblocking") {
       } else {
-          throw invalid_argument("Unknown server type "+server_type);
+        throw invalid_argument("Unknown server type " + server_type);
       }
     }
 
@@ -557,7 +591,7 @@
       } else if (protocol_type == "compact") {
       } else if (protocol_type == "json") {
       } else {
-          throw invalid_argument("Unknown protocol type "+protocol_type);
+        throw invalid_argument("Unknown protocol type " + protocol_type);
       }
     }
 
@@ -566,7 +600,7 @@
       } else if (transport_type == "framed") {
       } else if (transport_type == "http") {
       } else {
-          throw invalid_argument("Unknown transport type "+transport_type);
+        throw invalid_argument("Unknown transport type " + transport_type);
       }
     }
 
@@ -589,7 +623,8 @@
     boost::shared_ptr<TProtocolFactory> compactProtocolFactory(new TCompactProtocolFactory());
     protocolFactory = compactProtocolFactory;
   } else {
-    boost::shared_ptr<TProtocolFactory> binaryProtocolFactory(new TBinaryProtocolFactoryT<TBufferBase>());
+    boost::shared_ptr<TProtocolFactory> binaryProtocolFactory(
+        new TBinaryProtocolFactoryT<TBufferBase>());
     protocolFactory = binaryProtocolFactory;
   }
 
@@ -598,8 +633,8 @@
   boost::shared_ptr<ThriftTestProcessor> testProcessor(new ThriftTestProcessor(testHandler));
 
   if (vm.count("processor-events")) {
-    testProcessor->setEventHandler(boost::shared_ptr<TProcessorEventHandler>(
-          new TestProcessorEventHandler()));
+    testProcessor->setEventHandler(
+        boost::shared_ptr<TProcessorEventHandler>(new TestProcessorEventHandler()));
   }
 
   // Transport
@@ -637,8 +672,8 @@
   }
 
   // Server Info
-  cout << "Starting \"" << server_type << "\" server ("
-    << transport_type << "/" << protocol_type << ") listen on: " << domain_socket;
+  cout << "Starting \"" << server_type << "\" server (" << transport_type << "/" << protocol_type
+       << ") listen on: " << domain_socket;
   if (port != 0) {
     cout << port;
   }
@@ -648,17 +683,13 @@
   boost::shared_ptr<apache::thrift::server::TServer> server;
 
   if (server_type == "simple") {
-    server.reset(new TSimpleServer(testProcessor,
-                               serverSocket,
-                               transportFactory,
-                               protocolFactory));
+    server.reset(new TSimpleServer(testProcessor, serverSocket, transportFactory, protocolFactory));
   } else if (server_type == "thread-pool") {
 
-    boost::shared_ptr<ThreadManager> threadManager =
-      ThreadManager::newSimpleThreadManager(workers);
+    boost::shared_ptr<ThreadManager> threadManager = ThreadManager::newSimpleThreadManager(workers);
 
-    boost::shared_ptr<PlatformThreadFactory> threadFactory =
-      boost::shared_ptr<PlatformThreadFactory>(new PlatformThreadFactory());
+    boost::shared_ptr<PlatformThreadFactory> threadFactory
+        = boost::shared_ptr<PlatformThreadFactory>(new PlatformThreadFactory());
 
     threadManager->threadFactory(threadFactory);
 
@@ -671,15 +702,15 @@
                                        threadManager));
   } else if (server_type == "threaded") {
 
-    server.reset(new TThreadedServer(testProcessor,
-                                   serverSocket,
-                                   transportFactory,
-                                   protocolFactory));
+    server.reset(
+        new TThreadedServer(testProcessor, serverSocket, transportFactory, protocolFactory));
   } else if (server_type == "nonblocking") {
-    if(transport_type == "http") {
+    if (transport_type == "http") {
       boost::shared_ptr<TestHandlerAsync> testHandlerAsync(new TestHandlerAsync(testHandler));
-      boost::shared_ptr<TAsyncProcessor> testProcessorAsync(new ThriftTestAsyncProcessor(testHandlerAsync));
-      boost::shared_ptr<TAsyncBufferProcessor> testBufferProcessor(new TAsyncProtocolProcessor(testProcessorAsync, protocolFactory));
+      boost::shared_ptr<TAsyncProcessor> testProcessorAsync(
+          new ThriftTestAsyncProcessor(testHandlerAsync));
+      boost::shared_ptr<TAsyncBufferProcessor> testBufferProcessor(
+          new TAsyncProtocolProcessor(testProcessorAsync, protocolFactory));
 
       // not loading nonblockingServer into "server" because
       // TEvhttpServer doesn't inherit from TServer, and doesn't
@@ -691,17 +722,18 @@
     }
   }
 
-  if(server.get() != NULL)
-  {
+  if (server.get() != NULL) {
     apache::thrift::concurrency::PlatformThreadFactory factory;
     factory.setDetached(false);
     boost::shared_ptr<apache::thrift::concurrency::Runnable> serverThreadRunner(server);
-    boost::shared_ptr<apache::thrift::concurrency::Thread> thread = factory.newThread(serverThreadRunner);
+    boost::shared_ptr<apache::thrift::concurrency::Thread> thread
+        = factory.newThread(serverThreadRunner);
     thread->start();
 
     // HACK: cross language test suite is unable to handle cin properly
     //       that's why we stay in a endless loop here
-    while(1){}
+    while (1) {
+    }
     // FIXME: find another way to stop the server (e.g. a signal)
     // cout<<"Press enter to stop the server."<<endl;
     // cin.ignore(); //wait until a key is pressed
diff --git a/test/cpp/src/ThriftTest_extras.cpp b/test/cpp/src/ThriftTest_extras.cpp
index 33f681f..af5606e 100644
--- a/test/cpp/src/ThriftTest_extras.cpp
+++ b/test/cpp/src/ThriftTest_extras.cpp
@@ -22,12 +22,12 @@
 #include <thrift/protocol/TDebugProtocol.h>
 #include "gen-cpp/ThriftTest_types.h"
 
-
-namespace thrift { namespace test {
+namespace thrift {
+namespace test {
 
 bool Insanity::operator<(thrift::test::Insanity const& other) const {
   using apache::thrift::ThriftDebugString;
   return ThriftDebugString(*this) < ThriftDebugString(other);
 }
-
-}}
+}
+}