49 lines
824 B
C++
49 lines
824 B
C++
|
|
/*
|
|||
|
|
* AsyncRunnerTest.hh
|
|||
|
|
*
|
|||
|
|
* Created on: 21 мая 2024 г.
|
|||
|
|
* Author: leonid
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#ifndef ASYNCRUNNERTEST_HH_
|
|||
|
|
#define ASYNCRUNNERTEST_HH_
|
|||
|
|
|
|||
|
|
#include "UnitTestInterface.hh"
|
|||
|
|
|
|||
|
|
#include "AsyncRunnerInterface.hh"
|
|||
|
|
|
|||
|
|
namespace umlib { namespace tests {
|
|||
|
|
|
|||
|
|
class AsyncRunnerTest : public UnitTestInterface {
|
|||
|
|
|
|||
|
|
AsyncRunnerInterface & runner;
|
|||
|
|
|
|||
|
|
struct OnceCallTask : public TaskInterface {
|
|||
|
|
|
|||
|
|
int counter;
|
|||
|
|
|
|||
|
|
void reset();
|
|||
|
|
|
|||
|
|
void do_task();
|
|||
|
|
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
public:
|
|||
|
|
AsyncRunnerTest( AsyncRunnerInterface & runner );
|
|||
|
|
|
|||
|
|
void run( TestResult & result );
|
|||
|
|
|
|||
|
|
void test_once_call_on_zero( TestResult & result );
|
|||
|
|
void test_once_call_on_one( TestResult & result );
|
|||
|
|
void test_ran_after_run( TestResult & result );
|
|||
|
|
void test_cancel( TestResult & result );
|
|||
|
|
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
}}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
#endif /* ASYNCRUNNERTEST_HH_ */
|