tests: Adding unit tests.

The purpose of this commit is to start pushing unit test I am writing. I will add more unit tests in each patch

Refs: #1496

Change-Id: Ic132adddfa06a95780712eba63966d3bab4743af
This commit is contained in:
Ashlesh Gawande committed 2014-05-01 14:47:06 -05:00
1 parent c8a10f762b
commit eb582eb919
17 files changed
+727

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
/**
* Copyright (C) 2014 Regents of the University of Memphis.
* See COPYING for copyright and distribution information.
*/
#include "route/routing-table.hpp"
#include "route/routing-table-entry.hpp"
#include "route/nexthop.hpp"
#include <boost/test/unit_test.hpp>
namespace nlsr {
namespace test {
BOOST_AUTO_TEST_SUITE(TestRoutingTable)
BOOST_AUTO_TEST_CASE(RoutingTableAddNextHop)
{
RoutingTable rt1;
NextHop nh1;
const std::string DEST_ROUTER = "destRouter";
rt1.addNextHop("destRouter", nh1);
BOOST_CHECK_EQUAL(rt1.findRoutingTableEntry(DEST_ROUTER)->getDestination(),
"destRouter");
}
BOOST_AUTO_TEST_SUITE_END()
} //namespace test
} //namespace nlsr