diff --git a/tests/test-common.cpp b/tests/test-common.cpp
index b9a9464..55b566e 100644
--- a/tests/test-common.cpp
+++ b/tests/test-common.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016, Regents of the University of California,
+ * Copyright (c) 2014-2017, Regents of the University of California,
  *                          Arizona Board of Regents,
  *                          Colorado State University,
  *                          University Pierre & Marie Curie, Sorbonne University,
@@ -26,6 +26,8 @@
  */
 
 #include "test-common.hpp"
+
+#include <ndn-cxx/util/digest.hpp>
 #include <ndn-cxx/security/signature-sha256-with-rsa.hpp>
 
 namespace ndn {
@@ -121,6 +123,14 @@
   return nack;
 }
 
+ConstBufferPtr
+digestFromFile(const boost::filesystem::path& filename)
+{
+  boost::filesystem::ifstream iff(filename, std::ios::in | std::ios::binary);
+  util::Sha256 digest(iff);
+  return digest.computeDigest();
+}
+
 } // namespace tests
 } // namespace chronoshare
 } // namespace ndn
diff --git a/tests/test-common.hpp b/tests/test-common.hpp
index 6802e60..afbdac3 100644
--- a/tests/test-common.hpp
+++ b/tests/test-common.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016, Regents of the University of California,
+ * Copyright (c) 2014-2017, Regents of the University of California,
  *                          Arizona Board of Regents,
  *                          Colorado State University,
  *                          University Pierre & Marie Curie, Sorbonne University,
@@ -34,6 +34,7 @@
 
 #include <boost/asio/io_service.hpp>
 #include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
 
 #include <ndn-cxx/name.hpp>
 #include <ndn-cxx/data.hpp>
@@ -165,6 +166,11 @@
   packet.setName(name);
 }
 
+/** \brief convert file to digest
+ */
+ndn::ConstBufferPtr
+digestFromFile(const boost::filesystem::path& filename);
+
 } // namespace tests
 } // namespace chronoshare
 } // namespace ndn
diff --git a/tests/unit-tests/sync-core.t.cpp b/tests/unit-tests/sync-core.t.cpp
index 0d55fd1..5fdd5fa 100644
--- a/tests/unit-tests/sync-core.t.cpp
+++ b/tests/unit-tests/sync-core.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2016, Regents of the University of California.
+ * Copyright (c) 2013-2017, Regents of the University of California.
  *
  * This file is part of ChronoShare, a decentralized file sharing application over NDN.
  *
@@ -17,32 +17,44 @@
  *
  * See AUTHORS.md for complete list of ChronoShare authors and contributors.
  */
-#include "logging.hpp"
+
 #include "sync-core.hpp"
 
-#include <boost/filesystem.hpp>
-#include <boost/make_shared.hpp>
-#include <boost/test/unit_test.hpp>
+#include "test-common.hpp"
 
