A Discrete-Event Network Simulator
API
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
ThreadedSimulatorEventsTestCase Class Reference
+ Inheritance diagram for ThreadedSimulatorEventsTestCase:

Public Member Functions

 ThreadedSimulatorEventsTestCase (ObjectFactory schedulerFactory, const std::string &simulatorType, unsigned int threads)
 
void DoNothing (unsigned int threadno)
 
void End (void)
 
void EventA (int a)
 
void EventB (int b)
 
void EventC (int c)
 
void EventD (int d)
 
- Public Member Functions inherited from ns3::TestCase
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName (void) const
 

Static Public Member Functions

static void SchedulingThread (std::pair< ThreadedSimulatorEventsTestCase *, unsigned int > context)
 

Public Attributes

uint64_t m_a
 
uint64_t m_b
 
uint64_t m_c
 
uint64_t m_d
 
std::string m_error
 
ObjectFactory m_schedulerFactory
 
std::string m_simulatorType
 
bool m_stop
 
std::list< Ptr< SystemThread > > m_threadlist
 
unsigned int m_threads
 
bool m_threadWaiting [MAXTHREADS]
 

Private Member Functions

virtual void DoRun (void)
 Implementation to actually run this TestCase. More...
 
virtual void DoSetup (void)
 Implementation to do any local setup required for this TestCase. More...
 
virtual void DoTeardown (void)
 Implementation to do any local setup required for this TestCase. 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...
 
TestCaseGetParent () 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...
 

Detailed Description

Definition at line 40 of file threaded-test-suite.cc.

Constructor & Destructor Documentation

◆ ThreadedSimulatorEventsTestCase()

ThreadedSimulatorEventsTestCase::ThreadedSimulatorEventsTestCase ( ObjectFactory  schedulerFactory,
const std::string &  simulatorType,
unsigned int  threads 
)

Definition at line 69 of file threaded-test-suite.cc.

Member Function Documentation

◆ DoNothing()

void ThreadedSimulatorEventsTestCase::DoNothing ( unsigned int  threadno)

Definition at line 108 of file threaded-test-suite.cc.

References m_error, and m_threadWaiting.

Referenced by SchedulingThread().

◆ DoRun()

void ThreadedSimulatorEventsTestCase::DoRun ( void  )
privatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 206 of file threaded-test-suite.cc.

References End(), EventA(), list, m_a, m_b, m_c, m_d, m_error, m_schedulerFactory, m_stop, m_threadlist, ns3::MicroSeconds(), NS_TEST_EXPECT_MSG_EQ, and ns3::Seconds().

◆ DoSetup()

void ThreadedSimulatorEventsTestCase::DoSetup ( void  )
privatevirtual

Implementation to do any local setup required for this TestCase.

Subclasses should override this method to perform any costly per-test setup before DoRun is invoked.

Reimplemented from ns3::TestCase.

Definition at line 176 of file threaded-test-suite.cc.

References m_a, m_b, m_c, m_d, m_error, m_simulatorType, m_threadlist, m_threads, ns3::MakeBoundCallback(), SchedulingThread(), and ns3::Config::SetGlobal().

◆ DoTeardown()

void ThreadedSimulatorEventsTestCase::DoTeardown ( void  )
privatevirtual

Implementation to do any local setup required for this TestCase.

Subclasses should override this method to perform any costly per-test teardown

Reimplemented from ns3::TestCase.

Definition at line 199 of file threaded-test-suite.cc.

References m_threadlist, and ns3::Config::SetGlobal().

◆ End()

void ThreadedSimulatorEventsTestCase::End ( void  )

Definition at line 81 of file threaded-test-suite.cc.

References list, m_stop, and m_threadlist.

Referenced by DoRun().

◆ EventA()

void ThreadedSimulatorEventsTestCase::EventA ( int  a)

Definition at line 117 of file threaded-test-suite.cc.

