Update style to (almost) conform to ndn-cxx style using clang-format
diff --git a/tests/unit-tests/action-log.t.cpp b/tests/unit-tests/action-log.t.cpp
index 79796c7..f598276 100644
--- a/tests/unit-tests/action-log.t.cpp
+++ b/tests/unit-tests/action-log.t.cpp
@@ -18,16 +18,16 @@
  * See AUTHORS.md for complete list of ChronoShare authors and contributors.
  */
 
-#include <boost/test/unit_test.hpp>
 #include <boost/lexical_cast.hpp>
+#include <boost/test/unit_test.hpp>
 
-#include "logging.hpp"
 #include "action-log.hpp"
+#include "logging.hpp"
 
-#include <unistd.h>
-#include <iostream>
 #include <boost/filesystem.hpp>
 #include <boost/make_shared.hpp>
+#include <iostream>
+#include <unistd.h>
 
 using namespace std;
 using namespace boost;
@@ -36,110 +36,115 @@
 
 BOOST_AUTO_TEST_SUITE(TestActionLog)
 
-BOOST_AUTO_TEST_CASE (ActionLogTest)
+BOOST_AUTO_TEST_CASE(ActionLogTest)
 {
-  INIT_LOGGERS ();
+  INIT_LOGGERS();
 
-  Name localName ("/alex");
+  Name localName("/alex");
 
-  fs::path tmpdir = fs::unique_path (fs::temp_directory_path () / "%%%%-%%%%-%%%%-%%%%");
-  SyncLogPtr syncLog = make_shared<SyncLog> (tmpdir, localName);
-  NdnxWrapperPtr ndnx = make_shared<NdnxWrapper> ();
+  fs::path tmpdir = fs::unique_path(fs::temp_directory_path() / "%%%%-%%%%-%%%%-%%%%");
+  SyncLogPtr syncLog = make_shared<SyncLog>(tmpdir, localName);
+  CcnxWrapperPtr ccnx = make_shared<CcnxWrapper>();
 
-  ActionLogPtr actionLog = make_shared<ActionLog> (ndnx, tmpdir, syncLog, "top-secret", "test-chronoshare",
-                                                   ActionLog::OnFileAddedOrChangedCallback(), ActionLog::OnFileRemovedCallback ());
+  ActionLogPtr actionLog =
+    make_shared<ActionLog>(ccnx, tmpdir, syncLog, "top-secret", "test-chronoshare",
+                           ActionLog::OnFileAddedOrChangedCallback(),
+                           ActionLog::OnFileRemovedCallback());
 
-// const std::string &filename,
-//                    const Hash &hash,
-//                    time_t wtime,
-//                    int mode,
-//                    int seg_num
-  BOOST_CHECK_EQUAL (syncLog->SeqNo (localName), 0);
+  // const std::string &filename,
+  //                    const Hash &hash,
+  //                    time_t wtime,
+  //                    int mode,
+  //                    int seg_num
+  BOOST_CHECK_EQUAL(syncLog->SeqNo(localName), 0);
 
-  BOOST_CHECK_EQUAL (syncLog->LogSize (), 0);
-  BOOST_CHECK_EQUAL (actionLog->LogSize (), 0);
+  BOOST_CHECK_EQUAL(syncLog->LogSize(), 0);
+  BOOST_CHECK_EQUAL(actionLog->LogSize(), 0);
 
-  actionLog->AddLocalActionUpdate ("file.txt", *Hash::FromString ("2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c"),
-                              time (NULL), 0755, 10);
+  actionLog->AddLocalActionUpdate("file.txt",
+                                  *Hash::FromString(
+                                    "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c"),
+                                  time(NULL), 0755, 10);
 
-  BOOST_CHECK_EQUAL (syncLog->SeqNo (localName), 1);
-  BOOST_CHECK_EQUAL (syncLog->LogSize (), 0);
-  BOOST_CHECK_EQUAL (actionLog->LogSize (), 1);
+  BOOST_CHECK_EQUAL(syncLog->SeqNo(localName), 1);
+  BOOST_CHECK_EQUAL(syncLog->LogSize(), 0);
+  BOOST_CHECK_EQUAL(actionLog->LogSize(), 1);
 
-  HashPtr hash = syncLog->RememberStateInStateLog ();
-  BOOST_CHECK_EQUAL (syncLog->LogSize (), 1);
-  BOOST_CHECK_EQUAL (lexical_cast<string> (*hash), "3410477233f98d6c3f9a6f8da24494bf5a65e1a7c9f4f66b228128bd4e020558");
+  HashPtr hash = syncLog->RememberStateInStateLog();
+  BOOST_CHECK_EQUAL(syncLog->LogSize(), 1);
+  BOOST_CHECK_EQUAL(lexical_cast<string>(*hash),
+                    "3410477233f98d6c3f9a6f8da24494bf5a65e1a7c9f4f66b228128bd4e020558");
 
-  PcoPtr pco = actionLog->LookupActionPco (localName, 0);
-  BOOST_CHECK_EQUAL ((bool)pco, false);
+  PcoPtr pco = actionLog->LookupActionPco(localName, 0);
+  BOOST_CHECK_EQUAL((bool)pco, false);
 
-  pco = actionLog->LookupActionPco (localName, 1);
-  BOOST_CHECK_EQUAL ((bool)pco, true);
+  pco = actionLog->LookupActionPco(localName, 1);
+  BOOST_CHECK_EQUAL((bool)pco, true);
 
-  BOOST_CHECK_EQUAL (pco->name (), "/alex/test-chronoshare/action/top-secret/%00%01");
+  BOOST_CHECK_EQUAL(pco->name(), "/alex/test-chronoshare/action/top-secret/%00%01");
 
-  ActionItemPtr action = actionLog->LookupAction (Name ("/alex/test-chronoshare/action/top-secret")(0));
-  BOOST_CHECK_EQUAL ((bool)action, false);
+  ActionItemPtr action = actionLog->LookupAction(Name("/alex/test-chronoshare/action/top-secret")(0));
+  BOOST_CHECK_EQUAL((bool)action, false);
 
-  action = actionLog->LookupAction (Name ("/alex/test-chronoshare/action/top-secret")(1));
-  BOOST_CHECK_EQUAL ((bool)action, true);
+  action = actionLog->LookupAction(Name("/alex/test-chronoshare/action/top-secret")(1));
+  BOOST_CHECK_EQUAL((bool)action, true);
 
-  if (action)
-    {
-      BOOST_CHECK_EQUAL (action->version (), 0);
-      BOOST_CHECK_EQUAL (action->action (), 0);
+  if (action) {
+    BOOST_CHECK_EQUAL(action->version(), 0);
+    BOOST_CHECK_EQUAL(action->action(), 0);
 
-      BOOST_CHECK_EQUAL (action->filename (), "file.txt");
-      BOOST_CHECK_EQUAL (action->seg_num (), 10);
-      BOOST_CHECK_EQUAL (action->file_hash ().size (), 32);
-      BOOST_CHECK_EQUAL (action->mode (), 0755);
+    BOOST_CHECK_EQUAL(action->filename(), "file.txt");
+    BOOST_CHECK_EQUAL(action->seg_num(), 10);
+    BOOST_CHECK_EQUAL(action->file_hash().size(), 32);
+    BOOST_CHECK_EQUAL(action->mode(), 0755);
 
-      BOOST_CHECK_EQUAL (action->has_parent_device_name (), false);
-      BOOST_CHECK_EQUAL (action->has_parent_seq_no (), false);
-    }
+    BOOST_CHECK_EQUAL(action->has_parent_device_name(), false);
+    BOOST_CHECK_EQUAL(action->has_parent_seq_no(), false);
+  }
 
-  actionLog->AddLocalActionUpdate ("file.txt", *Hash::FromString ("2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c"),
-                              time (NULL), 0755, 10);
-  BOOST_CHECK_EQUAL (syncLog->SeqNo (localName), 2);
-  BOOST_CHECK_EQUAL (syncLog->LogSize (), 1);
-  BOOST_CHECK_EQUAL (actionLog->LogSize (), 2);
+  actionLog->AddLocalActionUpdate("file.txt",
+                                  *Hash::FromString(
+                                    "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c"),
+                                  time(NULL), 0755, 10);
+  BOOST_CHECK_EQUAL(syncLog->SeqNo(localName), 2);
+  BOOST_CHECK_EQUAL(syncLog->LogSize(), 1);
+  BOOST_CHECK_EQUAL(actionLog->LogSize(), 2);
 
-  action = actionLog->LookupAction (Name ("/alex"), 2);
-  BOOST_CHECK_EQUAL ((bool)action, true);
+  action = actionLog->LookupAction(Name("/alex"), 2);
+  BOOST_CHECK_EQUAL((bool)action, true);
 
-  if (action)
-    {
-      BOOST_CHECK_EQUAL (action->has_parent_device_name (), true);
-      BOOST_CHECK_EQUAL (action->has_parent_seq_no (), true);
+  if (action) {
+    BOOST_CHECK_EQUAL(action->has_parent_device_name(), true);
+    BOOST_CHECK_EQUAL(action->has_parent_seq_no(), true);
 
-      BOOST_CHECK_EQUAL (action->parent_seq_no (), 1);
-      BOOST_CHECK_EQUAL (action->version (), 1);
-    }
+    BOOST_CHECK_EQUAL(action->parent_seq_no(), 1);
+    BOOST_CHECK_EQUAL(action->version(), 1);
+  }
 
-  BOOST_CHECK_EQUAL ((bool)actionLog->AddRemoteAction (pco), true);
-  BOOST_CHECK_EQUAL (actionLog->LogSize (), 2);
+  BOOST_CHECK_EQUAL((bool)actionLog->AddRemoteAction(pco), true);
+  BOOST_CHECK_EQUAL(actionLog->LogSize(), 2);
 
   // create a real remote action
   ActionItem item;
-  item.set_action (ActionItem::UPDATE);
-  item.set_filename ("file.txt");
-  item.set_version (2);
-  item.set_timestamp (time (NULL));
+  item.set_action(ActionItem::UPDATE);
+  item.set_filename("file.txt");
+  item.set_version(2);
+  item.set_timestamp(time(NULL));
 
-  BytesPtr item_msg = serializeMsg (item);
-  Name actionName = Name ("/")(Name("/zhenkai/test"))("test-chronoshare")("action")("top-secret")(1);
-  Bytes actionData = ndnx->createContentObject (actionName, head (*item_msg), item_msg->size ());
+  BytesPtr item_msg = serializeMsg(item);
+  Name actionName = Name("/")(Name("/zhenkai/test"))("test-chronoshare")("action")("top-secret")(1);
+  Bytes actionData = ccnx->createContentObject(actionName, head(*item_msg), item_msg->size());
 
-  pco = make_shared<ParsedContentObject> (actionData);
-  BOOST_CHECK_EQUAL ((bool)actionLog->AddRemoteAction (pco), true);
-  BOOST_CHECK_EQUAL (actionLog->LogSize (), 3);
+  pco = make_shared<ParsedContentObject>(actionData);
+  BOOST_CHECK_EQUAL((bool)actionLog->AddRemoteAction(pco), true);
+  BOOST_CHECK_EQUAL(actionLog->LogSize(), 3);
 
-  remove_all (tmpdir);
+  remove_all(tmpdir);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
 
-  // catch (boost::exception &err)
-  //   {
-  //     cout << *boost::get_error_info<errmsg_info_str> (err) << endl;
-  //   }
+// catch (boost::exception &err)
+//   {
+//     cout << *boost::get_error_info<errmsg_info_str> (err) << endl;
+//   }
diff --git a/tests/unit-tests/dispatcher.t.cpp b/tests/unit-tests/dispatcher.t.cpp
index ec24eab..572db31 100644
--- a/tests/unit-tests/dispatcher.t.cpp
+++ b/tests/unit-tests/dispatcher.t.cpp
@@ -19,40 +19,41 @@
  */
 
 #include "ccnx-wrapper.hpp"
-#include "logging.hpp"
 #include "dispatcher.hpp"
-#include <boost/test/unit_test.hpp>
-#include <boost/make_shared.hpp>
+#include "logging.hpp"
 #include <boost/filesystem.hpp>
-#include <fstream>
+#include <boost/make_shared.hpp>
+#include <boost/test/unit_test.hpp>
 #include <cassert>
+#include <fstream>
 
 using namespace Ndnx;
 using namespace std;
 using namespace boost;
 namespace fs = boost::filesystem;
 
-INIT_LOGGER ("Test.Dispatcher");
+INIT_LOGGER("Test.Dispatcher");
 
 BOOST_AUTO_TEST_SUITE(TestDispatcher)
 
 
-void cleanDir(fs::path dir)
+void
+cleanDir(fs::path dir)
 {
-  if (fs::exists(dir))
-  {
+  if (fs::exists(dir)) {
     fs::remove_all(dir);
   }
 }
 
-void checkRoots(const HashPtr &root1, const HashPtr &root2)
+void
+checkRoots(const HashPtr& root1, const HashPtr& root2)
 {
   BOOST_CHECK_EQUAL(*root1, *root2);
 }
 
 BOOST_AUTO_TEST_CASE(DispatcherTest)
 {
-  INIT_LOGGERS ();
+  INIT_LOGGERS();
 
   fs::path dir1("./TestDispatcher/test-white-house");
   fs::path dir2("./TestDispatcher/test-black-house");
@@ -76,7 +77,7 @@
 
   usleep(14900000);
 
-  _LOG_DEBUG ("checking obama vs romney");
+  _LOG_DEBUG("checking obama vs romney");
   checkRoots(d1.SyncRoot(), d2.SyncRoot());
 
   fs::path filename("a_letter_to_romney.txt");
@@ -86,8 +87,7 @@
 
   ofstream ofs;
   ofs.open(abf.string().c_str());
-  for (int i = 0; i < 5000; i ++)
-  {
+  for (int i = 0; i < 5000; i++) {
     ofs << words;
   }
   ofs.close();
@@ -97,7 +97,8 @@
   sleep(5);
 
   fs::path ef = dir2 / filename;
-  BOOST_REQUIRE_MESSAGE(fs::exists(ef), user1 << " failed to notify " << user2 << " about " << filename.string());
+  BOOST_REQUIRE_MESSAGE(fs::exists(ef), user1 << " failed to notify " << user2 << " about "
+                                              << filename.string());
   BOOST_CHECK_EQUAL(fs::file_size(abf), fs::file_size(ef));
   HashPtr fileHash1 = Hash::FromFileContent(abf);
   HashPtr fileHash2 = Hash::FromFileContent(ef);
diff --git a/tests/unit-tests/fetch-manager.t.cpp b/tests/unit-tests/fetch-manager.t.cpp
index 0c6bb37..24ec688 100644
--- a/tests/unit-tests/fetch-manager.t.cpp
+++ b/tests/unit-tests/fetch-manager.t.cpp
@@ -18,15 +18,14 @@
  * See AUTHORS.md for complete list of ChronoShare authors and contributors.
  */
 
+#include "ccnx-wrapper.hpp"
 #include "fetch-manager.hpp"
 #include "fetcher.hpp"
-#include "ccnx-wrapper.hpp"
-#include <boost/test/unit_test.hpp>
-#include <boost/make_shared.hpp>
 #include "logging.hpp"
+#include <boost/make_shared.hpp>
+#include <boost/test/unit_test.hpp>
 
-
-INIT_LOGGER ("Test.FetchManager");
+INIT_LOGGER("Test.FetchManager");
 
 using namespace Ndnx;
 using namespace std;
@@ -45,47 +44,46 @@
   bool m_done;
   bool m_failed;
 
-  FetcherTestData ()
-    : m_done (false)
-    , m_failed (false)
+  FetcherTestData()
+    : m_done(false)
+    , m_failed(false)
   {
   }
 
   void
-  onData (const Ndnx::Name &deviceName, const Ndnx::Name &basename, uint64_t seqno, Ndnx::PcoPtr pco)
+  onData(const Ccnx::Name& deviceName, const Ccnx::Name& basename, uint64_t seqno, Ccnx::PcoPtr pco)
   {
-    _LOG_TRACE ("onData: " << seqno);
+    _LOG_TRACE("onData: " << seqno);
 
-    recvData.insert (seqno);
-    differentNames.insert (basename);
+    recvData.insert(seqno);
+    differentNames.insert(basename);
     Name name = basename;
     name.appendComp(seqno);
-    segmentNames.insert (name);
+    segmentNames.insert(name);
 
-    BytesPtr data = pco->contentPtr ();
+    BytesPtr data = pco->contentPtr();
 
-    if (data->size () == sizeof(int))
-      {
-        recvContent.insert (*reinterpret_cast<const int*> (head(*data)));
-      }
+    if (data->size() == sizeof(int)) {
+      recvContent.insert(*reinterpret_cast<const int*>(head(*data)));
+    }
 
     // cout << "<<< " << basename << ", " << name << ", " << seqno << endl;
   }
 
   void
-  finish(const Ndnx::Name &deviceName, const Ndnx::Name &baseName)
+  finish(const Ccnx::Name& deviceName, const Ccnx::Name& baseName)
   {
   }
 
   void
-  onComplete (Fetcher &fetcher)
+  onComplete(Fetcher& fetcher)
   {
     m_done = true;
     // cout << "Done" << endl;
   }
 
   void
-  onFail (Fetcher &fetcher)
+  onFail(Fetcher& fetcher)
   {
     m_failed = true;
     // cout << "Failed" << endl;
@@ -113,99 +111,96 @@
 
 }
 
-BOOST_AUTO_TEST_CASE (TestFetcher)
+BOOST_AUTO_TEST_CASE(TestFetcher)
 {
-  INIT_LOGGERS ();
+  INIT_LOGGERS();
 
-  NdnxWrapperPtr ndnx = make_shared<NdnxWrapper> ();
+  CcnxWrapperPtr ccnx = make_shared<CcnxWrapper>();
 
-  Name baseName ("/base");
-  Name deviceName ("/device");
+  Name baseName("/base");
+  Name deviceName("/device");
   /* publish seqnos:  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, <gap 5>, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, <gap 1>, 26 */
   // this will allow us to test our pipeline of 6
-  for (int i = 0; i < 10; i++)
-    {
-      ndnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 30);
-    }
+  for (int i = 0; i < 10; i++) {
+    ccnx->publishData(Name(baseName)(i), reinterpret_cast<const unsigned char*>(&i), sizeof(int), 30);
+  }
 
-  for (int i = 15; i < 25; i++)
-    {
-      ndnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 30);
-    }
+  for (int i = 15; i < 25; i++) {
+    ccnx->publishData(Name(baseName)(i), reinterpret_cast<const unsigned char*>(&i), sizeof(int), 30);
+  }
 
   int oneMore = 26;
-  ndnx->publishData (Name (baseName)(oneMore), reinterpret_cast<const unsigned char*> (&oneMore), sizeof(int), 30);
+  ccnx->publishData(Name(baseName)(oneMore), reinterpret_cast<const unsigned char*>(&oneMore),
+                    sizeof(int), 30);
 
   FetcherTestData data;
   ExecutorPtr executor = make_shared<Executor>(1);
-  executor->start ();
+  executor->start();
 
-  Fetcher fetcher (ndnx,
-                   executor,
-                   bind (&FetcherTestData::onData, &data, _1, _2, _3, _4),
-                   bind (&FetcherTestData::finish, &data, _1, _2),
-                   bind (&FetcherTestData::onComplete, &data, _1),
-                   bind (&FetcherTestData::onFail, &data, _1),
-                   deviceName, Name ("/base"), 0, 26,
-                   boost::posix_time::seconds (5)); // this time is not precise
+  Fetcher fetcher(ccnx, executor, bind(&FetcherTestData::onData, &data, _1, _2, _3, _4),
+                  bind(&FetcherTestData::finish, &data, _1, _2),
+                  bind(&FetcherTestData::onComplete, &data, _1),
+                  bind(&FetcherTestData::onFail, &data, _1), deviceName, Name("/base"), 0, 26,
+                  boost::posix_time::seconds(5)); // this time is not precise
 
-  BOOST_CHECK_EQUAL (fetcher.IsActive (), false);
-  fetcher.RestartPipeline ();
-  BOOST_CHECK_EQUAL (fetcher.IsActive (), true);
+  BOOST_CHECK_EQUAL(fetcher.IsActive(), false);
+  fetcher.RestartPipeline();
+  BOOST_CHECK_EQUAL(fetcher.IsActive(), true);
 
   usleep(7000000);
-  BOOST_CHECK_EQUAL (data.m_failed, true);
-  BOOST_CHECK_EQUAL (data.differentNames.size (), 1);
-  BOOST_CHECK_EQUAL (data.segmentNames.size (), 20);
-  BOOST_CHECK_EQUAL (data.recvData.size (), 20);
-  BOOST_CHECK_EQUAL (data.recvContent.size (), 20);
+  BOOST_CHECK_EQUAL(data.m_failed, true);
+  BOOST_CHECK_EQUAL(data.differentNames.size(), 1);
+  BOOST_CHECK_EQUAL(data.segmentNames.size(), 20);
+  BOOST_CHECK_EQUAL(data.recvData.size(), 20);
+  BOOST_CHECK_EQUAL(data.recvContent.size(), 20);
 
   {
     ostringstream recvData;
-    for (set<uint64_t>::iterator i = data.recvData.begin (); i != data.recvData.end (); i++)
+    for (set<uint64_t>::iterator i = data.recvData.begin(); i != data.recvData.end(); i++)
       recvData << *i << ", ";
 
     ostringstream recvContent;
-    for (set<uint64_t>::iterator i = data.recvContent.begin (); i != data.recvContent.end (); i++)
+    for (set<uint64_t>::iterator i = data.recvContent.begin(); i != data.recvContent.end(); i++)
       recvContent << *i << ", ";
 
-    BOOST_CHECK_EQUAL (recvData.str (), "0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, ");
-    BOOST_CHECK_EQUAL (recvData.str (), recvContent.str ());
+    BOOST_CHECK_EQUAL(recvData.str(),
+                      "0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, ");
+    BOOST_CHECK_EQUAL(recvData.str(), recvContent.str());
   }
 
-  BOOST_CHECK_EQUAL (fetcher.IsActive (), false);
-  fetcher.RestartPipeline ();
-  BOOST_CHECK_EQUAL (fetcher.IsActive (), true);
+  BOOST_CHECK_EQUAL(fetcher.IsActive(), false);
+  fetcher.RestartPipeline();
+  BOOST_CHECK_EQUAL(fetcher.IsActive(), true);
 
   usleep(7000000);
-  BOOST_CHECK_EQUAL (data.m_failed, true);
+  BOOST_CHECK_EQUAL(data.m_failed, true);
 
   // publishing missing pieces
-  for (int i = 0; i < 27; i++)
-    {
-      ndnx->publishData (Name (baseName)(i), reinterpret_cast<const unsigned char*> (&i), sizeof(int), 1);
-    }
-  BOOST_CHECK_EQUAL (fetcher.IsActive (), false);
-  fetcher.RestartPipeline ();
-  BOOST_CHECK_EQUAL (fetcher.IsActive (), true);
+  for (int i = 0; i < 27; i++) {
+    ccnx->publishData(Name(baseName)(i), reinterpret_cast<const unsigned char*>(&i), sizeof(int), 1);
+  }
+  BOOST_CHECK_EQUAL(fetcher.IsActive(), false);
+  fetcher.RestartPipeline();
+  BOOST_CHECK_EQUAL(fetcher.IsActive(), true);
 
   usleep(1000000);
-  BOOST_CHECK_EQUAL (data.m_done, true);
+  BOOST_CHECK_EQUAL(data.m_done, true);
 
   {
     ostringstream recvData;
-    for (set<uint64_t>::iterator i = data.recvData.begin (); i != data.recvData.end (); i++)
+    for (set<uint64_t>::iterator i = data.recvData.begin(); i != data.recvData.end(); i++)
       recvData << *i << ", ";
 
     ostringstream recvContent;
-    for (set<uint64_t>::iterator i = data.recvContent.begin (); i != data.recvContent.end (); i++)
+    for (set<uint64_t>::iterator i = data.recvContent.begin(); i != data.recvContent.end(); i++)
       recvContent << *i << ", ";
 
-    BOOST_CHECK_EQUAL (recvData.str (), "0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, ");
-    BOOST_CHECK_EQUAL (recvData.str (), recvContent.str ());
+    BOOST_CHECK_EQUAL(recvData.str(),
+                      "0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, ");
+    BOOST_CHECK_EQUAL(recvData.str(), recvContent.str());
   }
 
-  executor->shutdown ();
+  executor->shutdown();
 }
 
 
diff --git a/tests/unit-tests/fetch-task-db.t.cpp b/tests/unit-tests/fetch-task-db.t.cpp
index 35e372b..03c5de8 100644
--- a/tests/unit-tests/fetch-task-db.t.cpp
+++ b/tests/unit-tests/fetch-task-db.t.cpp
@@ -18,23 +18,23 @@
  * See AUTHORS.md for complete list of ChronoShare authors and contributors.
  */
 
-#include "logging.hpp"
 #include "fetch-task-db.hpp"
+#include "logging.hpp"
 
+#include <boost/bind.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/filesystem/fstream.hpp>
 #include <boost/function.hpp>
-#include <boost/bind.hpp>
 
-#include <boost/test/unit_test.hpp>
-#include <unistd.h>
 #include <boost/make_shared.hpp>
+#include <boost/test/unit_test.hpp>
 #include <iostream>
 #include <iterator>
 #include <map>
+#include <unistd.h>
 #include <utility>
 
-INIT_LOGGER ("Test.FetchTaskDb");
+INIT_LOGGER("Test.FetchTaskDb");
 
 using namespace Ndnx;
 using namespace std;
@@ -46,20 +46,38 @@
 class Checker
 {
 public:
-  Checker(const Name &deviceName, const Name &baseName, uint64_t minSeqNo, uint64_t maxSeqNo, int priority)
-        : m_deviceName(deviceName), m_baseName(baseName), m_minSeqNo(minSeqNo), m_maxSeqNo(maxSeqNo), m_priority(priority)
-  {}
+  Checker(const Name& deviceName, const Name& baseName, uint64_t minSeqNo, uint64_t maxSeqNo,
+          int priority)
+    : m_deviceName(deviceName)
+    , m_baseName(baseName)
+    , m_minSeqNo(minSeqNo)
+    , m_maxSeqNo(maxSeqNo)
+    , m_priority(priority)
+  {
+  }
 
-  Checker(const Checker &other)
-        : m_deviceName(other.m_deviceName), m_baseName(other.m_baseName), m_minSeqNo(other.m_minSeqNo), m_maxSeqNo(other.m_maxSeqNo), m_priority(other.m_priority)
-  {}
+  Checker(const Checker& other)
+    : m_deviceName(other.m_deviceName)
+    , m_baseName(other.m_baseName)
+    , m_minSeqNo(other.m_minSeqNo)
+    , m_maxSeqNo(other.m_maxSeqNo)
+    , m_priority(other.m_priority)
+  {
+  }
 
   bool
-  operator==(const Checker &other) { return m_deviceName == other.m_deviceName && m_baseName == other.m_baseName && m_minSeqNo == other.m_minSeqNo && m_maxSeqNo == other.m_maxSeqNo && m_priority == other.m_priority; }
-
-  void show()
+  operator==(const Checker& other)
   {
-    cout << m_deviceName  <<", " << m_baseName << ", " << m_minSeqNo << ", " << m_maxSeqNo << ", " << m_priority << endl;
+    return m_deviceName == other.m_deviceName && m_baseName == other.m_baseName &&
+           m_minSeqNo == other.m_minSeqNo && m_maxSeqNo == other.m_maxSeqNo &&
+           m_priority == other.m_priority;
+  }
+
+  void
+  show()
+  {
+    cout << m_deviceName << ", " << m_baseName << ", " << m_minSeqNo << ", " << m_maxSeqNo << ", "
+         << m_priority << endl;
   }
 
   Name m_deviceName;
@@ -73,20 +91,20 @@
 int g_counter = 0;
 
 void
-getChecker(const Name &deviceName, const Name &baseName, uint64_t minSeqNo, uint64_t maxSeqNo, int priority)
+getChecker(const Name& deviceName, const Name& baseName, uint64_t minSeqNo, uint64_t maxSeqNo,
+           int priority)
 {
   Checker checker(deviceName, baseName, minSeqNo, maxSeqNo, priority);
-  g_counter ++;
-  if (checkers.find(checker.m_deviceName + checker.m_baseName) != checkers.end())
-  {
+  g_counter++;
+  if (checkers.find(checker.m_deviceName + checker.m_baseName) != checkers.end()) {
     BOOST_FAIL("duplicated checkers");
   }
   checkers.insert(make_pair(checker.m_deviceName + checker.m_baseName, checker));
 }
 
-BOOST_AUTO_TEST_CASE (FetchTaskDbTest)
+BOOST_AUTO_TEST_CASE(FetchTaskDbTest)
 {
-  INIT_LOGGERS ();
+  INIT_LOGGERS();
   fs::path folder("TaskDbTest");
   fs::create_directories(folder / ".chronoshare");
 
@@ -101,8 +119,7 @@
   Name baseNamePrefix("/device/base");
 
   // add 10 tasks
-  for (uint64_t i = 0; i < 10; i++)
-  {
+  for (uint64_t i = 0; i < 10; i++) {
     Name d = deviceNamePrefix;
     Name b = baseNamePrefix;
     Checker c(d.appendComp(i), b.appendComp(i), i, 11, 1);
@@ -111,8 +128,7 @@
   }
 
   // delete the latter 5
-  for (uint64_t i = 5; i < 10; i++)
-  {
+  for (uint64_t i = 5; i < 10; i++) {
     Name d = deviceNamePrefix;
     Name b = baseNamePrefix;
     d.appendComp(i);
@@ -122,8 +138,7 @@
 
   // add back 3 to 7, 3 and 4 should not be added twice
 
-  for (uint64_t i = 3; i < 8; i++)
-  {
+  for (uint64_t i = 3; i < 8; i++) {
     Name d = deviceNamePrefix;
     Name b = baseNamePrefix;
     Checker c(d.appendComp(i), b.appendComp(i), i, 11, 1);
@@ -135,20 +150,16 @@
   BOOST_CHECK_EQUAL(g_counter, 8);
 
   map<Name, Checker>::iterator it = checkers.begin();
-  while (it != checkers.end())
-  {
+  while (it != checkers.end()) {
     map<Name, Checker>::iterator mt = m1.find(it->first);
-    if (mt == m1.end())
-    {
+    if (mt == m1.end()) {
       BOOST_FAIL("unknown task found");
     }
-    else
-    {
+    else {
       Checker c1 = it->second;
       Checker c2 = mt->second;
       BOOST_CHECK(c1 == c2);
-      if (! (c1 == c2))
-      {
+      if (!(c1 == c2)) {
         cout << "C1: " << endl;
         c1.show();
         cout << "C2: " << endl;
diff --git a/tests/unit-tests/fs-watcher-delay.t.cpp b/tests/unit-tests/fs-watcher-delay.t.cpp
index b647487..0ccd5cc 100644
--- a/tests/unit-tests/fs-watcher-delay.t.cpp
+++ b/tests/unit-tests/fs-watcher-delay.t.cpp
@@ -19,17 +19,17 @@
  */
 
 #include "fs-watcher.h"
-#include <boost/make_shared.hpp>
+#include <boost/bind.hpp>
 #include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
+#include <boost/lexical_cast.hpp>
+#include <boost/make_shared.hpp>
 #include <boost/test/unit_test.hpp>
 #include <boost/thread/thread.hpp>
-#include <boost/bind.hpp>
-#include <boost/lexical_cast.hpp>
-#include <boost/filesystem/fstream.hpp>
-#include <fstream>
-#include <set>
 #include <QtGui>
+#include <fstream>
 #include <iostream>
+#include <set>
 
 using namespace std;
 using namespace boost;
@@ -38,41 +38,42 @@
 BOOST_AUTO_TEST_SUITE(TestFsWatcherDelay)
 
 void
-onChange(const fs::path &file)
+onChange(const fs::path& file)
 {
   cerr << "onChange called" << endl;
 }
 
 void
-onDelete(const fs::path &file)
+onDelete(const fs::path& file)
 {
   cerr << "onDelete called" << endl;
 }
 
-void run(fs::path dir, FsWatcher::LocalFile_Change_Callback c, FsWatcher::LocalFile_Change_Callback d)
+void
+run(fs::path dir, FsWatcher::LocalFile_Change_Callback c, FsWatcher::LocalFile_Change_Callback d)
 {
   int x = 0;
-  QCoreApplication app (x, 0);
-  FsWatcher watcher (dir.string().c_str(), c, d);
+  QCoreApplication app(x, 0);
+  FsWatcher watcher(dir.string().c_str(), c, d);
   app.exec();
   sleep(100);
 }
 
-void SlowWrite(fs::path & file)
+void
+SlowWrite(fs::path& file)
 {
   fs::ofstream off(file, std::ios::out);
 
-  for (int i = 0; i < 10; i++){
-    off << i  << endl;
+  for (int i = 0; i < 10; i++) {
+    off << i << endl;
     usleep(200000);
   }
 }
 
-BOOST_AUTO_TEST_CASE (TestFsWatcherDelay)
+BOOST_AUTO_TEST_CASE(TestFsWatcherDelay)
 {
   fs::path dir = fs::absolute(fs::path("TestFsWatcher"));
-  if (fs::exists(dir))
-  {
+  if (fs::exists(dir)) {
     fs::remove_all(dir);
   }
 
@@ -88,12 +89,10 @@
   thread writeThread(SlowWrite, file);
 
 
-
   usleep(10000000);
 
   // cleanup
-  if (fs::exists(dir))
-  {
+  if (fs::exists(dir)) {
     fs::remove_all(dir);
   }
 
diff --git a/tests/unit-tests/fs-watcher.t.cpp b/tests/unit-tests/fs-watcher.t.cpp
index e74c06a..22b1838 100644
--- a/tests/unit-tests/fs-watcher.t.cpp
+++ b/tests/unit-tests/fs-watcher.t.cpp
@@ -17,18 +17,16 @@
  *
  * See AUTHORS.md for complete list of ChronoShare authors and contributors.
  */
-
 #include "fs-watcher.hpp"
-#include <boost/make_shared.hpp>
+#include <boost/bind.hpp>
 #include <boost/filesystem.hpp>
+#include <boost/lexical_cast.hpp>
+#include <boost/make_shared.hpp>
 #include <boost/test/unit_test.hpp>
 #include <boost/thread/thread.hpp>
-#include <boost/bind.hpp>
-#include <boost/lexical_cast.hpp>
+#include <QtGui>
 #include <fstream>
 #include <set>
-#include <QtGui>
-#include <iostream>
 
 using namespace std;
 using namespace boost;
@@ -37,45 +35,44 @@
 BOOST_AUTO_TEST_SUITE(TestFsWatcher)
 
 void
-onChange(set<string> &files, const fs::path &file)
+onChange(set<string>& files, const fs::path& file)
 {
   cerr << "onChange called" << endl;
   files.insert(file.string());
 }
 
 void
-onDelete(set<string> &files, const fs::path &file)
+onDelete(set<string>& files, const fs::path& file)
 {
   files.erase(file.string());
 }
 
-void create_file( const fs::path & ph, const std::string & contents )
+void
+create_file(const fs::path& ph, const std::string& contents)
 {
-  std::ofstream f( ph.string().c_str() );
-  if ( !f )
-  {
+  std::ofstream f(ph.string().c_str());
+  if (!f) {
     abort();
   }
-  if ( !contents.empty() )
-  {
+  if (!contents.empty()) {
     f << contents;
   }
 }
 
-void run(fs::path dir, FsWatcher::LocalFile_Change_Callback c, FsWatcher::LocalFile_Change_Callback d)
+void
+run(fs::path dir, FsWatcher::LocalFile_Change_Callback c, FsWatcher::LocalFile_Change_Callback d)
 {
   int x = 0;
-  QCoreApplication app (x, 0);
-  FsWatcher watcher (dir.string().c_str(), c, d);
+  QCoreApplication app(x, 0);
+  FsWatcher watcher(dir.string().c_str(), c, d);
   app.exec();
   sleep(100);
 }
 
-BOOST_AUTO_TEST_CASE (TestFsWatcher)
+BOOST_AUTO_TEST_CASE(TestFsWatcher)
 {
   fs::path dir = fs::absolute(fs::path("TestFsWatcher"));
-  if (fs::exists(dir))
-  {
+  if (fs::exists(dir)) {
     fs::remove_all(dir);
   }
 
@@ -83,7 +80,7 @@
 
   set<string> files;
 
-  FsWatcher::LocalFile_Change_Callback fileChange = boost::bind(onChange,ref(files), _1);
+  FsWatcher::LocalFile_Change_Callback fileChange = boost::bind(onChange, ref(files), _1);
   FsWatcher::LocalFile_Change_Callback fileDelete = boost::bind(onDelete, ref(files), _1);
 
   thread workThread(run, dir, fileChange, fileDelete);
@@ -100,8 +97,7 @@
   // =========== check create a bunch of files in sub dir =============
   fs::path subdir = dir / "sub";
   fs::create_directory(subdir);
-  for (int i = 0; i < 10; i++)
-  {
+  for (int i = 0; i < 10; i++) {
     string filename = boost::lexical_cast<string>(i);
     create_file(subdir / filename.c_str(), boost::lexical_cast<string>(i));
   }
@@ -110,18 +106,16 @@
   // test.txt
   // sub/0..9
   BOOST_CHECK_EQUAL(files.size(), 11);
-  for (int i = 0; i < 10; i++)
-  {
+  for (int i = 0; i < 10; i++) {
     string filename = boost::lexical_cast<string>(i);
-    BOOST_CHECK(files.find("sub/" +filename) != files.end());
+    BOOST_CHECK(files.find("sub/" + filename) != files.end());
   }
 
   // ============== check copy directory with files to two levels of sub dirs =================
   fs::create_directory(dir / "sub1");
   fs::path subdir1 = dir / "sub1" / "sub2";
   fs::copy_directory(subdir, subdir1);
-  for (int i = 0; i < 5; i++)
-  {
+  for (int i = 0; i < 5; i++) {
     string filename = boost::lexical_cast<string>(i);
     fs::copy_file(subdir / filename.c_str(), subdir1 / filename.c_str());
   }
@@ -131,15 +125,13 @@
   // sub/0..9
   // sub1/sub2/0..4
   BOOST_CHECK_EQUAL(files.size(), 16);
-  for (int i = 0; i < 5; i++)
-  {
+  for (int i = 0; i < 5; i++) {
     string filename = boost::lexical_cast<string>(i);
     BOOST_CHECK(files.find("sub1/sub2/" + filename) != files.end());
   }
 
   // =============== check remove files =========================
-  for (int i = 0; i < 7; i++)
-  {
+  for (int i = 0; i < 7; i++) {
     string filename = boost::lexical_cast<string>(i);
     fs::remove(subdir / filename.c_str());
   }
@@ -148,8 +140,7 @@
   // sub/7..9
   // sub1/sub2/0..4
   BOOST_CHECK_EQUAL(files.size(), 9);
-  for (int i = 0; i < 10; i++)
-  {
+  for (int i = 0; i < 10; i++) {
     string filename = boost::lexical_cast<string>(i);
     if (i < 7)
       BOOST_CHECK(files.find("sub/" + filename) == files.end());
@@ -159,8 +150,7 @@
 
   // =================== check remove files again, remove the whole dir this time ===================
   // before remove check
-  for (int i = 0; i < 5; i++)
-  {
+  for (int i = 0; i < 5; i++) {
     string filename = boost::lexical_cast<string>(i);
     BOOST_CHECK(files.find("sub1/sub2/" + filename) != files.end());
   }
@@ -169,15 +159,13 @@
   BOOST_CHECK_EQUAL(files.size(), 4);
   // test.txt
   // sub/7..9
-  for (int i = 0; i < 5; i++)
-  {
+  for (int i = 0; i < 5; i++) {
     string filename = boost::lexical_cast<string>(i);
     BOOST_CHECK(files.find("sub1/sub2/" + filename) == files.end());
   }
 
   // =================== check rename files =======================
-  for (int i = 7; i < 10; i++)
-  {
+  for (int i = 7; i < 10; i++) {
     string filename = boost::lexical_cast<string>(i);
     fs::rename(subdir / filename.c_str(), dir / filename.c_str());
   }
@@ -188,8 +176,7 @@
   // 9
   // sub
   BOOST_CHECK_EQUAL(files.size(), 4);
-  for (int i = 7; i < 10; i++)
-  {
+  for (int i = 7; i < 10; i++) {
     string filename = boost::lexical_cast<string>(i);
     BOOST_CHECK(files.find("sub/" + filename) == files.end());
     BOOST_CHECK(files.find(filename) != files.end());
@@ -197,31 +184,30 @@
 
   create_file(dir / "add-removal-check.txt", "add-removal-check");
   usleep(1200000);
-  BOOST_CHECK (files.find("add-removal-check.txt") != files.end());
+  BOOST_CHECK(files.find("add-removal-check.txt") != files.end());
 
-  fs::remove (dir / "add-removal-check.txt");
+  fs::remove(dir / "add-removal-check.txt");
   usleep(1200000);
-  BOOST_CHECK (files.find("add-removal-check.txt") == files.end());
+  BOOST_CHECK(files.find("add-removal-check.txt") == files.end());
 
   create_file(dir / "add-removal-check.txt", "add-removal-check");
   usleep(1200000);
-  BOOST_CHECK (files.find("add-removal-check.txt") != files.end());
+  BOOST_CHECK(files.find("add-removal-check.txt") != files.end());
 
-  fs::remove (dir / "add-removal-check.txt");
+  fs::remove(dir / "add-removal-check.txt");
   usleep(1200000);
-  BOOST_CHECK (files.find("add-removal-check.txt") == files.end());
+  BOOST_CHECK(files.find("add-removal-check.txt") == files.end());
 
   create_file(dir / "add-removal-check.txt", "add-removal-check");
   usleep(1200000);
-  BOOST_CHECK (files.find("add-removal-check.txt") != files.end());
+  BOOST_CHECK(files.find("add-removal-check.txt") != files.end());
 
-  fs::remove (dir / "add-removal-check.txt");
+  fs::remove(dir / "add-removal-check.txt");
   usleep(1200000);
-  BOOST_CHECK (files.find("add-removal-check.txt") == files.end());
+  BOOST_CHECK(files.find("add-removal-check.txt") == files.end());
 
   // cleanup
-  if (fs::exists(dir))
-  {
+  if (fs::exists(dir)) {
     fs::remove_all(dir);
   }
 }
diff --git a/tests/unit-tests/object-manager.t.cpp b/tests/unit-tests/object-manager.t.cpp
index 8cbc97e..c19cd75 100644
--- a/tests/unit-tests/object-manager.t.cpp
+++ b/tests/unit-tests/object-manager.t.cpp
@@ -24,13 +24,13 @@
 #include <boost/filesystem.hpp>
 #include <boost/filesystem/fstream.hpp>
 
-#include <boost/test/unit_test.hpp>
-#include <unistd.h>
 #include <boost/make_shared.hpp>
+#include <boost/test/unit_test.hpp>
 #include <iostream>
 #include <iterator>
+#include <unistd.h>
 
-INIT_LOGGER ("Test.ObjectManager");
+INIT_LOGGER("Test.ObjectManager");
 
 using namespace Ndnx;
 using namespace std;
@@ -39,36 +39,35 @@
 
 BOOST_AUTO_TEST_SUITE(TestObjectManager)
 
-BOOST_AUTO_TEST_CASE (ObjectManagerTest)
+BOOST_AUTO_TEST_CASE(ObjectManagerTest)
 {
-  INIT_LOGGERS ();
+  INIT_LOGGERS();
 
-  fs::path tmpdir = fs::unique_path (fs::temp_directory_path () / "%%%%-%%%%-%%%%-%%%%");
-  _LOG_DEBUG ("tmpdir: " << tmpdir);
-  Name deviceName ("/device");
+  fs::path tmpdir = fs::unique_path(fs::temp_directory_path() / "%%%%-%%%%-%%%%-%%%%");
+  _LOG_DEBUG("tmpdir: " << tmpdir);
+  Name deviceName("/device");
 
-  NdnxWrapperPtr ndnx = make_shared<NdnxWrapper> ();
-  ObjectManager manager (ndnx, tmpdir, "test-chronoshare");
+  CcnxWrapperPtr ccnx = make_shared<CcnxWrapper>();
+  ObjectManager manager(ccnx, tmpdir, "test-chronoshare");
 
-  tuple<HashPtr,int> hash_semgents = manager.localFileToObjects (fs::path("test") / "test-object-manager.cc", deviceName);
+  tuple<HashPtr, int> hash_semgents =
+    manager.localFileToObjects(fs::path("test") / "test-object-manager.cc", deviceName);
 
-  BOOST_CHECK_EQUAL (hash_semgents.get<1> (), 3);
+  BOOST_CHECK_EQUAL(hash_semgents.get<1>(), 3);
 
-  bool ok = manager.objectsToLocalFile (deviceName, *hash_semgents.get<0> (), tmpdir / "test.cc");
-  BOOST_CHECK_EQUAL (ok, true);
+  bool ok = manager.objectsToLocalFile(deviceName, *hash_semgents.get<0>(), tmpdir / "test.cc");
+  BOOST_CHECK_EQUAL(ok, true);
 
   {
-    fs::ifstream origFile (fs::path("test") / "test-object-manager.cc");
-    fs::ifstream newFile (tmpdir / "test.cc");
+    fs::ifstream origFile(fs::path("test") / "test-object-manager.cc");
+    fs::ifstream newFile(tmpdir / "test.cc");
 
-    istream_iterator<char> eof,
-      origFileI (origFile),
-      newFileI (newFile);
+    istream_iterator<char> eof, origFileI(origFile), newFileI(newFile);
 
-    BOOST_CHECK_EQUAL_COLLECTIONS (origFileI, eof, newFileI, eof);
+    BOOST_CHECK_EQUAL_COLLECTIONS(origFileI, eof, newFileI, eof);
   }
 
-  remove_all (tmpdir);
+  remove_all(tmpdir);
 }
 
 
diff --git a/tests/unit-tests/protobuf.t.cpp b/tests/unit-tests/protobuf.t.cpp
index 5bd0f1b..6bf6f23 100644
--- a/tests/unit-tests/protobuf.t.cpp
+++ b/tests/unit-tests/protobuf.t.cpp
@@ -17,16 +17,15 @@
  *
  * See AUTHORS.md for complete list of ChronoShare authors and contributors.
  */
-
 #include "ccnx-common.hpp"
 #include "sync-core.hpp"
-#include <boost/make_shared.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/iostreams/device/back_inserter.hpp>
 #include <boost/iostreams/filter/gzip.hpp>
 #include <boost/iostreams/filtering_stream.hpp>
-#include <boost/iostreams/device/back_inserter.hpp>
-#include <boost/range/iterator_range.hpp>
 #include <boost/make_shared.hpp>
+#include <boost/make_shared.hpp>
+#include <boost/range/iterator_range.hpp>
+#include <boost/test/unit_test.hpp>
 
 using namespace Ndnx;
 using namespace std;
@@ -35,11 +34,11 @@
 BOOST_AUTO_TEST_SUITE(ProtobufTests)
 
 
-BOOST_AUTO_TEST_CASE (TestGzipProtobuf)
+BOOST_AUTO_TEST_CASE(TestGzipProtobuf)
 {
   SyncStateMsgPtr msg = make_shared<SyncStateMsg>();
 
-  SyncState *state = msg->add_state();
+  SyncState* state = msg->add_state();
   state->set_type(SyncState::UPDATE);
   state->set_seq(100);
   char x[100] = {'a'};
@@ -50,7 +49,7 @@
 
   BytesPtr cb = serializeGZipMsg<SyncStateMsg>(*msg);
   BOOST_CHECK(cb->size() < bb->size());
-  cout << cb->size() <<", " << bb->size() << endl;
+  cout << cb->size() << ", " << bb->size() << endl;
 
   SyncStateMsgPtr msg1 = deserializeGZipMsg<SyncStateMsg>(*cb);
 
diff --git a/tests/unit-tests/serve-and-fetch.t.cpp b/tests/unit-tests/serve-and-fetch.t.cpp
index 8e8a3c6..d9aa6c7 100644
--- a/tests/unit-tests/serve-and-fetch.t.cpp
+++ b/tests/unit-tests/serve-and-fetch.t.cpp
@@ -18,22 +18,22 @@
  * See AUTHORS.md for complete list of ChronoShare authors and contributors.
  */
 
-#include "fetch-manager.hpp"
-#include "ccnx-wrapper.hpp"
 #include "ccnx-common.hpp"
-#include "scheduler.hpp"
+#include "ccnx-wrapper.hpp"
+#include "content-server.hpp"
+#include "fetch-manager.hpp"
 #include "object-db.hpp"
 #include "object-manager.hpp"
-#include "content-server.hpp"
-#include <boost/test/unit_test.hpp>
-#include <boost/make_shared.hpp>
+#include "scheduler.hpp"
 #include <boost/filesystem.hpp>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/locks.hpp>
-#include <boost/thread/thread_time.hpp>
+#include <boost/make_shared.hpp>
+#include <boost/test/unit_test.hpp>
 #include <boost/thread/condition_variable.hpp>
-#include <stdio.h>
+#include <boost/thread/locks.hpp>
+#include <boost/thread/mutex.hpp>
+#include <boost/thread/thread_time.hpp>
 #include <ctime>
+#include <stdio.h>
 
 #include "logging.hpp"
 
@@ -55,19 +55,18 @@
 bool finished;
 int ack;
 
-void setup()
+void
+setup()
 {
-  if (exists(root))
-  {
+  if (exists(root)) {
     remove_all(root);
   }
 
   create_directory(root);
 
   // create file
-  FILE *fp = fopen(filePath.string().c_str(), "w");
-  for (int i = 0; i < repeat; i++)
-  {
+  FILE* fp = fopen(filePath.string().c_str(), "w");
+  for (int i = 0; i < repeat; i++) {
     fwrite(&magic, 1, sizeof(magic), fp);
   }
   fclose(fp);
@@ -76,10 +75,10 @@
   finished = false;
 }
 
-void teardown()
+void
+teardown()
 {
-  if (exists(root))
-  {
+  if (exists(root)) {
     remove_all(root);
   }
 
@@ -88,25 +87,24 @@
 }
 
 Name
-simpleMap(const Name &deviceName)
+simpleMap(const Name& deviceName)
 {
   return Name("/local");
 }
 
 void
-segmentCallback(const Name &deviceName, const Name &baseName, uint64_t seq, PcoPtr pco)
+segmentCallback(const Name& deviceName, const Name& baseName, uint64_t seq, PcoPtr pco)
 {
   ack++;
   Bytes co = pco->content();
   int size = co.size();
-  for (int i = 0; i < size; i++)
-  {
+  for (int i = 0; i < size; i++) {
     BOOST_CHECK_EQUAL(co[i], magic);
   }
 }
 
 void
-finishCallback(Name &deviceName, Name &baseName)
+finishCallback(Name& deviceName, Name& baseName)
 {
   BOOST_CHECK_EQUAL(ack, repeat / 1024);
   unique_lock<mutex> lock(mut);
@@ -114,11 +112,11 @@
   cond.notify_one();
 }
 
-BOOST_AUTO_TEST_CASE (TestServeAndFetch)
+BOOST_AUTO_TEST_CASE(TestServeAndFetch)
 {
-  INIT_LOGGERS ();
+  INIT_LOGGERS();
 
-  _LOG_DEBUG ("Setting up test environment ...");
+  _LOG_DEBUG("Setting up test environment ...");
   setup();
 
   NdnxWrapperPtr ndnx_serve = make_shared<NdnxWrapper>();
@@ -132,38 +130,38 @@
   const string APPNAME = "test-chronoshare";
 
   time_t start = time(NULL);
-  _LOG_DEBUG ("At time " << start << ", publish local file to database, this is extremely slow ...");
+  _LOG_DEBUG("At time " << start << ", publish local file to database, this is extremely slow ...");
   // publish file to db
   ObjectManager om(ndnx_serve, root, APPNAME);
   tuple<HashPtr, size_t> pub = om.localFileToObjects(filePath, deviceName);
   time_t end = time(NULL);
-  _LOG_DEBUG ("At time " << end <<", publish finally finished, used " << end - start << " seconds ...");
+  _LOG_DEBUG("At time " << end << ", publish finally finished, used " << end - start
+                        << " seconds ...");
 
   ActionLogPtr dummyLog;
   ContentServer server(ndnx_serve, dummyLog, root, deviceName, "pentagon's secrets", APPNAME, 5);
   server.registerPrefix(localPrefix);
   server.registerPrefix(broadcastPrefix);
 
-  FetchManager fm(ndnx_fetch, bind(simpleMap, _1), Name("/local/broadcast"));
-  HashPtr hash = pub.get<0> ();
-  Name baseName = Name ("/")(deviceName)(APPNAME)("file")(hash->GetHash(), hash->GetHashBytes());
+  FetchManager fm(ccnx_fetch, bind(simpleMap, _1), Name("/local/broadcast"));
+  HashPtr hash = pub.get<0>();
+  Name baseName = Name("/")(deviceName)(APPNAME)("file")(hash->GetHash(), hash->GetHashBytes());
 
-  fm.Enqueue(deviceName, baseName, bind(segmentCallback, _1, _2, _3, _4), bind(finishCallback, _1, _2), 0, pub.get<1>() - 1);
+  fm.Enqueue(deviceName, baseName, bind(segmentCallback, _1, _2, _3, _4),
+             bind(finishCallback, _1, _2), 0, pub.get<1>() - 1);
 
   unique_lock<mutex> lock(mut);
   system_time timeout = get_system_time() + posix_time::milliseconds(5000);
-  while (!finished)
-    {
-      if (!cond.timed_wait(lock, timeout))
-        {
-          BOOST_FAIL ("Fetching has not finished after 5 seconds");
-          break;
-        }
+  while (!finished) {
+    if (!cond.timed_wait(lock, timeout)) {
+      BOOST_FAIL("Fetching has not finished after 5 seconds");
+      break;
     }
-  ndnx_fetch->shutdown ();
-  ndnx_serve->shutdown ();
+  }
+  ccnx_fetch->shutdown();
+  ccnx_serve->shutdown();
 
-  _LOG_DEBUG ("Finish");
+  _LOG_DEBUG("Finish");
   usleep(100000);
 
   teardown();
diff --git a/tests/unit-tests/sync-core.t.cpp b/tests/unit-tests/sync-core.t.cpp
index bfdaec2..0d55fd1 100644
--- a/tests/unit-tests/sync-core.t.cpp
+++ b/tests/unit-tests/sync-core.t.cpp
@@ -17,13 +17,12 @@
  *
  * See AUTHORS.md for complete list of ChronoShare authors and contributors.
  */
-
-#include "sync-core.hpp"
 #include "logging.hpp"
+#include "sync-core.hpp"
 
-#include <boost/test/unit_test.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/make_shared.hpp>
+#include <boost/test/unit_test.hpp>
 
 using namespace std;
 using namespace Ndnx;
@@ -34,25 +33,25 @@
 
 BOOST_AUTO_TEST_SUITE(SyncCoreTests)
 
-void callback(const SyncStateMsgPtr &msg)
+void
+callback(const SyncStateMsgPtr& msg)
 {
   BOOST_CHECK(msg->state_size() > 0);
   int size = msg->state_size();
   int index = 0;
-  while (index < size)
-  {
+  while (index < size) {
     SyncState state = msg->state(index);
     BOOST_CHECK(state.has_old_seq());
     BOOST_CHECK(state.old_seq() >= 0);
-    if (state.seq() != 0)
-    {
+    if (state.seq() != 0) {
       BOOST_CHECK(state.old_seq() != state.seq());
     }
     index++;
   }
 }
 
-void checkRoots(const HashPtr &root1, const HashPtr &root2)
+void
+checkRoots(const HashPtr& root1, const HashPtr& root2)
 {
   BOOST_CHECK_EQUAL(*root1, *root2);
 }
@@ -64,8 +63,7 @@
   string dir = "./SyncCoreTest";
   // clean the test dir
   path d(dir);
-  if (exists(d))
-  {
+  if (exists(d)) {
     remove_all(d);
   }
 
@@ -81,9 +79,9 @@
   SyncLogPtr log1(new SyncLog(dir1, user1.toString()));
   SyncLogPtr log2(new SyncLog(dir2, user2.toString()));
 
-  SyncCore *core1 = new SyncCore(log1, user1, loc1, syncPrefix, bind(callback, _1), c1);
+  SyncCore* core1 = new SyncCore(log1, user1, loc1, syncPrefix, bind(callback, _1), c1);
   usleep(10000);
-  SyncCore *core2 = new SyncCore(log2, user2, loc2, syncPrefix, bind(callback, _1), c2);
+  SyncCore* core2 = new SyncCore(log2, user2, loc2, syncPrefix, bind(callback, _1), c2);
 
   sleep(1);
   checkRoots(core1->root(), core2->root());
@@ -94,23 +92,23 @@
   usleep(100000);
   checkRoots(core1->root(), core2->root());
   BOOST_CHECK_EQUAL(core2->seq(user1), 1);
-  BOOST_CHECK_EQUAL(log2->LookupLocator (user1), loc1);
+  BOOST_CHECK_EQUAL(log2->LookupLocator(user1), loc1);
 
   core1->updateLocalState(5);
   usleep(100000);
   checkRoots(core1->root(), core2->root());
   BOOST_CHECK_EQUAL(core2->seq(user1), 5);
-  BOOST_CHECK_EQUAL(log2->LookupLocator (user1), loc1);
+  BOOST_CHECK_EQUAL(log2->LookupLocator(user1), loc1);
 
   core2->updateLocalState(10);
   usleep(100000);
   checkRoots(core1->root(), core2->root());
   BOOST_CHECK_EQUAL(core1->seq(user2), 10);
-  BOOST_CHECK_EQUAL(log1->LookupLocator (user2), loc2);
+  BOOST_CHECK_EQUAL(log1->LookupLocator(user2), loc2);
 
   // simple simultaneous data generation
   // _LOG_TRACE ("\n\n\n\n\n\n----------Simultaneous\n");
-  _LOG_TRACE ("Simultaneous");
+  _LOG_TRACE("Simultaneous");
 
   core1->updateLocalState(11);
   usleep(100);
@@ -120,14 +118,13 @@
   BOOST_CHECK_EQUAL(core1->seq(user2), 15);
   BOOST_CHECK_EQUAL(core2->seq(user1), 11);
 
-  BOOST_CHECK_EQUAL(log1->LookupLocator (user1), loc1);
-  BOOST_CHECK_EQUAL(log1->LookupLocator (user2), loc2);
-  BOOST_CHECK_EQUAL(log2->LookupLocator (user1), loc1);
-  BOOST_CHECK_EQUAL(log2->LookupLocator (user2), loc2);
+  BOOST_CHECK_EQUAL(log1->LookupLocator(user1), loc1);
+  BOOST_CHECK_EQUAL(log1->LookupLocator(user2), loc2);
+  BOOST_CHECK_EQUAL(log2->LookupLocator(user1), loc1);
+  BOOST_CHECK_EQUAL(log2->LookupLocator(user2), loc2);
 
   // clean the test dir
-  if (exists(d))
-  {
+  if (exists(d)) {
     remove_all(d);
   }
 }
diff --git a/tests/unit-tests/sync-log.t.cpp b/tests/unit-tests/sync-log.t.cpp
index cfb8971..9e9ebb0 100644
--- a/tests/unit-tests/sync-log.t.cpp
+++ b/tests/unit-tests/sync-log.t.cpp
@@ -18,15 +18,15 @@
  * See AUTHORS.md for complete list of ChronoShare authors and contributors.
  */
 
-#include <boost/test/unit_test.hpp>
 #include <boost/lexical_cast.hpp>
+#include <boost/test/unit_test.hpp>
 
-#include "logging.hpp"
-#include <unistd.h>
 #include "action-log.hpp"
-#include <iostream>
-#include <ndnx-name.h>
+#include "logging.hpp"
 #include <boost/filesystem.hpp>
+#include <ccnx-name.hpp>
+#include <iostream>
+#include <unistd.h>
 
 using namespace std;
 using namespace boost;
@@ -36,75 +36,85 @@
 BOOST_AUTO_TEST_SUITE(TestSyncLog)
 
 
-BOOST_AUTO_TEST_CASE (BasicDatabaseTest)
+BOOST_AUTO_TEST_CASE(BasicDatabaseTest)
 {
-  INIT_LOGGERS ();
+  INIT_LOGGERS();
 
-  fs::path tmpdir = fs::unique_path (fs::temp_directory_path () / "%%%%-%%%%-%%%%-%%%%");
-  SyncLog db (tmpdir, Name ("/alex"));
+  fs::path tmpdir = fs::unique_path(fs::temp_directory_path() / "%%%%-%%%%-%%%%-%%%%");
+  SyncLog db(tmpdir, Name("/alex"));
 
-  HashPtr hash = db.RememberStateInStateLog ();
+  HashPtr hash = db.RememberStateInStateLog();
   // should be empty
-  BOOST_CHECK_EQUAL (lexical_cast<string> (*hash), "7a6f2c1eefd539560d2dc3e5542868a79810d0867db15d9b87e41ec105899405");
+  BOOST_CHECK_EQUAL(lexical_cast<string>(*hash),
+                    "7a6f2c1eefd539560d2dc3e5542868a79810d0867db15d9b87e41ec105899405");
 
-  db.UpdateDeviceSeqNo (Name ("/alex"), 1);
-  hash = db.RememberStateInStateLog ();
+  db.UpdateDeviceSeqNo(Name("/alex"), 1);
+  hash = db.RememberStateInStateLog();
 
-  BOOST_CHECK_EQUAL (lexical_cast<string> (*hash), "3410477233f98d6c3f9a6f8da24494bf5a65e1a7c9f4f66b228128bd4e020558");
+  BOOST_CHECK_EQUAL(lexical_cast<string>(*hash),
+                    "3410477233f98d6c3f9a6f8da24494bf5a65e1a7c9f4f66b228128bd4e020558");
 
-  db.UpdateDeviceSeqNo (Name ("/alex"), 2);
-  hash = db.RememberStateInStateLog ();
-  BOOST_CHECK_EQUAL (lexical_cast<string> (*hash), "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c");
+  db.UpdateDeviceSeqNo(Name("/alex"), 2);
+  hash = db.RememberStateInStateLog();
+  BOOST_CHECK_EQUAL(lexical_cast<string>(*hash),
+                    "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c");
 
-  db.UpdateDeviceSeqNo (Name ("/alex"), 2);
-  hash = db.RememberStateInStateLog ();
-  BOOST_CHECK_EQUAL (lexical_cast<string> (*hash), "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c");
+  db.UpdateDeviceSeqNo(Name("/alex"), 2);
+  hash = db.RememberStateInStateLog();
+  BOOST_CHECK_EQUAL(lexical_cast<string>(*hash),
+                    "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c");
 
-  db.UpdateDeviceSeqNo (Name ("/alex"), 1);
-  hash = db.RememberStateInStateLog ();
-  BOOST_CHECK_EQUAL (lexical_cast<string> (*hash), "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c");
+  db.UpdateDeviceSeqNo(Name("/alex"), 1);
+  hash = db.RememberStateInStateLog();
+  BOOST_CHECK_EQUAL(lexical_cast<string>(*hash),
+                    "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c");
 
-  db.UpdateLocator(Name ("/alex"), Name("/hawaii"));
+  db.UpdateLocator(Name("/alex"), Name("/hawaii"));
 
-  BOOST_CHECK_EQUAL(db.LookupLocator(Name ("/alex")), Name ("/hawaii"));
+  BOOST_CHECK_EQUAL(db.LookupLocator(Name("/alex")), Name("/hawaii"));
 
-  SyncStateMsgPtr msg = db.FindStateDifferences ("00", "95284d3132a7a88b85c5141ca63efa68b7a7daf37315def69e296a0c24692833");
-  BOOST_CHECK_EQUAL (msg->state_size(), 0);
+  SyncStateMsgPtr msg =
+    db.FindStateDifferences("00", "95284d3132a7a88b85c5141ca63efa68b7a7daf37315def69e296a0c24692833");
+  BOOST_CHECK_EQUAL(msg->state_size(), 0);
 
-  msg = db.FindStateDifferences ("00", "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c");
-  BOOST_CHECK_EQUAL (msg->state_size(), 1);
-  BOOST_CHECK_EQUAL (msg->state (0).type (), SyncState::UPDATE);
-  BOOST_CHECK_EQUAL (msg->state (0).seq (), 2);
+  msg = db.FindStateDifferences("00",
+                                "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c");
+  BOOST_CHECK_EQUAL(msg->state_size(), 1);
+  BOOST_CHECK_EQUAL(msg->state(0).type(), SyncState::UPDATE);
+  BOOST_CHECK_EQUAL(msg->state(0).seq(), 2);
 
-  msg = db.FindStateDifferences ("2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c", "00");
-  BOOST_CHECK_EQUAL (msg->state_size(), 1);
-  BOOST_CHECK_EQUAL (msg->state (0).type (), SyncState::DELETE);
+  msg = db.FindStateDifferences("2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c",
+                                "00");
+  BOOST_CHECK_EQUAL(msg->state_size(), 1);
+  BOOST_CHECK_EQUAL(msg->state(0).type(), SyncState::DELETE);
 
-  msg = db.FindStateDifferences ("7a6f2c1eefd539560d2dc3e5542868a79810d0867db15d9b87e41ec105899405",
-                                 "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c");
-  BOOST_CHECK_EQUAL (msg->state_size(), 1);
-  BOOST_CHECK_EQUAL (msg->state (0).type (), SyncState::UPDATE);
-  BOOST_CHECK_EQUAL (msg->state (0).seq (), 2);
+  msg = db.FindStateDifferences("7a6f2c1eefd539560d2dc3e5542868a79810d0867db15d9b87e41ec105899405",
+                                "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c");
+  BOOST_CHECK_EQUAL(msg->state_size(), 1);
+  BOOST_CHECK_EQUAL(msg->state(0).type(), SyncState::UPDATE);
+  BOOST_CHECK_EQUAL(msg->state(0).seq(), 2);
 
-  msg = db.FindStateDifferences ("2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c",
-                                 "7a6f2c1eefd539560d2dc3e5542868a79810d0867db15d9b87e41ec105899405");
-  BOOST_CHECK_EQUAL (msg->state_size(), 1);
-  BOOST_CHECK_EQUAL (msg->state (0).type (), SyncState::UPDATE);
-  BOOST_CHECK_EQUAL (msg->state (0).seq (), 0);
+  msg = db.FindStateDifferences("2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c",
+                                "7a6f2c1eefd539560d2dc3e5542868a79810d0867db15d9b87e41ec105899405");
+  BOOST_CHECK_EQUAL(msg->state_size(), 1);
+  BOOST_CHECK_EQUAL(msg->state(0).type(), SyncState::UPDATE);
+  BOOST_CHECK_EQUAL(msg->state(0).seq(), 0);
 
-  db.UpdateDeviceSeqNo (Name ("/bob"), 1);
-  hash = db.RememberStateInStateLog ();
-  BOOST_CHECK_EQUAL (lexical_cast<string> (*hash), "5df5affc07120335089525e82ec9fda60c6dccd7addb667106fb79de80610519");
+  db.UpdateDeviceSeqNo(Name("/bob"), 1);
+  hash = db.RememberStateInStateLog();
+  BOOST_CHECK_EQUAL(lexical_cast<string>(*hash),
+                    "5df5affc07120335089525e82ec9fda60c6dccd7addb667106fb79de80610519");
 
-  msg = db.FindStateDifferences ("00", "5df5affc07120335089525e82ec9fda60c6dccd7addb667106fb79de80610519");
-  BOOST_CHECK_EQUAL (msg->state_size(), 2);
-  BOOST_CHECK_EQUAL (msg->state (0).type (), SyncState::UPDATE);
-  BOOST_CHECK_EQUAL (msg->state (0).seq (), 2);
+  msg = db.FindStateDifferences("00",
+                                "5df5affc07120335089525e82ec9fda60c6dccd7addb667106fb79de80610519");
+  BOOST_CHECK_EQUAL(msg->state_size(), 2);
+  BOOST_CHECK_EQUAL(msg->state(0).type(), SyncState::UPDATE);
+  BOOST_CHECK_EQUAL(msg->state(0).seq(), 2);
 
-  BOOST_CHECK_EQUAL (msg->state (1).type (), SyncState::UPDATE);
-  BOOST_CHECK_EQUAL (msg->state (1).seq (), 1);
+  BOOST_CHECK_EQUAL(msg->state(1).type(), SyncState::UPDATE);
+  BOOST_CHECK_EQUAL(msg->state(1).seq(), 1);
 
-  remove_all (tmpdir);
+  remove_all(tmpdir);
 }
 
 BOOST_AUTO_TEST_SUITE_END()