From 6c868ac9f6ed7d86d2481e25f435275ea4c9b7ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=B3r=C3=A1nt=20Pint=C3=A9r?= Date: Thu, 1 Feb 2024 17:38:00 +0100 Subject: [PATCH] Make ValueSchedule trivially copiable --- src/peripherals/valve/ValveScheduler.hpp | 7 ++++--- test/ValveSchedulerTest.cpp | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/peripherals/valve/ValveScheduler.hpp b/src/peripherals/valve/ValveScheduler.hpp index ef875d1c..dc31e099 100644 --- a/src/peripherals/valve/ValveScheduler.hpp +++ b/src/peripherals/valve/ValveScheduler.hpp @@ -39,9 +39,10 @@ class ValveSchedule { return duration; } - const time_point start; - const seconds period; - const seconds duration; +private: + time_point start; + seconds period; + seconds duration; }; struct ValveStateUpdate { diff --git a/test/ValveSchedulerTest.cpp b/test/ValveSchedulerTest.cpp index 13851943..584da257 100644 --- a/test/ValveSchedulerTest.cpp +++ b/test/ValveSchedulerTest.cpp @@ -31,9 +31,9 @@ class ValveSchedulerTest : public testing::Test { TEST_F(ValveSchedulerTest, can_create_schedule) { ValveSchedule schedule(base, hours { 1 }, minutes { 1 }); - EXPECT_EQ(schedule.start, base); - EXPECT_EQ(schedule.period, hours { 1 }); - EXPECT_EQ(schedule.duration, minutes { 1 }); + EXPECT_EQ(schedule.getStart(), base); + EXPECT_EQ(schedule.getPeriod(), hours { 1 }); + EXPECT_EQ(schedule.getDuration(), minutes { 1 }); } // TEST_F(ValveSchedulerTest, can_create_schedule_from_json) {