distortos  v0.5.0
object-oriented C++ RTOS for microcontrollers
SequenceAsserter.hpp
Go to the documentation of this file.
1 
12 #ifndef TEST_SEQUENCEASSERTER_HPP_
13 #define TEST_SEQUENCEASSERTER_HPP_
14 
15 namespace distortos
16 {
17 
18 namespace test
19 {
20 
30 {
31 public:
32 
37  constexpr SequenceAsserter() :
40  {
41 
42  }
43 
52  bool assertSequence(unsigned int sequencePoints);
53 
62  void sequencePoint(unsigned int sequencePointt);
63 
64 private:
65 
67  unsigned int expectedSequencePoint_;
68 
70  unsigned int sequencePointsCount_;
71 };
72 
73 } // namespace test
74 
75 } // namespace distortos
76 
77 #endif // TEST_SEQUENCEASSERTER_HPP_
void sequencePoint(unsigned int sequencePointt)
Increments the sequence by 1 if the order of calls matches. Each entry to this function is counted...
Definition: SequenceAsserter.cpp:31
bool assertSequence(unsigned int sequencePoints)
Checks whether the sequence of calls to sequencePoint() was correct.
Definition: SequenceAsserter.cpp:26
unsigned int sequencePointsCount_
count of calls to sequencePoint()
Definition: SequenceAsserter.hpp:70
unsigned int expectedSequencePoint_
next expected sequence point
Definition: SequenceAsserter.hpp:67
Top-level namespace of distortos project.
SequenceAsserter class is used to assert that some sequencePoint of events are performed in specific ...
Definition: SequenceAsserter.hpp:29
constexpr SequenceAsserter()
SequenceAsserter's constructor.
Definition: SequenceAsserter.hpp:37