aboutsummaryrefslogtreecommitdiff
path: root/tests/print-to.h
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2015-06-22 08:59:44 -0500
committerCharles Kerr <charles.kerr@canonical.com>2015-06-22 08:59:44 -0500
commit2ed815aa735fc6cede5b2649c8eb1693c89a55a9 (patch)
treeb5cb41eab0570dcdf0194ae74eddc89346b520f3 /tests/print-to.h
parent854ca59995e4e9364d68be8c9ad93e05995e8577 (diff)
parent23dc0fd91060fdd2f0d26a7b5bf22a952f08301f (diff)
downloadayatana-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.h35
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