Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
Junxiao Shi | b6e276f | 2017-08-14 20:10:04 +0000 | [diff] [blame] | 2 | /* |
Eric Newberry | 8422f57 | 2017-02-04 21:53:58 -0700 | [diff] [blame] | 3 | * Copyright (c) 2013-2017 Regents of the University of California. |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 4 | * |
| 5 | * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). |
| 6 | * |
| 7 | * ndn-cxx library is free software: you can redistribute it and/or modify it under the |
| 8 | * terms of the GNU Lesser General Public License as published by the Free Software |
| 9 | * Foundation, either version 3 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY |
| 12 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 13 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received copies of the GNU General Public License and GNU Lesser |
| 16 | * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see |
| 17 | * <http://www.gnu.org/licenses/>. |
| 18 | * |
| 19 | * See AUTHORS.md for complete list of ndn-cxx authors and contributors. |
| 20 | */ |
| 21 | |
| 22 | #include "lp/packet.hpp" |
| 23 | |
| 24 | #include "boost-test.hpp" |
| 25 | |
| 26 | namespace ndn { |
| 27 | namespace lp { |
| 28 | namespace tests { |
| 29 | |
Davide Pesavento | eee3e82 | 2016-11-26 19:19:34 +0100 | [diff] [blame] | 30 | BOOST_AUTO_TEST_SUITE(Lp) |
| 31 | BOOST_AUTO_TEST_SUITE(TestPacket) |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 32 | |
| 33 | BOOST_AUTO_TEST_CASE(FieldAccess) |
| 34 | { |
| 35 | Packet packet; |
| 36 | |
Junxiao Shi | b6e276f | 2017-08-14 20:10:04 +0000 | [diff] [blame] | 37 | BOOST_CHECK(packet.empty()); |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 38 | BOOST_CHECK(!packet.has<FragIndexField>()); |
| 39 | BOOST_CHECK_EQUAL(0, packet.count<FragIndexField>()); |
Junxiao Shi | b6e276f | 2017-08-14 20:10:04 +0000 | [diff] [blame] | 40 | |
| 41 | packet.set<FragIndexField>(1234); |
| 42 | BOOST_CHECK(!packet.empty()); |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 43 | BOOST_CHECK(packet.has<FragIndexField>()); |
| 44 | BOOST_CHECK_THROW(packet.add<FragIndexField>(5678), std::length_error); |
| 45 | BOOST_CHECK_EQUAL(1, packet.count<FragIndexField>()); |
| 46 | BOOST_CHECK_EQUAL(1234, packet.get<FragIndexField>(0)); |
| 47 | BOOST_CHECK_THROW(packet.get<FragIndexField>(1), std::out_of_range); |
| 48 | BOOST_CHECK_THROW(packet.remove<FragIndexField>(1), std::out_of_range); |
Junxiao Shi | b6e276f | 2017-08-14 20:10:04 +0000 | [diff] [blame] | 49 | |
| 50 | packet.remove<FragIndexField>(0); |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 51 | BOOST_CHECK_EQUAL(0, packet.count<FragIndexField>()); |
Junxiao Shi | b6e276f | 2017-08-14 20:10:04 +0000 | [diff] [blame] | 52 | |
| 53 | packet.add<FragIndexField>(832); |
| 54 | std::vector<uint64_t> fragIndexes = packet.list<FragIndexField>(); |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 55 | BOOST_CHECK_EQUAL(1, fragIndexes.size()); |
| 56 | BOOST_CHECK_EQUAL(832, fragIndexes.at(0)); |
Junxiao Shi | b6e276f | 2017-08-14 20:10:04 +0000 | [diff] [blame] | 57 | |
| 58 | packet.clear<FragIndexField>(); |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 59 | BOOST_CHECK_EQUAL(0, packet.count<FragIndexField>()); |
Junxiao Shi | b6e276f | 2017-08-14 20:10:04 +0000 | [diff] [blame] | 60 | BOOST_CHECK(packet.empty()); |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 61 | } |
| 62 | |
| 63 | /// \todo test field access methods with a REPEATABLE field |
| 64 | |
| 65 | BOOST_AUTO_TEST_CASE(EncodeFragment) |
| 66 | { |
| 67 | static const uint8_t expectedBlock[] = { |
Eric Newberry | 83872fd | 2015-08-06 17:01:24 -0700 | [diff] [blame] | 68 | 0x64, 0x08, // LpPacket |
| 69 | 0x51, 0x02, // Sequence |
| 70 | 0x03, 0xe8, |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 71 | 0x50, 0x02, // Fragment |
| 72 | 0x03, 0xe8, |
| 73 | }; |
| 74 | |
| 75 | Buffer buf(2); |
| 76 | buf[0] = 0x03; |
| 77 | buf[1] = 0xe8; |
| 78 | |
| 79 | Packet packet; |
| 80 | BOOST_CHECK_NO_THROW(packet.add<FragmentField>(std::make_pair(buf.begin(), buf.end()))); |
Eric Newberry | 83872fd | 2015-08-06 17:01:24 -0700 | [diff] [blame] | 81 | BOOST_CHECK_NO_THROW(packet.add<SequenceField>(1000)); |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 82 | Block wire; |
Eric Newberry | 83872fd | 2015-08-06 17:01:24 -0700 | [diff] [blame] | 83 | BOOST_CHECK_NO_THROW(wire = packet.wireEncode()); |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 84 | BOOST_CHECK_EQUAL_COLLECTIONS(expectedBlock, expectedBlock + sizeof(expectedBlock), |
| 85 | wire.begin(), wire.end()); |
| 86 | } |
| 87 | |
| 88 | BOOST_AUTO_TEST_CASE(EncodeSubTlv) |
| 89 | { |
| 90 | static const uint8_t expectedBlock[] = { |
| 91 | 0x64, 0x09, // LpPacket |
| 92 | 0xfd, 0x03, 0x20, 0x05, // Nack |
| 93 | 0xfd, 0x03, 0x21, 0x01, // NackReason |
| 94 | 0x64, |
| 95 | }; |
| 96 | |
| 97 | NackHeader nack; |
| 98 | nack.setReason(NackReason::DUPLICATE); |
| 99 | |
| 100 | Packet packet; |
| 101 | BOOST_CHECK_NO_THROW(packet.add<NackField>(nack)); |
| 102 | Block wire; |
| 103 | BOOST_REQUIRE_NO_THROW(wire = packet.wireEncode()); |
| 104 | BOOST_CHECK_EQUAL_COLLECTIONS(expectedBlock, expectedBlock + sizeof(expectedBlock), |
| 105 | wire.begin(), wire.end()); |
| 106 | } |
| 107 | |
| 108 | BOOST_AUTO_TEST_CASE(EncodeSortOrder) |
| 109 | { |
| 110 | static const uint8_t expectedBlock[] = { |
Eric Newberry | 8422f57 | 2017-02-04 21:53:58 -0700 | [diff] [blame] | 111 | 0x64, 0x19, // LpPacket |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 112 | 0x52, 0x01, // FragIndex |
| 113 | 0x00, |
| 114 | 0x53, 0x01, // FragCount |
| 115 | 0x01, |
Eric Newberry | 8422f57 | 2017-02-04 21:53:58 -0700 | [diff] [blame] | 116 | 0xfd, 0x03, 0x44, 0x01, // Ack |
| 117 | 0x02, |
| 118 | 0xfd, 0x03, 0x44, 0x01, // Ack |
| 119 | 0x04, |
| 120 | 0xfd, 0x03, 0x44, 0x01, // Ack |
| 121 | 0x03, |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 122 | 0x50, 0x02, // Fragment |
| 123 | 0x03, 0xe8, |
| 124 | }; |
| 125 | |
| 126 | Buffer frag(2); |
| 127 | frag[0] = 0x03; |
| 128 | frag[1] = 0xe8; |
| 129 | |
| 130 | Packet packet; |
| 131 | BOOST_CHECK_NO_THROW(packet.add<FragmentField>(std::make_pair(frag.begin(), frag.end()))); |
| 132 | BOOST_CHECK_NO_THROW(packet.add<FragIndexField>(0)); |
Eric Newberry | 8422f57 | 2017-02-04 21:53:58 -0700 | [diff] [blame] | 133 | BOOST_CHECK_NO_THROW(packet.add<AckField>(2)); |
Eric Newberry | 2a89077 | 2017-06-26 12:06:15 -0700 | [diff] [blame] | 134 | BOOST_REQUIRE_NO_THROW(packet.wireEncode()); |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 135 | BOOST_CHECK_NO_THROW(packet.add<FragCountField>(1)); |
Eric Newberry | 2a89077 | 2017-06-26 12:06:15 -0700 | [diff] [blame] | 136 | BOOST_REQUIRE_NO_THROW(packet.wireEncode()); |
Eric Newberry | 8422f57 | 2017-02-04 21:53:58 -0700 | [diff] [blame] | 137 | BOOST_CHECK_NO_THROW(packet.add<AckField>(4)); |
Eric Newberry | 2a89077 | 2017-06-26 12:06:15 -0700 | [diff] [blame] | 138 | BOOST_REQUIRE_NO_THROW(packet.wireEncode()); |
Eric Newberry | 8422f57 | 2017-02-04 21:53:58 -0700 | [diff] [blame] | 139 | BOOST_CHECK_NO_THROW(packet.add<AckField>(3)); |
Eric Newberry | 2a89077 | 2017-06-26 12:06:15 -0700 | [diff] [blame] | 140 | BOOST_REQUIRE_NO_THROW(packet.wireEncode()); |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 141 | Block wire; |
| 142 | BOOST_REQUIRE_NO_THROW(wire = packet.wireEncode()); |
| 143 | BOOST_CHECK_EQUAL_COLLECTIONS(expectedBlock, expectedBlock + sizeof(expectedBlock), |
| 144 | wire.begin(), wire.end()); |
| 145 | } |
| 146 | |
| 147 | BOOST_AUTO_TEST_CASE(DecodeNormal) |
| 148 | { |
| 149 | static const uint8_t inputBlock[] = { |
| 150 | 0x64, 0x0a, // LpPacket |
| 151 | 0x52, 0x01, // FragIndex |
| 152 | 0x00, |
| 153 | 0x53, 0x01, // FragCount |
| 154 | 0x01, |
| 155 | 0x50, 0x02, // Fragment |
| 156 | 0x03, 0xe8, |
| 157 | }; |
| 158 | |
| 159 | Packet packet; |
| 160 | Block wire(inputBlock, sizeof(inputBlock)); |
| 161 | BOOST_CHECK_NO_THROW(packet.wireDecode(wire)); |
| 162 | BOOST_CHECK_EQUAL(1, packet.count<FragmentField>()); |
| 163 | BOOST_CHECK_EQUAL(1, packet.count<FragIndexField>()); |
| 164 | BOOST_CHECK_EQUAL(1, packet.count<FragCountField>()); |
| 165 | Buffer::const_iterator first, last; |
| 166 | BOOST_REQUIRE_NO_THROW(std::tie(first, last) = packet.get<FragmentField>(0)); |
| 167 | BOOST_CHECK_EQUAL(2, last - first); |
| 168 | BOOST_CHECK_EQUAL(0x03, *first); |
| 169 | BOOST_CHECK_EQUAL(0xe8, *(last - 1)); |
| 170 | BOOST_CHECK_EQUAL(0, packet.get<FragIndexField>(0)); |
| 171 | BOOST_CHECK_EQUAL(1, packet.get<FragCountField>(0)); |
| 172 | } |
| 173 | |
| 174 | BOOST_AUTO_TEST_CASE(DecodeIdle) |
| 175 | { |
| 176 | static const uint8_t inputBlock[] = { |
| 177 | 0x64, 0x06, // LpPacket |
| 178 | 0x52, 0x01, // FragIndex |
| 179 | 0x00, |
| 180 | 0x53, 0x01, // FragCount |
| 181 | 0x01, |
| 182 | }; |
| 183 | |
| 184 | Packet packet; |
| 185 | Block wire(inputBlock, sizeof(inputBlock)); |
| 186 | BOOST_CHECK_NO_THROW(packet.wireDecode(wire)); |
| 187 | BOOST_CHECK_EQUAL(0, packet.count<FragmentField>()); |
| 188 | BOOST_CHECK_EQUAL(1, packet.count<FragIndexField>()); |
| 189 | BOOST_CHECK_EQUAL(1, packet.count<FragCountField>()); |
| 190 | BOOST_CHECK_EQUAL(0, packet.get<FragIndexField>(0)); |
| 191 | BOOST_CHECK_EQUAL(1, packet.get<FragCountField>(0)); |
| 192 | } |
| 193 | |
| 194 | BOOST_AUTO_TEST_CASE(DecodeFragment) |
| 195 | { |
| 196 | static const uint8_t inputBlock[] = { |
| 197 | 0x64, 0x04, // LpPacket |
| 198 | 0x50, 0x02, // Fragment |
| 199 | 0x03, 0xe8, |
| 200 | }; |
| 201 | |
| 202 | Packet packet; |
| 203 | Block wire(inputBlock, sizeof(inputBlock)); |
| 204 | BOOST_CHECK_NO_THROW(packet.wireDecode(wire)); |
| 205 | BOOST_CHECK_EQUAL(1, packet.count<FragmentField>()); |
| 206 | BOOST_CHECK_EQUAL(0, packet.count<FragIndexField>()); |
| 207 | Buffer::const_iterator first, last; |
| 208 | BOOST_REQUIRE_NO_THROW(std::tie(first, last) = packet.get<FragmentField>(0)); |
| 209 | BOOST_CHECK_EQUAL(2, last - first); |
| 210 | BOOST_CHECK_EQUAL(0x03, *first); |
| 211 | BOOST_CHECK_EQUAL(0xe8, *(last - 1)); |
| 212 | } |
| 213 | |
| 214 | BOOST_AUTO_TEST_CASE(DecodeEmpty) |
| 215 | { |
| 216 | static const uint8_t inputBlock[] = { |
| 217 | 0x64, 0x00, // LpPacket |
| 218 | }; |
| 219 | |
| 220 | Packet packet; |
| 221 | Block wire(inputBlock, sizeof(inputBlock)); |
| 222 | BOOST_CHECK_NO_THROW(packet.wireDecode(wire)); |
| 223 | BOOST_CHECK_EQUAL(0, packet.count<FragmentField>()); |
| 224 | BOOST_CHECK_EQUAL(0, packet.count<FragIndexField>()); |
| 225 | } |
| 226 | |
| 227 | BOOST_AUTO_TEST_CASE(DecodeRepeatedNonRepeatableHeader) |
| 228 | { |
| 229 | static const uint8_t inputBlock[] = { |
| 230 | 0x64, 0x06, // LpPacket |
| 231 | 0x52, 0x01, // FragIndex |
| 232 | 0x00, |
| 233 | 0x52, 0x01, // FragIndex |
| 234 | 0x01, |
| 235 | }; |
| 236 | |
| 237 | Packet packet; |
| 238 | Block wire(inputBlock, sizeof(inputBlock)); |
| 239 | BOOST_CHECK_THROW(packet.wireDecode(wire), Packet::Error); |
| 240 | } |
| 241 | |
Eric Newberry | 8422f57 | 2017-02-04 21:53:58 -0700 | [diff] [blame] | 242 | BOOST_AUTO_TEST_CASE(DecodeRepeatedRepeatableHeader) |
| 243 | { |
| 244 | static const uint8_t inputBlock[] = { |
| 245 | 0x64, 0x0f, // LpPacket |
| 246 | 0xfd, 0x03, 0x44, 0x01, // Ack |
| 247 | 0x01, |
| 248 | 0xfd, 0x03, 0x44, 0x01, // Ack |
| 249 | 0x03, |
| 250 | 0xfd, 0x03, 0x44, 0x01, // Ack |
| 251 | 0x02, |
| 252 | }; |
| 253 | |
| 254 | Packet packet; |
| 255 | Block wire(inputBlock, sizeof(inputBlock)); |
| 256 | BOOST_CHECK_NO_THROW(packet.wireDecode(wire)); |
| 257 | BOOST_REQUIRE_EQUAL(packet.count<AckField>(), 3); |
| 258 | BOOST_CHECK_EQUAL(packet.get<AckField>(), 1); |
| 259 | BOOST_CHECK_EQUAL(packet.get<AckField>(0), 1); |
| 260 | BOOST_CHECK_EQUAL(packet.get<AckField>(1), 3); |
| 261 | BOOST_CHECK_EQUAL(packet.get<AckField>(2), 2); |
| 262 | } |
| 263 | |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 264 | BOOST_AUTO_TEST_CASE(DecodeRepeatedFragment) |
| 265 | { |
| 266 | static const uint8_t inputBlock[] = { |
| 267 | 0x64, 0x08, // LpPacket |
| 268 | 0x50, 0x02, // Fragment |
| 269 | 0x03, 0xe8, |
| 270 | 0x50, 0x02, // Fragment |
| 271 | 0x03, 0xe9, |
| 272 | }; |
| 273 | |
| 274 | Packet packet; |
| 275 | Block wire(inputBlock, sizeof(inputBlock)); |
| 276 | BOOST_CHECK_THROW(packet.wireDecode(wire), Packet::Error); |
| 277 | } |
| 278 | |
| 279 | BOOST_AUTO_TEST_CASE(DecodeWrongOrderAmongHeaders) |
| 280 | { |
| 281 | static const uint8_t inputBlock[] = { |
| 282 | 0x64, 0x0a, // LpPacket |
| 283 | 0x53, 0x01, // FragCount |
| 284 | 0x01, |
| 285 | 0x52, 0x01, // FragIndex |
| 286 | 0x00, |
| 287 | 0x50, 0x02, // Fragment |
| 288 | 0x03, 0xe8, |
| 289 | }; |
| 290 | |
| 291 | Packet packet; |
| 292 | Block wire(inputBlock, sizeof(inputBlock)); |
| 293 | BOOST_CHECK_THROW(packet.wireDecode(wire), Packet::Error); |
| 294 | } |
| 295 | |
| 296 | BOOST_AUTO_TEST_CASE(DecodeWrongOrderFragment) |
| 297 | { |
| 298 | static const uint8_t inputBlock[] = { |
| 299 | 0x64, 0x0a, // LpPacket |
| 300 | 0x52, 0x01, // FragIndex |
| 301 | 0x00, |
| 302 | 0x50, 0x02, // Fragment |
| 303 | 0x03, 0xe8, |
| 304 | 0x53, 0x01, // FragCount |
| 305 | 0x01, |
| 306 | }; |
| 307 | |
| 308 | Packet packet; |
| 309 | Block wire(inputBlock, sizeof(inputBlock)); |
| 310 | BOOST_CHECK_THROW(packet.wireDecode(wire), Packet::Error); |
| 311 | } |
| 312 | |
| 313 | BOOST_AUTO_TEST_CASE(DecodeIgnoredHeader) |
| 314 | { |
| 315 | static const uint8_t inputBlock[] = { |
| 316 | 0x64, 0x0c, // LpPacket |
| 317 | 0x52, 0x01, // FragIndex |
| 318 | 0x00, |
Eric Newberry | 3ed6247 | 2016-12-11 22:11:38 -0700 | [diff] [blame] | 319 | 0xfd, 0x03, 0x24, 0x01, // unknown TLV-TYPE 804 (ignored) |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 320 | 0x02, |
| 321 | 0x50, 0x02, // Fragment |
| 322 | 0x03, 0xe8, |
| 323 | }; |
| 324 | |
| 325 | Packet packet; |
| 326 | Block wire(inputBlock, sizeof(inputBlock)); |
| 327 | BOOST_CHECK_NO_THROW(packet.wireDecode(wire)); |
| 328 | BOOST_CHECK_EQUAL(1, packet.count<FragmentField>()); |
| 329 | BOOST_CHECK_EQUAL(1, packet.count<FragIndexField>()); |
| 330 | } |
| 331 | |
| 332 | BOOST_AUTO_TEST_CASE(DecodeUnrecognizedHeader) |
| 333 | { |
| 334 | static const uint8_t inputBlock[] = { |
| 335 | 0x64, 0x0c, // LpPacket |
| 336 | 0x52, 0x01, // FragIndex |
| 337 | 0x00, |
| 338 | 0xfd, 0x03, 0x22, 0x01, // unknown TLV-TYPE 802 (cannot ignore) |
| 339 | 0x02, |
| 340 | 0x50, 0x02, // Fragment |
| 341 | 0x03, 0xe8, |
| 342 | }; |
| 343 | |
| 344 | Packet packet; |
| 345 | Block wire(inputBlock, sizeof(inputBlock)); |
| 346 | BOOST_CHECK_THROW(packet.wireDecode(wire), Packet::Error); |
| 347 | } |
| 348 | |
| 349 | BOOST_AUTO_TEST_CASE(DecodeBareNetworkLayerPacket) |
| 350 | { |
| 351 | static const uint8_t inputBlock[] = { |
| 352 | 0x05, 0x0a, // Interest |
| 353 | 0x07, 0x02, // Name |
| 354 | 0x03, 0xe8, |
| 355 | 0x0a, 0x04, // Nonce |
| 356 | 0x01, 0x02, 0x03, 0x04, |
| 357 | }; |
| 358 | |
| 359 | Packet packet; |
| 360 | Block wire(inputBlock, sizeof(inputBlock)); |
| 361 | BOOST_CHECK_NO_THROW(packet.wireDecode(wire)); |
| 362 | BOOST_CHECK_EQUAL(1, packet.count<FragmentField>()); |
| 363 | |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 364 | Block encoded; |
| 365 | BOOST_CHECK_NO_THROW(encoded = packet.wireEncode()); |
Eric Newberry | 83872fd | 2015-08-06 17:01:24 -0700 | [diff] [blame] | 366 | BOOST_CHECK_EQUAL_COLLECTIONS(inputBlock, inputBlock + sizeof(inputBlock), |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 367 | encoded.begin(), encoded.end()); |
| 368 | } |
| 369 | |
Eric Newberry | 43bf6bb | 2015-10-09 16:12:09 -0700 | [diff] [blame] | 370 | BOOST_AUTO_TEST_CASE(DecodeUnrecognizedTlvType) |
| 371 | { |
| 372 | Packet packet; |
| 373 | Block wire = encoding::makeEmptyBlock(ndn::tlv::Name); |
| 374 | BOOST_CHECK_THROW(packet.wireDecode(wire), Packet::Error); |
| 375 | } |
| 376 | |
Davide Pesavento | eee3e82 | 2016-11-26 19:19:34 +0100 | [diff] [blame] | 377 | BOOST_AUTO_TEST_SUITE_END() // TestPacket |
| 378 | BOOST_AUTO_TEST_SUITE_END() // Lp |
Eric Newberry | 261dbc2 | 2015-07-22 23:18:18 -0700 | [diff] [blame] | 379 | |
| 380 | } // namespace tests |
| 381 | } // namespace lp |
Davide Pesavento | eee3e82 | 2016-11-26 19:19:34 +0100 | [diff] [blame] | 382 | } // namespace ndn |