Dummy test node for unit testing
authorTom Henderson <tomh@tomh.org>
Tue, 10 Jul 2007 13:58:13 -0700
changeset 1066 f19baa3a0cb5
parent 1065 4850d9e9badd
child 1067 704eb2583865
Dummy test node for unit testing
src/routing/static-route-manager.cc
--- a/src/routing/static-route-manager.cc	Tue Jul 10 13:40:36 2007 -0700
+++ b/src/routing/static-route-manager.cc	Tue Jul 10 13:58:13 2007 -0700
@@ -305,6 +305,28 @@
 
 namespace ns3 {
 
+class StaticRouterTestNode : public Node
+{
+public:
+  StaticRouterTestNode();
+
+private:
+  virtual void DoAddDevice (Ptr<NetDevice> device) const {};
+  virtual TraceResolver *DoCreateTraceResolver (TraceContext const &context);
+};
+
+StaticRouterTestNode::StaticRouterTestNode ()
+{
+//  Ptr<Ipv4L3Protocol> ipv4 = Create<Ipv4L3Protocol> (this);
+}
+
+TraceResolver*
+StaticRouterTestNode::DoCreateTraceResolver (TraceContext const &context)
+{
+  return 0;
+}
+
+
 class StaticRouteManagerTest : public Test {
 public:
   StaticRouteManagerTest ();
@@ -454,6 +476,9 @@
   srmlsdb->Insert(lsa3->m_linkStateId, v3);
   NS_ASSERT(v2 == srmlsdb->GetVertex(lsa2->m_linkStateId));
 
+  // We need a dummy node to populate the routing tables
+  Ptr<StaticRouterTestNode> n2 = Create<StaticRouterTestNode> ();
+
   // XXX next, calculate routes based on the manually created LSDB
   StaticRouteManager* srm = new StaticRouteManager();
   srm->DebugUseLsdb (srmlsdb);