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

test step for semaphores More...

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

Public Types

enum  Type : uint8_t { Type::wait, Type::tryWaitFor, Type::tryWaitUntil }
 type of semaphore test step More...
 

Public Member Functions

 SemaphoreTestStep (const Type type)
 SemaphoreTestStep'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

Semaphore semaphore_
 tested object More...
 
Type type_
 type of test step More...
 

Detailed Description

test step for semaphores

Member Enumeration Documentation

◆ Type

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

type of semaphore test step

Enumerator
wait 

uses Semaphore::wait()

tryWaitFor 

uses Semaphore::tryWaitFor()

tryWaitUntil 

uses Semaphore::tryWaitUntil()

Constructor & Destructor Documentation

◆ SemaphoreTestStep()

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

SemaphoreTestStep's constructor.

Parameters
[in]typeis the type of test step

Member Function Documentation

◆ block()

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

Executes the action that will block current thread.

Calls Semaphore::wait(), Semaphore::tryWaitFor() or Semaphore::tryWaitUntil() - depending on the type of test step - and ensures that the function returns with EINTR error code.

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}::SemaphoreTestStep::postcondition ( )
inlineoverrideprivatevirtual

Checks postcondition of the test step.

Checks state of semaphore after interruption.

Returns
true if postcondition was satisfied, false otherwise

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

Member Data Documentation

◆ semaphore_

Semaphore distortos::test::anonymous_namespace{SignalsInterruptionTestCase.cpp}::SemaphoreTestStep::semaphore_
private

tested object

◆ type_

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

type of test step


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