From 6481c0ecf40df26eca71779a683aeeab9455f1f2 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 14 Mar 2015 21:33:51 -0500 Subject: sync the rest of the code with the changes to DateTime instantiation mentioned two commits ago --- tests/test-planner.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tests/test-planner.cpp') 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); } -- cgit v1.2.3