Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
SubsystemRunner_test Class Reference

Description

Test:
managing start and stop of several dependent "subsystems" under various conditions. Using mock-subsystems, which actually spawn a thread and finish by themselves and generally behave sane. For each such MockSys, we can define a behaviour pattern, e.g. weather the start succeeds and if the run terminates with error.
See also
lumiera::Subsys
lumiera::SubsystemRunner
lumiera::AppState
main.cpp

Definition at line 269 of file subsystem-runner-test.cpp.

Private Member Functions

virtual void run (Arg)
 
void singleSubsys_complete_cycle ()
 
void singleSubsys_start_failure ()
 
void singleSubsys_emegency_exit ()
 
void dependentSubsys_complete_cycle ()
 
void dependentSubsys_start_failure ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Test
static string firstTok (Arg)
 conveniently pick the first token from the argument line
 
static uint firstVal (Arg, uint=1)
 conveniently use some number given as argument, with optional default
 
- Public Member Functions inherited from Test
virtual ~Test ()=default
 this is an interface
 
virtual void run (Arg arg)=0
 
void seedRand ()
 draw a new random seed from a common nucleus, and re-seed the default-Gen.
 
lib::Random makeRandGen ()
 build a dedicated new RandomGen, seeded from the default-Gen
 

Member Function Documentation

◆ run()

virtual void run ( Arg  )
inlineprivatevirtual

◆ singleSubsys_complete_cycle()

void singleSubsys_complete_cycle ( )
inlineprivate

Definition at line 286 of file subsystem-runner-test.cpp.

References SubsystemRunner::maybeRun(), and SubsystemRunner::wait().

Referenced by SubsystemRunner_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ singleSubsys_start_failure()

void singleSubsys_start_failure ( )
inlineprivate
Note
as this test focuses on the SubsystemRunner, the mock subsystem is implemented rather simplistic. Especially, there is a race when a subsystem is configured to "fail" – because in this case the starting context may go away before the remainder of the subsystem thread has executed after the sync() barrier. Especially in this case, no MockSys actually starts without failure, and thus the SubsystemRunner::wait() has no guarding effect. This can be considered a shortcoming of the test fixture; a well behaved subsystem won't just go away...

Definition at line 314 of file subsystem-runner-test.cpp.

References SubsystemRunner::maybeRun(), TEST, VERIFY_ERROR, and SubsystemRunner::wait().

Referenced by SubsystemRunner_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ singleSubsys_emegency_exit()

void singleSubsys_emegency_exit ( )
inlineprivate

Definition at line 346 of file subsystem-runner-test.cpp.

References SubsystemRunner::maybeRun(), and SubsystemRunner::wait().

Referenced by SubsystemRunner_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dependentSubsys_complete_cycle()

void dependentSubsys_complete_cycle ( )
inlineprivate

Definition at line 363 of file subsystem-runner-test.cpp.

References SubsystemRunner::maybeRun(), and SubsystemRunner::wait().

Referenced by SubsystemRunner_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dependentSubsys_start_failure()

void dependentSubsys_start_failure ( )
inlineprivate

Definition at line 398 of file subsystem-runner-test.cpp.

References SubsystemRunner::maybeRun(), VERIFY_ERROR, and SubsystemRunner::wait().

Referenced by SubsystemRunner_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
+ Inheritance diagram for SubsystemRunner_test:
+ Collaboration diagram for SubsystemRunner_test:

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