distortos  v0.5.0
object-oriented C++ RTOS for microcontrollers
distortos::test::anonymous_namespace{SignalsInterruptionTestCase.cpp}::ConditionVariableTestStep Class Reference

test step for condition variables More...

Inheritance diagram for distortos::test::anonymous_namespace{SignalsInterruptionTestCase.cpp}::ConditionVariableTestStep:
[legend]
Collaboration diagram for distortos::test::anonymous_namespace{SignalsInterruptionTestCase.cpp}::ConditionVariableTestStep:
[legend]

Public Types

enum  Type : uint8_t { Type::wait, Type::waitFor, Type::waitUntil }
 type of condition variable test step More...
 

Public Member Functions

 ConditionVariableTestStep (const Type type)
 ConditionVariableTestStep's constructor. More...
 
- Public Member Functions inherited from distortos::test::anonymous_namespace{SignalsInterruptionTestCase.cpp}::TestStep
constexpr TestStep (const uint8_t totalSequencePoints, const uint8_t expectedContextSwitchCount, const uint8_t signalingThreadSequencePoint1, const uint8_t signalHandlerSequencePoint, const uint8_t joinSequencePoint, const uint8_t signalingThreadSequencePoint2)
 TestStep's constructor. More...
 
virtual ~TestStep ()
 TestStep's virtual destructor. More...
 
bool run (SequenceAsserter &sequenceAsserter)
 Runs test step. More...
 
std::pair< uint8_t, uint8_t > getParameters () const
 Gets execution parameters of test step. More...
 

Private Member Functions

bool block () override
 Executes the action that will block current thread. More...
 
bool postcondition () override
 Checks postcondition of the test step. More...
 

Private Attributes

ConditionVariable conditionVariable_
 tested object More...
 
Mutex mutex_
 mutex used with conditionVariable_ More...
 
Type type_
 type of test step More...
 

Detailed Description

test step for condition variables

Member Enumeration Documentation

◆ Type

enum distortos::test::anonymous_namespace{SignalsInterruptionTestCase.cpp}::ConditionVariableTestStep::Type : uint8_t
strong

type of condition variable test step

Enumerator
wait 

uses ConditionVariable::wait()

waitFor 

uses ConditionVariable::waitFor()

waitUntil 

uses ConditionVariable::waitUntil()

Constructor & Destructor Documentation

◆ ConditionVariableTestStep()

distortos::test::anonymous_namespace{SignalsInterruptionTestCase.cpp}::ConditionVariableTestStep::ConditionVariableTestStep ( const Type  type)
inlineexplicit

ConditionVariableTestStep's constructor.

Parameters
[in]typeis the type of test step

Member Function Documentation

◆ block()

bool distortos::test::anonymous_namespace{SignalsInterruptionTestCase.cpp}::ConditionVariableTestStep::block ( )
inlineoverrideprivatevirtual

Executes the action that will block current thread.

Calls ConditionVariable::wait(), ConditionVariable::waitFor() or ConditionVariable::waitUntil() - depending on the type of test step - and ensures that the function completes successfully.

Returns
true if execution of blocking action succeeded, false otherwise

Implements distortos::test::anonymous_namespace{SignalsInterruptionTestCase.cpp}::TestStep.

Here is the call graph for this function:

◆ postcondition()

bool distortos::test::anonymous_namespace{SignalsInterruptionTestCase.cpp}::ConditionVariableTestStep::postcondition ( )
inlineoverrideprivatevirtual

Checks postcondition of the test step.

Checks state of condition variable's mutex after test step.

Returns
true if postcondition was satisfied, false otherwise

Reimplemented from distortos::test::anonymous_namespace{SignalsInterruptionTestCase.cpp}::TestStep.

Member Data Documentation

◆ conditionVariable_

ConditionVariable distortos::test::anonymous_namespace{SignalsInterruptionTestCase.cpp}::ConditionVariableTestStep::conditionVariable_
private

tested object

◆ mutex_

Mutex distortos::test::anonymous_namespace{SignalsInterruptionTestCase.cpp}::ConditionVariableTestStep::mutex_
private

mutex used with conditionVariable_

◆ type_

Type distortos::test::anonymous_namespace{SignalsInterruptionTestCase.cpp}::ConditionVariableTestStep::type_
private

type of test step


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