-using namespace std;
-using namespace Ndnx;
-using namespace boost;
-using namespace boost::filesystem;
+namespace ndn {
+namespace chronoshare {
+namespace tests {
 
-INIT_LOGGER("Test.SyncCore");
+namespace fs = boost::filesystem;
 
-BOOST_AUTO_TEST_SUITE(SyncCoreTests)
+INIT_LOGGER("Test.SyncCore")
+
+class TestSyncCoreFixture : public IdentityManagementTimeFixture
+{
+public:
+  void
+  advanceClocks()
+  {
+    for (int i = 0; i < 100; ++i) {
+      usleep(10000);
+      IdentityManagementTimeFixture::advanceClocks(time::milliseconds(10), 1);
+    }
+  }
+};
+
+BOOST_FIXTURE_TEST_SUITE(TestSyncCore, TestSyncCoreFixture)
 
 void
 callback(const SyncStateMsgPtr& msg)
 {
+  _LOG_DEBUG("Callback I'm called!!!!");
   BOOST_CHECK(msg->state_size() > 0);
   int size = msg->state_size();
   int index = 0;
   while (index < size) {
     SyncState state = msg->state(index);
     BOOST_CHECK(state.has_old_seq());
-    BOOST_CHECK(state.old_seq() >= 0);
     if (state.seq() != 0) {
       BOOST_CHECK(state.old_seq() != state.seq());
     }
@@ -50,71 +62,63 @@
   }
 }
 
-void
-checkRoots(const HashPtr& root1, const HashPtr& root2)
+BOOST_AUTO_TEST_CASE(TwoNodes)
 {
-  BOOST_CHECK_EQUAL(*root1, *root2);
-}
-
-BOOST_AUTO_TEST_CASE(SyncCoreTest)
-{
-  INIT_LOGGERS();
-
-  string dir = "./SyncCoreTest";
-  // clean the test dir
-  path d(dir);
-  if (exists(d)) {
-    remove_all(d);
+  fs::path tmpdir = fs::unique_path(UNIT_TEST_CONFIG_PATH) / "SyncCoreTest";
+  if (exists(tmpdir)) {
+    remove_all(tmpdir);
   }
 
-  string dir1 = "./SyncCoreTest/1";
-  string dir2 = "./SyncCoreTest/2";
-  Name user1("/joker");
-  Name loc1("/gotham1");
-  Name user2("/darkknight");
-  Name loc2("/gotham2");
-  Name syncPrefix("/broadcast/darkknight");
-  NdnxWrapperPtr c1(new NdnxWrapper());
-  NdnxWrapperPtr c2(new NdnxWrapper());
-  SyncLogPtr log1(new SyncLog(dir1, user1.toString()));
-  SyncLogPtr log2(new SyncLog(dir2, user2.toString()));
+  std::string dir1 = (tmpdir / "1").string();
+  std::string dir2 = (tmpdir / "2").string();
+  Name user1("/shuai");
+  Name loc1("/locator1");
+  Name user2("/loli");
+  Name loc2("/locator2");
+  Name syncPrefix("/broadcast/arslan");
 
-  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);
+  shared_ptr<Face> c1 = make_shared<Face>(this->m_io);
+  auto log1 = make_shared<SyncLog>(dir1, user1);
+  auto core1 = make_shared<SyncCore>(*c1, log1, user1, loc1, syncPrefix, bind(&callback, _1));
 
-  sleep(1);
-  checkRoots(core1->root(), core2->root());
+  shared_ptr<Face> c2 = make_shared<Face>(this->m_io);
+  auto log2 = make_shared<SyncLog>(dir2, user2);
+  auto core2 = make_shared<SyncCore>(*c2, log2, user2, loc2, syncPrefix, bind(&callback, _1));
 
-  // _LOG_TRACE ("\n\n\n\n\n\n----------\n");
+  // @TODO: Implement test using the dummy forwarder and disable dependency on real time
+
+  this->advanceClocks();
+
+  BOOST_CHECK_EQUAL(toHex(*core1->root()), toHex(*core2->root()));
+
+  // _LOG_TRACE("\n\n\n\n\n\n----------\n");
 
   core1->updateLocalState(1);
-  usleep(100000);
-  checkRoots(core1->root(), core2->root());
+  this->advanceClocks();
+  BOOST_CHECK_EQUAL(toHex(*core1->root()), toHex(*core2->root()));
   BOOST_CHECK_EQUAL(core2->seq(user1), 1);
   BOOST_CHECK_EQUAL(log2->LookupLocator(user1), loc1);
 
   core1->updateLocalState(5);
-  usleep(100000);
-  checkRoots(core1->root(), core2->root());
+  this->advanceClocks();
+  BOOST_CHECK_EQUAL(toHex(*core1->root()), toHex(*core2->root()));
   BOOST_CHECK_EQUAL(core2->seq(user1), 5);
   BOOST_CHECK_EQUAL(log2->LookupLocator(user1), loc1);
 
   core2->updateLocalState(10);
-  usleep(100000);
-  checkRoots(core1->root(), core2->root());
+  this->advanceClocks();
+  BOOST_CHECK_EQUAL(toHex(*core1->root()), toHex(*core2->root()));
   BOOST_CHECK_EQUAL(core1->seq(user2), 10);
   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("\n\n\n\n\n\n----------Simultaneous\n");
 
   core1->updateLocalState(11);
-  usleep(100);
+  this->advanceClocks();
   core2->updateLocalState(15);
-  usleep(2000000);
-  checkRoots(core1->root(), core2->root());
+  this->advanceClocks();
+  BOOST_CHECK_EQUAL(toHex(*core1->root()), toHex(*core2->root()));
   BOOST_CHECK_EQUAL(core1->seq(user2), 15);
   BOOST_CHECK_EQUAL(core2->seq(user1), 11);
 
@@ -122,11 +126,10 @@
   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)) {
-    remove_all(d);
-  }
 }
 
 BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace chronoshare
+} // namespace ndn
diff --git a/tests/unit-tests/sync-log.t.cpp b/tests/unit-tests/sync-log.t.cpp
index 9e9ebb0..bf5801e 100644
--- a/tests/unit-tests/sync-log.t.cpp
+++ b/tests/unit-tests/sync-log.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2016, Regents of the University of California.
+ * Copyright (c) 2013-2017, Regents of the University of California.
  *
  * This file is part of ChronoShare, a decentralized file sharing application over NDN.
  *
