From 1be6c26a6daba4224b6763025cf8dd2e1d674422 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sun, 23 Mar 2014 17:40:31 +0400 Subject: [PATCH] SystemClockMock adjustment support --- libuavcan/test/clock.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libuavcan/test/clock.hpp b/libuavcan/test/clock.hpp index 4b7accbd32..6b20454ba1 100644 --- a/libuavcan/test/clock.hpp +++ b/libuavcan/test/clock.hpp @@ -14,6 +14,7 @@ class SystemClockMock : public uavcan::ISystemClock public: mutable uint64_t monotonic; mutable uint64_t utc; + uavcan::UtcDuration last_adjustment; int64_t monotonic_auto_advance; SystemClockMock(uint64_t initial = 0) @@ -42,9 +43,10 @@ public: return uavcan::UtcTime::fromUSec(utc); } - void adjustUtc(uavcan::UtcDuration) + void adjustUtc(uavcan::UtcDuration adjustment) { - assert(0); + assert(this); + last_adjustment = adjustment; } };