Commit 647ceea6 authored by Dominik Charousset's avatar Dominik Charousset

Make sure the test clock never reports 0 as now()

parent 7d6e221a
...@@ -28,6 +28,8 @@ class test_actor_clock : public simple_actor_clock { ...@@ -28,6 +28,8 @@ class test_actor_clock : public simple_actor_clock {
public: public:
time_point current_time; time_point current_time;
test_actor_clock();
time_point now() const noexcept override; time_point now() const noexcept override;
duration_type difference(atom_value measurement, long units, time_point t0, duration_type difference(atom_value measurement, long units, time_point t0,
......
...@@ -21,6 +21,12 @@ ...@@ -21,6 +21,12 @@
namespace caf { namespace caf {
namespace detail { namespace detail {
test_actor_clock::test_actor_clock() : current_time(duration_type{1}) {
// This ctor makes sure that the clock isn't at the default-constructed
// time_point, because that value has special meaning (for the tick_emitter,
// for example).
}
test_actor_clock::time_point test_actor_clock::now() const noexcept { test_actor_clock::time_point test_actor_clock::now() const noexcept {
return current_time; return current_time;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment