Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
Davide Pesavento | e422f9e | 2022-06-03 01:30:23 -0400 | [diff] [blame] | 2 | /* |
Davide Pesavento | caa60cc | 2024-02-18 18:18:37 -0500 | [diff] [blame] | 3 | * Copyright (c) 2014-2024, Regents of the University of California, |
Alexander Afanasyev | 7c10b3b | 2015-01-20 12:24:27 -0800 | [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. |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 10 | * |
| 11 | * This file is part of NFD (Named Data Networking Forwarding Daemon). |
| 12 | * See AUTHORS.md for complete list of NFD authors and contributors. |
| 13 | * |
| 14 | * NFD 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 | * NFD 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 | * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
| 24 | */ |
| 25 | |
| 26 | #include "rib/rib.hpp" |
| 27 | |
| 28 | #include "tests/test-common.hpp" |
| 29 | #include "fib-updates-common.hpp" |
| 30 | |
Davide Pesavento | e422f9e | 2022-06-03 01:30:23 -0400 | [diff] [blame] | 31 | namespace nfd::tests { |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 32 | |
Davide Pesavento | caa60cc | 2024-02-18 18:18:37 -0500 | [diff] [blame] | 33 | BOOST_AUTO_TEST_SUITE(Rib) |
Spyridon Mastorakis | d0381c0 | 2015-02-19 10:29:41 -0800 | [diff] [blame] | 34 | BOOST_FIXTURE_TEST_SUITE(TestFibUpdates, FibUpdatesFixture) |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 35 | BOOST_AUTO_TEST_SUITE(UpdateFace) |
| 36 | |
| 37 | BOOST_AUTO_TEST_CASE(TurnOffChildInheritLowerCost) |
| 38 | { |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 39 | insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
| 40 | insertRoute("/a", 2, 0, 10, 0); |
| 41 | insertRoute("/", 1, 128, 25, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 42 | |
| 43 | // Clear updates generated from previous insertions |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 44 | clearFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 45 | |
| 46 | // Should generate 2 updates: 1 to update the cost of / face 1 to 50 and |
| 47 | // 1 to update the cost of /a face 1 to 50 |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 48 | insertRoute("/", 1, 128, 75, 0); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 49 | |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 50 | FibUpdater::FibUpdateList updates = getSortedFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 51 | BOOST_REQUIRE_EQUAL(updates.size(), 2); |
| 52 | |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 53 | FibUpdater::FibUpdateList::const_iterator update = updates.begin(); |
| 54 | BOOST_CHECK_EQUAL(update->name, "/"); |
| 55 | BOOST_CHECK_EQUAL(update->faceId, 1); |
| 56 | BOOST_CHECK_EQUAL(update->cost, 50); |
| 57 | BOOST_CHECK_EQUAL(update->action, FibUpdate::ADD_NEXTHOP); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 58 | |
| 59 | ++update; |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 60 | BOOST_CHECK_EQUAL(update->name, "/a"); |
| 61 | BOOST_CHECK_EQUAL(update->faceId, 1); |
| 62 | BOOST_CHECK_EQUAL(update->cost, 50); |
| 63 | BOOST_CHECK_EQUAL(update->action, FibUpdate::ADD_NEXTHOP); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | BOOST_AUTO_TEST_CASE(UpdateOnLowerCostOnly) |
| 67 | { |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 68 | insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
| 69 | insertRoute("/a", 2, 0, 10, 0); |
| 70 | insertRoute("/", 1, 128, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 71 | |
| 72 | // Clear updates generated from previous insertions |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 73 | clearFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 74 | |
| 75 | // Should generate 0 updates |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 76 | insertRoute("/", 1, 128, 75, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 77 | |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 78 | FibUpdater::FibUpdateList updates = getSortedFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 79 | BOOST_REQUIRE_EQUAL(updates.size(), 0); |
| 80 | |
| 81 | // Clear updates generated from previous insertions |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 82 | clearFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 83 | |
| 84 | // Should generate 2 updates |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 85 | insertRoute("/", 1, 128, 25, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 86 | |
| 87 | updates = getSortedFibUpdates(); |
| 88 | BOOST_REQUIRE_EQUAL(updates.size(), 2); |
| 89 | |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 90 | FibUpdater::FibUpdateList::const_iterator update = updates.begin(); |
| 91 | BOOST_CHECK_EQUAL(update->name, "/"); |
| 92 | BOOST_CHECK_EQUAL(update->faceId, 1); |
| 93 | BOOST_CHECK_EQUAL(update->cost, 25); |
| 94 | BOOST_CHECK_EQUAL(update->action, FibUpdate::ADD_NEXTHOP); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 95 | |
| 96 | ++update; |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 97 | BOOST_CHECK_EQUAL(update->name, "/a"); |
| 98 | BOOST_CHECK_EQUAL(update->faceId, 1); |
| 99 | BOOST_CHECK_EQUAL(update->cost, 25); |
| 100 | BOOST_CHECK_EQUAL(update->action, FibUpdate::ADD_NEXTHOP); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 101 | } |
| 102 | |
| 103 | BOOST_AUTO_TEST_CASE(NoChangeInCost) |
| 104 | { |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 105 | insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
| 106 | insertRoute("/a", 2, 0, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
| 107 | insertRoute("/a/b", 3, 0, 10, 0); |
| 108 | insertRoute("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 109 | |
| 110 | // Clear updates generated from previous insertions |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 111 | clearFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 112 | |
| 113 | // Should generate 0 updates |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 114 | insertRoute("/a", 2, 0, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 115 | |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 116 | FibUpdater::FibUpdateList updates = getSortedFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 117 | BOOST_REQUIRE_EQUAL(updates.size(), 0); |
| 118 | } |
| 119 | |
| 120 | BOOST_AUTO_TEST_CASE(ChangeCost) |
| 121 | { |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 122 | insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
| 123 | insertRoute("/a", 2, 0, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
| 124 | insertRoute("/a/b", 3, 0, 10, 0); |
| 125 | insertRoute("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 126 | |
| 127 | // Clear updates generated from previous insertions |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 128 | clearFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 129 | |
| 130 | // Should generate 2 updates: 1 to add face2 with new cost to /a and |
| 131 | // 1 to add face2 with new cost to /a/b |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 132 | insertRoute("/a", 2, 0, 300, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 133 | |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 134 | FibUpdater::FibUpdateList updates = getSortedFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 135 | BOOST_REQUIRE_EQUAL(updates.size(), 2); |
| 136 | |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 137 | FibUpdater::FibUpdateList::const_iterator update = updates.begin(); |
| 138 | BOOST_CHECK_EQUAL(update->name, "/a"); |
| 139 | BOOST_CHECK_EQUAL(update->faceId, 2); |
| 140 | BOOST_CHECK_EQUAL(update->cost, 300); |
| 141 | BOOST_CHECK_EQUAL(update->action, FibUpdate::ADD_NEXTHOP); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 142 | |
| 143 | ++update; |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 144 | BOOST_CHECK_EQUAL(update->name, "/a/b"); |
| 145 | BOOST_CHECK_EQUAL(update->faceId, 2); |
| 146 | BOOST_CHECK_EQUAL(update->cost, 300); |
| 147 | BOOST_CHECK_EQUAL(update->action, FibUpdate::ADD_NEXTHOP); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 148 | } |
| 149 | |
| 150 | BOOST_AUTO_TEST_CASE(TurnOnChildInherit) |
| 151 | { |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 152 | insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
| 153 | insertRoute("/a", 2, 0, 10, 0); |
| 154 | insertRoute("/a/b", 3, 0, 10, 0); |
| 155 | insertRoute("/a/c", 4, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 156 | |
| 157 | // Clear updates generated from previous insertions |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 158 | clearFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 159 | |
| 160 | // Turn on child inherit flag for the entry in /a |
| 161 | // Should generate 1 updates: 1 to add face to /a/b |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 162 | insertRoute("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 163 | |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 164 | FibUpdater::FibUpdateList updates = getSortedFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 165 | BOOST_REQUIRE_EQUAL(updates.size(), 1); |
| 166 | |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 167 | FibUpdater::FibUpdateList::const_iterator update = updates.begin(); |
| 168 | BOOST_CHECK_EQUAL(update->name, "/a/b"); |
| 169 | BOOST_CHECK_EQUAL(update->faceId, 2); |
| 170 | BOOST_CHECK_EQUAL(update->cost, 10); |
| 171 | BOOST_CHECK_EQUAL(update->action, FibUpdate::ADD_NEXTHOP); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 172 | } |
| 173 | |
| 174 | BOOST_AUTO_TEST_CASE(TurnOffChildInherit) |
| 175 | { |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 176 | insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
| 177 | insertRoute("/a", 1, 0, 100, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
| 178 | insertRoute("/a/b", 2, 0, 10, 0); |
| 179 | insertRoute("/a/c", 1, 0, 25, 0); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 180 | |
| 181 | // Clear updates generated from previous insertions |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 182 | clearFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 183 | |
| 184 | // Turn off child inherit flag for the entry in /a |
| 185 | // Should generate 1 update: 1 to add face1 to /a/b |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 186 | insertRoute("/a", 1, 0, 100, 0); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 187 | |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 188 | FibUpdater::FibUpdateList updates = getSortedFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 189 | BOOST_REQUIRE_EQUAL(updates.size(), 1); |
| 190 | |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 191 | FibUpdater::FibUpdateList::const_iterator update = updates.begin(); |
| 192 | BOOST_CHECK_EQUAL(update->name, "/a/b"); |
| 193 | BOOST_CHECK_EQUAL(update->faceId, 1); |
| 194 | BOOST_CHECK_EQUAL(update->cost, 50); |
| 195 | BOOST_CHECK_EQUAL(update->action, FibUpdate::ADD_NEXTHOP); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 196 | } |
| 197 | |
| 198 | BOOST_AUTO_TEST_CASE(TurnOnCapture) |
| 199 | { |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 200 | insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
| 201 | insertRoute("/a", 2, 0, 10, 0); |
| 202 | insertRoute("/a/b", 3, 0, 10, 0); |
| 203 | insertRoute("/a/c", 1, 0, 10, 0); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 204 | |
| 205 | // Clear updates generated from previous insertions |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 206 | clearFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 207 | |
| 208 | // Turn on capture flag for the entry in /a |
| 209 | // Should generate 2 updates: 1 to remove face1 from /a and |
| 210 | // 1 to remove face1 from /a/b |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 211 | insertRoute("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 212 | |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 213 | FibUpdater::FibUpdateList updates = getSortedFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 214 | BOOST_REQUIRE_EQUAL(updates.size(), 2); |
| 215 | |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 216 | FibUpdater::FibUpdateList::const_iterator update = updates.begin(); |
| 217 | BOOST_CHECK_EQUAL(update->name, "/a"); |
| 218 | BOOST_CHECK_EQUAL(update->faceId, 1); |
| 219 | BOOST_CHECK_EQUAL(update->action, FibUpdate::REMOVE_NEXTHOP); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 220 | |
| 221 | ++update; |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 222 | BOOST_CHECK_EQUAL(update->name, "/a/b"); |
| 223 | BOOST_CHECK_EQUAL(update->faceId, 1); |
| 224 | BOOST_CHECK_EQUAL(update->action, FibUpdate::REMOVE_NEXTHOP); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 225 | } |
| 226 | |
| 227 | BOOST_AUTO_TEST_CASE(TurnOffCapture) |
| 228 | { |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 229 | insertRoute("/", 1, 0, 50, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT); |
| 230 | insertRoute("/a", 2, 0, 10, ndn::nfd::ROUTE_FLAG_CAPTURE); |
| 231 | insertRoute("/a/b", 3, 0, 10, 0); |
| 232 | insertRoute("/a/c", 1, 0, 10, 0); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 233 | |
| 234 | // Clear updates generated from previous insertions |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 235 | clearFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 236 | |
| 237 | // Turn off capture flag for the entry in /a |
| 238 | // Should generate 2 updates: 1 to add face1 to /a and |
| 239 | // 1 to add face1 to /a/b |
Vince Lehman | 218be0a | 2015-01-15 17:25:20 -0600 | [diff] [blame] | 240 | insertRoute("/a", 2, 0, 10, 0); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 241 | |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 242 | FibUpdater::FibUpdateList updates = getSortedFibUpdates(); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 243 | BOOST_REQUIRE_EQUAL(updates.size(), 2); |
| 244 | |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 245 | FibUpdater::FibUpdateList::const_iterator update = updates.begin(); |
| 246 | BOOST_CHECK_EQUAL(update->name, "/a"); |
| 247 | BOOST_CHECK_EQUAL(update->faceId, 1); |
| 248 | BOOST_CHECK_EQUAL(update->cost, 50); |
| 249 | BOOST_CHECK_EQUAL(update->action, FibUpdate::ADD_NEXTHOP); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 250 | |
| 251 | ++update; |
Vince Lehman | 76c751c | 2014-11-18 17:36:38 -0600 | [diff] [blame] | 252 | BOOST_CHECK_EQUAL(update->name, "/a/b"); |
| 253 | BOOST_CHECK_EQUAL(update->faceId, 1); |
| 254 | BOOST_CHECK_EQUAL(update->cost, 50); |
| 255 | BOOST_CHECK_EQUAL(update->action, FibUpdate::ADD_NEXTHOP); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 256 | } |
| 257 | |
| 258 | BOOST_AUTO_TEST_SUITE_END() // UpdateFace |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 259 | BOOST_AUTO_TEST_SUITE_END() // FibUpdates |
Davide Pesavento | caa60cc | 2024-02-18 18:18:37 -0500 | [diff] [blame] | 260 | BOOST_AUTO_TEST_SUITE_END() // Rib |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 261 | |
Davide Pesavento | e422f9e | 2022-06-03 01:30:23 -0400 | [diff] [blame] | 262 | } // namespace nfd::tests |