template<typename EventList>
class tcspc::capture_output_checker< EventList >
Event-set-specific wrapper for tcspc::capture_output_access.
This class has almost the same interface as tcspc::capture_output_access but is parameterized on EventList so does not require specifying the event set when calling check() or pop().
|
|
| capture_output_checker (feed_as feeder_value_category, capture_output_access access) |
| | Construct from a tcspc::capture_output_access, with the feeder's value category.
|
|
| capture_output_checker (feed_as feeder_value_category, std::shared_ptr< context > context, std::string const &name) |
| | Construct from a context, tracker name of tcspc::capture_output processor, and feeder's value category.
|
| template<typename Event> |
| auto | check (emitted_as value_category, Event const &expected_event) -> bool |
| | Check that the next recorded output event matches with the given event and value category.
|
| template<typename Event> |
| auto | check (Event const &expected_event) -> bool |
| | Check that the next recorded output event matches with the given event, disregarding value category.
|
| auto | check_flushed () -> bool |
| | Check that no recorded output events remain and the output has been flushed.
|
| auto | check_not_flushed () -> bool |
| | Check that no recorded output events remain but the output has not been flushed.
|
| template<typename Event> |
| auto | pop () -> Event |
| | Retrieve the next recorded output event, disregarding value category.
|
| template<typename Event> |
| auto | pop (emitted_as value_category) -> Event |
| | Retrieve the next recorded output event, checking its value category.
|
|
void | throw_end_processing_on_flush () |
| | Arrange to throw tcspc::end_of_processing on receiving a flush.
|
| void | throw_end_processing_on_next (std::size_t count=0) |
| | Arrange to throw tcspc::end_of_processing on receiving the given number of events.
|
|
void | throw_error_on_flush () |
| | Arrange to throw tcspc::test_error on receiving a flush.
|
| void | throw_error_on_next (std::size_t count=0) |
| | Arrange to throw tcspc::test_error on receiving the given number of events.
|
◆ check() [1/2]
template<typename EventList>
template<typename Event>
Check that the next recorded output event matches with the given event and value category.
This function never returns false; a std::logic_error is thrown if the check is unsuccessful. It returns true for convenient use with testing framework macros such as CHECK() or REQUIRE() (which typically help locate where an exception was thrown).
- Template Parameters
-
| Event | the expected event type |
- Parameters
-
| value_category | the expected value category of the emitted event; tcspc::emitted_as::same_as_fed is only allowed if the feeder value category was set upon construction |
| expected_event | the expected event |
- Returns
- true if the check was successful
◆ check() [2/2]
template<typename EventList>
template<typename Event>
Check that the next recorded output event matches with the given event, disregarding value category.
Equivalent to check(tcspc::emitted_as::any_allowed, expected_event).
◆ check_flushed()
template<typename EventList>
Check that no recorded output events remain and the output has been flushed.
This function never returns false; a std::logic_error is thrown if the check is unsuccessful. It returns true for convenient use with testing framework macros such as CHECK() or REQUIRE() (which typically help locate where an exception was thrown).
- Returns
- true if the check was successful.
◆ check_not_flushed()
template<typename EventList>
Check that no recorded output events remain but the output has not been flushed.
This function never returns false; a std::logic_error is thrown if the check is unsuccessful. It returns true for convenient use with testing framework macros such as CHECK() or REQUIRE() (which typically help locate where an exception was thrown).
- Returns
- true if the check was successful.
◆ pop() [1/2]
template<typename EventList>
template<typename Event>
Retrieve the next recorded output event, disregarding value category.
Equivalent to pop(tcspc::emitted_as::any_allowed).
◆ pop() [2/2]
template<typename EventList>
template<typename Event>
Retrieve the next recorded output event, checking its value category.
This can be used when check() is not convenient (for example, because the exactly matching event is not known).
- Template Parameters
-
| Event | the expected event type |
- Returns
- the event
◆ throw_end_processing_on_next()
template<typename EventList>
Arrange to throw tcspc::end_of_processing on receiving the given number of events.
- Parameters
-
| count | number of events to handle normally before throwing |
◆ throw_error_on_next()
template<typename EventList>
Arrange to throw tcspc::test_error on receiving the given number of events.
- Parameters
-
| count | number of events to handle normally before throwing |
The documentation for this class was generated from the following file: