Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /* |
Davide Pesavento | b3570c6 | 2022-02-19 19:19:00 -0500 | [diff] [blame] | 3 | * Copyright (c) 2014-2022, Regents of the University of California, |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 4 | * Arizona Board of Regents, |
| 5 | * Colorado State University, |
| 6 | * University Pierre & Marie Curie, Sorbonne University, |
| 7 | * Washington University in St. Louis, |
| 8 | * Beijing Institute of Technology, |
| 9 | * The University of Memphis. |
| 10 | * |
| 11 | * This file is part of ndn-tools (Named Data Networking Essential Tools). |
| 12 | * See AUTHORS.md for complete list of ndn-tools authors and contributors. |
| 13 | * |
| 14 | * ndn-tools is free software: you can redistribute it and/or modify it under the terms |
| 15 | * of the GNU General Public License as published by the Free Software Foundation, |
| 16 | * either version 3 of the License, or (at your option) any later version. |
| 17 | * |
| 18 | * ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 19 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 20 | * PURPOSE. See the GNU General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU General Public License along with |
| 23 | * ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
| 24 | */ |
| 25 | |
| 26 | #include "tools/peek/ndnpoke/ndnpoke.hpp" |
| 27 | |
| 28 | #include "tests/test-common.hpp" |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 29 | #include "tests/io-fixture.hpp" |
| 30 | #include "tests/key-chain-fixture.hpp" |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 31 | |
| 32 | #include <ndn-cxx/util/dummy-client-face.hpp> |
| 33 | |
Davide Pesavento | b3570c6 | 2022-02-19 19:19:00 -0500 | [diff] [blame] | 34 | namespace ndn::peek::tests { |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 35 | |
| 36 | using namespace ndn::tests; |
| 37 | |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 38 | template<bool WANT_PREFIX_REG_REPLY = true> |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 39 | class NdnPokeFixture : public IoFixture, public KeyChainFixture |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 40 | { |
| 41 | protected: |
| 42 | NdnPokeFixture() |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 43 | { |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 44 | m_keyChain.createIdentity("/test-id"); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | void |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 48 | initialize(const PokeOptions& opts = makeDefaultOptions()) |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 49 | { |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 50 | poke = make_unique<NdnPoke>(face, m_keyChain, payload, opts); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | static PokeOptions |
| 54 | makeDefaultOptions() |
| 55 | { |
| 56 | PokeOptions opt; |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 57 | opt.name = "/poke/test"; |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 58 | return opt; |
| 59 | } |
| 60 | |
| 61 | protected: |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 62 | ndn::util::DummyClientFace face{m_io, m_keyChain, {true, WANT_PREFIX_REG_REPLY}}; |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 63 | std::stringstream payload{"Hello, world!\n"}; |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 64 | unique_ptr<NdnPoke> poke; |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 65 | }; |
| 66 | |
| 67 | BOOST_AUTO_TEST_SUITE(Peek) |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 68 | BOOST_FIXTURE_TEST_SUITE(TestNdnPoke, NdnPokeFixture<>) |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 69 | |
| 70 | BOOST_AUTO_TEST_CASE(Basic) |
| 71 | { |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 72 | initialize(); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 73 | |
| 74 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 75 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 76 | |
Eric Newberry | 468dbdf | 2018-06-20 23:58:55 -0700 | [diff] [blame] | 77 | // Check for prefix registration |
| 78 | BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1); |
| 79 | BOOST_CHECK_EQUAL(face.sentInterests.front().getName().getPrefix(4), "/localhost/nfd/rib/register"); |
| 80 | |
Junxiao Shi | 20d5a0b | 2018-08-14 09:26:11 -0600 | [diff] [blame] | 81 | face.receive(*makeInterest("/poke/test")); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 82 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 83 | |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 84 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 85 | BOOST_REQUIRE_EQUAL(face.sentData.size(), 1); |
| 86 | BOOST_CHECK_EQUAL(face.sentData.back().getName(), "/poke/test"); |
| 87 | BOOST_CHECK(!face.sentData.back().getFinalBlock()); |
| 88 | BOOST_CHECK_EQUAL(face.sentData.back().getFreshnessPeriod(), 0_ms); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 89 | BOOST_CHECK_EQUAL(face.sentData.back().getContentType(), tlv::ContentType_Blob); |
| 90 | BOOST_CHECK_EQUAL(face.sentData.back().getContent(), "150E48656C6C6F2C20776F726C64210A"_block); |
Davide Pesavento | 3527558 | 2020-07-27 18:02:03 -0400 | [diff] [blame] | 91 | BOOST_CHECK_EQUAL(face.sentData.back().getSignatureType(), tlv::SignatureSha256WithEcdsa); |
Eric Newberry | 468dbdf | 2018-06-20 23:58:55 -0700 | [diff] [blame] | 92 | |
| 93 | // Check for prefix unregistration |
| 94 | BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 2); // One for registration, one for unregistration |
| 95 | BOOST_CHECK_EQUAL(face.sentInterests.back().getName().getPrefix(4), "/localhost/nfd/rib/unregister"); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 96 | } |
| 97 | |
Davide Pesavento | c5243b4 | 2019-07-26 13:30:16 -0400 | [diff] [blame] | 98 | BOOST_AUTO_TEST_CASE(NoMatch) |
| 99 | { |
| 100 | initialize(); |
| 101 | |
| 102 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 103 | this->advanceClocks(1_ms, 10); |
Davide Pesavento | c5243b4 | 2019-07-26 13:30:16 -0400 | [diff] [blame] | 104 | |
| 105 | face.receive(*makeInterest("/poke/test/foo")); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 106 | this->advanceClocks(1_ms, 10); |
Davide Pesavento | c5243b4 | 2019-07-26 13:30:16 -0400 | [diff] [blame] | 107 | |
| 108 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::UNKNOWN); |
| 109 | BOOST_CHECK_EQUAL(face.sentData.size(), 0); |
| 110 | |
| 111 | face.receive(*makeInterest("/poke/test")); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 112 | this->advanceClocks(1_ms, 10); |
Davide Pesavento | c5243b4 | 2019-07-26 13:30:16 -0400 | [diff] [blame] | 113 | |
| 114 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT); |
| 115 | BOOST_REQUIRE_EQUAL(face.sentData.size(), 1); |
| 116 | BOOST_CHECK_EQUAL(face.sentData.back().getName(), "/poke/test"); |
| 117 | } |
| 118 | |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 119 | BOOST_AUTO_TEST_CASE(FreshnessPeriod) |
| 120 | { |
| 121 | auto options = makeDefaultOptions(); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 122 | options.freshnessPeriod = 1_s; |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 123 | initialize(options); |
| 124 | |
| 125 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 126 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 127 | |
Junxiao Shi | 20d5a0b | 2018-08-14 09:26:11 -0600 | [diff] [blame] | 128 | face.receive(*makeInterest("/poke/test")); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 129 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 130 | |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 131 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 132 | BOOST_REQUIRE_EQUAL(face.sentData.size(), 1); |
| 133 | BOOST_CHECK_EQUAL(face.sentData.back().getName(), "/poke/test"); |
| 134 | BOOST_CHECK(!face.sentData.back().getFinalBlock()); |
| 135 | BOOST_CHECK_EQUAL(face.sentData.back().getFreshnessPeriod(), 1_s); |
Davide Pesavento | 3527558 | 2020-07-27 18:02:03 -0400 | [diff] [blame] | 136 | BOOST_CHECK_EQUAL(face.sentData.back().getSignatureType(), tlv::SignatureSha256WithEcdsa); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 137 | } |
| 138 | |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 139 | BOOST_AUTO_TEST_CASE(FinalBlockId) |
| 140 | { |
| 141 | auto options = makeDefaultOptions(); |
| 142 | options.name = "/poke/test/123"; |
| 143 | options.wantFinalBlockId = true; |
| 144 | initialize(options); |
| 145 | |
| 146 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 147 | this->advanceClocks(1_ms, 10); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 148 | |
| 149 | face.receive(*makeInterest(options.name)); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 150 | this->advanceClocks(1_ms, 10); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 151 | |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 152 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 153 | BOOST_REQUIRE_EQUAL(face.sentData.size(), 1); |
| 154 | BOOST_CHECK_EQUAL(face.sentData.back().getName(), options.name); |
| 155 | BOOST_REQUIRE(face.sentData.back().getFinalBlock()); |
| 156 | BOOST_CHECK_EQUAL(*(face.sentData.back().getFinalBlock()), name::Component("123")); |
| 157 | BOOST_CHECK_EQUAL(face.sentData.back().getFreshnessPeriod(), 0_ms); |
Davide Pesavento | 3527558 | 2020-07-27 18:02:03 -0400 | [diff] [blame] | 158 | BOOST_CHECK_EQUAL(face.sentData.back().getSignatureType(), tlv::SignatureSha256WithEcdsa); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 159 | } |
| 160 | |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 161 | BOOST_AUTO_TEST_CASE(DigestSha256) |
| 162 | { |
| 163 | auto options = makeDefaultOptions(); |
| 164 | options.signingInfo.setSha256Signing(); |
| 165 | initialize(options); |
| 166 | |
| 167 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 168 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 169 | |
Junxiao Shi | 20d5a0b | 2018-08-14 09:26:11 -0600 | [diff] [blame] | 170 | face.receive(*makeInterest("/poke/test")); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 171 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 172 | |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 173 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 174 | BOOST_REQUIRE_EQUAL(face.sentData.size(), 1); |
| 175 | BOOST_CHECK_EQUAL(face.sentData.back().getName(), "/poke/test"); |
| 176 | BOOST_CHECK(!face.sentData.back().getFinalBlock()); |
| 177 | BOOST_CHECK_EQUAL(face.sentData.back().getFreshnessPeriod(), 0_ms); |
Davide Pesavento | 3527558 | 2020-07-27 18:02:03 -0400 | [diff] [blame] | 178 | BOOST_CHECK_EQUAL(face.sentData.back().getSignatureType(), tlv::DigestSha256); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 179 | } |
| 180 | |
Davide Pesavento | 6a1396e | 2019-07-26 15:03:28 -0400 | [diff] [blame] | 181 | BOOST_AUTO_TEST_CASE(Unsolicited) |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 182 | { |
| 183 | auto options = makeDefaultOptions(); |
Davide Pesavento | 6a1396e | 2019-07-26 15:03:28 -0400 | [diff] [blame] | 184 | options.wantUnsolicited = true; |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 185 | initialize(options); |
| 186 | |
| 187 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 188 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 189 | |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 190 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 191 | BOOST_REQUIRE_EQUAL(face.sentData.size(), 1); |
| 192 | BOOST_CHECK_EQUAL(face.sentData.back().getName(), "/poke/test"); |
| 193 | BOOST_CHECK(!face.sentData.back().getFinalBlock()); |
| 194 | BOOST_CHECK_EQUAL(face.sentData.back().getFreshnessPeriod(), 0_ms); |
Davide Pesavento | 3527558 | 2020-07-27 18:02:03 -0400 | [diff] [blame] | 195 | BOOST_CHECK_EQUAL(face.sentData.back().getSignatureType(), tlv::SignatureSha256WithEcdsa); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 196 | } |
| 197 | |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 198 | BOOST_AUTO_TEST_CASE(Timeout) |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 199 | { |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 200 | auto options = makeDefaultOptions(); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 201 | options.timeout = 4_s; |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 202 | initialize(options); |
| 203 | |
| 204 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 205 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 206 | |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 207 | // Check for prefix registration |
| 208 | BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1); |
| 209 | BOOST_CHECK_EQUAL(face.sentInterests.front().getName().getPrefix(4), "/localhost/nfd/rib/register"); |
| 210 | |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 211 | this->advanceClocks(1_s, 4); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 212 | |
Davide Pesavento | 94dff00 | 2019-07-24 23:35:05 -0400 | [diff] [blame] | 213 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::TIMEOUT); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 214 | BOOST_CHECK_EQUAL(face.sentData.size(), 0); |
| 215 | |
| 216 | // Check for prefix unregistration |
| 217 | BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 2); // One for registration, one for unregistration |
| 218 | BOOST_CHECK_EQUAL(face.sentInterests.back().getName().getPrefix(4), "/localhost/nfd/rib/unregister"); |
| 219 | } |
| 220 | |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 221 | BOOST_FIXTURE_TEST_CASE(PrefixRegTimeout, NdnPokeFixture<false>) |
| 222 | { |
| 223 | initialize(); |
| 224 | |
| 225 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 226 | this->advanceClocks(1_ms, 10); |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 227 | |
| 228 | // Check for prefix registration |
| 229 | BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1); |
| 230 | BOOST_CHECK_EQUAL(face.sentInterests.front().getName().getPrefix(4), "/localhost/nfd/rib/register"); |
| 231 | |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 232 | this->advanceClocks(1_s, 10); |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 233 | |
| 234 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::PREFIX_REG_FAIL); |
| 235 | BOOST_CHECK_EQUAL(face.sentData.size(), 0); |
| 236 | } |
| 237 | |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 238 | BOOST_AUTO_TEST_CASE(OversizedPacket) |
| 239 | { |
| 240 | payload << std::string(MAX_NDN_PACKET_SIZE, 'A'); |
| 241 | initialize(); |
| 242 | |
| 243 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame] | 244 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 245 | |
Junxiao Shi | 20d5a0b | 2018-08-14 09:26:11 -0600 | [diff] [blame] | 246 | face.receive(*makeInterest("/poke/test")); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 247 | BOOST_CHECK_THROW(face.processEvents(), Face::OversizedPacketError); |
| 248 | |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 249 | // No point in checking getResult() here. The exception is thrown from processEvents(), |
| 250 | // not from put(), so the result is still DATA_SENT even though no packets were sent. |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 251 | BOOST_CHECK_EQUAL(face.sentData.size(), 0); |
| 252 | } |
| 253 | |
| 254 | BOOST_AUTO_TEST_SUITE_END() // TestNdnPoke |
| 255 | BOOST_AUTO_TEST_SUITE_END() // Peek |
| 256 | |
Davide Pesavento | b3570c6 | 2022-02-19 19:19:00 -0500 | [diff] [blame] | 257 | } // namespace ndn::peek::tests |