/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
 * Copyright (c) 2014,  Regents of the University of California,
 *                      Arizona Board of Regents,
 *                      Colorado State University,
 *                      University Pierre & Marie Curie, Sorbonne University,
 *                      Washington University in St. Louis,
 *                      Beijing Institute of Technology,
 *                      The University of Memphis
 *
 * This file is part of NFD (Named Data Networking Forwarding Daemon).
 * See AUTHORS.md for complete list of NFD authors and contributors.
 *
 * NFD is free software: you can redistribute it and/or modify it under the terms
 * of the GNU General Public License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any later version.
 *
 * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "rib/rib.hpp"

#include "tests/test-common.hpp"

namespace nfd {
namespace rib {
namespace tests {

BOOST_FIXTURE_TEST_SUITE(Rib, nfd::tests::BaseFixture)

BOOST_AUTO_TEST_CASE(RibEntry)
{
  rib::RibEntry entry;

  rib::Route route1;
  route1.faceId = 1;
  route1.origin = 0;

  entry.insertRoute(route1);
  BOOST_CHECK_EQUAL(entry.getRoutes().size(), 1);

  Route route2;
  route2.faceId = 1;
  route2.origin = 128;

  entry.insertRoute(route2);
  BOOST_CHECK_EQUAL(entry.getRoutes().size(), 2);

  entry.eraseRoute(route1);
  BOOST_CHECK_EQUAL(entry.getRoutes().size(), 1);

  BOOST_CHECK(entry.findRoute(route1) == entry.getRoutes().end());
  BOOST_CHECK(entry.findRoute(route2) != entry.getRoutes().end());

  entry.insertRoute(route2);
  BOOST_CHECK_EQUAL(entry.getRoutes().size(), 1);

  entry.eraseRoute(route1);
  BOOST_CHECK_EQUAL(entry.getRoutes().size(), 1);
  BOOST_CHECK(entry.findRoute(route2) != entry.getRoutes().end());
}

BOOST_AUTO_TEST_CASE(Parent)
{
  rib::Rib rib;

  Route root;
  Name name1("/");
  root.faceId = 1;
  root.origin = 20;
  rib.insert(name1, root);

  Route route1;
  Name name2("/hello");
  route1.faceId = 2;
  route1.origin = 20;
  rib.insert(name2, route1);

  Route route2;
  Name name3("/hello/world");
  route2.faceId = 3;
  route2.origin = 20;
  rib.insert(name3, route2);

  shared_ptr<rib::RibEntry> ribEntry = rib.findParent(name3);
  BOOST_REQUIRE(static_cast<bool>(ribEntry));
  BOOST_CHECK_EQUAL(ribEntry->getRoutes().front().faceId, 2);

  ribEntry = rib.findParent(name2);
  BOOST_REQUIRE(static_cast<bool>(ribEntry));
  BOOST_CHECK_EQUAL(ribEntry->getRoutes().front().faceId, 1);

  Route route3;
  Name name4("/hello/test/foo/bar");
  route2.faceId = 3;
  route2.origin = 20;
  rib.insert(name4, route3);

  ribEntry = rib.findParent(name4);
  BOOST_CHECK(ribEntry != shared_ptr<rib::RibEntry>());
  BOOST_CHECK(ribEntry->getRoutes().front().faceId == 2);
}

BOOST_AUTO_TEST_CASE(Children)
{
  rib::Rib rib;

  Route route1;
  Name name1("/");
  route1.faceId = 1;
  route1.origin = 20;
  rib.insert(name1, route1);

  Route route2;
  Name name2("/hello/world");
  route2.faceId = 2;
  route2.origin = 20;
  rib.insert(name2, route2);

  Route route3;
  Name name3("/hello/test/foo/bar");
  route3.faceId = 3;
  route3.origin = 20;
  rib.insert(name3, route3);

  BOOST_CHECK_EQUAL((rib.find(name1)->second)->getChildren().size(), 2);
  BOOST_CHECK_EQUAL((rib.find(name2)->second)->getChildren().size(), 0);
  BOOST_CHECK_EQUAL((rib.find(name3)->second)->getChildren().size(), 0);

  Route entry4;
  Name name4("/hello");
  entry4.faceId = 4;
  entry4.origin = 20;
  rib.insert(name4, entry4);

  BOOST_CHECK_EQUAL((rib.find(name1)->second)->getChildren().size(), 1);
  BOOST_CHECK_EQUAL((rib.find(name2)->second)->getChildren().size(), 0);
  BOOST_CHECK_EQUAL((rib.find(name3)->second)->getChildren().size(), 0);
  BOOST_CHECK_EQUAL((rib.find(name4)->second)->getChildren().size(), 2);

  BOOST_CHECK_EQUAL((rib.find(name1)->second)->getChildren().front()->getName(), "/hello");
  BOOST_CHECK_EQUAL((rib.find(name4)->second)->getParent()->getName(), "/");

  BOOST_REQUIRE(static_cast<bool>((rib.find(name2)->second)->getParent()));
  BOOST_CHECK_EQUAL((rib.find(name2)->second)->getParent()->getName(), name4);
  BOOST_REQUIRE(static_cast<bool>((rib.find(name3)->second)->getParent()));
  BOOST_CHECK_EQUAL((rib.find(name3)->second)->getParent()->getName(), name4);
}

BOOST_AUTO_TEST_CASE(EraseFace)
{
  rib::Rib rib;

  Route route1;
  Name name1("/");
  route1.faceId = 1;
  route1.origin = 20;
  rib.insert(name1, route1);

  Route route2;
  Name name2("/hello/world");
  route2.faceId = 2;
  route2.origin = 20;
  rib.insert(name2, route2);

  Route route3;
  Name name3("/hello/world");
  route3.faceId = 1;
  route3.origin = 20;
  rib.insert(name3, route3);

  Route entry4;
  Name name4("/not/inserted");
  entry4.faceId = 1;
  entry4.origin = 20;

  rib.erase(name4, entry4);
  rib.erase(name1, route1);

  BOOST_CHECK(rib.find(name1) == rib.end());
  BOOST_CHECK_EQUAL((rib.find(name2)->second)->getRoutes().size(), 2);

  rib.erase(name2, route2);

  BOOST_CHECK_EQUAL((rib.find(name2)->second)->getRoutes().size(), 1);
  BOOST_CHECK_EQUAL((rib.find(name2)->second)->getRoutes().front().faceId, 1);

  rib.erase(name3, route3);

  BOOST_CHECK(rib.find(name2) == rib.end());

  rib.erase(name4, entry4);
}

BOOST_AUTO_TEST_CASE(EraseRibEntry)
{
  rib::Rib rib;

  Route route1;
  Name name1("/");
  route1.faceId = 1;
  route1.origin = 20;
  rib.insert(name1, route1);

  Route route2;
  Name name2("/hello");
  route2.faceId = 2;
  route2.origin = 20;
  rib.insert(name2, route2);

  Route route3;
  Name name3("/hello/world");
  route3.faceId = 1;
  route3.origin = 20;
  rib.insert(name3, route3);

  shared_ptr<rib::RibEntry> ribEntry1 = rib.find(name1)->second;
  shared_ptr<rib::RibEntry> ribEntry2 = rib.find(name2)->second;
  shared_ptr<rib::RibEntry> ribEntry3 = rib.find(name3)->second;

  BOOST_CHECK(ribEntry1->getChildren().front() == ribEntry2);
  BOOST_CHECK(ribEntry3->getParent() == ribEntry2);

  rib.erase(name2, route2);
  BOOST_CHECK(ribEntry1->getChildren().front() == ribEntry3);
  BOOST_CHECK(ribEntry3->getParent() == ribEntry1);
}

BOOST_AUTO_TEST_CASE(EraseByFaceId)
{
  rib::Rib rib;

  Route route1;
  Name name1("/");
  route1.faceId = 1;
  route1.origin = 20;
  rib.insert(name1, route1);

  Route route2;
  Name name2("/hello/world");
  route2.faceId = 2;
  route2.origin = 20;
  rib.insert(name2, route2);

  Route route3;
  Name name3("/hello/world");
  route3.faceId = 1;
  route3.origin = 20;
  rib.insert(name3, route3);

  rib.erase(1);
  BOOST_CHECK(rib.find(name1) == rib.end());
  BOOST_CHECK_EQUAL((rib.find(name2)->second)->getRoutes().size(), 1);

  rib.erase(3);
  BOOST_CHECK_EQUAL((rib.find(name2)->second)->getRoutes().size(), 1);

  rib.erase(2);
  BOOST_CHECK(rib.find(name2) == rib.end());

  rib.erase(3);
}

BOOST_AUTO_TEST_CASE(Basic)
{
  rib::Rib rib;

  Route route1;
  Name name1("/hello/world");
  route1.faceId = 1;
  route1.origin = 20;
  route1.cost = 10;
  route1.flags = ndn::nfd::ROUTE_FLAG_CHILD_INHERIT | ndn::nfd::ROUTE_FLAG_CAPTURE;
  route1.expires = time::steady_clock::now() + time::milliseconds(1500);

  rib.insert(name1, route1);
  BOOST_CHECK_EQUAL(rib.size(), 1);

  rib.insert(name1, route1);
  BOOST_CHECK_EQUAL(rib.size(), 1);

  Route route2;
  Name name2("/hello/world");
  route2.faceId = 1;
  route2.origin = 20;
  route2.cost = 100;
  route2.flags = ndn::nfd::ROUTE_FLAG_CHILD_INHERIT;
  route2.expires = time::steady_clock::now() + time::seconds(0);

  rib.insert(name2, route2);
  BOOST_CHECK_EQUAL(rib.size(), 1);

  route2.faceId = 2;
  rib.insert(name2, route2);
  BOOST_CHECK_EQUAL(rib.size(), 2);

  BOOST_CHECK(rib.find(name1)->second->hasFaceId(route1.faceId));
  BOOST_CHECK(rib.find(name1)->second->hasFaceId(route2.faceId));

  Name name3("/foo/bar");
  rib.insert(name3, route2);
  BOOST_CHECK_EQUAL(rib.size(), 3);

  route2.origin = 1;
  rib.insert(name3, route2);
  BOOST_CHECK_EQUAL(rib.size(), 4);

  rib.erase(name3, route2);
  BOOST_CHECK_EQUAL(rib.size(), 3);

  Name name4("/hello/world");
  rib.erase(name4, route2);
  BOOST_CHECK_EQUAL(rib.size(), 3);

  route2.origin = 20;
  rib.erase(name4, route2);
  BOOST_CHECK_EQUAL(rib.size(), 2);

  BOOST_CHECK_EQUAL(rib.find(name2, route2), static_cast<Route*>(0));
  BOOST_CHECK_NE(rib.find(name1, route1), static_cast<Route*>(0));

  rib.erase(name1, route1);
  BOOST_CHECK_EQUAL(rib.size(), 1);
}

BOOST_AUTO_TEST_SUITE_END()

} // namespace tests
} // namespace rib
} // namespace nfd
