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

Typedefs

using SequencePoints = std::pair< unsigned int, unsigned int >
 pair of sequence points More...
 
using TestThreadFunction = void(SequenceAsserter &, SequencePoints, const QueueWrapper &)
 type of test thread function More...
 
using Prepare = void(const QueueWrapper &)
 function executed to prepare queue for test More...
 
using Trigger = bool(const QueueWrapper &, size_t)
 function executed on queue to trigger unblocking of test thread More...
 
using FinalCheck = bool(const QueueWrapper &)
 function with final check of queue's contents after all test threads are terminated More...
 
using Stage = std::tuple< const TestThreadFunction &, const Prepare *const, const Trigger *const, const FinalCheck *const >
 tuple with functions for one stage, Prepare and FinalCheck may be nullptr More...
 

Functions

bool popFinalCheck (const QueueWrapper &queueWrapper)
 Final check for "pop" stage. More...
 
void popPrepare (const QueueWrapper &queueWrapper)
 Prepares queue for "pop" stage - just fills it completely with increasing values. More...
 
void popThread (SequenceAsserter &sequenceAsserter, const SequencePoints sequencePoints, const QueueWrapper &queueWrapper)
 QueueWrapper::pop() test thread. More...
 
bool popTrigger (const QueueWrapper &queueWrapper, const size_t i)
 Trigger action with QueueWrapper::pop(). More...
 
void pushThread (SequenceAsserter &sequenceAsserter, const SequencePoints sequencePoints, const QueueWrapper &queueWrapper)
 QueueWrapper::push() test thread. More...
 
bool pushTrigger (const QueueWrapper &queueWrapper, const size_t i)
 Trigger action with QueueWrapper::push(). More...
 
DynamicThread makeTestThread (const TestThreadFunction &testThreadFunction, const unsigned int firstSequencePoint, const ThreadParameters &threadParameters, SequenceAsserter &sequenceAsserter, const QueueWrapper &queueWrapper)
 Builder of test threads. More...
 

Variables

constexpr bool falseTrue [] {false, true}
 array with "false" and "true" bool values More...
 
constexpr size_t testThreadStackSize {512}
 size of stack for test thread, bytes More...
 
const std::array< Stage, 2 > stages
 test stages More...
 

Typedef Documentation

◆ FinalCheck

using distortos::test::anonymous_namespace{FifoQueuePriorityTestCase.cpp}::FinalCheck = typedef bool(const QueueWrapper&)

function with final check of queue's contents after all test threads are terminated

◆ Prepare

using distortos::test::anonymous_namespace{FifoQueuePriorityTestCase.cpp}::Prepare = typedef void(const QueueWrapper&)

function executed to prepare queue for test

◆ SequencePoints

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

pair of sequence points

◆ Stage

using distortos::test::anonymous_namespace{FifoQueuePriorityTestCase.cpp}::Stage = typedef std::tuple<const TestThreadFunction&, const Prepare* const, const Trigger* const, const FinalCheck* const>

tuple with functions for one stage, Prepare and FinalCheck may be nullptr

◆ TestThreadFunction

using distortos::test::anonymous_namespace{FifoQueuePriorityTestCase.cpp}::TestThreadFunction = typedef void(SequenceAsserter&, SequencePoints, const QueueWrapper&)

type of test thread function

◆ Trigger

using distortos::test::anonymous_namespace{FifoQueuePriorityTestCase.cpp}::Trigger = typedef bool(const QueueWrapper&, size_t)

function executed on queue to trigger unblocking of test thread

Function Documentation

◆ makeTestThread()

DynamicThread distortos::test::anonymous_namespace{FifoQueuePriorityTestCase.cpp}::makeTestThread ( const TestThreadFunction testThreadFunction,
const unsigned int  firstSequencePoint,
const ThreadParameters threadParameters,
SequenceAsserter sequenceAsserter,
const QueueWrapper queueWrapper 
)

Builder of test threads.

Parameters
[in]testThreadFunctionis a reference to function that will be used in test thread
[in]firstSequencePointis the first sequence point for this instance - equal to the order in which this thread will be started
[in]threadParametersis a reference to ThreadParameters object
[in]sequenceAsserteris a reference to SequenceAsserter shared object
[in]queueWrapperis a reference to shared QueueWrapper object
Returns
constructed DynamicThread object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ popFinalCheck()

bool distortos::test::anonymous_namespace{FifoQueuePriorityTestCase.cpp}::popFinalCheck ( const QueueWrapper queueWrapper)

Final check for "pop" stage.

The queue should contain "second" sequence points of test threads in the same order as expected by SequenceAsserter.

