diff --git a/tests/daemon/table/measurements-accessor.cpp b/tests/daemon/table/measurements-accessor.cpp
index cbcbe5a..8d09ca4 100644
--- a/tests/daemon/table/measurements-accessor.cpp
+++ b/tests/daemon/table/measurements-accessor.cpp
@@ -1,11 +1,12 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014  Regents of the University of California,
- *                     Arizona Board of Regents,
- *                     Colorado State University,
- *                     University Pierre & Marie Curie, Sorbonne University,
- *                     Washington University in St. Louis,
- *                     Beijing Institute of Technology
+ * Copyright (c) 2014,  Regents of the University of California,
+ *                      Arizona Board of Regents,
+ *                      Colorado State University,
+ *                      University Pierre & Marie Curie, Sorbonne University,
+ *                      Washington University in St. Louis,
+ *                      Beijing Institute of Technology,
+ *                      The University of Memphis
  *
  * This file is part of NFD (Named Data Networking Forwarding Daemon).
  * See AUTHORS.md for complete list of NFD authors and contributors.
@@ -20,7 +21,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "table/measurements-accessor.hpp"
 #include "fw/strategy.hpp"
@@ -67,10 +68,8 @@
 {
   Forwarder forwarder;
 
-  shared_ptr<MeasurementsAccessorTestStrategy> strategy1 =
-    make_shared<MeasurementsAccessorTestStrategy>(ref(forwarder), "ndn:/strategy1");
-  shared_ptr<MeasurementsAccessorTestStrategy> strategy2 =
-    make_shared<MeasurementsAccessorTestStrategy>(ref(forwarder), "ndn:/strategy2");
+  auto strategy1 = make_shared<MeasurementsAccessorTestStrategy>(ref(forwarder), "ndn:/strategy1");
+  auto strategy2 = make_shared<MeasurementsAccessorTestStrategy>(ref(forwarder), "ndn:/strategy2");
 
   Name nameRoot("ndn:/");
   Name nameA   ("ndn:/A");
@@ -95,7 +94,7 @@
   BOOST_CHECK_EQUAL(static_cast<bool>(accessor1.get(nameAD  )), false);
 
   shared_ptr<measurements::Entry> entryRoot = forwarder.getMeasurements().get(nameRoot);
-  BOOST_CHECK_NO_THROW(accessor1.getParent(entryRoot));
+  BOOST_CHECK_NO_THROW(accessor1.getParent(*entryRoot));
 
   BOOST_CHECK_EQUAL(static_cast<bool>(accessor2.get(nameRoot)), false);
   BOOST_CHECK_EQUAL(static_cast<bool>(accessor2.get(nameA   )), true);
diff --git a/tests/daemon/table/measurements.cpp b/tests/daemon/table/measurements.cpp
index 30b71c4..63254bd 100644
--- a/tests/daemon/table/measurements.cpp
+++ b/tests/daemon/table/measurements.cpp
@@ -43,23 +43,22 @@
   Name nameAB("ndn:/A/B");
 
   shared_ptr<measurements::Entry> entryAB = measurements.get(nameAB);
-  BOOST_REQUIRE(static_cast<bool>(entryAB));
+  BOOST_REQUIRE(entryAB != nullptr);
   BOOST_CHECK_EQUAL(entryAB->getName(), nameAB);
 
   shared_ptr<measurements::Entry> entry0 = measurements.get(name0);
-  BOOST_REQUIRE(static_cast<bool>(entry0));
+  BOOST_REQUIRE(entry0 != nullptr);
 
-  shared_ptr<measurements::Entry> entryA = measurements.getParent(entryAB);
-  BOOST_REQUIRE(static_cast<bool>(entryA));
+  shared_ptr<measurements::Entry> entryA = measurements.getParent(*entryAB);
+  BOOST_REQUIRE(entryA != nullptr);
   BOOST_CHECK_EQUAL(entryA->getName(), nameA);
 
-  shared_ptr<measurements::Entry> entry0c = measurements.getParent(entryA);
+  shared_ptr<measurements::Entry> entry0c = measurements.getParent(*entryA);
   BOOST_CHECK_EQUAL(entry0, entry0c);
 }
 
