diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2015-06-22 08:59:44 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2015-06-22 08:59:44 -0500 |
commit | 2ed815aa735fc6cede5b2649c8eb1693c89a55a9 (patch) | |
tree | b5cb41eab0570dcdf0194ae74eddc89346b520f3 /tests/print-to.h | |
parent | 854ca59995e4e9364d68be8c9ad93e05995e8577 (diff) | |
parent | 23dc0fd91060fdd2f0d26a7b5bf22a952f08301f (diff) | |
download | ayatana-indicator-datetime-2ed815aa735fc6cede5b2649c8eb1693c89a55a9.tar.gz ayatana-indicator-datetime-2ed815aa735fc6cede5b2649c8eb1693c89a55a9.tar.bz2 ayatana-indicator-datetime-2ed815aa735fc6cede5b2649c8eb1693c89a55a9.zip |
get the 15.10 branch up-to-date with the fixes and test improvements in the 15.04 branch.
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 |