route: Adjust cost to integer before registering

refs: #1907

Change-Id: I471cd2eafb65a8458b4f527a3c3d7ea6682f5627
diff --git a/tests/test-nexthop-list.cpp b/tests/test-nexthop-list.cpp
index f2bb7fd..eeea461 100644
--- a/tests/test-nexthop-list.cpp
+++ b/tests/test-nexthop-list.cpp
@@ -43,6 +43,26 @@
   BOOST_CHECK_EQUAL(nhl1.getSize(), (uint32_t)0);
 }
 
+BOOST_AUTO_TEST_CASE(RemoveNextHop)
+{
+  NextHop hop1;
+  hop1.setRouteCost(12.34);
+
+  NexthopList hopList;
+  hopList.addNextHop(hop1);
+
+  NextHop hop2;
+  hop2.setRouteCost(12.35);
+
+  BOOST_REQUIRE_EQUAL(hopList.getSize(), 1);
+
+  hopList.removeNextHop(hop2);
+  BOOST_CHECK_EQUAL(hopList.getSize(), 1);
+
+  hopList.removeNextHop(hop1);
+  BOOST_CHECK_EQUAL(hopList.getSize(), 0);
+}
+
 BOOST_AUTO_TEST_SUITE_END()
 
 } //namespace test