@@ -18,103 +18,103 @@
  * See AUTHORS.md for complete list of ChronoShare authors and contributors.
  */
 
-#include <boost/lexical_cast.hpp>
-#include <boost/test/unit_test.hpp>
+#include "sync-log.hpp"
 
-#include "action-log.hpp"
-#include "logging.hpp"
-#include <boost/filesystem.hpp>
-#include <ccnx-name.hpp>
-#include <iostream>
-#include <unistd.h>
+#include "test-common.hpp"
 
-using namespace std;
-using namespace boost;
-using namespace Ndnx;
+namespace ndn {
+namespace chronoshare {
+namespace tests {
+
 namespace fs = boost::filesystem;
 
-BOOST_AUTO_TEST_SUITE(TestSyncLog)
+INIT_LOGGER("Test.SyncLog")
 
+BOOST_FIXTURE_TEST_SUITE(TestSyncLog, IdentityManagementTimeFixture)
 
 BOOST_AUTO_TEST_CASE(BasicDatabaseTest)
 {
-  INIT_LOGGERS();
+  fs::path tmpdir = fs::unique_path(UNIT_TEST_CONFIG_PATH);
+  if (exists(tmpdir)) {
+    remove_all(tmpdir);
+  }
 
-  fs::path tmpdir = fs::unique_path(fs::temp_directory_path() / "%%%%-%%%%-%%%%-%%%%");
-  SyncLog db(tmpdir, Name("/alex"));
+  SyncLog db(tmpdir, Name("/lijing"));
 
-  HashPtr hash = db.RememberStateInStateLog();
+  ndn::ConstBufferPtr hash = db.RememberStateInStateLog();
   // should be empty
-  BOOST_CHECK_EQUAL(lexical_cast<string>(*hash),
-                    "7a6f2c1eefd539560d2dc3e5542868a79810d0867db15d9b87e41ec105899405");
 
-  db.UpdateDeviceSeqNo(Name("/alex"), 1);
+  BOOST_CHECK_EQUAL(toHex(*hash),
+                    "94D988A90C6A3D0F74624368BE65E5369DDDDB3444841FAD4EF41F674B937F26");
+
+  db.UpdateDeviceSeqNo(Name("/lijing"), 1);
   hash = db.RememberStateInStateLog();
 
-  BOOST_CHECK_EQUAL(lexical_cast<string>(*hash),
-                    "3410477233f98d6c3f9a6f8da24494bf5a65e1a7c9f4f66b228128bd4e020558");
+  BOOST_CHECK_EQUAL(toHex(*hash),
+                    "91A849EEDE75ACD56AE1BCB99E92D8FB28757683BC387DBB0E59C3108FCF4F18");
 
-  db.UpdateDeviceSeqNo(Name("/alex"), 2);
+  db.UpdateDeviceSeqNo(Name("/lijing"), 2);
   hash = db.RememberStateInStateLog();
-  BOOST_CHECK_EQUAL(lexical_cast<string>(*hash),
-                    "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c");
+  BOOST_CHECK_EQUAL(toHex(*hash),
+                    "D2DFEDA56ED98C0E17D455A859BC8C3B9E31C85C138C280A8BADAB4FC551F282");
 
-  db.UpdateDeviceSeqNo(Name("/alex"), 2);
+  db.UpdateDeviceSeqNo(Name("/lijing"), 2);
   hash = db.RememberStateInStateLog();
-  BOOST_CHECK_EQUAL(lexical_cast<string>(*hash),
-                    "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c");
+  BOOST_CHECK_EQUAL(toHex(*hash),
+                    "D2DFEDA56ED98C0E17D455A859BC8C3B9E31C85C138C280A8BADAB4FC551F282");
 
-  db.UpdateDeviceSeqNo(Name("/alex"), 1);
+  db.UpdateDeviceSeqNo(Name("/lijing"), 1);
   hash = db.RememberStateInStateLog();
-  BOOST_CHECK_EQUAL(lexical_cast<string>(*hash),
-                    "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c");
+  BOOST_CHECK_EQUAL(toHex(*hash),
+                    "D2DFEDA56ED98C0E17D455A859BC8C3B9E31C85C138C280A8BADAB4FC551F282");
 
-  db.UpdateLocator(Name("/alex"), Name("/hawaii"));
+  db.UpdateLocator(Name("/lijing"), Name("/hawaii"));
 
-  BOOST_CHECK_EQUAL(db.LookupLocator(Name("/alex")), Name("/hawaii"));
+  BOOST_CHECK_EQUAL(db.LookupLocator(Name("/lijing")), Name("/hawaii"));
 
-  SyncStateMsgPtr msg =
-    db.FindStateDifferences("00", "95284d3132a7a88b85c5141ca63efa68b7a7daf37315def69e296a0c24692833");
+  SyncStateMsgPtr msg = db.FindStateDifferences("00", "95284D3132A7A88B85C5141CA63EFA68B7A7DAF37315DEF69E296A0C24692833");
   BOOST_CHECK_EQUAL(msg->state_size(), 0);
 
   msg = db.FindStateDifferences("00",
-                                "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c");
+                                "D2DFEDA56ED98C0E17D455A859BC8C3B9E31C85C138C280A8BADAB4FC551F282");
   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",
+  msg = db.FindStateDifferences("D2DFEDA56ED98C0E17D455A859BC8C3B9E31C85C138C280A8BADAB4FC551F282",
                                 "00");
   BOOST_CHECK_EQUAL(msg->state_size(), 1);
   BOOST_CHECK_EQUAL(msg->state(0).type(), SyncState::DELETE);
 
-  msg = db.FindStateDifferences("7a6f2c1eefd539560d2dc3e5542868a79810d0867db15d9b87e41ec105899405",
-                                "2ff304769cdb0125ac039e6fe7575f8576dceffc62618a431715aaf6eea2bf1c");
+  msg = db.FindStateDifferences("94D988A90C6A3D0F74624368BE65E5369DDDDB3444841FAD4EF41F674B937F26",
+                                "D2DFEDA56ED98C0E17D455A859BC8C3B9E31C85C138C280A8BADAB4FC551F282");
   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");
+  msg = db.FindStateDifferences("D2DFEDA56ED98C0E17D455A859BC8C3B9E31C85C138C280A8BADAB4FC551F282",
+                                "94D988A90C6A3D0F74624368BE65E5369DDDDB3444841FAD4EF41F674B937F26");
   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);
+  db.UpdateDeviceSeqNo(Name("/shuai"), 1);
   hash = db.RememberStateInStateLog();
-  BOOST_CHECK_EQUAL(lexical_cast<string>(*hash),
-                    "5df5affc07120335089525e82ec9fda60c6dccd7addb667106fb79de80610519");
+  BOOST_CHECK_EQUAL(toHex(*hash),
+                    "602FF1878FC394B90E4A0E90C7409EA4B8EE8AA40169801D62F838470551DB7C");
 
   msg = db.FindStateDifferences("00",
-                                "5df5affc07120335089525e82ec9fda60c6dccd7addb667106fb79de80610519");
+                                "602FF1878FC394B90E4A0E90C7409EA4B8EE8AA40169801D62F838470551DB7C");
   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);
