aboutsummaryrefslogtreecommitdiff
path: root/tests/test-planner.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2015-03-14 21:33:51 -0500
committerCharles Kerr <charles.kerr@canonical.com>2015-03-14 21:33:51 -0500
commit6481c0ecf40df26eca71779a683aeeab9455f1f2 (patch)
treef4ed9b9ce8177c5aacc262c8e6671bc67924f42c /tests/test-planner.cpp
parentc940b70c65b1550fe65dbad5841adfe906cf0cdf (diff)
downloadayatana-indicator-datetime-6481c0ecf40df26eca71779a683aeeab9455f1f2.tar.gz
ayatana-indicator-datetime-6481c0ecf40df26eca71779a683aeeab9455f1f2.tar.bz2
ayatana-indicator-datetime-6481c0ecf40df26eca71779a683aeeab9455f1f2.zip
sync the rest of the code with the changes to DateTime instantiation mentioned two commits ago
Diffstat (limited to 'tests/test-planner.cpp')
-rw-r--r--tests/test-planner.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/test-planner.cpp b/tests/test-planner.cpp
index 8f1590c..1e8ac66 100644
--- a/tests/test-planner.cpp
+++ b/tests/test-planner.cpp
@@ -39,30 +39,30 @@ typedef GlibFixture PlannerFixture;
TEST_F(PlannerFixture, HelloWorld)
{
- auto halloween = g_date_time_new_local(2020, 10, 31, 18, 30, 59);
- auto christmas = g_date_time_new_local(2020, 12, 25, 0, 0, 0);
+ auto halloween = DateTime::Local(2020, 10, 31, 18, 30, 59);
+ auto christmas = DateTime::Local(2020, 12, 25, 0, 0, 0);
Appointment a;
a.summary = "Test";
a.begin = halloween;
- a.end = g_date_time_add_hours(halloween, 1);
+ a.end = a.begin.add_full(0,0,0,1,0,0);
const Appointment b = a;
a.summary = "Foo";
EXPECT_EQ(a.summary, "Foo");
EXPECT_EQ(b.summary, "Test");
- EXPECT_EQ(0, g_date_time_compare(a.begin(), b.begin()));
- EXPECT_EQ(0, g_date_time_compare(a.end(), b.end()));
+ EXPECT_EQ(a.begin, b.begin);
+ EXPECT_EQ(a.end, b.end);
Appointment c;
c.begin = christmas;
- c.end = g_date_time_add_hours(christmas, 1);
+ c.end = c.begin.add_days(1);
Appointment d;
d = c;
- EXPECT_EQ(0, g_date_time_compare(c.begin(), d.begin()));
- EXPECT_EQ(0, g_date_time_compare(c.end(), d.end()));
+ EXPECT_EQ(c.begin, d.begin);
+ EXPECT_EQ(c.end, d.end);
a = d;
- EXPECT_EQ(0, g_date_time_compare(d.begin(), a.begin()));
- EXPECT_EQ(0, g_date_time_compare(d.end(), a.end()));
+ EXPECT_EQ(d.begin, a.begin);
+ EXPECT_EQ(d.end, a.end);
}