route: use ndn::FaceUri type for faceUri
refs #4227
Change-Id: I1b0d7ed97e43e4d0c50770ed306cbe85382dfc9a
diff --git a/tests/route/test-link-state-calculator.cpp b/tests/route/test-link-state-calculator.cpp
index 0a4c522..73421b0 100644
--- a/tests/route/test-link-state-calculator.cpp
+++ b/tests/route/test-link-state-calculator.cpp
@@ -35,6 +35,15 @@
namespace test {
constexpr ndn::time::system_clock::time_point MAX_TIME = ndn::time::system_clock::time_point::max();
+static const ndn::Name ROUTER_A_NAME = "/ndn/site/%C1.Router/this-router";
+static const ndn::Name ROUTER_B_NAME = "/ndn/site/%C1.Router/b";
+static const ndn::Name ROUTER_C_NAME = "/ndn/site/%C1.Router/c";
+static const ndn::FaceUri ROUTER_A_FACE("udp4://10.0.0.1");
+static const ndn::FaceUri ROUTER_B_FACE("udp4://10.0.0.2");
+static const ndn::FaceUri ROUTER_C_FACE("udp4://10.0.0.3");
+constexpr double LINK_AB_COST = 5;
+constexpr double LINK_AC_COST = 10;
+constexpr double LINK_BC_COST = 17;
class LinkStateCalculatorFixture : public IoKeyChainFixture
{
@@ -53,9 +62,9 @@
// Triangle topology with routers A, B, C connected
void setUpTopology()
{
- Adjacent a(ROUTER_A_NAME, ndn::FaceUri(ROUTER_A_FACE), 0, Adjacent::STATUS_ACTIVE, 0, 0);
- Adjacent b(ROUTER_B_NAME, ndn::FaceUri(ROUTER_B_FACE), 0, Adjacent::STATUS_ACTIVE, 0, 0);
- Adjacent c(ROUTER_C_NAME, ndn::FaceUri(ROUTER_C_FACE), 0, Adjacent::STATUS_ACTIVE, 0, 0);
+ Adjacent a(ROUTER_A_NAME, ROUTER_A_FACE, 0, Adjacent::STATUS_ACTIVE, 0, 0);
+ Adjacent b(ROUTER_B_NAME, ROUTER_B_FACE, 0, Adjacent::STATUS_ACTIVE, 0, 0);
+ Adjacent c(ROUTER_C_NAME, ROUTER_C_FACE, 0, Adjacent::STATUS_ACTIVE, 0, 0);
// Router A
b.setLinkCost(LINK_AB_COST);
@@ -103,32 +112,8 @@
RoutingTable& routingTable;
Lsdb& lsdb;
-
- static const ndn::Name ROUTER_A_NAME;
- static const ndn::Name ROUTER_B_NAME;
- static const ndn::Name ROUTER_C_NAME;
-
- static const std::string ROUTER_A_FACE;
- static const std::string ROUTER_B_FACE;
- static const std::string ROUTER_C_FACE;
-
- static const double LINK_AB_COST;
- static const double LINK_AC_COST;
- static const double LINK_BC_COST;
};
-const ndn::Name LinkStateCalculatorFixture::ROUTER_A_NAME = "/ndn/site/%C1.Router/this-router";
-const ndn::Name LinkStateCalculatorFixture::ROUTER_B_NAME = "/ndn/site/%C1.Router/b";
-const ndn::Name LinkStateCalculatorFixture::ROUTER_C_NAME = "/ndn/site/%C1.Router/c";
-
-const std::string LinkStateCalculatorFixture::ROUTER_A_FACE = "udp4://10.0.0.1";
-const std::string LinkStateCalculatorFixture::ROUTER_B_FACE = "udp4://10.0.0.2";
-const std::string LinkStateCalculatorFixture::ROUTER_C_FACE = "udp4://10.0.0.3";
-
-const double LinkStateCalculatorFixture::LINK_AB_COST = 5;
-const double LinkStateCalculatorFixture::LINK_AC_COST = 10;
-const double LinkStateCalculatorFixture::LINK_BC_COST = 17;
-
BOOST_FIXTURE_TEST_SUITE(TestLinkStateRoutingCalculator, LinkStateCalculatorFixture)
BOOST_AUTO_TEST_CASE(Basic)
@@ -144,7 +129,7 @@
BOOST_REQUIRE_EQUAL(bHopList.getNextHops().size(), 2);
for (const NextHop& hop : bHopList) {
- std::string faceUri = hop.getConnectingFaceUri();
+ auto faceUri = hop.getConnectingFaceUri();
uint64_t cost = hop.getRouteCostAsAdjustedInteger();
BOOST_CHECK((faceUri == ROUTER_B_FACE && cost == LINK_AB_COST) ||
@@ -160,7 +145,7 @@
BOOST_REQUIRE_EQUAL(cHopList.getNextHops().size(), 2);
for (const NextHop& hop : cHopList) {
- std::string faceUri = hop.getConnectingFaceUri();
+ auto faceUri = hop.getConnectingFaceUri();
uint64_t cost = hop.getRouteCostAsAdjustedInteger();
BOOST_CHECK((faceUri == ROUTER_C_FACE && cost == LINK_AC_COST) ||
@@ -192,7 +177,7 @@
BOOST_REQUIRE_EQUAL(bHopList.getNextHops().size(), 2);
for (const NextHop& hop : bHopList) {
- std::string faceUri = hop.getConnectingFaceUri();
+ auto faceUri = hop.getConnectingFaceUri();
uint64_t cost = hop.getRouteCostAsAdjustedInteger();
BOOST_CHECK((faceUri == ROUTER_B_FACE && cost == LINK_AB_COST) ||
@@ -208,7 +193,7 @@
BOOST_REQUIRE_EQUAL(cHopList.getNextHops().size(), 2);
for (const NextHop& hop : cHopList) {
- std::string faceUri = hop.getConnectingFaceUri();
+ auto faceUri = hop.getConnectingFaceUri();
uint64_t cost = hop.getRouteCostAsAdjustedInteger();
BOOST_CHECK((faceUri == ROUTER_C_FACE && cost == LINK_AC_COST) ||