-BOOST_AUTO_TEST_CASE(Lifetime)
+BOOST_FIXTURE_TEST_CASE(Lifetime, UnitTestTimeFixture)
 {
-  LimitedIo limitedIo;
   NameTree nameTree;
   Measurements measurements(nameTree);
   Name nameA("ndn:/A");
@@ -78,14 +77,14 @@
   const time::nanoseconds CHECK2 = time::seconds(5);
   const time::nanoseconds EXTEND_C = time::seconds(6);
   const time::nanoseconds CHECK3 = time::seconds(7);
-  BOOST_ASSERT(EXTEND_A < CHECK1 &&
-               CHECK1 < Measurements::getInitialLifetime() &&
-               Measurements::getInitialLifetime() < CHECK2 &&
-               CHECK2 < EXTEND_C &&
-               EXTEND_C < CHECK3);
+  BOOST_ASSERT(EXTEND_A < CHECK1);
+  BOOST_ASSERT(CHECK1 < Measurements::getInitialLifetime());
+  BOOST_ASSERT(Measurements::getInitialLifetime() < CHECK2);
+  BOOST_ASSERT(CHECK2 < EXTEND_C);
+  BOOST_ASSERT(EXTEND_C < CHECK3);
 
-  measurements.extendLifetime(entryA, EXTEND_A);
-  measurements.extendLifetime(entryC, EXTEND_C);
+  measurements.extendLifetime(*entryA, EXTEND_A);
+  measurements.extendLifetime(*entryC, EXTEND_C);
   // remaining lifetime:
   //   A = initial lifetime, because it's extended by less duration
   //   B = initial lifetime
@@ -94,39 +93,33 @@
   entryB.reset();
   entryC.reset();
 
-  BOOST_CHECK_EQUAL(limitedIo.run(LimitedIo::UNLIMITED_OPS, CHECK1), LimitedIo::EXCEED_TIME);
-  BOOST_CHECK_EQUAL(static_cast<bool>(measurements.findExactMatch(nameA)), true);
-  BOOST_CHECK_EQUAL(static_cast<bool>(measurements.findExactMatch(nameB)), true);
-  BOOST_CHECK_EQUAL(static_cast<bool>(measurements.findExactMatch(nameC)), true);
+  this->advanceClocks(time::milliseconds(100), CHECK1);
+  BOOST_CHECK(measurements.findExactMatch(nameA) != nullptr);
+  BOOST_CHECK(measurements.findExactMatch(nameB) != nullptr);
+  BOOST_CHECK(measurements.findExactMatch(nameC) != nullptr);
   BOOST_CHECK_EQUAL(measurements.size(), 3);
 
-  BOOST_CHECK_EQUAL(limitedIo.run(LimitedIo::UNLIMITED_OPS, CHECK2 - CHECK1),
-                    LimitedIo::EXCEED_TIME);
-  BOOST_CHECK_EQUAL(static_cast<bool>(measurements.findExactMatch(nameA)), false);
-  BOOST_CHECK_EQUAL(static_cast<bool>(measurements.findExactMatch(nameB)), false);
-  BOOST_CHECK_EQUAL(static_cast<bool>(measurements.findExactMatch(nameC)), true);
+  this->advanceClocks(time::milliseconds(100), CHECK2 - CHECK1);
+  BOOST_CHECK(measurements.findExactMatch(nameA) == nullptr);
+  BOOST_CHECK(measurements.findExactMatch(nameB) == nullptr);
+  BOOST_CHECK(measurements.findExactMatch(nameC) != nullptr);
   BOOST_CHECK_EQUAL(measurements.size(), 1);
 
-  BOOST_CHECK_EQUAL(limitedIo.run(LimitedIo::UNLIMITED_OPS, CHECK3 - CHECK2),
-                    LimitedIo::EXCEED_TIME);
-  BOOST_CHECK_EQUAL(static_cast<bool>(measurements.findExactMatch(nameA)), false);
-  BOOST_CHECK_EQUAL(static_cast<bool>(measurements.findExactMatch(nameB)), false);
-  BOOST_CHECK_EQUAL(static_cast<bool>(measurements.findExactMatch(nameC)), false);
+  this->advanceClocks(time::milliseconds(100), CHECK3 - CHECK2);
+  BOOST_CHECK(measurements.findExactMatch(nameA) == nullptr);
+  BOOST_CHECK(measurements.findExactMatch(nameB) == nullptr);
+  BOOST_CHECK(measurements.findExactMatch(nameC) == nullptr);
   BOOST_CHECK_EQUAL(measurements.size(), 0);
 }
 
