Periodic Timer
Loading...
Searching...
No Matches
periodic_timer_test.cpp File Reference

Test scenarios for periodic_timer class template. More...

#include "catch2/catch_test_macros.hpp"
#include <chrono>
#include <thread>
#include <optional>
#include <system_error>
#include "asio/executor_work_guard.hpp"
#include "timer/periodic_timer.hpp"
Include dependency graph for periodic_timer_test.cpp:

Typedefs

using wk_guard = asio::executor_work_guard<asio::io_context::executor_type>
 

Functions

template<typename D >
bool lambda_util (std::error_code err, D elap)
 
void wait_util (std::chrono::milliseconds ms, wk_guard &wg, std::thread &thr)
 
template<typename Clock >
void test_util ()
 
 SCENARIO ("A periodic timer can be instantiated on the steady clock", "[periodic_timer] [steady_clock]")
 
 SCENARIO ("A periodic timer can be instantiated on the system clock", "[periodic_timer] [system_clock]")
 
 SCENARIO ("A periodic timer can be instantiated on the high resolution clock", "[periodic_timer] [high_resolution_clock]")
 

Variables

constexpr int Expected = 9
 
int count = 0
 

Detailed Description

Test scenarios for periodic_timer class template.

Author
Cliff Green

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)