aboutsummaryrefslogtreecommitdiff
path: root/tests/test-alarm-queue.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2015-03-17 15:23:49 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2015-03-17 15:23:49 +0000
commitddde67df581dea8c5a261e43d5b12a3821f06ed1 (patch)
treee3c2859c54b0bba9c72ad221ea41c95ed8f5a70f /tests/test-alarm-queue.cpp
parent15ec7f61fa84a9a8b40c1c9fcfa6c2a268d3232b (diff)
parent273c3b3829c9a3e853d0b6b0a32ae87cc3c6852b (diff)
downloadayatana-indicator-datetime-ddde67df581dea8c5a261e43d5b12a3821f06ed1.tar.gz
ayatana-indicator-datetime-ddde67df581dea8c5a261e43d5b12a3821f06ed1.tar.bz2
ayatana-indicator-datetime-ddde67df581dea8c5a261e43d5b12a3821f06ed1.zip
Fix bug that prevented clicking on calendar days where DST sprang forward. Fixes: #1429388
Approved by: Ted Gould, PS Jenkins bot
Diffstat (limited to 'tests/test-alarm-queue.cpp')
-rw-r--r--tests/test-alarm-queue.cpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/tests/test-alarm-queue.cpp b/tests/test-alarm-queue.cpp
index 12ffe92..3fdf787 100644
--- a/tests/test-alarm-queue.cpp
+++ b/tests/test-alarm-queue.cpp
@@ -68,12 +68,8 @@ protected:
std::vector<Appointment> build_some_appointments()
{
const auto now = m_state->clock->localtime();
- auto tomorrow = g_date_time_add_days (now.get(), 1);
- auto tomorrow_begin = g_date_time_add_full (tomorrow, 0, 0, 0,
- -g_date_time_get_hour(tomorrow),
- -g_date_time_get_minute(tomorrow),
- -g_date_time_get_seconds(tomorrow));
- auto tomorrow_end = g_date_time_add_full (tomorrow_begin, 0, 0, 1, 0, 0, -1);
+ const auto tomorrow_begin = now.add_days(1).start_of_day();
+ const auto tomorrow_end = tomorrow_begin.end_of_day();
Appointment a1; // an alarm clock appointment
a1.color = "red";
@@ -84,8 +80,8 @@ protected:
a1.begin = tomorrow_begin;
a1.end = tomorrow_end;
- auto ubermorgen_begin = g_date_time_add_days (tomorrow, 1);
- auto ubermorgen_end = g_date_time_add_full (tomorrow_begin, 0, 0, 1, 0, 0, -1);
+ const auto ubermorgen_begin = now.add_days(2).start_of_day();
+ const auto ubermorgen_end = ubermorgen_begin.end_of_day();
Appointment a2; // a non-alarm appointment
a2.color = "green";
@@ -96,13 +92,6 @@ protected:
a2.begin = ubermorgen_begin;
a2.end = ubermorgen_end;
- // cleanup
- g_date_time_unref(ubermorgen_end);
- g_date_time_unref(ubermorgen_begin);
- g_date_time_unref(tomorrow_end);
- g_date_time_unref(tomorrow_begin);
- g_date_time_unref(tomorrow);
-
return std::vector<Appointment>({a1, a2});
}
};