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 | 3527558 | 2020-07-27 18:02:03 -0400 | [diff] [blame] | 3 | * Copyright (c) 2014-2020, 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 | |
| 34 | namespace ndn { |
| 35 | namespace peek { |
| 36 | namespace tests { |
| 37 | |
| 38 | using namespace ndn::tests; |
| 39 | |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 40 | template<bool WANT_PREFIX_REG_REPLY = true> |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 41 | class NdnPokeFixture : public IoFixture, public KeyChainFixture |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 42 | { |
| 43 | protected: |
| 44 | NdnPokeFixture() |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 45 | { |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 46 | m_keyChain.createIdentity("/test-id"); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | void |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 50 | initialize(const PokeOptions& opts = makeDefaultOptions()) |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 51 | { |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 52 | poke = make_unique<NdnPoke>(face, m_keyChain, payload, opts); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 53 | } |
| 54 | |
| 55 | static PokeOptions |
| 56 | makeDefaultOptions() |
| 57 | { |
| 58 | PokeOptions opt; |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 59 | opt.name = "/poke/test"; |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 60 | return opt; |
| 61 | } |
| 62 | |
| 63 | protected: |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 64 | 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] | 65 | std::stringstream payload{"Hello, world!\n"}; |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 66 | unique_ptr<NdnPoke> poke; |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 67 | }; |
| 68 | |
| 69 | BOOST_AUTO_TEST_SUITE(Peek) |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 70 | BOOST_FIXTURE_TEST_SUITE(TestNdnPoke, NdnPokeFixture<>) |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 71 | |
| 72 | BOOST_AUTO_TEST_CASE(Basic) |
| 73 | { |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 74 | initialize(); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 75 | |
| 76 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 77 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 78 | |
Eric Newberry | 468dbdf | 2018-06-20 23:58:55 -0700 | [diff] [blame] | 79 | // Check for prefix registration |
| 80 | BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1); |
| 81 | BOOST_CHECK_EQUAL(face.sentInterests.front().getName().getPrefix(4), "/localhost/nfd/rib/register"); |
| 82 | |
Junxiao Shi | 20d5a0b | 2018-08-14 09:26:11 -0600 | [diff] [blame] | 83 | face.receive(*makeInterest("/poke/test")); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 84 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 85 | |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 86 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 87 | BOOST_REQUIRE_EQUAL(face.sentData.size(), 1); |
| 88 | BOOST_CHECK_EQUAL(face.sentData.back().getName(), "/poke/test"); |
| 89 | BOOST_CHECK(!face.sentData.back().getFinalBlock()); |
| 90 | BOOST_CHECK_EQUAL(face.sentData.back().getFreshnessPeriod(), 0_ms); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 91 | BOOST_CHECK_EQUAL(face.sentData.back().getContentType(), tlv::ContentType_Blob); |
| 92 | BOOST_CHECK_EQUAL(face.sentData.back().getContent(), "150E48656C6C6F2C20776F726C64210A"_block); |
Davide Pesavento | 3527558 | 2020-07-27 18:02:03 -0400 | [diff] [blame] | 93 | BOOST_CHECK_EQUAL(face.sentData.back().getSignatureType(), tlv::SignatureSha256WithEcdsa); |
Eric Newberry | 468dbdf | 2018-06-20 23:58:55 -0700 | [diff] [blame] | 94 | |
| 95 | // Check for prefix unregistration |
| 96 | BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 2); // One for registration, one for unregistration |
| 97 | 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] | 98 | } |
| 99 | |
Davide Pesavento | c5243b4 | 2019-07-26 13:30:16 -0400 | [diff] [blame] | 100 | BOOST_AUTO_TEST_CASE(NoMatch) |
| 101 | { |
| 102 | initialize(); |
| 103 | |
| 104 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 105 | this->advanceClocks(1_ms, 10); |
Davide Pesavento | c5243b4 | 2019-07-26 13:30:16 -0400 | [diff] [blame] | 106 | |
| 107 | face.receive(*makeInterest("/poke/test/foo")); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 108 | this->advanceClocks(1_ms, 10); |
Davide Pesavento | c5243b4 | 2019-07-26 13:30:16 -0400 | [diff] [blame] | 109 | |
| 110 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::UNKNOWN); |
| 111 | BOOST_CHECK_EQUAL(face.sentData.size(), 0); |
| 112 | |
| 113 | face.receive(*makeInterest("/poke/test")); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 114 | this->advanceClocks(1_ms, 10); |
Davide Pesavento | c5243b4 | 2019-07-26 13:30:16 -0400 | [diff] [blame] | 115 | |
| 116 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT); |
| 117 | BOOST_REQUIRE_EQUAL(face.sentData.size(), 1); |
| 118 | BOOST_CHECK_EQUAL(face.sentData.back().getName(), "/poke/test"); |
| 119 | } |
| 120 | |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 121 | BOOST_AUTO_TEST_CASE(FreshnessPeriod) |
| 122 | { |
| 123 | auto options = makeDefaultOptions(); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 124 | options.freshnessPeriod = 1_s; |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 125 | initialize(options); |
| 126 | |
| 127 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 128 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 129 | |
Junxiao Shi | 20d5a0b | 2018-08-14 09:26:11 -0600 | [diff] [blame] | 130 | face.receive(*makeInterest("/poke/test")); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 131 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 132 | |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 133 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 134 | BOOST_REQUIRE_EQUAL(face.sentData.size(), 1); |
| 135 | BOOST_CHECK_EQUAL(face.sentData.back().getName(), "/poke/test"); |
| 136 | BOOST_CHECK(!face.sentData.back().getFinalBlock()); |
| 137 | BOOST_CHECK_EQUAL(face.sentData.back().getFreshnessPeriod(), 1_s); |
Davide Pesavento | 3527558 | 2020-07-27 18:02:03 -0400 | [diff] [blame] | 138 | BOOST_CHECK_EQUAL(face.sentData.back().getSignatureType(), tlv::SignatureSha256WithEcdsa); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 139 | } |
| 140 | |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 141 | BOOST_AUTO_TEST_CASE(FinalBlockId) |
| 142 | { |
| 143 | auto options = makeDefaultOptions(); |
| 144 | options.name = "/poke/test/123"; |
| 145 | options.wantFinalBlockId = true; |
| 146 | initialize(options); |
| 147 | |
| 148 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 149 | this->advanceClocks(1_ms, 10); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 150 | |
| 151 | face.receive(*makeInterest(options.name)); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 152 | this->advanceClocks(1_ms, 10); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 153 | |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 154 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 155 | BOOST_REQUIRE_EQUAL(face.sentData.size(), 1); |
| 156 | BOOST_CHECK_EQUAL(face.sentData.back().getName(), options.name); |
| 157 | BOOST_REQUIRE(face.sentData.back().getFinalBlock()); |
| 158 | BOOST_CHECK_EQUAL(*(face.sentData.back().getFinalBlock()), name::Component("123")); |
| 159 | BOOST_CHECK_EQUAL(face.sentData.back().getFreshnessPeriod(), 0_ms); |
Davide Pesavento | 3527558 | 2020-07-27 18:02:03 -0400 | [diff] [blame] | 160 | BOOST_CHECK_EQUAL(face.sentData.back().getSignatureType(), tlv::SignatureSha256WithEcdsa); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 161 | } |
| 162 | |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 163 | BOOST_AUTO_TEST_CASE(DigestSha256) |
| 164 | { |
| 165 | auto options = makeDefaultOptions(); |
| 166 | options.signingInfo.setSha256Signing(); |
| 167 | initialize(options); |
| 168 | |
| 169 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 170 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 171 | |
Junxiao Shi | 20d5a0b | 2018-08-14 09:26:11 -0600 | [diff] [blame] | 172 | face.receive(*makeInterest("/poke/test")); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 173 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 174 | |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 175 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 176 | BOOST_REQUIRE_EQUAL(face.sentData.size(), 1); |
| 177 | BOOST_CHECK_EQUAL(face.sentData.back().getName(), "/poke/test"); |
| 178 | BOOST_CHECK(!face.sentData.back().getFinalBlock()); |
| 179 | BOOST_CHECK_EQUAL(face.sentData.back().getFreshnessPeriod(), 0_ms); |
Davide Pesavento | 3527558 | 2020-07-27 18:02:03 -0400 | [diff] [blame] | 180 | BOOST_CHECK_EQUAL(face.sentData.back().getSignatureType(), tlv::DigestSha256); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 181 | } |
| 182 | |
Davide Pesavento | 6a1396e | 2019-07-26 15:03:28 -0400 | [diff] [blame] | 183 | BOOST_AUTO_TEST_CASE(Unsolicited) |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 184 | { |
| 185 | auto options = makeDefaultOptions(); |
Davide Pesavento | 6a1396e | 2019-07-26 15:03:28 -0400 | [diff] [blame] | 186 | options.wantUnsolicited = true; |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 187 | initialize(options); |
| 188 | |
| 189 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 190 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 191 | |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 192 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 193 | BOOST_REQUIRE_EQUAL(face.sentData.size(), 1); |
| 194 | BOOST_CHECK_EQUAL(face.sentData.back().getName(), "/poke/test"); |
| 195 | BOOST_CHECK(!face.sentData.back().getFinalBlock()); |
| 196 | BOOST_CHECK_EQUAL(face.sentData.back().getFreshnessPeriod(), 0_ms); |
Davide Pesavento | 3527558 | 2020-07-27 18:02:03 -0400 | [diff] [blame] | 197 | BOOST_CHECK_EQUAL(face.sentData.back().getSignatureType(), tlv::SignatureSha256WithEcdsa); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 198 | } |
| 199 | |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 200 | BOOST_AUTO_TEST_CASE(Timeout) |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 201 | { |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 202 | auto options = makeDefaultOptions(); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 203 | options.timeout = 4_s; |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 204 | initialize(options); |
| 205 | |
| 206 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 207 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 208 | |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 209 | // Check for prefix registration |
| 210 | BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1); |
| 211 | BOOST_CHECK_EQUAL(face.sentInterests.front().getName().getPrefix(4), "/localhost/nfd/rib/register"); |
| 212 | |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 213 | this->advanceClocks(1_s, 4); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 214 | |
Davide Pesavento | 94dff00 | 2019-07-24 23:35:05 -0400 | [diff] [blame] | 215 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::TIMEOUT); |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 216 | BOOST_CHECK_EQUAL(face.sentData.size(), 0); |
| 217 | |
| 218 | // Check for prefix unregistration |
| 219 | BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 2); // One for registration, one for unregistration |
| 220 | BOOST_CHECK_EQUAL(face.sentInterests.back().getName().getPrefix(4), "/localhost/nfd/rib/unregister"); |
| 221 | } |
| 222 | |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 223 | BOOST_FIXTURE_TEST_CASE(PrefixRegTimeout, NdnPokeFixture<false>) |
| 224 | { |
| 225 | initialize(); |
| 226 | |
| 227 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 228 | this->advanceClocks(1_ms, 10); |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 229 | |
| 230 | // Check for prefix registration |
| 231 | BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1); |
| 232 | BOOST_CHECK_EQUAL(face.sentInterests.front().getName().getPrefix(4), "/localhost/nfd/rib/register"); |
| 233 | |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 234 | this->advanceClocks(1_s, 10); |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 235 | |
| 236 | BOOST_CHECK(poke->getResult() == NdnPoke::Result::PREFIX_REG_FAIL); |
| 237 | BOOST_CHECK_EQUAL(face.sentData.size(), 0); |
| 238 | } |
| 239 | |
Davide Pesavento | e75861e | 2019-07-24 21:55:39 -0400 | [diff] [blame] | 240 | BOOST_AUTO_TEST_CASE(OversizedPacket) |
| 241 | { |
| 242 | payload << std::string(MAX_NDN_PACKET_SIZE, 'A'); |
| 243 | initialize(); |
| 244 | |
| 245 | poke->start(); |
Davide Pesavento | 6677762 | 2020-10-09 18:46:03 -0400 | [diff] [blame^] | 246 | this->advanceClocks(1_ms, 10); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 247 | |
Junxiao Shi | 20d5a0b | 2018-08-14 09:26:11 -0600 | [diff] [blame] | 248 | face.receive(*makeInterest("/poke/test")); |
Eric Newberry | 2f041d2 | 2018-06-03 18:02:31 -0700 | [diff] [blame] | 249 | BOOST_CHECK_THROW(face.processEvents(), Face::OversizedPacketError); |
| 250 | |
Davide Pesavento | 87434be | 2019-07-25 19:04:23 -0400 | [diff] [blame] | 251 | // No point in checking getResult() here. The exception is thrown from processEvents(), |
| 252 | // 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] | 253 | BOOST_CHECK_EQUAL(face.sentData.size(), 0); |
| 254 | } |
| 255 | |
| 256 | BOOST_AUTO_TEST_SUITE_END() // TestNdnPoke |
| 257 | BOOST_AUTO_TEST_SUITE_END() // Peek |
| 258 | |
| 259 | } // namespace tests |
| 260 | } // namespace peek |
| 261 | } // namespace ndn |