build: migrate to C++17
Change-Id: Ic9f09efd20b608bfcb713fd319834b2666cf6242
diff --git a/tests/route/test-routing-table-entry.cpp b/tests/route/test-routing-table-entry.cpp
index ef470e1..f30e17e 100644
--- a/tests/route/test-routing-table-entry.cpp
+++ b/tests/route/test-routing-table-entry.cpp
@@ -26,15 +26,14 @@
BOOST_AUTO_TEST_SUITE(TestRoutingTableEntry)
-BOOST_AUTO_TEST_CASE(RoutingTableEntryDestination)
+BOOST_AUTO_TEST_CASE(Destination)
{
RoutingTableEntry rte1("router1");
BOOST_CHECK_EQUAL(rte1.getDestination(), "router1");
}
-const uint8_t RoutingTableEntryWithNexthopsData[] =
-{
+const uint8_t RoutingTableEntryWithNexthopsData[] = {
// Header
0x91, 0x35,
// Destination Name
@@ -47,15 +46,14 @@
0x66, 0x66, 0x66, 0x66
};
-const uint8_t RoutingTableEntryWithoutNexthopsData[] =
-{
+const uint8_t RoutingTableEntryWithoutNexthopsData[] = {
// Header
0x91, 0x09,
// Destination Name
0x07, 0x07, 0x08, 0x05, 0x64, 0x65, 0x73, 0x74, 0x31
};
-BOOST_AUTO_TEST_CASE(RoutingTableEntryEncodeWithNexthops)
+BOOST_AUTO_TEST_CASE(EncodeWithNexthops)
{
RoutingTableEntry rte(ndn::Name("dest1"));
@@ -73,7 +71,7 @@
boost::test_tools::per_element());
}
-BOOST_AUTO_TEST_CASE(RoutingTableEntryDecodeWithNexthops)
+BOOST_AUTO_TEST_CASE(DecodeWithNexthops)
{
RoutingTableEntry rte(ndn::Block{RoutingTableEntryWithNexthopsData});
BOOST_CHECK_EQUAL(rte.getDestination(), "dest1");
@@ -88,21 +86,21 @@
BOOST_CHECK_EQUAL(it->getRouteCost(), 1.65);
}
-BOOST_AUTO_TEST_CASE(RoutingTableEntryEncodeWithoutNexthops)
+BOOST_AUTO_TEST_CASE(EncodeWithoutNexthops)
{
RoutingTableEntry rte(ndn::Name("dest1"));
BOOST_TEST(rte.wireEncode() == RoutingTableEntryWithoutNexthopsData,
boost::test_tools::per_element());
}
-BOOST_AUTO_TEST_CASE(RoutingTableEntryDecodeWithoutNexthops)
+BOOST_AUTO_TEST_CASE(DecodeWithoutNexthops)
{
RoutingTableEntry rte(ndn::Block{RoutingTableEntryWithoutNexthopsData});
BOOST_CHECK_EQUAL(rte.getDestination(), "dest1");
BOOST_CHECK_EQUAL(rte.getNexthopList().size(), 0);
}
-BOOST_AUTO_TEST_CASE(RoutingTableEntryClear)
+BOOST_AUTO_TEST_CASE(Clear)
{
RoutingTableEntry rte(ndn::Name("dest1"));
@@ -131,7 +129,7 @@
BOOST_CHECK_EQUAL(it->getRouteCost(), 99);
}
-BOOST_AUTO_TEST_CASE(RoutingTableEntryOutputStream)
+BOOST_AUTO_TEST_CASE(OutputStream)
{
RoutingTableEntry rte(ndn::Name("dest1"));
diff --git a/tests/route/test-routing-table.cpp b/tests/route/test-routing-table.cpp
index 15ad958..6bbe475 100644
--- a/tests/route/test-routing-table.cpp
+++ b/tests/route/test-routing-table.cpp
@@ -45,7 +45,7 @@
BOOST_AUTO_TEST_SUITE(TestRoutingTable)
-BOOST_FIXTURE_TEST_CASE(RoutingTableAddNextHop, RoutingTableFixture)
+BOOST_FIXTURE_TEST_CASE(AddNextHop, RoutingTableFixture)
{
NextHop nh1;
const std::string DEST_ROUTER = "destRouter";
@@ -54,8 +54,7 @@
BOOST_CHECK_EQUAL(rt.findRoutingTableEntry(DEST_ROUTER)->getDestination(), DEST_ROUTER);
}
-const uint8_t RoutingTableData1[] =
-{
+const uint8_t RoutingTableData1[] = {
// Header
0x90, 0x20,
// Routing table entry
@@ -67,39 +66,30 @@
0x66, 0x66, 0x66, 0x66, 0x66
};
-const uint8_t RoutingTableData2[] =
-{
+const uint8_t RoutingTableData2[] = {
// Header
0x90, 0x00
};
-BOOST_FIXTURE_TEST_CASE(RoutingTableEncode1, RoutingTableFixture)
+BOOST_FIXTURE_TEST_CASE(Encode, RoutingTableFixture)
{
NextHop nexthops;
nexthops.setConnectingFaceUri("nexthop");
nexthops.setRouteCost(1.65);
rt.addNextHop("dest1", nexthops);
-
- auto wire = rt.wireEncode();
- BOOST_REQUIRE_EQUAL_COLLECTIONS(RoutingTableData1,
- RoutingTableData1 + sizeof(RoutingTableData1),
- wire.begin(), wire.end());
+ BOOST_TEST(rt.wireEncode() == RoutingTableData1, boost::test_tools::per_element());
}
-BOOST_FIXTURE_TEST_CASE(RoutingTableEncode2, RoutingTableFixture)
+BOOST_FIXTURE_TEST_CASE(EncodeEmpty, RoutingTableFixture)
{
- auto wire = rt.wireEncode();
- BOOST_REQUIRE_EQUAL_COLLECTIONS(RoutingTableData2,
- RoutingTableData2 + sizeof(RoutingTableData2),
- wire.begin(), wire.end());
+ BOOST_TEST(rt.wireEncode() == RoutingTableData2, boost::test_tools::per_element());
}
-BOOST_FIXTURE_TEST_CASE(RoutingTableDecode1, RoutingTableFixture)
+BOOST_FIXTURE_TEST_CASE(Decode, RoutingTableFixture)
{
RoutingTableStatus rtStatus(ndn::Block{RoutingTableData1});
auto it1 = rtStatus.m_rTable.begin();
-
ndn::Name des1 = it1->getDestination();
BOOST_CHECK_EQUAL(des1, "dest1");
@@ -110,7 +100,7 @@
BOOST_CHECK_EQUAL(rtStatus.m_rTable.size(), 1);
}
-BOOST_FIXTURE_TEST_CASE(RoutingTableOutputStream, RoutingTableFixture)
+BOOST_FIXTURE_TEST_CASE(OutputStream, RoutingTableFixture)
{
NextHop nexthops;
nexthops.setConnectingFaceUri("nexthop");