-BOOST_AUTO_TEST_CASE(EraseNameTreeEntry)
+BOOST_FIXTURE_TEST_CASE(EraseNameTreeEntry, UnitTestTimeFixture)
 {
-  LimitedIo limitedIo;
   NameTree nameTree;
   Measurements measurements(nameTree);
   size_t nNameTreeEntriesBefore = nameTree.size();
 
   shared_ptr<measurements::Entry> entry = measurements.get("/A");
-  BOOST_CHECK_EQUAL(
-    limitedIo.run(LimitedIo::UNLIMITED_OPS,
-                  Measurements::getInitialLifetime() + time::milliseconds(10)),
-    LimitedIo::EXCEED_TIME);
+  this->advanceClocks(Measurements::getInitialLifetime() + time::milliseconds(10));
   BOOST_CHECK_EQUAL(measurements.size(), 0);
   BOOST_CHECK_EQUAL(nameTree.size(), nNameTreeEntriesBefore);
 }
diff --git a/tests/test-common.hpp b/tests/test-common.hpp
index d122189..e3bc0b5 100644
--- a/tests/test-common.hpp
+++ b/tests/test-common.hpp
@@ -64,7 +64,7 @@
  */
 class UnitTestTimeFixture : public BaseFixture
 {
-public:
+protected:
   UnitTestTimeFixture()
     : steadyClock(make_shared<time::UnitTestSteadyClock>())
     , systemClock(make_shared<time::UnitTestSystemClock>())
@@ -88,9 +88,38 @@
   void
   advanceClocks(const time::nanoseconds& tick, size_t nTicks = 1)
   {
-    for (size_t i = 0; i < nTicks; ++i) {
-      steadyClock->advance(tick);
-      systemClock->advance(tick);
+    BOOST_ASSERT(nTicks >= 0);
+
+    this->advanceClocks(tick, tick * nTicks);
+  }
+
+  /** \brief advance steady and system clocks
+   *
+   *  Clocks are advanced in increments of \p tick for \p total time.
+   *  The last increment might be shorter than \p tick.
+   *  After each tick, global io_service is polled to process pending I/O events.
+   *
+   *  Exceptions thrown during I/O events are propagated to the caller.
+   *  Clock advancing would stop in case of an exception.
+   */
+  void
+  advanceClocks(const time::nanoseconds& tick, const time::nanoseconds& total)
+  {
+    BOOST_ASSERT(tick > time::nanoseconds::zero());
+    BOOST_ASSERT(total >= time::nanoseconds::zero());
+
+    time::nanoseconds remaining = total;
+    while (remaining > time::nanoseconds::zero()) {
+      if (remaining >= tick) {
+        steadyClock->advance(tick);
+        systemClock->advance(tick);
+        remaining -= tick;
+      }
+      else {
+        steadyClock->advance(remaining);
+        systemClock->advance(remaining);
+        remaining = time::nanoseconds::zero();
+      }
 
       if (g_io.stopped())
         g_io.reset();
