Bug 793: remove remaining memory leaks due to not cleaned Simulator
This commit is contained in:
@@ -138,7 +138,7 @@ bool EventGarbageCollectorTestCase::DoRun (void)
|
||||
Simulator::Run ();
|
||||
NS_TEST_EXPECT_MSG_EQ (m_events, 0, "");
|
||||
NS_TEST_EXPECT_MSG_EQ (m_counter, 50, "");
|
||||
|
||||
Simulator::Destroy ();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ WifiTest::DoRun (void)
|
||||
m_propDelay.SetTypeId ("ns3::RandomPropagationDelayModel");
|
||||
m_mac.SetTypeId ("ns3::AdhocWifiMac");
|
||||
RunOne ();
|
||||
|
||||
Simulator::Destroy ();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "ns3/net-device.h"
|
||||
#include "ns3/ipv4.h"
|
||||
#include "ns3/ipv4-address-generator.h"
|
||||
#include "ns3/simulator.h"
|
||||
#include "ipv4-address-helper.h"
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE("Ipv4AddressHelper");
|
||||
@@ -200,6 +201,7 @@ void
|
||||
NetworkAllocatorHelperTestCase::DoTeardown (void)
|
||||
{
|
||||
Ipv4AddressGenerator::Reset ();
|
||||
Simulator::Destroy ();
|
||||
}
|
||||
bool
|
||||
NetworkAllocatorHelperTestCase::DoRun (void)
|
||||
@@ -246,6 +248,7 @@ void
|
||||
AddressAllocatorHelperTestCase::DoTeardown (void)
|
||||
{
|
||||
Ipv4AddressGenerator::Reset ();
|
||||
Simulator::Destroy ();
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -337,6 +340,7 @@ void
|
||||
ResetAllocatorHelperTestCase::DoTeardown (void)
|
||||
{
|
||||
Ipv4AddressGenerator::Reset ();
|
||||
Simulator::Destroy ();
|
||||
}
|
||||
|
||||
static class Ipv4AddressHelperTestSuite : public TestSuite
|
||||
|
||||
@@ -94,7 +94,7 @@ Ipv4L3ProtocolTestCase::DoRun (void)
|
||||
Ipv4InterfaceAddress output = interface->GetAddress (2);
|
||||
NS_TEST_ASSERT_MSG_EQ (ifaceAddr4, output,
|
||||
"The addresses should be identical");
|
||||
|
||||
Simulator::Destroy ();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ Ipv6L3ProtocolTestCase::DoRun ()
|
||||
|
||||
index = ipv6->GetInterfaceForAddress ("2001:ffff:5678:9000::1"); /* address we just remove */
|
||||
NS_TEST_ASSERT_MSG_EQ (index, (uint32_t) -1, "Address should not be found??");
|
||||
|
||||
Simulator::Destroy ();
|
||||
return false;
|
||||
}//end DoRun
|
||||
static class IPv6L3ProtocolTestSuite : public TestSuite
|
||||
|
||||
@@ -560,6 +560,7 @@ void
|
||||
AddressAllocatorTestCase::DoTeardown (void)
|
||||
{
|
||||
Ipv4AddressGenerator::Reset ();
|
||||
Simulator::Destroy ();
|
||||
}
|
||||
|
||||
|
||||
@@ -579,6 +580,7 @@ void
|
||||
NetworkAndAddressTestCase::DoTeardown (void)
|
||||
{
|
||||
Ipv4AddressGenerator::Reset ();
|
||||
Simulator::Destroy ();
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -695,6 +697,7 @@ void
|
||||
AddressCollisionTestCase::DoTeardown (void)
|
||||
{
|
||||
Ipv4AddressGenerator::Reset ();
|
||||
Simulator::Destroy ();
|
||||
}
|
||||
bool
|
||||
AddressCollisionTestCase::DoRun (void)
|
||||
|
||||
@@ -474,7 +474,7 @@ struct AodvRtableEntryTest : public TestCase
|
||||
NS_TEST_EXPECT_MSG_EQ (rt.IsPrecursorListEmpty (), true, "trivial");
|
||||
rt.GetPrecursors (prec);
|
||||
NS_TEST_EXPECT_MSG_EQ (prec.size (), 2, "trivial");
|
||||
|
||||
Simulator::Destroy ();
|
||||
return GetErrorStatus ();
|
||||
}
|
||||
};
|
||||
@@ -528,7 +528,7 @@ struct AodvRtableTest : public TestCase
|
||||
NS_TEST_EXPECT_MSG_EQ (rt.GetFlag (), INVALID, "trivial");
|
||||
NS_TEST_EXPECT_MSG_EQ (rtable.DeleteRoute (Ipv4Address ("1.2.3.4")), true, "trivial");
|
||||
NS_TEST_EXPECT_MSG_EQ (rtable.DeleteRoute (Ipv4Address ("1.2.3.4")), false, "trivial");
|
||||
|
||||
Simulator::Destroy ();
|
||||
return GetErrorStatus ();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user