management: nfd::FibEntry encoding corrections
Change-Id: I958c171d7a8f47e8ccfe443d839c211f8af29a98
Refs: #1378
diff --git a/tests/management/test-nfd-fib-entry.cpp b/tests/management/test-nfd-fib-entry.cpp
index fb3383c..e92c39f 100644
--- a/tests/management/test-nfd-fib-entry.cpp
+++ b/tests/management/test-nfd-fib-entry.cpp
@@ -28,14 +28,10 @@
const uint8_t TestFibEntry[] =
{
- 0x80, 0x38, 0x07, 0x13, 0x08, 0x04, 0x74, 0x68,
- 0x69, 0x73, 0x08, 0x02, 0x69, 0x73, 0x08, 0x01,
- 0x61, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x81,
- 0x07, 0x69, 0x01, 0x28, 0x6a, 0x02, 0x01, 0xf4,
- 0x81, 0x07, 0x69, 0x01, 0x1e, 0x6a, 0x02, 0x01,
- 0x90, 0x81, 0x07, 0x69, 0x01, 0x14, 0x6a, 0x02,
- 0x01, 0x2c, 0x81, 0x06, 0x69, 0x01, 0x0a, 0x6a,
- 0x01, 0xc8
+ 0x80, 0x38, 0x07, 0x13, 0x08, 0x04, 0x74, 0x68, 0x69, 0x73, 0x08, 0x02, 0x69, 0x73, 0x08, 0x01,
+ 0x61, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x81, 0x06, 0x69, 0x01, 0x0a, 0x6a, 0x01, 0xc8, 0x81,
+ 0x07, 0x69, 0x01, 0x14, 0x6a, 0x02, 0x01, 0x2c, 0x81, 0x07, 0x69, 0x01, 0x1e, 0x6a, 0x02, 0x01,
+ 0x90, 0x81, 0x07, 0x69, 0x01, 0x28, 0x6a, 0x02, 0x01, 0xf4
};
BOOST_AUTO_TEST_CASE(TestNextHopRecordEncode)
@@ -106,14 +102,13 @@
entry.addNextHopRecord(oneMore);
const Block& wire = entry.wireEncode();
- BOOST_REQUIRE_EQUAL_COLLECTIONS(TestFibEntry,
- TestFibEntry + sizeof(TestFibEntry),
- wire.begin(), wire.end());
+ BOOST_CHECK_EQUAL_COLLECTIONS(TestFibEntry,
+ TestFibEntry + sizeof(TestFibEntry),
+ wire.begin(), wire.end());
// std::ofstream of("out.tmp");
// of.write((const char*)entry.wireEncode().wire(),
// entry.wireEncode().size());
-
}
BOOST_AUTO_TEST_CASE(TestFibEntryDecode)
@@ -124,10 +119,10 @@
std::list<NextHopRecord> records = entry.getNextHopRecords();
- BOOST_REQUIRE_EQUAL(entry.getPrefix(), "/this/is/a/test");
- BOOST_REQUIRE_EQUAL(entry.getNextHopRecords().size(), 4);
+ BOOST_CHECK_EQUAL(entry.getPrefix(), "/this/is/a/test");
+ BOOST_CHECK_EQUAL(entry.getNextHopRecords().size(), 4);
- size_t value = 4;
+ size_t value = 1;
for (std::list<NextHopRecord>::const_iterator i = records.begin();
i != records.end();
@@ -135,7 +130,7 @@
{
BOOST_CHECK_EQUAL(i->getFaceId(), value * 10);
BOOST_CHECK_EQUAL(i->getCost(), (value * 100) + 100);
- --value;
+ ++value;
}
}