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
diff --git a/tests/test-nexthop.cpp b/tests/test-nexthop.cpp
new file mode 100644
index 0000000..b0bb90d
--- /dev/null
+++ b/tests/test-nexthop.cpp
@@ -0,0 +1,30 @@
+/**
+ * Copyright (C) 2014 Regents of the University of Memphis.
+ * See COPYING for copyright and distribution information.
+ */
+
+#include "route/nexthop.hpp"
+#include <boost/test/unit_test.hpp>
+
+namespace nlsr {
+
+namespace test {
+
+BOOST_AUTO_TEST_SUITE(TestNexthop)
+
+BOOST_AUTO_TEST_CASE(NexthopSetAndGet)
+{
+ NextHop np1;
+
+ np1.setConnectingFace(1);
+
+ np1.setRouteCost(10.5);
+
+ BOOST_CHECK_EQUAL(np1.getConnectingFace(), 1);
+ BOOST_CHECK_CLOSE(np1.getRouteCost(), 10.5, 0.0001);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} //namespace test
+} //namespace nlsr