link: simplify with DelegationList
refs #4055
Change-Id: Id8280037beb7d128cda8faa8ed1ed21e2209ba97
diff --git a/tests/unit-tests/interest.t.cpp b/tests/unit-tests/interest.t.cpp
index 3e31438..295af50 100644
--- a/tests/unit-tests/interest.t.cpp
+++ b/tests/unit-tests/interest.t.cpp
@@ -221,7 +221,7 @@
};
const uint8_t InterestWithLinkMissingContentType[] = {
- 0x05, 0xf8, // Interest
+ 0x05, 0xf5, // Interest
0x07, 0x14, // Name
0x08, 0x5, // NameComponent
0x6c, 0x6f, 0x63, 0x61, 0x6c,
@@ -276,13 +276,11 @@
0x64, 0xd6, 0x66, 0xb4, 0xe9, 0x8d, 0x0c, 0x28, 0x43, 0xee, 0xa6, 0x64, 0xe8,
0x55, 0xf6, 0x1c, 0x19, 0x0b, 0xef, 0x99, 0x25, 0x1e, 0xdc, 0x78, 0xb3, 0xa7,
0xaa, 0x0d, 0x14, 0x58, 0x30, 0xe5, 0x37, 0x6a, 0x6d, 0xdb, 0x56, 0xac, 0xa3,
- 0xfc, 0x90, 0x7a, 0xb8, 0x66, 0x9c, 0x0e, 0xf6, 0xb7, 0x64, 0xd1,
- 0x20, 0x01, // SelectedDelegation
- 0x00
+ 0xfc, 0x90, 0x7a, 0xb8, 0x66, 0x9c, 0x0e, 0xf6, 0xb7, 0x64, 0xd1
};
const uint8_t InterestWithLinkNoMetaInfo[] = {
- 0x05, 0xf2, // Interest
+ 0x05, 0xef, // Interest
0x07, 0x14, // Name
0x08, 0x5, // NameComponent
0x6c, 0x6f, 0x63, 0x61, 0x6c,
@@ -334,13 +332,11 @@
0x64, 0xd6, 0x66, 0xb4, 0xe9, 0x8d, 0x0c, 0x28, 0x43, 0xee, 0xa6, 0x64, 0xe8,
0x55, 0xf6, 0x1c, 0x19, 0x0b, 0xef, 0x99, 0x25, 0x1e, 0xdc, 0x78, 0xb3, 0xa7,
0xaa, 0x0d, 0x14, 0x58, 0x30, 0xe5, 0x37, 0x6a, 0x6d, 0xdb, 0x56, 0xac, 0xa3,
- 0xfc, 0x90, 0x7a, 0xb8, 0x66, 0x9c, 0x0e, 0xf6, 0xb7, 0x64, 0xd1,
- 0x20, 0x01, // SelectedDelegation
- 0x00
+ 0xfc, 0x90, 0x7a, 0xb8, 0x66, 0x9c, 0x0e, 0xf6, 0xb7, 0x64, 0xd1
};
const uint8_t InterestWithLinkWrongContentType[] = {
- 0x05, 0xfb, // Interest
+ 0x05, 0xf8, // Interest
0x07, 0x14, // Name
0x08, 0x5, // NameComponent
0x6c, 0x6f, 0x63, 0x61, 0x6c,
@@ -397,9 +393,7 @@
0x64, 0xd6, 0x66, 0xb4, 0xe9, 0x8d, 0x0c, 0x28, 0x43, 0xee, 0xa6, 0x64, 0xe8,
0x55, 0xf6, 0x1c, 0x19, 0x0b, 0xef, 0x99, 0x25, 0x1e, 0xdc, 0x78, 0xb3, 0xa7,
0xaa, 0x0d, 0x14, 0x58, 0x30, 0xe5, 0x37, 0x6a, 0x6d, 0xdb, 0x56, 0xac, 0xa3,
- 0xfc, 0x90, 0x7a, 0xb8, 0x66, 0x9c, 0x0e, 0xf6, 0xb7, 0x64, 0xd1,
- 0x20, 0x01, // SelectedDelegation
- 0x00
+ 0xfc, 0x90, 0x7a, 0xb8, 0x66, 0x9c, 0x0e, 0xf6, 0xb7, 0x64, 0xd1
};
const uint8_t InterestWithSelectedDelegationButNoLink[] = {
@@ -932,9 +926,7 @@
Block interestBlock(InterestWithLinkMissingContentType,
sizeof(InterestWithLinkMissingContentType));
- ndn::Interest i;
- BOOST_REQUIRE_NO_THROW(i.wireDecode(interestBlock));
- BOOST_REQUIRE_THROW(i.getLink(), Link::Error);
+ BOOST_CHECK_THROW(Interest(interestBlock).getLink(), tlv::Error);
}
BOOST_AUTO_TEST_CASE(LinkObjectNoMetaInfo)
@@ -942,10 +934,7 @@
Block interestBlock(InterestWithLinkNoMetaInfo,
sizeof(InterestWithLinkNoMetaInfo));
- ndn::Interest i;
- BOOST_REQUIRE_NO_THROW(i.wireDecode(interestBlock));
- BOOST_CHECK_THROW(i.getLink(), tlv::Error);
- BOOST_CHECK_THROW(i.getLink(), tlv::Error);
+ BOOST_CHECK_THROW(Interest(interestBlock).getLink(), tlv::Error);
}
BOOST_AUTO_TEST_CASE(LinkObjectWrongContentType)
@@ -953,9 +942,7 @@
Block interestBlock(InterestWithLinkWrongContentType,
sizeof(InterestWithLinkWrongContentType));
- ndn::Interest i;
- BOOST_REQUIRE_NO_THROW(i.wireDecode(interestBlock));
- BOOST_CHECK_THROW(i.getLink(), Link::Error);
+ BOOST_CHECK_THROW(Interest(interestBlock).getLink(), tlv::Error);
}
BOOST_AUTO_TEST_CASE(InterestContainingSelectedDelegationButNoLink)