rib: move entire subdir to daemon/rib
Refs: #4528
Change-Id: I7de03631ddef0f014f12f979373aa449f42486d1
diff --git a/tests/rib/rib-test-common.hpp b/tests/daemon/rib/create-route.hpp
similarity index 73%
rename from tests/rib/rib-test-common.hpp
rename to tests/daemon/rib/create-route.hpp
index 8cddafe..b248575 100644
--- a/tests/rib/rib-test-common.hpp
+++ b/tests/daemon/rib/create-route.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -23,8 +23,8 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NFD_TESTS_RIB_RIB_TEST_COMMON_HPP
-#define NFD_TESTS_RIB_RIB_TEST_COMMON_HPP
+#ifndef NFD_TESTS_DAEMON_RIB_CREATE_ROUTE_HPP
+#define NFD_TESTS_DAEMON_RIB_CREATE_ROUTE_HPP
#include "rib/route.hpp"
@@ -34,21 +34,20 @@
inline Route
createRoute(uint64_t faceId,
- std::underlying_type<ndn::nfd::RouteOrigin>::type origin,
+ std::underlying_type_t<ndn::nfd::RouteOrigin> origin,
uint64_t cost = 0,
- std::underlying_type<ndn::nfd::RouteFlags>::type flags = ndn::nfd::ROUTE_FLAGS_NONE)
+ std::underlying_type_t<ndn::nfd::RouteFlags> flags = ndn::nfd::ROUTE_FLAGS_NONE)
{
- Route temp;
- temp.faceId = faceId;
- temp.origin = static_cast<ndn::nfd::RouteOrigin>(origin);
- temp.cost = cost;
- temp.flags = flags;
-
- return temp;
+ Route r;
+ r.faceId = faceId;
+ r.origin = static_cast<ndn::nfd::RouteOrigin>(origin);
+ r.cost = cost;
+ r.flags = flags;
+ return r;
}
} // namespace tests
} // namespace rib
} // namespace nfd
-#endif // NFD_TESTS_RIB_RIB_TEST_COMMON_HPP
+#endif // NFD_TESTS_DAEMON_RIB_CREATE_ROUTE_HPP
diff --git a/tests/rib/fib-updates-common.hpp b/tests/daemon/rib/fib-updates-common.hpp
similarity index 88%
rename from tests/rib/fib-updates-common.hpp
rename to tests/daemon/rib/fib-updates-common.hpp
index 66b1c8e..4668af5 100644
--- a/tests/rib/fib-updates-common.hpp
+++ b/tests/daemon/rib/fib-updates-common.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -23,13 +23,13 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NFD_TESTS_RIB_FIB_UPDATES_COMMON_HPP
-#define NFD_TESTS_RIB_FIB_UPDATES_COMMON_HPP
+#ifndef NFD_TESTS_DAEMON_RIB_FIB_UPDATES_COMMON_HPP
+#define NFD_TESTS_DAEMON_RIB_FIB_UPDATES_COMMON_HPP
#include "rib/fib-updater.hpp"
-#include "rib-test-common.hpp"
#include "tests/identity-management-fixture.hpp"
+#include "tests/daemon/rib/create-route.hpp"
#include <ndn-cxx/util/dummy-client-face.hpp>
@@ -72,8 +72,9 @@
void
insertRoute(const Name& name, uint64_t faceId,
- std::underlying_type<ndn::nfd::RouteOrigin>::type origin,
- uint64_t cost, std::underlying_type<ndn::nfd::RouteFlags>::type flags)
+ std::underlying_type_t<ndn::nfd::RouteOrigin> origin,
+ uint64_t cost,
+ std::underlying_type_t<ndn::nfd::RouteFlags> flags)
{
Route route = createRoute(faceId, origin, cost, flags);
@@ -88,7 +89,7 @@
void
eraseRoute(const Name& name, uint64_t faceId,
- std::underlying_type<ndn::nfd::RouteOrigin>::type origin)
+ std::underlying_type_t<ndn::nfd::RouteOrigin> origin)
{
Route route = createRoute(faceId, origin, 0, 0);
@@ -155,4 +156,4 @@
} // namespace rib
} // namespace nfd
-#endif // NFD_TESTS_RIB_FIB_UPDATES_COMMON_HPP
+#endif // NFD_TESTS_DAEMON_RIB_FIB_UPDATES_COMMON_HPP
diff --git a/tests/rib/fib-updates-erase-face.t.cpp b/tests/daemon/rib/fib-updates-erase-face.t.cpp
similarity index 100%
rename from tests/rib/fib-updates-erase-face.t.cpp
rename to tests/daemon/rib/fib-updates-erase-face.t.cpp
diff --git a/tests/rib/fib-updates-new-face.t.cpp b/tests/daemon/rib/fib-updates-new-face.t.cpp
similarity index 100%
rename from tests/rib/fib-updates-new-face.t.cpp
rename to tests/daemon/rib/fib-updates-new-face.t.cpp
diff --git a/tests/rib/fib-updates-new-namespace.t.cpp b/tests/daemon/rib/fib-updates-new-namespace.t.cpp
similarity index 100%
rename from tests/rib/fib-updates-new-namespace.t.cpp
rename to tests/daemon/rib/fib-updates-new-namespace.t.cpp
diff --git a/tests/rib/fib-updates-update-face.t.cpp b/tests/daemon/rib/fib-updates-update-face.t.cpp
similarity index 100%
rename from tests/rib/fib-updates-update-face.t.cpp
rename to tests/daemon/rib/fib-updates-update-face.t.cpp
diff --git a/tests/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp b/tests/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
similarity index 100%
rename from tests/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
rename to tests/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
diff --git a/tests/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp b/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
similarity index 100%
rename from tests/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
rename to tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
diff --git a/tests/rib/readvertise/nfd-rib-readvertise-destination.t.cpp b/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
similarity index 100%
rename from tests/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
rename to tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
diff --git a/tests/rib/readvertise/readvertise.t.cpp b/tests/daemon/rib/readvertise/readvertise.t.cpp
similarity index 100%
rename from tests/rib/readvertise/readvertise.t.cpp
rename to tests/daemon/rib/readvertise/readvertise.t.cpp
diff --git a/tests/rib/rib-entry.t.cpp b/tests/daemon/rib/rib-entry.t.cpp
similarity index 100%
rename from tests/rib/rib-entry.t.cpp
rename to tests/daemon/rib/rib-entry.t.cpp
diff --git a/tests/rib/rib-manager.t.cpp b/tests/daemon/rib/rib-manager.t.cpp
similarity index 100%
rename from tests/rib/rib-manager.t.cpp
rename to tests/daemon/rib/rib-manager.t.cpp
diff --git a/tests/rib/rib-update.t.cpp b/tests/daemon/rib/rib-update.t.cpp
similarity index 95%
rename from tests/rib/rib-update.t.cpp
rename to tests/daemon/rib/rib-update.t.cpp
index f40730f..22577f0 100644
--- a/tests/rib/rib-update.t.cpp
+++ b/tests/daemon/rib/rib-update.t.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-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,8 @@
#include "rib/rib-update.hpp"
#include "rib/rib-update-batch.hpp"
-#include "rib-test-common.hpp"
#include "tests/test-common.hpp"
+#include "tests/daemon/rib/create-route.hpp"
namespace nfd {
namespace rib {
diff --git a/tests/rib/rib.t.cpp b/tests/daemon/rib/rib.t.cpp
similarity index 98%
rename from tests/rib/rib.t.cpp
rename to tests/daemon/rib/rib.t.cpp
index 3b9840c..26a47b3 100644
--- a/tests/rib/rib.t.cpp
+++ b/tests/daemon/rib/rib.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,8 @@
#include "rib/rib.hpp"
-#include "rib-test-common.hpp"
#include "tests/test-common.hpp"
+#include "tests/daemon/rib/create-route.hpp"
namespace nfd {
namespace rib {
diff --git a/tests/rib/route.t.cpp b/tests/daemon/rib/route.t.cpp
similarity index 100%
rename from tests/rib/route.t.cpp
rename to tests/daemon/rib/route.t.cpp
diff --git a/tests/rib/service.t.cpp b/tests/daemon/rib/service.t.cpp
similarity index 100%
rename from tests/rib/service.t.cpp
rename to tests/daemon/rib/service.t.cpp
diff --git a/tests/rib/sl-announce.t.cpp b/tests/daemon/rib/sl-announce.t.cpp
similarity index 100%
rename from tests/rib/sl-announce.t.cpp
rename to tests/daemon/rib/sl-announce.t.cpp
diff --git a/tests/other/wscript b/tests/other/wscript
index b09be43..da57688 100644
--- a/tests/other/wscript
+++ b/tests/other/wscript
@@ -1,6 +1,6 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
"""
-Copyright (c) 2014-2018, Regents of the University of California,
+Copyright (c) 2014-2019, Regents of the University of California,
Arizona Board of Regents,
Colorado State University,
University Pierre & Marie Curie, Sorbonne University,
@@ -37,7 +37,7 @@
bld.program(name=module,
target='../../%s' % module,
source=bld.path.ant_glob('%s*.cpp' % module),
- use='daemon-objects rib-objects unit-tests-base other-tests-%s-main' % module,
+ use='daemon-objects unit-tests-base other-tests-%s-main' % module,
defines=['UNIT_TEST_CONFIG_PATH="%s"' % bld.bldnode.make_node('tmp-files')],
install_path=None)
@@ -45,5 +45,5 @@
bld.program(name='face-benchmark',
target='../../face-benchmark',
source=bld.path.ant_glob('face-benchmark*.cpp'),
- use='daemon-objects rib-objects',
+ use='daemon-objects',
install_path=None)
diff --git a/tests/wscript b/tests/wscript
index 2103753..7f5b321 100644
--- a/tests/wscript
+++ b/tests/wscript
@@ -1,6 +1,6 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
"""
-Copyright (c) 2014-2018, Regents of the University of California,
+Copyright (c) 2014-2019, Regents of the University of California,
Arizona Board of Regents,
Colorado State University,
University Pierre & Marie Curie, Sorbonne University,
@@ -39,17 +39,18 @@
headers='../core/common.hpp boost-test.hpp',
defines=[config_path])
- for module, name in {"core": "Core Tests",
- "daemon": "Daemon Tests",
- "rib": "RIB Tests",
- "tools": "Tools Tests"}.items():
+ for module, name in {'core': 'Core Tests',
+ 'daemon': 'Daemon Tests',
+ 'rib': 'RIB Tests',
+ 'tools': 'Tools Tests'}.items():
# main() for the module
bld.objects(target='unit-tests-%s-main' % module,
source='main.cpp',
use='BOOST',
defines=['BOOST_TEST_MODULE=%s' % name])
- node = bld.path.find_dir(module)
+ subdir = 'daemon/rib' if module == 'rib' else module
+ node = bld.path.find_dir(subdir)
src = node.ant_glob('**/*.cpp', excl=['face/*ethernet*.cpp',
'face/pcap*.cpp',
'face/unix*.cpp',
@@ -62,21 +63,14 @@
if bld.env.HAVE_WEBSOCKET:
src += node.ant_glob('face/websocket*.cpp')
- # unit-tests-%module
- if module == "daemon":
- bld.program(name='unit-tests-%s' % module,
- target='../unit-tests-%s' % module,
- source=src,
- use='%s-objects rib-objects unit-tests-base unit-tests-%s-main' % (module, module),
- defines=[config_path],
- install_path=None)
- else:
- bld.program(name='unit-tests-%s' % module,
- target='../unit-tests-%s' % module,
- source=src,
- use='%s-objects unit-tests-base unit-tests-%s-main' % (module, module),
- defines=[config_path],
- install_path=None)
+ objmod = 'daemon' if module == 'rib' else module
+ # unit-tests binary for the module
+ bld.program(name='unit-tests-%s' % module,
+ target='../unit-tests-%s' % module,
+ source=src,
+ use='%s-objects unit-tests-base unit-tests-%s-main' % (objmod, module),
+ defines=[config_path],
+ install_path=None)
# Other tests (e.g., stress tests and benchmarks that can be enabled even if unit tests are disabled)
if bld.env.WITH_TESTS or bld.env.WITH_OTHER_TESTS: