|
Open Model Railroad Network (OpenMRN)
|
Class that injects a fake progression of time for unit tests. More...
#include <FakeClock.hxx>
Public Member Functions | |
| void | advance (long long nsec) |
| Advances the time returned by os_get_time_monotonic(). | |
| long long | get_time_nsec () |
Additional Inherited Members | |
Static Public Member Functions inherited from Singleton< FakeClock > | |
| static FakeClock * | instance () |
| static bool | exists () |
Private Member Functions inherited from FakeClockContent | |
| FakeClockContent (long long t) | |
Private Attributes inherited from FakeClockContent | |
| long long | lastTime_ |
Class that injects a fake progression of time for unit tests.
When this class is created, the time as returned by os_get_time_monotonic() freezes. From that point on time only moves forward when advance() is called.
There can be at most one instance of this class at any time.
Definition at line 62 of file FakeClock.hxx.
|
inline |
Definition at line 65 of file FakeClock.hxx.
|
inline |
Advances the time returned by os_get_time_monotonic().
| nsec | how much the time should jump forward (relative to now). |
Definition at line 72 of file FakeClock.hxx.
|
inline |
Definition at line 86 of file FakeClock.hxx.