distortos  v0.5.0
object-oriented C++ RTOS for microcontrollers
distortos::test::SequenceAsserter Class Reference

SequenceAsserter class is used to assert that some sequencePoint of events are performed in specific order. More...

#include <SequenceAsserter.hpp>

Public Member Functions

constexpr SequenceAsserter ()
 SequenceAsserter's constructor. More...
 
bool assertSequence (unsigned int sequencePoints)
 Checks whether the sequence of calls to sequencePoint() was correct. More...
 
void sequencePoint (unsigned int sequencePointt)
 Increments the sequence by 1 if the order of calls matches. Each entry to this function is counted. More...
 

Private Attributes

unsigned int expectedSequencePoint_
 next expected sequence point More...
 
unsigned int sequencePointsCount_
 count of calls to sequencePoint() More...
 

Detailed Description

SequenceAsserter class is used to assert that some sequencePoint of events are performed in specific order.

This asserter expects a number of calls to sequencePoint(x) with x increasing by 1 with each call, starting with 0. If this sequence occurs, a call to assertSequence(y) will return true if y equals the number of calls to sequencePoint() (y equals "last x" + 1).

Constructor & Destructor Documentation

◆ SequenceAsserter()

constexpr distortos::test::SequenceAsserter::SequenceAsserter ( )
inline

SequenceAsserter's constructor.

Here is the call graph for this function:

Member Function Documentation

◆ assertSequence()

bool distortos::test::SequenceAsserter::assertSequence ( unsigned int  sequencePoints)

Checks whether the sequence of calls to sequencePoint() was correct.

Parameters
[in]sequencePointsis the number of calls to sequencePoint() that is expected
Returns
true if sequence was correct, false otherwise
Here is the caller graph for this function:

◆ sequencePoint()

void distortos::test::SequenceAsserter::sequencePoint ( unsigned int  sequencePointt)

Increments the sequence by 1 if the order of calls matches. Each entry to this function is counted.

Entry to this function is synchronized with interrupt masking lock.

Parameters
[in]sequencePointtis the sequence point
Here is the caller graph for this function:

Member Data Documentation

◆ expectedSequencePoint_

unsigned int distortos::test::SequenceAsserter::expectedSequencePoint_
private

next expected sequence point

◆ sequencePointsCount_

unsigned int distortos::test::SequenceAsserter::sequencePointsCount_
private

count of calls to sequencePoint()


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