diff --git a/tests/core/config-file.cpp b/tests/core/config-file.cpp
new file mode 100644
index 0000000..bb75b77
--- /dev/null
+++ b/tests/core/config-file.cpp
@@ -0,0 +1,367 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * 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 "core/config-file.hpp"
+
+#include "tests/test-common.hpp"
+
+#include <fstream>
+
+namespace nfd {
+namespace tests {
+
+NFD_LOG_INIT("ConfigFileTest");
+
+BOOST_FIXTURE_TEST_SUITE(MgmtConfigFile, BaseFixture)
+
+// a
+// {
+//    akey "avalue"
+// }
+// b
+// {
+//   bkey "bvalue"
+// }
+
+const std::string CONFIG =
+"a\n"
+"{\n"
+"        akey \"avalue\"\n"
+"}\n"
+"b\n"
+"{\n"
+"        bkey \"bvalue\"\n"
+"}\n";
+
+
+// a
+// {
+//    akey "avalue"
+// }
+// b
+//
+//   bkey "bvalue"
+// }
+
+const std::string MALFORMED_CONFIG =
+"a\n"
+"{\n"
+"        akey \"avalue\"\n"
+"}\n"
+"b\n"
+"\n"
+"        bkey \"bvalue\"\n"
+"}\n";
+
+// counts of the respective section counts in config_example.info
+
+const int CONFIG_N_A_SECTIONS = 1;
+const int CONFIG_N_B_SECTIONS = 1;
+
+class DummySubscriber
+{
+public:
+
+  DummySubscriber(ConfigFile& config,
+                  int nASections,
+                  int nBSections,
+                  bool expectDryRun)
+    : m_nASections(nASections),
+      m_nBSections(nBSections),
+      m_nRemainingACallbacks(nASections),
+      m_nRemainingBCallbacks(nBSections),
+      m_expectDryRun(expectDryRun)
+  {
+
+  }
+
+  void
+  onA(const ConfigSection& section, bool isDryRun)
+  {
+    // NFD_LOG_DEBUG("a");
+    BOOST_CHECK_EQUAL(isDryRun, m_expectDryRun);
+    --m_nRemainingACallbacks;
+  }
+
+
+  void
+  onB(const ConfigSection& section, bool isDryRun)
+  {
+    // NFD_LOG_DEBUG("b");
+    BOOST_CHECK_EQUAL(isDryRun, m_expectDryRun);
+    --m_nRemainingBCallbacks;
+  }
+
+  bool
+  allCallbacksFired() const
+  {
+    return m_nRemainingACallbacks == 0 &&
+      m_nRemainingBCallbacks == 0;
+  }
+
+  bool
+  noCallbacksFired() const
+  {
+    return m_nRemainingACallbacks == m_nASections &&
+      m_nRemainingBCallbacks == m_nBSections;
+  }
+
+  virtual
+  ~DummySubscriber()
+  {
+
+  }
+
+private:
+  int m_nASections;
+  int m_nBSections;
+  int m_nRemainingACallbacks;
+  int m_nRemainingBCallbacks;
+  bool m_expectDryRun;
+};
+
+class DummyAllSubscriber : public DummySubscriber
+{
+public:
+  DummyAllSubscriber(ConfigFile& config, bool expectDryRun=false)
+    : DummySubscriber(config,
+                      CONFIG_N_A_SECTIONS,
+                      CONFIG_N_B_SECTIONS,
+                      expectDryRun)
+  {
+    config.addSectionHandler("a", bind(&DummySubscriber::onA, this, _1, _2));
+    config.addSectionHandler("b", bind(&DummySubscriber::onB, this, _1, _2));
+  }
+
+  virtual
+  ~DummyAllSubscriber()
+  {
+
+  }
+};
+
+class DummyOneSubscriber : public DummySubscriber
+{
+public:
+  DummyOneSubscriber(ConfigFile& config,
+                     const std::string& sectionName,
+                     bool expectDryRun=false)
+    : DummySubscriber(config,
+                      (sectionName == "a"),
+                      (sectionName == "b"),
+                      expectDryRun)
+  {
+    if (sectionName == "a")
+      {
+        config.addSectionHandler(sectionName, bind(&DummySubscriber::onA, this, _1, _2));
+      }
+    else if (sectionName == "b")
+      {
+        config.addSectionHandler(sectionName, bind(&DummySubscriber::onB, this, _1, _2));
+      }
+    else
+      {
+        BOOST_FAIL("Test setup error: "
+                   << "Unexpected section name "
+                   <<"\"" << sectionName << "\"");
+      }
+
+  }
+
+  virtual
+  ~DummyOneSubscriber()
+  {
+
+  }
+};
+
+class DummyNoSubscriber : public DummySubscriber
+{
+public:
+  DummyNoSubscriber(ConfigFile& config, bool expectDryRun)
+    : DummySubscriber(config, 0, 0, expectDryRun)
+  {
+
+  }
+
+  virtual
+  ~DummyNoSubscriber()
+  {
+
+  }
+};
+
+BOOST_AUTO_TEST_CASE(OnConfigStream)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file);
+  std::ifstream input;
+
+  input.open("tests/core/config_example.info");
+  BOOST_REQUIRE(input.is_open());
+
+  file.parse(input, false, "config_example.info");
+  BOOST_CHECK(sub.allCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigStreamEmptyStream)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file);
+
+  std::ifstream input;
+
+  BOOST_CHECK_THROW(file.parse(input, false, "unknown"), ConfigFile::Error);
+  BOOST_CHECK(sub.noCallbacksFired());
+}
+
+
+BOOST_AUTO_TEST_CASE(OnConfigString)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file);
+
+  file.parse(CONFIG, false, "dummy-config");
+
+  BOOST_CHECK(sub.allCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigStringEmpty)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file);
+
+  BOOST_CHECK_THROW(file.parse(std::string(), false, "dummy-config"), ConfigFile::Error);
+  BOOST_CHECK(sub.noCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigStringMalformed)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file);
+
+  BOOST_CHECK_THROW(file.parse(MALFORMED_CONFIG, false, "dummy-config"), ConfigFile::Error);
+  BOOST_CHECK(sub.noCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigStringDryRun)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file, true);
+
+  file.parse(CONFIG, true, "dummy-config");
+
+  BOOST_CHECK(sub.allCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigFilename)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file);
+
+  file.parse("tests/core/config_example.info", false);
+
+  BOOST_CHECK(sub.allCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigFilenameNoFile)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file);
+
+  BOOST_CHECK_THROW(file.parse("i_made_this_up.info", false), ConfigFile::Error);
+
+  BOOST_CHECK(sub.noCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigFilenameMalformed)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file);
+
+  BOOST_CHECK_THROW(file.parse("tests/core/config_malformed.info", false), ConfigFile::Error);
+
+  BOOST_CHECK(sub.noCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigStreamDryRun)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file, true);
+  std::ifstream input;
+
+  input.open("tests/core/config_example.info");
+  BOOST_REQUIRE(input.is_open());
+
+  file.parse(input, true, "tests/core/config_example.info");
+
+  BOOST_CHECK(sub.allCallbacksFired());
+
+  input.close();
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigFilenameDryRun)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub(file, true);
+
+  file.parse("tests/core/config_example.info", true);
+  BOOST_CHECK(sub.allCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigReplaceSubscriber)
+{
+  ConfigFile file;
+  DummyAllSubscriber sub1(file);
+  DummyAllSubscriber sub2(file);
+
+  file.parse(CONFIG, false, "dummy-config");
+
+  BOOST_CHECK(sub1.noCallbacksFired());
+  BOOST_CHECK(sub2.allCallbacksFired());
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigUncoveredSections)
+{
+  ConfigFile file;
+
+  BOOST_CHECK_THROW(file.parse(CONFIG, false, "dummy-config"), ConfigFile::Error);
+}
+
+BOOST_AUTO_TEST_CASE(OnConfigCoveredByPartialSubscribers)
+{
+  ConfigFile file;
+  DummyOneSubscriber subA(file, "a");
+  DummyOneSubscriber subB(file, "b");
+
+  file.parse(CONFIG, false, "dummy-config");
+
+  BOOST_CHECK(subA.allCallbacksFired());
+  BOOST_CHECK(subB.allCallbacksFired());
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/core/config_example.info b/tests/core/config_example.info
new file mode 100644
index 0000000..d61691f
--- /dev/null
+++ b/tests/core/config_example.info
@@ -0,0 +1,9 @@
+a
+{
+        akey "avalue"
+}
+
+b
+{
+        bkey "bvalue"
+}
\ No newline at end of file
diff --git a/tests/core/config_malformed.info b/tests/core/config_malformed.info
new file mode 100644
index 0000000..d3a1f9e
--- /dev/null
+++ b/tests/core/config_malformed.info
@@ -0,0 +1,9 @@
+a
+{
+        akey "avalue"
+}
+
+b
+
+        bkey "bvalue"
+}
\ No newline at end of file
diff --git a/tests/core/ethernet.cpp b/tests/core/ethernet.cpp
new file mode 100644
index 0000000..157f574
--- /dev/null
+++ b/tests/core/ethernet.cpp
@@ -0,0 +1,89 @@
+/* -*- 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
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * 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 "core/ethernet.hpp"
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(FaceEthernetAddress, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(Checks)
+{
+  BOOST_CHECK(ethernet::Address().isNull());
+  BOOST_CHECK(ethernet::getBroadcastAddress().isBroadcast());
+  BOOST_CHECK(ethernet::getDefaultMulticastAddress().isMulticast());
+}
+
+BOOST_AUTO_TEST_CASE(ToString)
+{
+  BOOST_CHECK_EQUAL(ethernet::Address().toString('-'),
+                    "00-00-00-00-00-00");
+  BOOST_CHECK_EQUAL(ethernet::getBroadcastAddress().toString(),
+                    "ff:ff:ff:ff:ff:ff");
+  BOOST_CHECK_EQUAL(ethernet::Address(0x01, 0x23, 0x45, 0x67, 0x89, 0xAB).toString('-'),
+                    "01-23-45-67-89-ab");
+  BOOST_CHECK_EQUAL(ethernet::Address(0x01, 0x23, 0x45, 0x67, 0x89, 0xAB).toString(),
+                    "01:23:45:67:89:ab");
+}
+
+BOOST_AUTO_TEST_CASE(FromString)
+{
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("0:0:0:0:0:0"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("ff-ff-ff-ff-ff-ff"),
+                    ethernet::getBroadcastAddress());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("de:ad:be:ef:1:2"),
+                    ethernet::Address(0xde, 0xad, 0xbe, 0xef, 0x01, 0x02));
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("DE:AD:BE:EF:1:2"),
+                    ethernet::Address(0xde, 0xad, 0xbe, 0xef, 0x01, 0x02));
+
+  // malformed inputs
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("01.23.45.67.89.ab"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("01:23:45 :67:89:ab"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("01:23:45:67:89::1"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("01-23-45-67-89"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("01:23:45:67:89:ab:cd"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("01:23:45:67-89-ab"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("qw-er-ty-12-34-56"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("this-is-not-an-ethernet-address"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString("foobar"),
+                    ethernet::Address());
+  BOOST_CHECK_EQUAL(ethernet::Address::fromString(""),
+                    ethernet::Address());
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/core/face-uri.cpp b/tests/core/face-uri.cpp
index 5d31f66..0e54f04 100644
--- a/tests/core/face-uri.cpp
+++ b/tests/core/face-uri.cpp
@@ -24,7 +24,7 @@
 
 #include "core/face-uri.hpp"
 #ifdef HAVE_LIBPCAP
-#include "face/ethernet.hpp"
+#include "core/ethernet.hpp"
 #endif // HAVE_LIBPCAP
 
 #include "tests/test-common.hpp"
diff --git a/tests/core/global-configuration.cpp b/tests/core/global-configuration.cpp
deleted file mode 100644
index 77c28c4..0000000
--- a/tests/core/global-configuration.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- 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
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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 "../test-common.hpp"
-#include "core/logger.hpp"
-#include "mgmt/config-file.hpp"
-
-#include <boost/filesystem.hpp>
-
-namespace nfd {
-namespace tests {
-
-class GlobalConfigurationFixture
-{
-public:
-  GlobalConfigurationFixture()
-  {
-    const std::string filename = "unit-tests.conf";
-    if (boost::filesystem::exists(filename))
-      {
-        ConfigFile config;
-        LoggerFactory::getInstance().setConfigFile(config);
-
-        config.parse(filename, false);
-      }
-  }
-};
-
-BOOST_GLOBAL_FIXTURE(GlobalConfigurationFixture)
-
-} // namespace tests
-} // namespace nfd
diff --git a/tests/core/limited-io.cpp b/tests/core/limited-io.cpp
deleted file mode 100644
index b22be89..0000000
--- a/tests/core/limited-io.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- 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
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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 "limited-io.hpp"
-#include "core/logger.hpp"
-
-namespace nfd {
-namespace tests {
-
-NFD_LOG_INIT("LimitedIo");
-
-const int LimitedIo::UNLIMITED_OPS = std::numeric_limits<int>::max();
-const time::nanoseconds LimitedIo::UNLIMITED_TIME = time::nanoseconds::min();
-
-LimitedIo::LimitedIo()
-  : m_isRunning(false)
-  , m_nOpsRemaining(0)
-{
-}
-
-LimitedIo::StopReason
-LimitedIo::run(int nOpsLimit, const time::nanoseconds& nTimeLimit)
-{
-  BOOST_ASSERT(!m_isRunning);
-  m_isRunning = true;
-
-  m_reason = NO_WORK;
-  m_nOpsRemaining = nOpsLimit;
-  if (nTimeLimit >= time::nanoseconds::zero()) {
-    m_timeout = scheduler::schedule(nTimeLimit, bind(&LimitedIo::afterTimeout, this));
-  }
-
-  try {
-    getGlobalIoService().run();
-  }
-  catch (std::exception& ex) {
-    m_reason = EXCEPTION;
-    NFD_LOG_ERROR("g_io.run() exception: " << ex.what());
-    m_lastException = ex;
-  }
-
-  getGlobalIoService().reset();
-  scheduler::cancel(m_timeout);
-  m_isRunning = false;
-  return m_reason;
-}
-
-void
-LimitedIo::afterOp()
-{
-  --m_nOpsRemaining;
-  if (m_nOpsRemaining <= 0) {
-    m_reason = EXCEED_OPS;
-    getGlobalIoService().stop();
-  }
-}
-
-void
-LimitedIo::afterTimeout()
-{
-  m_reason = EXCEED_TIME;
-  getGlobalIoService().stop();
-}
-
-const std::exception&
-LimitedIo::getLastException() const
-{
-  return m_lastException;
-}
-
-} // namespace tests
-} // namespace nfd
diff --git a/tests/core/limited-io.hpp b/tests/core/limited-io.hpp
deleted file mode 100644
index 2d5788c..0000000
--- a/tests/core/limited-io.hpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- 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
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * 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/>.
- **/
-
-#ifndef NFD_TEST_CORE_LIMITED_IO_HPP
-#define NFD_TEST_CORE_LIMITED_IO_HPP
-
-#include "core/global-io.hpp"
-#include "core/scheduler.hpp"
-
-namespace nfd {
-namespace tests {
-
-/** \brief provides IO operations limit and/or time limit for unit testing
- */
-class LimitedIo
-{
-public:
-  LimitedIo();
-
-  /// indicates why .run returns
-  enum StopReason
-  {
-    /// g_io.run() runs normally because there's no work to do
-    NO_WORK,
-    /// .afterOp() has been invoked nOpsLimit times
-    EXCEED_OPS,
-    /// nTimeLimit has elapsed
-    EXCEED_TIME,
-    /// an exception is thrown
-    EXCEPTION
-  };
-
-  /** \brief g_io.run() with operation count and/or time limit
-   *
-   *  \param nOpsLimit operation count limit, pass UNLIMITED_OPS for no limit
-   *  \param nTimeLimit time limit, pass UNLIMITED_TIME for no limit
-   */
-  StopReason
-  run(int nOpsLimit, const time::nanoseconds& nTimeLimit);
-
-  /// count an operation
-  void
-  afterOp();
-
-  const std::exception&
-  getLastException() const;
-
-private:
-  void
-  afterTimeout();
-
-public:
-  static const int UNLIMITED_OPS;
-  static const time::nanoseconds UNLIMITED_TIME;
-
-private:
-  bool m_isRunning;
-  int m_nOpsRemaining;
-  EventId m_timeout;
-  StopReason m_reason;
-  std::exception m_lastException;
-};
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TEST_CORE_LIMITED_IO_HPP
diff --git a/tests/core/version.cpp b/tests/core/version.cpp
index ee29615..669a866 100644
--- a/tests/core/version.cpp
+++ b/tests/core/version.cpp
@@ -22,7 +22,7 @@
  * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  **/
 
-#include "core/version.hpp"
+#include "version.hpp"
 #include "core/logger.hpp"
 
 #include "tests/test-common.hpp"
