KiCad PCB EDA Suite
Loading...
Searching...
No Matches
COROUTINE_INCREMENTING_HARNESS Class Reference

Simple coroutine harness that runs a coroutine that increments a number up to a pre-set limit, spitting out coroutine events as it goes. More...

Public Types

using TEST_COROUTINE = COROUTINE< int, int >
 The coroutine test take ints and returns them.
 
using EVT_HANDLER = std::function< void(const COROUTINE_TEST_EVENT &)>
 

Public Member Functions

 COROUTINE_INCREMENTING_HARNESS (EVT_HANDLER aHandler, int aCount)
 
int CountTo (int n)
 
void Run ()
 

Public Attributes

EVT_HANDLER m_handler
 
std::unique_ptr< TEST_COROUTINEm_cofunc
 
int m_count
 

Detailed Description

Simple coroutine harness that runs a coroutine that increments a number up to a pre-set limit, spitting out coroutine events as it goes.

This can then be used to ensure the events are occurring as expected.

Definition at line 85 of file test_coroutine.cpp.

Member Typedef Documentation

◆ EVT_HANDLER

Definition at line 93 of file test_coroutine.cpp.

◆ TEST_COROUTINE

The coroutine test take ints and returns them.

Definition at line 91 of file test_coroutine.cpp.

Constructor & Destructor Documentation

◆ COROUTINE_INCREMENTING_HARNESS()

COROUTINE_INCREMENTING_HARNESS::COROUTINE_INCREMENTING_HARNESS ( EVT_HANDLER  aHandler,
int  aCount 
)
inline

Definition at line 95 of file test_coroutine.cpp.

Member Function Documentation

◆ CountTo()

int COROUTINE_INCREMENTING_HARNESS::CountTo ( int  n)
inline

Definition at line 100 of file test_coroutine.cpp.

References m_cofunc, and m_handler.

Referenced by Run().

◆ Run()

void COROUTINE_INCREMENTING_HARNESS::Run ( )
inline

Definition at line 113 of file test_coroutine.cpp.

References CountTo(), m_cofunc, m_count, and m_handler.

Referenced by BOOST_AUTO_TEST_CASE().

Member Data Documentation

◆ m_cofunc

std::unique_ptr<TEST_COROUTINE> COROUTINE_INCREMENTING_HARNESS::m_cofunc

Definition at line 133 of file test_coroutine.cpp.

Referenced by CountTo(), and Run().

◆ m_count

int COROUTINE_INCREMENTING_HARNESS::m_count

Definition at line 134 of file test_coroutine.cpp.

Referenced by Run().

◆ m_handler

EVT_HANDLER COROUTINE_INCREMENTING_HARNESS::m_handler

Definition at line 132 of file test_coroutine.cpp.

Referenced by CountTo(), and Run().


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