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

Typedefs

using SequencePoints = std::pair< unsigned int, unsigned int >
 pair of sequence points More...
 

Functions

void function (SequenceAsserter &sequenceAsserter)
 Test function passed to callOnce(). More...
 
void thread (SequenceAsserter &sequenceAsserter, const SequencePoints sequencePoints, OnceFlag &onceFlag, TickClock::time_point &timePoint)
 Test thread function. More...
 
DynamicThread makeTestThread (const size_t stackSize, const uint8_t priority, SequenceAsserter &sequenceAsserter, const SequencePoints sequencePoints, OnceFlag &onceFlag, TickClock::time_point &timePoint)
 Builder of test threads. More...
 

Variables

constexpr auto sleepForDuration = TickClock::duration{10}
 sleepFor() duration used in function() passed to callOnce() More...
 
constexpr size_t testThreadHighStackSize {768}
 size of stack for first test thread, bytes More...
 
constexpr size_t testThreadLowStackSize {512}
 size of stack for remaining test threads, bytes More...
 
constexpr size_t totalThreads {8}
 number of test threads More...
 

Typedef Documentation

◆ SequencePoints

using distortos::test::anonymous_namespace{CallOnceOperationsTestCase.cpp}::SequencePoints = typedef std::pair<unsigned int, unsigned int>

pair of sequence points

Function Documentation

◆ function()

void distortos::test::anonymous_namespace{CallOnceOperationsTestCase.cpp}::function ( SequenceAsserter sequenceAsserter)

Test function passed to callOnce().

This function marks first sequence point, executes ThisThread::sleepFor() and marks second sequence point.

Parameters
[in]sequenceAsserteris a reference to SequenceAsserter shared object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeTestThread()

DynamicThread distortos::test::anonymous_namespace{CallOnceOperationsTestCase.cpp}::makeTestThread ( const size_t  stackSize,
const uint8_t  priority,
SequenceAsserter sequenceAsserter,
const SequencePoints  sequencePoints,
OnceFlag onceFlag,
TickClock::time_point timePoint 
)

Builder of test threads.

Parameters
[in]stackSizeis the size of stack for test thread, bytes
[in]priorityis the thread's priority
[in]sequenceAsserteris a reference to SequenceAsserter shared object
[in]sequencePointsis a pair of sequence points for this instance
[in]onceFlagis a reference to OnceFlag shared object
[in]timePointis a reference to variable into which wake time point of thread will be saved
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{CallOnceOperationsTestCase.cpp}::thread ( SequenceAsserter sequenceAsserter,
const SequencePoints  sequencePoints,
OnceFlag onceFlag,
TickClock::time_point timePoint 
)

Test thread function.

This function marks first sequence point, passes function() to callOnce(), saves wake time point and marks second sequence point.

Parameters
[in]sequenceAsserteris a reference to SequenceAsserter shared object
[in]sequencePointsis a pair of sequence points for this instance
[in]onceFlagis a reference to OnceFlag shared object
[out]timePointis a reference to variable into which wake time point will be saved
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ sleepForDuration

constexpr auto distortos::test::anonymous_namespace{CallOnceOperationsTestCase.cpp}::sleepForDuration = TickClock::duration{10}

sleepFor() duration used in function() passed to callOnce()

◆ testThreadHighStackSize

constexpr size_t distortos::test::anonymous_namespace{CallOnceOperationsTestCase.cpp}::testThreadHighStackSize {768}

size of stack for first test thread, bytes

◆ testThreadLowStackSize

constexpr size_t distortos::test::anonymous_namespace{CallOnceOperationsTestCase.cpp}::testThreadLowStackSize {512}

size of stack for remaining test threads, bytes

◆ totalThreads

constexpr size_t distortos::test::anonymous_namespace{CallOnceOperationsTestCase.cpp}::totalThreads {8}

number of test threads