diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-09-15 14:49:20 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-09-15 14:49:20 -0500 |
commit | c0055ef9118a7a284b26d164617985236a2d432a (patch) | |
tree | 47c0598e5ac78fd037fe12f010f56948c984a1f3 /include/datetime | |
parent | 321873e4c41328e6ef61ca11362abdc753cf1178 (diff) | |
download | ayatana-indicator-datetime-c0055ef9118a7a284b26d164617985236a2d432a.tar.gz ayatana-indicator-datetime-c0055ef9118a7a284b26d164617985236a2d432a.tar.bz2 ayatana-indicator-datetime-c0055ef9118a7a284b26d164617985236a2d432a.zip |
add unit tests for the powerd monitor
Diffstat (limited to 'include/datetime')
-rw-r--r-- | include/datetime/clock-mock.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/datetime/clock-mock.h b/include/datetime/clock-mock.h index fb9b52f..0e24377 100644 --- a/include/datetime/clock-mock.h +++ b/include/datetime/clock-mock.h @@ -41,15 +41,23 @@ public: DateTime localtime() const { return m_localtime; } - void set_localtime(const DateTime& dt) { + void set_localtime(const DateTime& dt) + { const auto old = m_localtime; - m_localtime = dt; + + set_localtime_quietly(dt); + if (!DateTime::is_same_minute(old, m_localtime)) minute_changed(); if (!DateTime::is_same_day(old, m_localtime)) date_changed(); } + void set_localtime_quietly(const DateTime& dt) + { + m_localtime = dt; + } + private: DateTime m_localtime; }; |