3#include <xrpl/beast/clock/abstract_clock.h>
4#include <xrpl/beast/clock/manual_clock.h>
5#include <xrpl/beast/unit_test/suite.h>
17 template <
class Clock>
23 auto const t1(c.
now());
25 auto const t2(c.
now());
27 log <<
"t1= " << t1.time_since_epoch().count() <<
", t2= " << t2.time_since_epoch().count()
28 <<
", elapsed= " << (t2 - t1).count() <<
std::endl;
41 auto c1 = c.
now().time_since_epoch();
43 auto c2 = c.now().time_since_epoch();
45 auto c3 = c.now().time_since_epoch();
47 log <<
"[" << c1.count() <<
"," << c2.count() <<
"," << c3.count() <<
"]" <<
std::endl;
Abstract interface to a clock.
virtual time_point now() const =0
Returns the current time.
Manual clock implementation.
void test(std::string name, AbstractClock< Clock > &c)
void run() override
Runs the suite.
void pass()
Record a successful test condition.
LogOs< char > log
Logging output stream.
TestcaseT testcase
Memberspace for declaring test cases.
AbstractClock< Facade > & getAbstractClock()
Returns a global instance of an abstract clock.
BEAST_DEFINE_TESTSUITE_MANUAL(abstract_clock, beast, beast)