Dummy test node for unit testing

This commit is contained in:
Tom Henderson
2007-07-10 13:58:13 -07:00
parent f4d5687704
commit 40e70fc6e9

View File

@@ -305,6 +305,28 @@ StaticRouteManager::SPFCalculate(Ipv4Address root)
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 @@ StaticRouteManagerTest::RunTests (void)
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);