tests+mgmt: Import common unit test code NFD
This commit introduces BaseFixture, UnitTestTimeFixture,
IdentityManagementFixture, and IdentityManagementTimeFixture.
In addition to that, the command line of the unit test binary (for boost
libraries before 1.62) are extended to support multi-format output.
This commit also addresses a strange bug in the management tool that was
causing spurious segmentation faults during unit tests.
Change-Id: Ib34b4007773f0b35d9ed919eebbdc4e0d413fa1e
diff --git a/tests/unit/clients/iterative-query-controller.cpp b/tests/unit/clients/iterative-query-controller.cpp
index a34375b..93bbb4e 100644
--- a/tests/unit/clients/iterative-query-controller.cpp
+++ b/tests/unit/clients/iterative-query-controller.cpp
@@ -19,13 +19,9 @@
#include "clients/iterative-query-controller.hpp"
#include "daemon/name-server.hpp"
-#include "logger.hpp"
-#include "../database-test-data.hpp"
-#include "../../boost-test.hpp"
-#include <ndn-cxx/util/dummy-client-face.hpp>
-
-#include <boost/asio.hpp>
+#include "test-common.hpp"
+#include "unit/database-test-data.hpp"
namespace ndn {
namespace ndns {
diff --git a/tests/unit/clients/query.cpp b/tests/unit/clients/query.cpp
index 6fdca35..40fdfc3 100644
--- a/tests/unit/clients/query.cpp
+++ b/tests/unit/clients/query.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2016, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -19,7 +19,7 @@
#include "clients/query.hpp"
-#include "../../boost-test.hpp"
+#include "test-common.hpp"
namespace ndn {
namespace ndns {
@@ -69,6 +69,6 @@
BOOST_AUTO_TEST_SUITE_END()
-}// namespace tests
-}// namespace ndns
+} // namespace tests
+} // namespace ndns
} // namespace ndn
diff --git a/tests/unit/clients/response.cpp b/tests/unit/clients/response.cpp
index 7332c35..5950063 100644
--- a/tests/unit/clients/response.cpp
+++ b/tests/unit/clients/response.cpp
@@ -18,20 +18,17 @@
*/
#include "clients/response.hpp"
-#include <ndn-cxx/security/key-chain.hpp>
-#include "../../boost-test.hpp"
+
+#include "test-common.hpp"
namespace ndn {
namespace ndns {
namespace tests {
-
-
-BOOST_AUTO_TEST_SUITE(Response)
+BOOST_FIXTURE_TEST_SUITE(Response, IdentityManagementFixture)
BOOST_AUTO_TEST_CASE(Basic)
{
- KeyChain keyChain("sqlite3", "file");
Name hint;
Name zone("/net");
name::Component qType = ndns::label::NDNS_ITERATIVE_QUERY;
@@ -54,7 +51,7 @@
//const Block& block = r.wireEncode();
shared_ptr<Data> data = r.toData();
- // keyChain.sign(*data);
+ // m_keyChain.sign(*data);
ndns::Response r2;
BOOST_CHECK_EQUAL(r2.fromData(hint, zone, *data), true);
@@ -75,7 +72,7 @@
BOOST_CHECK_NE(r2, r4);
data = r4.toData();
- // keyChain.sign(*data);
+ // m_keyChain.sign(*data);
ndns::Response r5(zone, qType);