fw: reorder function params to make the strategy API more uniform
Also add a non-const overload of Face::getCounters to avoid const_cast
Refs: #5173
Change-Id: Iff0bfbdedb90e68a373090cf3f247d9a7501f58d
diff --git a/tests/daemon/fw/unsolicited-data-policy.t.cpp b/tests/daemon/fw/unsolicited-data-policy.t.cpp
index 21894ca..bc95d4f 100644
--- a/tests/daemon/fw/unsolicited-data-policy.t.cpp
+++ b/tests/daemon/fw/unsolicited-data-policy.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -94,18 +94,18 @@
template<typename Policy, bool shouldAdmitLocal, bool shouldAdmitNonLocal>
struct FaceScopePolicyTest
{
- typedef Policy PolicyType;
- typedef std::integral_constant<bool, shouldAdmitLocal> ShouldAdmitLocal;
- typedef std::integral_constant<bool, shouldAdmitNonLocal> ShouldAdmitNonLocal;
+ using PolicyType = Policy;
+ using ShouldAdmitLocal = std::integral_constant<bool, shouldAdmitLocal>;
+ using ShouldAdmitNonLocal = std::integral_constant<bool, shouldAdmitNonLocal>;
};
-typedef boost::mpl::vector<
+using FaceScopePolicyTests = boost::mpl::vector<
FaceScopePolicyTest<void, false, false>, // default policy
FaceScopePolicyTest<DropAllUnsolicitedDataPolicy, false, false>,
FaceScopePolicyTest<AdmitLocalUnsolicitedDataPolicy, true, false>,
FaceScopePolicyTest<AdmitNetworkUnsolicitedDataPolicy, false, true>,
FaceScopePolicyTest<AdmitAllUnsolicitedDataPolicy, true, true>
-> FaceScopePolicyTests;
+>;
BOOST_AUTO_TEST_CASE_TEMPLATE(FaceScopePolicy, T, FaceScopePolicyTests)
{
@@ -115,16 +115,16 @@
ndn::nfd::FACE_SCOPE_LOCAL);
faceTable.add(face1);
- shared_ptr<Data> data1 = makeData("/unsolicited-from-local");
- forwarder.onIncomingData(FaceEndpoint(*face1, 0), *data1);
+ auto data1 = makeData("/unsolicited-from-local");
+ forwarder.onIncomingData(*data1, FaceEndpoint(*face1, 0));
BOOST_CHECK_EQUAL(isInCs(*data1), T::ShouldAdmitLocal::value);
auto face2 = make_shared<DummyFace>("dummy://", "dummy://",
ndn::nfd::FACE_SCOPE_NON_LOCAL);
faceTable.add(face2);
- shared_ptr<Data> data2 = makeData("/unsolicited-from-non-local");
- forwarder.onIncomingData(FaceEndpoint(*face2, 0), *data2);
+ auto data2 = makeData("/unsolicited-from-non-local");
+ forwarder.onIncomingData(*data2, FaceEndpoint(*face2, 0));
BOOST_CHECK_EQUAL(isInCs(*data2), T::ShouldAdmitNonLocal::value);
}