core: drop std::function and ndn::Exclude from common.hpp, add ndn::optional
Change-Id: Ie3983d8b6f9929430efd8ada8d942e3f95755cd4
diff --git a/tests/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp b/tests/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
index 6535a87..6925de1 100644
--- a/tests/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
+++ b/tests/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
@@ -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-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -46,7 +46,7 @@
RibRouteRef rrr{entry, routeIt};
ClientToNlsrReadvertisePolicy policy;
- ndn::optional<ReadvertiseAction> action = policy.handleNewRoute(rrr);
+ optional<ReadvertiseAction> action = policy.handleNewRoute(rrr);
BOOST_REQUIRE(action);
BOOST_CHECK_EQUAL(action->prefix, "/test/A");
@@ -63,7 +63,7 @@
RibRouteRef rrr{entry, routeIt};
ClientToNlsrReadvertisePolicy policy;
- ndn::optional<ReadvertiseAction> action = policy.handleNewRoute(rrr);
+ optional<ReadvertiseAction> action = policy.handleNewRoute(rrr);
BOOST_CHECK(!action);
}
diff --git a/tests/rib/readvertise/readvertise.t.cpp b/tests/rib/readvertise/readvertise.t.cpp
index 14949b8..5de7208 100644
--- a/tests/rib/readvertise/readvertise.t.cpp
+++ b/tests/rib/readvertise/readvertise.t.cpp
@@ -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-2018, 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/readvertise/readvertise.hpp"
-#include "tests/test-common.hpp"
#include "tests/identity-management-fixture.hpp"
+
#include <ndn-cxx/mgmt/nfd/controller.hpp>
#include <ndn-cxx/util/dummy-client-face.hpp>
#include <boost/range/adaptor/transformed.hpp>
@@ -41,7 +41,7 @@
class DummyReadvertisePolicy : public ReadvertisePolicy
{
public:
- ndn::optional<ReadvertiseAction>
+ optional<ReadvertiseAction>
handleNewRoute(const RibRouteRef& route) const override
{
return this->decision;
@@ -54,7 +54,7 @@
}
public:
- ndn::optional<ReadvertiseAction> decision;
+ optional<ReadvertiseAction> decision;
};
class DummyReadvertiseDestination : public ReadvertiseDestination
@@ -195,7 +195,7 @@
BOOST_AUTO_TEST_CASE(NoAdvertise)
{
- policy->decision = ndn::nullopt;
+ policy->decision = nullopt;
this->insertRoute("/A/1", 1, ndn::nfd::ROUTE_ORIGIN_CLIENT);
this->insertRoute("/A/2", 1, ndn::nfd::ROUTE_ORIGIN_CLIENT);
diff --git a/tests/rib/rib-manager.t.cpp b/tests/rib/rib-manager.t.cpp
index 55ae1c8..cdf1581 100644
--- a/tests/rib/rib-manager.t.cpp
+++ b/tests/rib/rib-manager.t.cpp
@@ -452,7 +452,7 @@
Route route;
route.faceId = ++faceId;
route.cost = route.faceId * 10;
- route.expires = ndn::nullopt;
+ route.expires = nullopt;
return route;
};
diff --git a/tests/rib/rib.t.cpp b/tests/rib/rib.t.cpp
index e572a72..420a82d 100644
--- a/tests/rib/rib.t.cpp
+++ b/tests/rib/rib.t.cpp
@@ -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-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -291,17 +291,17 @@
Route root = createRoute(1, 20);
Name name1("/");
- root.expires = ndn::nullopt;
+ root.expires = nullopt;
rib.insert(name1, root);
Route route1 = createRoute(2, 20);
Name name2("/hello");
- route1.expires = ndn::nullopt;
+ route1.expires = nullopt;
rib.insert(name2, route1);
Route route2 = createRoute(3, 20);
Name name3("/hello/world");
- route2.expires = ndn::nullopt;
+ route2.expires = nullopt;
rib.insert(name3, route2);
const std::string ribStr = std::string(R"TEXT(
diff --git a/tests/rib/route.t.cpp b/tests/rib/route.t.cpp
index d7b70eb..4d66d0d 100644
--- a/tests/rib/route.t.cpp
+++ b/tests/rib/route.t.cpp
@@ -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-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -24,6 +24,7 @@
*/
#include "rib/route.hpp"
+
#include "tests/test-common.hpp"
namespace nfd {
@@ -63,9 +64,9 @@
BOOST_CHECK_NE(a, b);
a.cost = 103;
- b.expires = ndn::nullopt;
+ b.expires = nullopt;
BOOST_CHECK_NE(a, b);
- a.expires = ndn::nullopt;
+ a.expires = nullopt;
BOOST_CHECK_EQUAL(a, b);
}
@@ -84,7 +85,7 @@
BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(r),
"Route(faceid: 4980, origin: static, cost: 2312, flags: 0x1, expires in: 791214234 milliseconds)");
- r.expires = ndn::nullopt;
+ r.expires = nullopt;
BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(r),
"Route(faceid: 4980, origin: static, cost: 2312, flags: 0x1, never expires)");
}