Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
| 3 | * Copyright (C) 2014 Named Data Networking Project |
| 4 | * See COPYING for copyright and distribution information. |
| 5 | */ |
| 6 | |
| 7 | #include "table/pit.hpp" |
Junxiao Shi | d9ee45c | 2014-02-27 15:38:11 -0700 | [diff] [blame] | 8 | #include "tests/face/dummy-face.hpp" |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 9 | |
Junxiao Shi | d9ee45c | 2014-02-27 15:38:11 -0700 | [diff] [blame] | 10 | #include "tests/test-common.hpp" |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 11 | |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 12 | namespace nfd { |
Junxiao Shi | d9ee45c | 2014-02-27 15:38:11 -0700 | [diff] [blame] | 13 | namespace tests { |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 14 | |
Junxiao Shi | d9ee45c | 2014-02-27 15:38:11 -0700 | [diff] [blame] | 15 | BOOST_FIXTURE_TEST_SUITE(TablePit, BaseFixture) |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 16 | |
Junxiao Shi | d3c792f | 2014-01-30 00:46:13 -0700 | [diff] [blame] | 17 | BOOST_AUTO_TEST_CASE(EntryInOutRecords) |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 18 | { |
Junxiao Shi | 8c8d218 | 2014-01-30 22:33:00 -0700 | [diff] [blame] | 19 | shared_ptr<Face> face1 = make_shared<DummyFace>(); |
| 20 | shared_ptr<Face> face2 = make_shared<DummyFace>(); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 21 | Name name("ndn:/KuYfjtRq"); |
| 22 | Interest interest(name); |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 23 | Interest interest1(name, static_cast<ndn::Milliseconds>(2528)); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 24 | interest1.setNonce(25559); |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 25 | Interest interest2(name, static_cast<ndn::Milliseconds>(6464)); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 26 | interest2.setNonce(19004); |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 27 | Interest interest3(name, static_cast<ndn::Milliseconds>(3585)); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 28 | interest3.setNonce(24216); |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 29 | Interest interest4(name, static_cast<ndn::Milliseconds>(8795)); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 30 | interest4.setNonce(17365); |
| 31 | |
| 32 | pit::Entry entry(interest); |
| 33 | |
| 34 | BOOST_CHECK(entry.getInterest().getName().equals(name)); |
| 35 | BOOST_CHECK(entry.getName().equals(name)); |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 36 | |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 37 | const pit::InRecordCollection& inRecords1 = entry.getInRecords(); |
| 38 | BOOST_CHECK_EQUAL(inRecords1.size(), 0); |
| 39 | const pit::OutRecordCollection& outRecords1 = entry.getOutRecords(); |
| 40 | BOOST_CHECK_EQUAL(outRecords1.size(), 0); |
| 41 | |
| 42 | // insert InRecord |
| 43 | time::Point before1 = time::now(); |
| 44 | pit::InRecordCollection::iterator in1 = |
| 45 | entry.insertOrUpdateInRecord(face1, interest1); |
| 46 | time::Point after1 = time::now(); |
| 47 | const pit::InRecordCollection& inRecords2 = entry.getInRecords(); |
| 48 | BOOST_CHECK_EQUAL(inRecords2.size(), 1); |
| 49 | BOOST_CHECK(in1 == inRecords2.begin()); |
| 50 | BOOST_CHECK_EQUAL(in1->getFace(), face1); |
| 51 | BOOST_CHECK_EQUAL(in1->getLastNonce(), interest1.getNonce()); |
| 52 | BOOST_CHECK_GE(in1->getLastRenewed(), before1); |
| 53 | BOOST_CHECK_LE(in1->getLastRenewed(), after1); |
| 54 | BOOST_CHECK_LE(std::abs(in1->getExpiry() - in1->getLastRenewed() |
| 55 | - time::milliseconds(interest1.getInterestLifetime())), |
| 56 | (after1 - before1)); |
| 57 | |
| 58 | // insert OutRecord |
| 59 | time::Point before2 = time::now(); |
| 60 | pit::OutRecordCollection::iterator out1 = |
| 61 | entry.insertOrUpdateOutRecord(face1, interest1); |
| 62 | time::Point after2 = time::now(); |
| 63 | const pit::OutRecordCollection& outRecords2 = entry.getOutRecords(); |
| 64 | BOOST_CHECK_EQUAL(outRecords2.size(), 1); |
| 65 | BOOST_CHECK(out1 == outRecords2.begin()); |
| 66 | BOOST_CHECK_EQUAL(out1->getFace(), face1); |
| 67 | BOOST_CHECK_EQUAL(out1->getLastNonce(), interest1.getNonce()); |
| 68 | BOOST_CHECK_GE(out1->getLastRenewed(), before2); |
| 69 | BOOST_CHECK_LE(out1->getLastRenewed(), after2); |
| 70 | BOOST_CHECK_LE(std::abs(out1->getExpiry() - out1->getLastRenewed() |
| 71 | - time::milliseconds(interest1.getInterestLifetime())), |
| 72 | (after2 - before2)); |
| 73 | |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 74 | // update InRecord |
| 75 | time::Point before3 = time::now(); |
| 76 | pit::InRecordCollection::iterator in2 = |
| 77 | entry.insertOrUpdateInRecord(face1, interest2); |
| 78 | time::Point after3 = time::now(); |
| 79 | const pit::InRecordCollection& inRecords3 = entry.getInRecords(); |
| 80 | BOOST_CHECK_EQUAL(inRecords3.size(), 1); |
| 81 | BOOST_CHECK(in2 == inRecords3.begin()); |
| 82 | BOOST_CHECK_EQUAL(in2->getFace(), face1); |
| 83 | BOOST_CHECK_EQUAL(in2->getLastNonce(), interest2.getNonce()); |
| 84 | BOOST_CHECK_LE(std::abs(in2->getExpiry() - in2->getLastRenewed() |
| 85 | - time::milliseconds(interest2.getInterestLifetime())), |
| 86 | (after3 - before3)); |
| 87 | |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 88 | // insert another InRecord |
| 89 | pit::InRecordCollection::iterator in3 = |
| 90 | entry.insertOrUpdateInRecord(face2, interest3); |
| 91 | const pit::InRecordCollection& inRecords4 = entry.getInRecords(); |
| 92 | BOOST_CHECK_EQUAL(inRecords4.size(), 2); |
| 93 | BOOST_CHECK_EQUAL(in3->getFace(), face2); |
| 94 | |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 95 | // delete all InRecords |
| 96 | entry.deleteInRecords(); |
| 97 | const pit::InRecordCollection& inRecords5 = entry.getInRecords(); |
| 98 | BOOST_CHECK_EQUAL(inRecords5.size(), 0); |
| 99 | |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 100 | // insert another OutRecord |
| 101 | pit::OutRecordCollection::iterator out2 = |
| 102 | entry.insertOrUpdateOutRecord(face2, interest4); |
| 103 | const pit::OutRecordCollection& outRecords3 = entry.getOutRecords(); |
| 104 | BOOST_CHECK_EQUAL(outRecords3.size(), 2); |
| 105 | BOOST_CHECK_EQUAL(out2->getFace(), face2); |
| 106 | |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 107 | // delete OutRecord |
| 108 | entry.deleteOutRecord(face2); |
| 109 | const pit::OutRecordCollection& outRecords4 = entry.getOutRecords(); |
| 110 | BOOST_REQUIRE_EQUAL(outRecords4.size(), 1); |
| 111 | BOOST_CHECK_EQUAL(outRecords4.begin()->getFace(), face1); |
| 112 | |
Junxiao Shi | d3c792f | 2014-01-30 00:46:13 -0700 | [diff] [blame] | 113 | } |
| 114 | |
| 115 | BOOST_AUTO_TEST_CASE(EntryNonce) |
| 116 | { |
| 117 | Name name("ndn:/qtCQ7I1c"); |
| 118 | Interest interest(name); |
| 119 | |
| 120 | pit::Entry entry(interest); |
| 121 | |
| 122 | BOOST_CHECK_EQUAL(entry.addNonce(25559), true); |
| 123 | BOOST_CHECK_EQUAL(entry.addNonce(25559), false); |
| 124 | BOOST_CHECK_EQUAL(entry.addNonce(19004), true); |
| 125 | BOOST_CHECK_EQUAL(entry.addNonce(19004), false); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | BOOST_AUTO_TEST_CASE(Insert) |
| 129 | { |
| 130 | Name name1("ndn:/5vzBNnMst"); |
| 131 | Name name2("ndn:/igSGfEIM62"); |
| 132 | Exclude exclude0; |
| 133 | Exclude exclude1; |
| 134 | exclude1.excludeOne(Name::Component("u26p47oep")); |
| 135 | Exclude exclude2; |
| 136 | exclude2.excludeOne(Name::Component("FG1Ni6nYcf")); |
| 137 | |
| 138 | // base |
| 139 | Interest interestA(name1, -1, -1, exclude0, -1, false, -1, -1.0, 0); |
| 140 | // A+exclude1 |
| 141 | Interest interestB(name1, -1, -1, exclude1, -1, false, -1, -1.0, 0); |
| 142 | // A+exclude2 |
| 143 | Interest interestC(name1, -1, -1, exclude2, -1, false, -1, -1.0, 0); |
| 144 | // A+MinSuffixComponents |
| 145 | Interest interestD(name1, 2, -1, exclude0, -1, false, -1, -1.0, 0); |
| 146 | // A+MaxSuffixComponents |
| 147 | Interest interestE(name1, -1, 4, exclude0, -1, false, -1, -1.0, 0); |
| 148 | // A+ChildSelector |
| 149 | Interest interestF(name1, -1, -1, exclude0, 1, false, -1, -1.0, 0); |
| 150 | // A+MustBeFresh |
| 151 | Interest interestG(name1, -1, -1, exclude0, -1, true, -1, -1.0, 0); |
| 152 | // A+Scope |
| 153 | Interest interestH(name1, -1, -1, exclude0, -1, false, 2, -1.0, 0); |
| 154 | // A+InterestLifetime |
| 155 | Interest interestI(name1, -1, -1, exclude0, -1, false, -1, 2000, 0); |
| 156 | // A+Nonce |
| 157 | Interest interestJ(name1, -1, -1, exclude0, -1, false, -1, -1.0, 2192); |
| 158 | // different Name+exclude1 |
| 159 | Interest interestK(name2, -1, -1, exclude1, -1, false, -1, -1.0, 0); |
| 160 | |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 161 | NameTree nameTree(16); |
| 162 | Pit pit(nameTree); |
| 163 | |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 164 | std::pair<shared_ptr<pit::Entry>, bool> insertResult; |
| 165 | |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 166 | BOOST_CHECK_EQUAL(pit.size(), 0); |
| 167 | |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 168 | insertResult = pit.insert(interestA); |
| 169 | BOOST_CHECK_EQUAL(insertResult.second, true); |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 170 | BOOST_CHECK_EQUAL(pit.size(), 1); |
| 171 | |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 172 | insertResult = pit.insert(interestB); |
| 173 | BOOST_CHECK_EQUAL(insertResult.second, true); |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 174 | BOOST_CHECK_EQUAL(pit.size(), 2); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 175 | |
| 176 | insertResult = pit.insert(interestC); |
| 177 | BOOST_CHECK_EQUAL(insertResult.second, true); |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 178 | BOOST_CHECK_EQUAL(pit.size(), 3); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 179 | |
| 180 | insertResult = pit.insert(interestD); |
| 181 | BOOST_CHECK_EQUAL(insertResult.second, true); |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 182 | BOOST_CHECK_EQUAL(pit.size(), 4); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 183 | |
| 184 | insertResult = pit.insert(interestE); |
| 185 | BOOST_CHECK_EQUAL(insertResult.second, true); |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 186 | BOOST_CHECK_EQUAL(pit.size(), 5); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 187 | |
| 188 | insertResult = pit.insert(interestF); |
| 189 | BOOST_CHECK_EQUAL(insertResult.second, true); |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 190 | BOOST_CHECK_EQUAL(pit.size(), 6); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 191 | |
| 192 | insertResult = pit.insert(interestG); |
| 193 | BOOST_CHECK_EQUAL(insertResult.second, true); |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 194 | BOOST_CHECK_EQUAL(pit.size(), 7); |
| 195 | |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 196 | |
| 197 | insertResult = pit.insert(interestH); |
| 198 | BOOST_CHECK_EQUAL(insertResult.second, false);// only guiders differ |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 199 | BOOST_CHECK_EQUAL(pit.size(), 7); |
| 200 | |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 201 | insertResult = pit.insert(interestI); |
| 202 | BOOST_CHECK_EQUAL(insertResult.second, false);// only guiders differ |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 203 | BOOST_CHECK_EQUAL(pit.size(), 7); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 204 | |
| 205 | insertResult = pit.insert(interestJ); |
| 206 | BOOST_CHECK_EQUAL(insertResult.second, false);// only guiders differ |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 207 | BOOST_CHECK_EQUAL(pit.size(), 7); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 208 | |
| 209 | insertResult = pit.insert(interestK); |
| 210 | BOOST_CHECK_EQUAL(insertResult.second, true); |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 211 | BOOST_CHECK_EQUAL(pit.size(), 8); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 212 | } |
| 213 | |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 214 | BOOST_AUTO_TEST_CASE(Erase) |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 215 | { |
| 216 | Interest interest(Name("ndn:/z88Admz6A2")); |
| 217 | |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 218 | NameTree nameTree(16); |
| 219 | Pit pit(nameTree); |
| 220 | |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 221 | std::pair<shared_ptr<pit::Entry>, bool> insertResult; |
| 222 | |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 223 | BOOST_CHECK_EQUAL(pit.size(), 0); |
| 224 | |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 225 | insertResult = pit.insert(interest); |
| 226 | BOOST_CHECK_EQUAL(insertResult.second, true); |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 227 | BOOST_CHECK_EQUAL(pit.size(), 1); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 228 | |
| 229 | insertResult = pit.insert(interest); |
| 230 | BOOST_CHECK_EQUAL(insertResult.second, false); |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 231 | BOOST_CHECK_EQUAL(pit.size(), 1); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 232 | |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 233 | pit.erase(insertResult.first); |
| 234 | BOOST_CHECK_EQUAL(pit.size(), 0); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 235 | |
| 236 | insertResult = pit.insert(interest); |
| 237 | BOOST_CHECK_EQUAL(insertResult.second, true); |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 238 | BOOST_CHECK_EQUAL(pit.size(), 1); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 239 | |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 240 | } |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 241 | |
| 242 | BOOST_AUTO_TEST_CASE(FindAllDataMatches) |
| 243 | { |
Haowei Yuan | e1079fc | 2014-03-08 14:41:25 -0600 | [diff] [blame] | 244 | Name nameA ("ndn:/A"); |
| 245 | Name nameAB ("ndn:/A/B"); |
| 246 | Name nameABC ("ndn:/A/B/C"); |
| 247 | Name nameABCD("ndn:/A/B/C/D"); |
| 248 | Name nameD ("ndn:/D"); |
| 249 | |
| 250 | Interest interestA (nameA ); |
| 251 | Interest interestABC(nameABC); |
| 252 | Interest interestD (nameD ); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 253 | |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 254 | NameTree nameTree(16); |
| 255 | Pit pit(nameTree); |
Haowei Yuan | e1079fc | 2014-03-08 14:41:25 -0600 | [diff] [blame] | 256 | int count = 0; |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 257 | |
| 258 | BOOST_CHECK_EQUAL(pit.size(), 0); |
| 259 | |
Haowei Yuan | e1079fc | 2014-03-08 14:41:25 -0600 | [diff] [blame] | 260 | pit.insert(interestA ); |
| 261 | pit.insert(interestABC); |
| 262 | pit.insert(interestD ); |
| 263 | |
| 264 | nameTree.lookup(nameABCD); // make sure /A/B/C/D is in nameTree |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 265 | |
Haowei Yuan | 78c84d1 | 2014-02-27 15:35:13 -0600 | [diff] [blame] | 266 | BOOST_CHECK_EQUAL(pit.size(), 3); |
| 267 | |
Haowei Yuan | e1079fc | 2014-03-08 14:41:25 -0600 | [diff] [blame] | 268 | Data data(nameABCD); |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 269 | |
| 270 | shared_ptr<pit::DataMatchResult> matches = pit.findAllDataMatches(data); |
Haowei Yuan | e1079fc | 2014-03-08 14:41:25 -0600 | [diff] [blame] | 271 | |
| 272 | bool hasA = false; |
| 273 | bool hasAB = false; |
| 274 | bool hasABC = false; |
| 275 | bool hasD = false; |
| 276 | |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 277 | for (pit::DataMatchResult::iterator it = matches->begin(); |
| 278 | it != matches->end(); ++it) { |
| 279 | ++count; |
| 280 | shared_ptr<pit::Entry> entry = *it; |
Haowei Yuan | e1079fc | 2014-03-08 14:41:25 -0600 | [diff] [blame] | 281 | |
| 282 | if (entry->getName().equals(nameA )) |
| 283 | hasA = true; |
| 284 | |
| 285 | if (entry->getName().equals(nameAB)) |
| 286 | hasAB = true; |
| 287 | |
| 288 | if (entry->getName().equals(nameABC)) |
| 289 | hasABC = true; |
| 290 | |
| 291 | if (entry->getName().equals(nameD)) |
| 292 | hasD = true; |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 293 | } |
Haowei Yuan | e1079fc | 2014-03-08 14:41:25 -0600 | [diff] [blame] | 294 | BOOST_CHECK_EQUAL(hasA , true); |
| 295 | BOOST_CHECK_EQUAL(hasAB , false); |
| 296 | BOOST_CHECK_EQUAL(hasABC, true); |
| 297 | BOOST_CHECK_EQUAL(hasD , false); |
| 298 | |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 299 | BOOST_CHECK_EQUAL(count, 2); |
Haowei Yuan | e1079fc | 2014-03-08 14:41:25 -0600 | [diff] [blame] | 300 | |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 301 | } |
| 302 | |
| 303 | BOOST_AUTO_TEST_SUITE_END() |
| 304 | |
Junxiao Shi | d9ee45c | 2014-02-27 15:38:11 -0700 | [diff] [blame] | 305 | } // namespace tests |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 306 | } // namespace nfd |