References EventB(), m_a, m_b, m_c, m_d, m_error, and ns3::MicroSeconds().

Referenced by DoRun(), and EventD().

◆ EventB()

void ThreadedSimulatorEventsTestCase::EventB ( int  b)

Definition at line 130 of file threaded-test-suite.cc.

References EventC(), m_a, m_b, m_c, m_d, m_error, and ns3::MicroSeconds().

Referenced by EventA().

◆ EventC()

void ThreadedSimulatorEventsTestCase::EventC ( int  c)

Definition at line 143 of file threaded-test-suite.cc.

References EventD(), m_a, m_b, m_c, m_d, m_error, and ns3::MicroSeconds().

Referenced by EventB().

◆ EventD()

void ThreadedSimulatorEventsTestCase::EventD ( int  d)

Definition at line 156 of file threaded-test-suite.cc.

References EventA(), m_a, m_b, m_c, m_d, m_error, m_stop, and ns3::MicroSeconds().

Referenced by EventC().

◆ SchedulingThread()

void ThreadedSimulatorEventsTestCase::SchedulingThread ( std::pair< ThreadedSimulatorEventsTestCase *, unsigned int >  context)
static

Definition at line 90 of file threaded-test-suite.cc.

References DoNothing(), m_stop, m_threadWaiting, and ns3::MicroSeconds().

Referenced by DoSetup().

Member Data Documentation

◆ m_a

uint64_t ThreadedSimulatorEventsTestCase::m_a

Definition at line 52 of file threaded-test-suite.cc.

Referenced by DoRun(), DoSetup(), EventA(), EventB(), EventC(), and EventD().

◆ m_b

uint64_t ThreadedSimulatorEventsTestCase::m_b

Definition at line 51 of file threaded-test-suite.cc.

Referenced by DoRun(), DoSetup(), EventA(), EventB(), EventC(), and EventD().

◆ m_c

uint64_t ThreadedSimulatorEventsTestCase::m_c

Definition at line 53 of file threaded-test-suite.cc.

Referenced by DoRun(), DoSetup(), EventA(), EventB(), EventC(), and EventD().

◆ m_d

uint64_t ThreadedSimulatorEventsTestCase::m_d

Definition at line 54 of file threaded-test-suite.cc.

Referenced by DoRun(), DoSetup(), EventA(), EventB(), EventC(), and EventD().

◆ m_error

std::string ThreadedSimulatorEventsTestCase::m_error

Definition at line 60 of file threaded-test-suite.cc.

Referenced by DoNothing(), DoRun(), DoSetup(), EventA(), EventB(), EventC(), and EventD().

◆ m_schedulerFactory

ObjectFactory ThreadedSimulatorEventsTestCase::m_schedulerFactory

Definition at line 58 of file threaded-test-suite.cc.

Referenced by DoRun().

◆ m_simulatorType

std::string ThreadedSimulatorEventsTestCase::m_simulatorType

Definition at line 59 of file threaded-test-suite.cc.

Referenced by DoSetup().

◆ m_stop

bool ThreadedSimulatorEventsTestCase::m_stop

Definition at line 57 of file threaded-test-suite.cc.

Referenced by DoRun(), End(), EventD(), and SchedulingThread().

◆ m_threadlist

std::list<Ptr<SystemThread> > ThreadedSimulatorEventsTestCase::m_threadlist

Definition at line 61 of file threaded-test-suite.cc.

Referenced by DoRun(), DoSetup(), DoTeardown(), and End().

◆ m_threads

unsigned int ThreadedSimulatorEventsTestCase::m_threads

Definition at line 55 of file threaded-test-suite.cc.

Referenced by DoSetup().

◆ m_threadWaiting

bool ThreadedSimulatorEventsTestCase::m_threadWaiting[MAXTHREADS]

Definition at line 56 of file threaded-test-suite.cc.

Referenced by DoNothing(), and SchedulingThread().


The documentation for this class was generated from the following file: