Check that basic event handling is working with different Simulator implementations. More...
Public Member Functions | |
SimulatorEventsTestCase (ObjectFactory schedulerFactory) | |
Constructor. More... | |
void | Destroy (void) |
Checks that the events has been detroyed. More... | |
virtual void | DoRun (void) |
Implementation to actually run this TestCase. More... | |
void | Eventfoo0 (void) |
Test Event. More... | |
uint64_t | NowUs (void) |
Get the simulator time. More... | |
void | EventA (int value) |
Test Event. More... | |
void | EventB (int value) |
Test Event. More... | |
void | EventC (int value) |
Test Event. More... | |
void | EventD (int value) |
Test Event. 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 | |
EventId | m_destroyId |
Event to check event lifetime. More... | |
EventId | m_idC |
Event C. More... | |
ObjectFactory | m_schedulerFactory |
Scheduler factory. More... | |
bool | m_a |
Checks that events are properly handled. More... | |
bool | m_b |
Checks that events are properly handled. More... | |
bool | m_c |
Checks that events are properly handled. More... | |
bool | m_d |
Checks that events are properly handled. More... | |
bool | m_destroy |
Checks that events are properly handled. 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... | |
Check that basic event handling is working with different Simulator implementations.
Definition at line 46 of file simulator-test-suite.cc.
SimulatorEventsTestCase::SimulatorEventsTestCase | ( | ObjectFactory | schedulerFactory | ) |
Constructor.
schedulerFactory | Scheduler factory. |
Definition at line 96 of file simulator-test-suite.cc.
void SimulatorEventsTestCase::Destroy | ( | void | ) |
Checks that the events has been detroyed.
Definition at line 153 of file simulator-test-suite.cc.
References ns3::EventId::IsExpired(), m_destroy, and m_destroyId.
Referenced by DoRun().
|
virtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 161 of file simulator-test-suite.cc.
References ns3::EventId::Cancel(), Destroy(), EventA(), EventB(), EventC(), Eventfoo0(), ns3::EventId::IsExpired(), m_a, m_b, m_c, m_d, m_destroy, m_destroyId, m_idC, m_schedulerFactory, ns3::MicroSeconds(), and NS_TEST_EXPECT_MSG_EQ.
void SimulatorEventsTestCase::EventA | ( | int | value | ) |
Test Event.
value | Event parameter. |
Definition at line 109 of file simulator-test-suite.cc.
References m_a.
Referenced by DoRun().
void SimulatorEventsTestCase::EventB | ( | int | value | ) |
Test Event.
value | Event parameter. |
Definition at line 115 of file simulator-test-suite.cc.
References EventD(), m_b, m_idC, ns3::MicroSeconds(), and NowUs().
Referenced by DoRun().
void SimulatorEventsTestCase::EventC | ( | int | value | ) |
Test Event.
value | Event parameter. |
Definition at line 130 of file simulator-test-suite.cc.
References m_c.
Referenced by DoRun().
void SimulatorEventsTestCase::EventD | ( | int | value | ) |
Test Event.
value | Event parameter. |
Definition at line 136 of file simulator-test-suite.cc.
Referenced by EventB().
void SimulatorEventsTestCase::Eventfoo0 | ( | void | ) |
Test Event.
Definition at line 149 of file simulator-test-suite.cc.
Referenced by DoRun().
uint64_t SimulatorEventsTestCase::NowUs | ( | void | ) |
Get the simulator time.
Definition at line 102 of file simulator-test-suite.cc.
References ns3::Time::GetNanoSeconds(), and ns3::Now().
Referenced by EventB(), and EventD().
bool SimulatorEventsTestCase::m_a |
Checks that events are properly handled.
Definition at line 84 of file simulator-test-suite.cc.
bool SimulatorEventsTestCase::m_b |
Checks that events are properly handled.
Definition at line 85 of file simulator-test-suite.cc.
bool SimulatorEventsTestCase::m_c |
Checks that events are properly handled.
Definition at line 86 of file simulator-test-suite.cc.
bool SimulatorEventsTestCase::m_d |
Checks that events are properly handled.
Definition at line 87 of file simulator-test-suite.cc.
bool SimulatorEventsTestCase::m_destroy |
Checks that events are properly handled.
Definition at line 88 of file simulator-test-suite.cc.
EventId SimulatorEventsTestCase::m_destroyId |
Event to check event lifetime.
Definition at line 92 of file simulator-test-suite.cc.
EventId SimulatorEventsTestCase::m_idC |
Event C.
Definition at line 91 of file simulator-test-suite.cc.
ObjectFactory SimulatorEventsTestCase::m_schedulerFactory |