TrickleTimer test. More...
Public Member Functions | |
TrickleTimerTestCase () | |
Constructor. More... | |
void | ConsistentEvent (Time interval, TrickleTimer *tricklePtr) |
Inject in the timer a consistent event. More... | |
virtual void | DoRun (void) |
Implementation to actually run this TestCase. More... | |
void | ExpireTimer (void) |
Function to invoke when TrickleTimer expires. More... | |
void | TestRedundancy (Time unit) |
Test the redundancy suppression. More... | |
void | TestSteadyState (Time unit) |
Test the steady-state. More... | |
void | TransientOver (void) |
Function to signal that the transient is over. More... | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName (void) const |
TestCase & | operator= (const TestCase &)=delete |
Public Attributes | |
bool | m_enableDataCollection |
Collect data if true. More... | |
std::vector< Time > | m_expiredTimes |
Time when TrickleTimer expired. More... | |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Protected Member Functions inherited from ns3::TestCase | |
TestCase (std::string name) | |
Constructor. More... | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. More... | |
TestCase * | GetParent () const |
Get the parent of this TestCsse. More... | |
bool | IsStatusFailure (void) const |
Check if any tests failed. More... | |
bool | IsStatusSuccess (void) const |
Check if all tests passed. More... | |
void | SetDataDir (std::string directory) |
Set the data directory where reference trace files can be found. More... | |
void | ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line) |
Log the failure of this TestCase. More... | |
bool | MustAssertOnFailure (void) const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure (void) const |
Check if this run should continue on failure. More... | |
std::string | CreateDataDirFilename (std::string filename) |
Construct the full path to a file in the data directory. More... | |
std::string | CreateTempDirFilename (std::string filename) |
Construct the full path to a file in a temporary directory. More... | |
TrickleTimer test.
Definition at line 51 of file trickle-timer-test-suite.cc.
ns3::tests::TrickleTimerTestCase::TrickleTimerTestCase | ( | ) |
Constructor.
Definition at line 90 of file trickle-timer-test-suite.cc.
void ns3::tests::TrickleTimerTestCase::ConsistentEvent | ( | Time | interval, |
TrickleTimer * | tricklePtr | ||
) |
Inject in the timer a consistent event.
interval | Interval |
tricklePtr | Pointer to the TrickleTimer |
Definition at line 173 of file trickle-timer-test-suite.cc.
References ns3::TrickleTimer::ConsistentEvent(), and ns3::Simulator::Schedule().
Referenced by TestRedundancy().
|
virtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 181 of file trickle-timer-test-suite.cc.
References ns3::Seconds(), TestRedundancy(), and TestSteadyState().
void ns3::tests::TrickleTimerTestCase::ExpireTimer | ( | void | ) |
Function to invoke when TrickleTimer expires.
Definition at line 95 of file trickle-timer-test-suite.cc.
References m_enableDataCollection, m_expiredTimes, and ns3::Simulator::Now().
Referenced by TestRedundancy(), and TestSteadyState().
void ns3::tests::TrickleTimerTestCase::TestRedundancy | ( | Time | unit | ) |
Test the redundancy suppression.
unit | Minimum interval |
Definition at line 147 of file trickle-timer-test-suite.cc.
References ConsistentEvent(), ns3::Simulator::Destroy(), ns3::TrickleTimer::Enable(), ExpireTimer(), ns3::TrickleTimer::GetDoublings(), m_enableDataCollection, m_expiredTimes, NS_TEST_EXPECT_MSG_EQ, ns3::TrickleTimer::Reset(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::TrickleTimer::SetFunction(), ns3::Simulator::Stop(), and TransientOver().
Referenced by DoRun().
void ns3::tests::TrickleTimerTestCase::TestSteadyState | ( | Time | unit | ) |
Test the steady-state.
unit | Minimum interval |
Definition at line 112 of file trickle-timer-test-suite.cc.
References ns3::Simulator::Destroy(), ns3::TrickleTimer::Enable(), ExpireTimer(), ns3::TrickleTimer::GetDoublings(), m_enableDataCollection, m_expiredTimes, max, min, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_GT_OR_EQ, NS_TEST_EXPECT_MSG_LT_OR_EQ, ns3::TrickleTimer::Reset(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::TrickleTimer::SetFunction(), ns3::Simulator::Stop(), and TransientOver().
Referenced by DoRun().
void ns3::tests::TrickleTimerTestCase::TransientOver | ( | void | ) |
Function to signal that the transient is over.
Definition at line 106 of file trickle-timer-test-suite.cc.
References m_enableDataCollection.
Referenced by TestRedundancy(), and TestSteadyState().
bool ns3::tests::TrickleTimerTestCase::m_enableDataCollection |
Collect data if true.
Definition at line 87 of file trickle-timer-test-suite.cc.
Referenced by ExpireTimer(), TestRedundancy(), TestSteadyState(), and TransientOver().
std::vector<Time> ns3::tests::TrickleTimerTestCase::m_expiredTimes |
Time when TrickleTimer expired.
Definition at line 61 of file trickle-timer-test-suite.cc.
Referenced by ExpireTimer(), TestRedundancy(), and TestSteadyState().