aboutsummaryrefslogtreecommitdiff
path: root/tests/print-to.h
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2015-05-21 15:24:27 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2015-05-21 15:24:27 +0000
commitc07b11f4e0b943c9f895b946e0cc84e70b603b8a (patch)
tree50cb9235c877138253b39274e88646505b182ee2 /tests/print-to.h
parent22084967d0e5ef0abbf0e2f798596f8eb6092266 (diff)
parent58efd72df90047765721c6e931da22abdb3a956a (diff)
downloadayatana-indicator-datetime-c07b11f4e0b943c9f895b946e0cc84e70b603b8a.tar.gz
ayatana-indicator-datetime-c07b11f4e0b943c9f895b946e0cc84e70b603b8a.tar.bz2
ayatana-indicator-datetime-c07b11f4e0b943c9f895b946e0cc84e70b603b8a.zip
Fix regression that caused nonrepeating alarms to go off at the wrong time. Fixes: #1456281
Approved by: PS Jenkins bot, Ted Gould
Diffstat (limited to 'tests/print-to.h')
-rw-r--r--tests/print-to.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/print-to.h b/tests/print-to.h
index 78cf574..f4af2f7 100644
--- a/tests/print-to.h
+++ b/tests/print-to.h
@@ -33,9 +33,18 @@ 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 << '}';
}
} // namespace datetime