blob: bb05aaf83a7e03f65e1a10be492fca61d616571c [file] [log] [blame]
Junxiao Shi727ed292014-02-19 23:26:45 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Spyridon Mastorakisd0381c02015-02-19 10:29:41 -08003 * Copyright (c) 2014-2015, Regents of the University of California,
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.
Alexander Afanasyev9bcbc7c2014-04-06 19:37:37 -070010 *
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/>.
Spyridon Mastorakisd0381c02015-02-19 10:29:41 -080024 */
Junxiao Shi727ed292014-02-19 23:26:45 -070025
26#include "fw/broadcast-strategy.hpp"
Junxiao Shi727ed292014-02-19 23:26:45 -070027
Junxiao Shid9ee45c2014-02-27 15:38:11 -070028#include "tests/test-common.hpp"
Junxiao Shi727ed292014-02-19 23:26:45 -070029
30namespace nfd {
Spyridon Mastorakisd0381c02015-02-19 10:29:41 -080031namespace fw {
Junxiao Shid9ee45c2014-02-27 15:38:11 -070032namespace tests {
Junxiao Shi727ed292014-02-19 23:26:45 -070033
Spyridon Mastorakisd0381c02015-02-19 10:29:41 -080034using namespace nfd::tests;
35
Junxiao Shid9ee45c2014-02-27 15:38:11 -070036BOOST_FIXTURE_TEST_SUITE(FwBroadcastStrategy, BaseFixture)
Junxiao Shi727ed292014-02-19 23:26:45 -070037
Junxiao Shi67ba8d22015-08-21 21:21:28 -070038BOOST_AUTO_TEST_CASE(Registry)
Junxiao Shi727ed292014-02-19 23:26:45 -070039{
Junxiao Shic041ca32014-02-25 20:01:15 -070040 Forwarder forwarder;
Junxiao Shi67ba8d22015-08-21 21:21:28 -070041 StrategyChoice& sc = forwarder.getStrategyChoice();
Junxiao Shi727ed292014-02-19 23:26:45 -070042
Junxiao Shi67ba8d22015-08-21 21:21:28 -070043 BOOST_CHECK(sc.hasStrategy("ndn:/localhost/nfd/strategy/broadcast"));
44 BOOST_CHECK(sc.hasStrategy("ndn:/localhost/nfd/strategy/multicast"));
Junxiao Shi727ed292014-02-19 23:26:45 -070045}
46
Junxiao Shi67ba8d22015-08-21 21:21:28 -070047BOOST_AUTO_TEST_CASE(StrategyName)
Junxiao Shi57f0f312014-03-16 11:52:20 -070048{
49 Forwarder forwarder;
Junxiao Shi67ba8d22015-08-21 21:21:28 -070050 fw::BroadcastStrategy strategy(forwarder);
51 BOOST_CHECK_EQUAL(strategy.getName(), fw::BroadcastStrategy::STRATEGY_NAME);
Junxiao Shi727ed292014-02-19 23:26:45 -070052}
53
54BOOST_AUTO_TEST_SUITE_END()
55
Junxiao Shid9ee45c2014-02-27 15:38:11 -070056} // namespace tests
Spyridon Mastorakisd0381c02015-02-19 10:29:41 -080057} // namespace fw
Junxiao Shi727ed292014-02-19 23:26:45 -070058} // namespace nfd