aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-02-04 00:10:17 -0600
committerCharles Kerr <charles.kerr@canonical.com>2014-02-04 00:10:17 -0600
commit894c0c625ff1e2f2d031f48f157a3008302cb5a7 (patch)
treeccdfa8520159bb95555368aa9a7439c384e6bb1c /tests
parent7d1ec01369d1c107cd42b0a7501f8cdb3c7e08ac (diff)
downloadayatana-indicator-datetime-894c0c625ff1e2f2d031f48f157a3008302cb5a7.tar.gz
ayatana-indicator-datetime-894c0c625ff1e2f2d031f48f157a3008302cb5a7.tar.bz2
ayatana-indicator-datetime-894c0c625ff1e2f2d031f48f157a3008302cb5a7.zip
pin the planner's upcoming appointments to the live clock time, rather than the calendar's time, so that they always update correctly in real-time
Diffstat (limited to 'tests')
-rw-r--r--tests/test-planner.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/test-planner.cpp b/tests/test-planner.cpp
index b476ee8..1923ba1 100644
--- a/tests/test-planner.cpp
+++ b/tests/test-planner.cpp
@@ -28,9 +28,7 @@
#include <langinfo.h>
#include <locale.h>
-using unity::indicator::datetime::Appointment;
-using unity::indicator::datetime::DateTime;
-using unity::indicator::datetime::PlannerEds;
+using namespace unity::indicator::datetime;
/***
****
@@ -40,11 +38,15 @@ typedef GlibFixture PlannerFixture;
TEST_F(PlannerFixture, EDS)
{
- PlannerEds planner;
+ auto tmp = g_date_time_new_now_local();
+ const auto now = DateTime(tmp);
+ g_date_time_unref(tmp);
+
+ std::shared_ptr<Clock> clock(new MockClock(now));
+ PlannerEds planner(clock);
wait_msec(100);
- auto now = g_date_time_new_now_local();
- planner.time.set(DateTime(now));
+ planner.time.set(now);
wait_msec(2500);
std::vector<Appointment> this_month = planner.this_month.get();