Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
Junxiao Shi | b54aabd | 2018-04-16 19:36:24 +0000 | [diff] [blame] | 2 | /* |
Junxiao Shi | fd2d101 | 2022-01-11 18:20:38 +0000 | [diff] [blame] | 3 | * Copyright (c) 2014-2022, Arizona Board of Regents. |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 4 | * |
| 5 | * This file is part of ndn-tools (Named Data Networking Essential Tools). |
| 6 | * See AUTHORS.md for complete list of ndn-tools authors and contributors. |
| 7 | * |
| 8 | * ndn-tools is free software: you can redistribute it and/or modify it under the terms |
| 9 | * of the GNU General Public License as published by the Free Software Foundation, |
| 10 | * either version 3 of the License, or (at your option) any later version. |
| 11 | * |
| 12 | * ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 13 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 14 | * PURPOSE. See the GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License along with |
| 17 | * ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | |
| 20 | #include "tools/peek/ndnpeek/ndnpeek.hpp" |
| 21 | |
| 22 | #include "tests/test-common.hpp" |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 23 | #include "tests/io-fixture.hpp" |
Davide Pesavento | bf28cd7 | 2017-08-13 17:22:47 -0400 | [diff] [blame] | 24 | |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 25 | #include <ndn-cxx/util/dummy-client-face.hpp> |
| 26 | |
| 27 | #include <boost/mpl/vector.hpp> |
Davide Pesavento | a8600b0 | 2019-12-22 18:52:36 -0500 | [diff] [blame] | 28 | #include <boost/test/tools/output_test_stream.hpp> |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 29 | |
Davide Pesavento | b3570c6 | 2022-02-19 19:19:00 -0500 | [diff] [blame] | 30 | namespace ndn::peek::tests { |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 31 | |
| 32 | using namespace ndn::tests; |
| 33 | using boost::test_tools::output_test_stream; |
| 34 | |
| 35 | class CoutRedirector : noncopyable |
| 36 | { |
| 37 | public: |
| 38 | explicit |
| 39 | CoutRedirector(std::ostream& destination) |
| 40 | { |
| 41 | m_originalBuf = std::cout.rdbuf(destination.rdbuf()); |
| 42 | } |
| 43 | |
| 44 | ~CoutRedirector() |
| 45 | { |
| 46 | std::cout.rdbuf(m_originalBuf); |
| 47 | } |
| 48 | |
| 49 | private: |
| 50 | std::streambuf* m_originalBuf; |
| 51 | }; |
| 52 | |
Davide Pesavento | 9602823 | 2019-08-17 01:26:13 -0400 | [diff] [blame] | 53 | static PeekOptions |
| 54 | makeDefaultOptions() |
| 55 | { |
| 56 | PeekOptions opt; |
| 57 | opt.name = "/peek/test"; |
| 58 | return opt; |
| 59 | } |
| 60 | |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 61 | class NdnPeekFixture : public IoFixture |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 62 | { |
| 63 | protected: |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 64 | void |
Davide Pesavento | 9602823 | 2019-08-17 01:26:13 -0400 | [diff] [blame] | 65 | initialize(const PeekOptions& opts = makeDefaultOptions()) |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 66 | { |
| 67 | peek = make_unique<NdnPeek>(face, opts); |
| 68 | } |
| 69 | |
| 70 | protected: |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 71 | ndn::util::DummyClientFace face{m_io}; |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 72 | output_test_stream output; |
| 73 | unique_ptr<NdnPeek> peek; |
| 74 | }; |
| 75 | |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 76 | class OutputFull |
| 77 | { |
| 78 | public: |
| 79 | static PeekOptions |
| 80 | makeOptions() |
| 81 | { |
| 82 | return makeDefaultOptions(); |
| 83 | } |
| 84 | |
| 85 | static void |
| 86 | checkOutput(output_test_stream& output, const Data& data) |
| 87 | { |
| 88 | const Block& block = data.wireEncode(); |
Davide Pesavento | 242d506 | 2022-03-11 16:34:23 -0500 | [diff] [blame] | 89 | std::string expected(reinterpret_cast<const char*>(block.data()), block.size()); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 90 | BOOST_CHECK(output.is_equal(expected)); |
| 91 | } |
| 92 | |
| 93 | static void |
| 94 | checkOutput(output_test_stream& output, const lp::Nack& nack) |
| 95 | { |
| 96 | const Block& block = nack.getHeader().wireEncode(); |
Davide Pesavento | 242d506 | 2022-03-11 16:34:23 -0500 | [diff] [blame] | 97 | std::string expected(reinterpret_cast<const char*>(block.data()), block.size()); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 98 | BOOST_CHECK(output.is_equal(expected)); |
| 99 | } |
| 100 | }; |
| 101 | |
| 102 | class OutputPayloadOnly |
| 103 | { |
| 104 | public: |
| 105 | static PeekOptions |
| 106 | makeOptions() |
| 107 | { |
| 108 | PeekOptions opt = makeDefaultOptions(); |
| 109 | opt.wantPayloadOnly = true; |
| 110 | return opt; |
| 111 | } |
| 112 | |
| 113 | static void |
| 114 | checkOutput(output_test_stream& output, const Data& data) |
| 115 | { |
| 116 | const Block& block = data.getContent(); |
| 117 | std::string expected(reinterpret_cast<const char*>(block.value()), block.value_size()); |
| 118 | BOOST_CHECK(output.is_equal(expected)); |
| 119 | } |
| 120 | |
| 121 | static void |
| 122 | checkOutput(output_test_stream& output, const lp::Nack& nack) |
| 123 | { |
| 124 | std::string expected = boost::lexical_cast<std::string>(nack.getReason()) + '\n'; |
| 125 | BOOST_CHECK(output.is_equal(expected)); |
| 126 | } |
| 127 | }; |
| 128 | |
| 129 | BOOST_AUTO_TEST_SUITE(Peek) |
| 130 | BOOST_FIXTURE_TEST_SUITE(TestNdnPeek, NdnPeekFixture) |
| 131 | |
| 132 | using OutputChecks = boost::mpl::vector<OutputFull, OutputPayloadOnly>; |
| 133 | |
| 134 | BOOST_AUTO_TEST_CASE_TEMPLATE(Default, OutputCheck, OutputChecks) |
| 135 | { |
| 136 | auto options = OutputCheck::makeOptions(); |
| 137 | initialize(options); |
| 138 | |
Junxiao Shi | b54aabd | 2018-04-16 19:36:24 +0000 | [diff] [blame] | 139 | auto data = makeData(options.name); |
Davide Pesavento | 5998428 | 2022-02-16 22:41:03 -0500 | [diff] [blame] | 140 | data->setContent({'n', 'd', 'n', 'p', 'e', 'e', 'k'}); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 141 | |
| 142 | { |
| 143 | CoutRedirector redir(output); |
| 144 | peek->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 145 | this->advanceClocks(25_ms, 4); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 146 | face.receive(*data); |
| 147 | } |
| 148 | |
| 149 | OutputCheck::checkOutput(output, *data); |
| 150 | BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1); |
Junxiao Shi | fd2d101 | 2022-01-11 18:20:38 +0000 | [diff] [blame] | 151 | const auto& interest = face.sentInterests.back(); |
| 152 | BOOST_CHECK_EQUAL(interest.getCanBePrefix(), false); |
| 153 | BOOST_CHECK_EQUAL(interest.getMustBeFresh(), false); |
| 154 | BOOST_CHECK_EQUAL(interest.getForwardingHint().empty(), true); |
| 155 | BOOST_CHECK_EQUAL(interest.getInterestLifetime(), DEFAULT_INTEREST_LIFETIME); |
| 156 | BOOST_CHECK(interest.getHopLimit() == nullopt); |
| 157 | BOOST_CHECK(!interest.hasApplicationParameters()); |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 158 | BOOST_CHECK(peek->getResult() == NdnPeek::Result::DATA); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 159 | } |
| 160 | |
Junxiao Shi | b54aabd | 2018-04-16 19:36:24 +0000 | [diff] [blame] | 161 | BOOST_AUTO_TEST_CASE_TEMPLATE(NonDefault, OutputCheck, OutputChecks) |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 162 | { |
| 163 | auto options = OutputCheck::makeOptions(); |
Junxiao Shi | b54aabd | 2018-04-16 19:36:24 +0000 | [diff] [blame] | 164 | options.canBePrefix = true; |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 165 | options.mustBeFresh = true; |
Junxiao Shi | fd2d101 | 2022-01-11 18:20:38 +0000 | [diff] [blame] | 166 | options.forwardingHint.emplace_back("/fh"); |
Junxiao Shi | b54aabd | 2018-04-16 19:36:24 +0000 | [diff] [blame] | 167 | options.interestLifetime = 200_ms; |
Davide Pesavento | c214e07 | 2019-08-17 01:33:28 -0400 | [diff] [blame] | 168 | options.hopLimit = 64; |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 169 | initialize(options); |
| 170 | |
Junxiao Shi | b54aabd | 2018-04-16 19:36:24 +0000 | [diff] [blame] | 171 | auto data = makeData(Name(options.name).append("suffix")); |
Junxiao Shi | 9619295 | 2019-05-22 15:45:12 +0000 | [diff] [blame] | 172 | data->setFreshnessPeriod(1_s); |
Davide Pesavento | 5998428 | 2022-02-16 22:41:03 -0500 | [diff] [blame] | 173 | data->setContent({'n', 'd', 'n', 'p', 'e', 'e', 'k'}); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 174 | |
| 175 | { |
| 176 | CoutRedirector redir(output); |
| 177 | peek->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 178 | this->advanceClocks(25_ms, 4); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 179 | face.receive(*data); |
| 180 | } |
| 181 | |
| 182 | OutputCheck::checkOutput(output, *data); |
| 183 | BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1); |
Junxiao Shi | fd2d101 | 2022-01-11 18:20:38 +0000 | [diff] [blame] | 184 | const auto& interest = face.sentInterests.back(); |
| 185 | BOOST_CHECK_EQUAL(interest.getCanBePrefix(), true); |
| 186 | BOOST_CHECK_EQUAL(interest.getMustBeFresh(), true); |
| 187 | BOOST_TEST(interest.getForwardingHint() == std::vector<Name>({"/fh"}), |
| 188 | boost::test_tools::per_element()); |
| 189 | BOOST_CHECK_EQUAL(interest.getInterestLifetime(), 200_ms); |
| 190 | BOOST_CHECK(interest.getHopLimit() == 64); |
| 191 | BOOST_CHECK(!interest.hasApplicationParameters()); |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 192 | BOOST_CHECK(peek->getResult() == NdnPeek::Result::DATA); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 193 | } |
| 194 | |
| 195 | BOOST_AUTO_TEST_CASE_TEMPLATE(ReceiveNackWithReason, OutputCheck, OutputChecks) |
| 196 | { |
| 197 | auto options = OutputCheck::makeOptions(); |
| 198 | initialize(options); |
| 199 | lp::Nack nack; |
| 200 | |
| 201 | { |
| 202 | CoutRedirector redir(output); |
| 203 | peek->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 204 | this->advanceClocks(25_ms, 4); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 205 | nack = makeNack(face.sentInterests.at(0), lp::NackReason::NO_ROUTE); |
| 206 | face.receive(nack); |
| 207 | } |
| 208 | |
| 209 | OutputCheck::checkOutput(output, nack); |
| 210 | BOOST_CHECK_EQUAL(face.sentInterests.size(), 1); |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 211 | BOOST_CHECK(peek->getResult() == NdnPeek::Result::NACK); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 212 | } |
| 213 | |
| 214 | BOOST_AUTO_TEST_CASE_TEMPLATE(ReceiveNackWithoutReason, OutputCheck, OutputChecks) |
| 215 | { |
| 216 | auto options = OutputCheck::makeOptions(); |
| 217 | initialize(options); |
| 218 | lp::Nack nack; |
| 219 | |
| 220 | { |
| 221 | CoutRedirector redir(output); |
| 222 | peek->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 223 | this->advanceClocks(25_ms, 4); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 224 | nack = makeNack(face.sentInterests.at(0), lp::NackReason::NONE); |
| 225 | face.receive(nack); |
| 226 | } |
| 227 | |
| 228 | OutputCheck::checkOutput(output, nack); |
| 229 | BOOST_CHECK_EQUAL(face.sentInterests.size(), 1); |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 230 | BOOST_CHECK(peek->getResult() == NdnPeek::Result::NACK); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 231 | } |
| 232 | |
Davide Pesavento | 9602823 | 2019-08-17 01:26:13 -0400 | [diff] [blame] | 233 | BOOST_AUTO_TEST_CASE(ApplicationParameters) |
| 234 | { |
| 235 | auto options = makeDefaultOptions(); |
| 236 | options.applicationParameters = make_shared<Buffer>("hello", 5); |
| 237 | initialize(options); |
| 238 | |
| 239 | peek->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 240 | this->advanceClocks(25_ms, 4); |
Davide Pesavento | 9602823 | 2019-08-17 01:26:13 -0400 | [diff] [blame] | 241 | |
| 242 | BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1); |
| 243 | BOOST_CHECK_EQUAL(face.sentInterests.back().getCanBePrefix(), false); |
| 244 | BOOST_CHECK_EQUAL(face.sentInterests.back().getMustBeFresh(), false); |
| 245 | BOOST_CHECK_EQUAL(face.sentInterests.back().getForwardingHint().empty(), true); |
| 246 | BOOST_CHECK_EQUAL(face.sentInterests.back().getInterestLifetime(), DEFAULT_INTEREST_LIFETIME); |
| 247 | BOOST_CHECK_EQUAL(face.sentInterests.back().hasApplicationParameters(), true); |
| 248 | BOOST_CHECK_EQUAL(face.sentInterests.back().getApplicationParameters(), "2405 68656C6C6F"_block); |
| 249 | } |
| 250 | |
Davide Pesavento | 65d1155 | 2019-06-09 19:15:50 -0400 | [diff] [blame] | 251 | BOOST_AUTO_TEST_CASE(NoTimeout) |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 252 | { |
| 253 | auto options = makeDefaultOptions(); |
Davide Pesavento | 65d1155 | 2019-06-09 19:15:50 -0400 | [diff] [blame] | 254 | options.interestLifetime = 1_s; |
Davide Pesavento | 242d506 | 2022-03-11 16:34:23 -0500 | [diff] [blame] | 255 | options.timeout = std::nullopt; |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 256 | initialize(options); |
| 257 | |
Davide Pesavento | 65d1155 | 2019-06-09 19:15:50 -0400 | [diff] [blame] | 258 | BOOST_CHECK_EQUAL(face.sentInterests.size(), 0); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 259 | |
| 260 | peek->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 261 | this->advanceClocks(100_ms, 9); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 262 | BOOST_CHECK_EQUAL(face.sentInterests.size(), 1); |
Davide Pesavento | 65d1155 | 2019-06-09 19:15:50 -0400 | [diff] [blame] | 263 | BOOST_CHECK_EQUAL(face.getNPendingInterests(), 1); |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 264 | BOOST_CHECK(peek->getResult() == NdnPeek::Result::UNKNOWN); |
Davide Pesavento | 65d1155 | 2019-06-09 19:15:50 -0400 | [diff] [blame] | 265 | |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 266 | this->advanceClocks(100_ms, 2); |
Davide Pesavento | 65d1155 | 2019-06-09 19:15:50 -0400 | [diff] [blame] | 267 | BOOST_CHECK_EQUAL(face.sentInterests.size(), 1); |
| 268 | BOOST_CHECK_EQUAL(face.getNPendingInterests(), 0); |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 269 | BOOST_CHECK(peek->getResult() == NdnPeek::Result::TIMEOUT); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 270 | } |
| 271 | |
| 272 | BOOST_AUTO_TEST_CASE(TimeoutLessThanLifetime) |
| 273 | { |
| 274 | auto options = makeDefaultOptions(); |
Junxiao Shi | b54aabd | 2018-04-16 19:36:24 +0000 | [diff] [blame] | 275 | options.interestLifetime = 200_ms; |
| 276 | options.timeout = 100_ms; |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 277 | initialize(options); |
| 278 | |
Davide Pesavento | 65d1155 | 2019-06-09 19:15:50 -0400 | [diff] [blame] | 279 | BOOST_CHECK_EQUAL(face.sentInterests.size(), 0); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 280 | |
| 281 | peek->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 282 | this->advanceClocks(25_ms, 6); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 283 | |
| 284 | BOOST_CHECK_EQUAL(face.sentInterests.size(), 1); |
Davide Pesavento | 65d1155 | 2019-06-09 19:15:50 -0400 | [diff] [blame] | 285 | BOOST_CHECK_EQUAL(face.getNPendingInterests(), 0); |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 286 | BOOST_CHECK(peek->getResult() == NdnPeek::Result::TIMEOUT); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 287 | } |
| 288 | |
| 289 | BOOST_AUTO_TEST_CASE(TimeoutGreaterThanLifetime) |
| 290 | { |
| 291 | auto options = makeDefaultOptions(); |
Junxiao Shi | b54aabd | 2018-04-16 19:36:24 +0000 | [diff] [blame] | 292 | options.interestLifetime = 50_ms; |
| 293 | options.timeout = 200_ms; |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 294 | initialize(options); |
| 295 | |
Davide Pesavento | 65d1155 | 2019-06-09 19:15:50 -0400 | [diff] [blame] | 296 | BOOST_CHECK_EQUAL(face.sentInterests.size(), 0); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 297 | |
| 298 | peek->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 299 | this->advanceClocks(25_ms, 4); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 300 | |
| 301 | BOOST_CHECK_EQUAL(face.sentInterests.size(), 1); |
Davide Pesavento | 65d1155 | 2019-06-09 19:15:50 -0400 | [diff] [blame] | 302 | BOOST_CHECK_EQUAL(face.getNPendingInterests(), 0); |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 303 | BOOST_CHECK(peek->getResult() == NdnPeek::Result::TIMEOUT); |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 304 | } |
| 305 | |
Davide Pesavento | 9602823 | 2019-08-17 01:26:13 -0400 | [diff] [blame] | 306 | BOOST_AUTO_TEST_CASE(OversizedPacket) |
| 307 | { |
| 308 | auto options = makeDefaultOptions(); |
| 309 | options.applicationParameters = make_shared<Buffer>(MAX_NDN_PACKET_SIZE); |
| 310 | initialize(options); |
| 311 | |
| 312 | peek->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 313 | BOOST_CHECK_THROW(this->advanceClocks(1_ms, 10), Face::OversizedPacketError); |
Davide Pesavento | 9602823 | 2019-08-17 01:26:13 -0400 | [diff] [blame] | 314 | |
| 315 | BOOST_CHECK_EQUAL(face.sentInterests.size(), 0); |
| 316 | } |
| 317 | |
Zhuo Li | b355889 | 2016-08-12 15:51:12 -0700 | [diff] [blame] | 318 | BOOST_AUTO_TEST_SUITE_END() // TestNdnPeek |
| 319 | BOOST_AUTO_TEST_SUITE_END() // Peek |
| 320 | |
Davide Pesavento | b3570c6 | 2022-02-19 19:19:00 -0500 | [diff] [blame] | 321 | } // namespace ndn::peek::tests |