-
-  remove_all(tmpdir);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace chronoshare
+} // namespace ndn
diff --git a/tests/unit-tests/protobuf.t.cpp b/tests/unit-tests/sync-state.pb.t.cpp
similarity index 69%
rename from tests/unit-tests/protobuf.t.cpp
rename to tests/unit-tests/sync-state.pb.t.cpp
index 6bf6f23..b0ce112 100644
--- a/tests/unit-tests/protobuf.t.cpp
+++ b/tests/unit-tests/sync-state.pb.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2016, Regents of the University of California.
+ * Copyright (c) 2013-2017, Regents of the University of California.
  *
  * This file is part of ChronoShare, a decentralized file sharing application over NDN.
  *
@@ -17,26 +17,27 @@
  *
  * See AUTHORS.md for complete list of ChronoShare authors and contributors.
  */
-#include "ccnx-common.hpp"
+
+#include "sync-state.pb.h"
 #include "sync-core.hpp"
+
 #include <boost/iostreams/device/back_inserter.hpp>
 #include <boost/iostreams/filter/gzip.hpp>
 #include <boost/iostreams/filtering_stream.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;
-using namespace boost;
+#include "test-common.hpp"
 
-BOOST_AUTO_TEST_SUITE(ProtobufTests)
+namespace ndn {
+namespace chronoshare {
+namespace tests {
 
+INIT_LOGGER("Test.protobuf")
 
-BOOST_AUTO_TEST_CASE(TestGzipProtobuf)
+BOOST_AUTO_TEST_SUITE(TestSyncStatePb)
+
+BOOST_AUTO_TEST_CASE(Serialize)
 {
-  SyncStateMsgPtr msg = make_shared<SyncStateMsg>();
+  auto msg = make_shared<SyncStateMsg>();
 
   SyncState* state = msg->add_state();
   state->set_type(SyncState::UPDATE);
@@ -45,22 +46,26 @@
   state->set_locator(&x[0], sizeof(x));
   state->set_name(&x[0], sizeof(x));
 
-  BytesPtr bb = serializeMsg<SyncStateMsg>(*msg);
+  ndn::ConstBufferPtr bb = serializeMsg<SyncStateMsg>(*msg);
 
-  BytesPtr cb = serializeGZipMsg<SyncStateMsg>(*msg);
-  BOOST_CHECK(cb->size() < bb->size());
-  cout << cb->size() << ", " << bb->size() << endl;
+  ndn::ConstBufferPtr cb = serializeGZipMsg<SyncStateMsg>(*msg);
+  BOOST_CHECK_LT(cb->size(), bb->size());
 
   SyncStateMsgPtr msg1 = deserializeGZipMsg<SyncStateMsg>(*cb);
 
-  BOOST_REQUIRE(msg1->state_size() == 1);
+  BOOST_REQUIRE_EQUAL(msg1->state_size(), 1);
 
   SyncState state1 = msg1->state(0);
   BOOST_CHECK_EQUAL(state->seq(), state1.seq());
   BOOST_CHECK_EQUAL(state->type(), state1.type());
-  string sx(x, 100);
+
+  std::string sx(x, 100);
   BOOST_CHECK_EQUAL(sx, state1.name());
   BOOST_CHECK_EQUAL(sx, state1.locator());
 }
 
 BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace chronoshare
+} // namespace ndn
diff --git a/tests/wscript b/tests/wscript
index 5d667b5..b47447b 100644
--- a/tests/wscript
+++ b/tests/wscript
@@ -8,7 +8,7 @@
     if not bld.env['WITH_TESTS']:
         return
 
-    Logs.error("Most unit tests are temporary disabled")
+    Logs.error("Many unit tests are temporary disabled")
 
     bld(features='cxx',
         target='unit-tests-main',
@@ -21,8 +21,10 @@
     unit_tests = bld.program(
             target='../unit-tests',
             features='cxx cxxprogram',
-            source=bld.path.ant_glob(['**/*.cpp'], excl=['main.cpp',
-                                                         'unit-tests/**/*.cpp']),
+            source=bld.path.ant_glob(['*.cpp',
+                                      'unit-tests/sync-*.t.cpp',
+                                      ],
+                                     excl=['main.cpp']),
             use='unit-tests-main core-objects chronoshare',
             install_path=None,
             defines='UNIT_TEST_CONFIG_PATH=\"%s/tmp-files/\"' % (bld.bldnode),
