diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2015-06-22 18:03:36 +0000 |
---|---|---|
committer | CI Train Bot <ci-train-bot@canonical.com> | 2015-06-22 18:03:36 +0000 |
commit | a85f744191fb08dfd5340f91c137500b927ca1f0 (patch) | |
tree | c16973f373295fc7ee32378d307d786d3acd973e /tests/print-to.h | |
parent | 854ca59995e4e9364d68be8c9ad93e05995e8577 (diff) | |
parent | cfefa6fbb0e0e552e31dc14b06977429b1fcf3ca (diff) | |
download | ayatana-indicator-datetime-a85f744191fb08dfd5340f91c137500b927ca1f0.tar.gz ayatana-indicator-datetime-a85f744191fb08dfd5340f91c137500b927ca1f0.tar.bz2 ayatana-indicator-datetime-a85f744191fb08dfd5340f91c137500b927ca1f0.zip |
Fix bugs relating to timezones and triggers from clock-app alarms. Fixes: #1456281, #1465806
Approved by: Ted Gould, PS Jenkins bot
Diffstat (limited to 'tests/print-to.h')
-rw-r--r-- | tests/print-to.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/tests/print-to.h b/tests/print-to.h index 78cf574..357925f 100644 --- a/tests/print-to.h +++ b/tests/print-to.h @@ -33,9 +33,42 @@ namespace datetime { ***/ void +PrintTo(const DateTime& datetime, std::ostream* os) +{ + *os << "{time:'" << datetime.format("%F %T %z") << '}'; +} + +void PrintTo(const Alarm& alarm, std::ostream* os) { - *os << "{text:'" << alarm.text << "', audio_url:'" << alarm.audio_url << "', time:'"<<alarm.time.format("%F %T")<<"'}"; + *os << '{'; + *os << "{text:" << alarm.text << '}'; + PrintTo(alarm.time, os); + *os << '}'; +} + +void +PrintTo(const Appointment& appointment, std::ostream* os) +{ + *os << '{'; + + *os << "{uid:'" << appointment.uid << "'}" + << "{color:'" << appointment.color << "'}" + << "{summary:'" << appointment.summary << "'}" + << "{activation_url:'" << appointment.activation_url << "'}"; + + *os << "{begin:"; + PrintTo(appointment.begin, os); + *os << '}'; + + *os << "{end:"; + PrintTo(appointment.end, os); + *os << '}'; + + for(const auto& alarm : appointment.alarms) + PrintTo(alarm, os); + + *os << '}'; } } // namespace datetime |