distortos  v0.5.0
object-oriented C++ RTOS for microcontrollers
distortos::test::anonymous_namespace{ThreadSleepForTestCase.cpp} Namespace Reference

Functions

void thread (const uint8_t sleepFor, SequenceAsserter &sequenceAsserter, const unsigned int sequencePoint, const TickClock::time_point &sleepStart, TickClock::duration &durationDeviation, int &sharedRet)
 Test thread. More...
 
DynamicThread makeTestThread (const uint8_t priority, const ThreadParameters &threadParameters, SequenceAsserter &sequenceAsserter, const TickClock::time_point &sleepStart, TickClock::duration &durationDeviation, int &sharedRet)
 Builder of test threads. More...
 

Variables

constexpr size_t testThreadStackSize {512}
 size of stack for test thread, bytes More...
 

Function Documentation

◆ makeTestThread()

DynamicThread distortos::test::anonymous_namespace{ThreadSleepForTestCase.cpp}::makeTestThread ( const uint8_t  priority,
const ThreadParameters threadParameters,
SequenceAsserter sequenceAsserter,
const TickClock::time_point sleepStart,
TickClock::duration durationDeviation,
int &  sharedRet 
)

Builder of test threads.

This test uses "priority" field of test parameters as a "reversed" amount of time to sleep.

Parameters
[in]priorityis the thread's priority
[in]threadParametersis a reference to ThreadParameters object
[in]sequenceAsserteris a reference to SequenceAsserter shared object
[in]sleepStartis a reference to variable with time point of sleep's start - it is used for deviation of sleep duration calculation
[out]durationDeviationis a reference to variable for storing deviation of sleep duration
[out]sharedRetis a reference to variable for storing return value of ThisThread::sleepFor()
Returns
constructed DynamicThread object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ thread()

void distortos::test::anonymous_namespace{ThreadSleepForTestCase.cpp}::thread ( const uint8_t  sleepFor,
SequenceAsserter sequenceAsserter,
const unsigned int  sequencePoint,
const TickClock::time_point sleepStart,
TickClock::duration durationDeviation,
int &  sharedRet 
)

Test thread.

Sleeps for requested amount of time and marks the sequence point in SequenceAsserter, also storing the deviation of duration actually slept.

Parameters
[in]sleepForis the number of ticks the thread will sleep before marking sequence point
[in]sequenceAsserteris a reference to SequenceAsserter shared object
[in]sequencePointis the sequence point of this instance
[in]sleepStartis a reference to variable with time point of sleep's start - it is used for deviation of sleep duration calculation
[out]durationDeviationis a reference to variable for storing deviation of sleep duration
[out]sharedRetis a reference to variable for storing return value of ThisThread::sleepFor()
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ testThreadStackSize

constexpr size_t distortos::test::anonymous_namespace{ThreadSleepForTestCase.cpp}::testThreadStackSize {512}

size of stack for test thread, bytes