Parameters
[in]queueWrapperis a reference to shared QueueWrapper object
Returns
true if final check succeeded, false otherwise
Here is the call graph for this function:

◆ popPrepare()

void distortos::test::anonymous_namespace{FifoQueuePriorityTestCase.cpp}::popPrepare ( const QueueWrapper queueWrapper)

Prepares queue for "pop" stage - just fills it completely with increasing values.

Parameters
[in]queueWrapperis a reference to shared QueueWrapper object
Here is the call graph for this function:

◆ popThread()

void distortos::test::anonymous_namespace{FifoQueuePriorityTestCase.cpp}::popThread ( SequenceAsserter sequenceAsserter,
const SequencePoints  sequencePoints,
const QueueWrapper queueWrapper 
)

QueueWrapper::pop() test thread.

Marks the first sequence point in SequenceAsserter, waits for the last sequence point from FIFO queue and marks it in SequenceAsserter.

Parameters
[in]sequenceAsserteris a reference to SequenceAsserter shared object
[in]sequencePointsis a pair of sequence points for this instance (second one is ignored)
[in]queueWrapperis a reference to shared QueueWrapper object
Here is the call graph for this function:

◆ popTrigger()

bool distortos::test::anonymous_namespace{FifoQueuePriorityTestCase.cpp}::popTrigger ( const QueueWrapper queueWrapper,
const size_t  i 
)

Trigger action with QueueWrapper::pop().

Parameters
[in]queueWrapperis a reference to shared QueueWrapper object
[in]iis the iteration counter
Returns
true if trigger check succeeded, false otherwise
Here is the call graph for this function:

◆ pushThread()

void distortos::test::anonymous_namespace{FifoQueuePriorityTestCase.cpp}::pushThread ( SequenceAsserter sequenceAsserter,
const SequencePoints  sequencePoints,
const QueueWrapper queueWrapper 
)

QueueWrapper::push() test thread.

Marks the first sequence point in SequenceAsserter, waits for free space in FIFO queue and marks last sequence point in SequenceAsserter.

Parameters
[in]sequenceAsserteris a reference to SequenceAsserter shared object
[in]sequencePointsis a pair of sequence points for this instance
[in]queueWrapperis a reference to shared QueueWrapper object
Here is the call graph for this function:

◆ pushTrigger()

bool distortos::test::anonymous_namespace{FifoQueuePriorityTestCase.cpp}::pushTrigger ( const QueueWrapper queueWrapper,
const size_t  i 
)

Trigger action with QueueWrapper::push().

Parameters
[in]queueWrapperis a reference to shared QueueWrapper object
[in]iis the iteration counter
Returns
true if trigger check succeeded, false otherwise
Here is the call graph for this function:

Variable Documentation

◆ falseTrue

constexpr bool distortos::test::anonymous_namespace{FifoQueuePriorityTestCase.cpp}::falseTrue[] {false, true}

array with "false" and "true" bool values

◆ stages

const std::array<Stage, 2> distortos::test::anonymous_namespace{FifoQueuePriorityTestCase.cpp}::stages
Initial value:
{{
Stage{popThread, nullptr, pushTrigger, nullptr},
}}
bool pushTrigger(const QueueWrapper &queueWrapper, const size_t i)
Trigger action with QueueWrapper::push().
Definition: FifoQueuePriorityTestCase.cpp:172
bool popTrigger(const QueueWrapper &queueWrapper, const size_t i)
Trigger action with QueueWrapper::pop().
Definition: FifoQueuePriorityTestCase.cpp:136
bool popFinalCheck(const QueueWrapper &queueWrapper)
Final check for "pop" stage.
Definition: FifoQueuePriorityTestCase.cpp:80
void pushThread(SequenceAsserter &sequenceAsserter, const SequencePoints sequencePoints, const QueueWrapper &queueWrapper)
QueueWrapper::push() test thread.
Definition: FifoQueuePriorityTestCase.cpp:155
void popPrepare(const QueueWrapper &queueWrapper)
Prepares queue for "pop" stage - just fills it completely with increasing values. ...
Definition: FifoQueuePriorityTestCase.cpp:100
std::tuple< const TestThreadFunction &, const Prepare *const, const Trigger *const, const FinalCheck *const > Stage
tuple with functions for one stage, Prepare and FinalCheck may be nullptr
Definition: FifoQueuePriorityTestCase.cpp:64
void popThread(SequenceAsserter &sequenceAsserter, const SequencePoints sequencePoints, const QueueWrapper &queueWrapper)
QueueWrapper::pop() test thread.
Definition: FifoQueuePriorityTestCase.cpp:117

test stages

◆ testThreadStackSize

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

size of stack for test thread, bytes