Skip to content

Commit

Permalink
Make ValueSchedule trivially copiable
Browse files Browse the repository at this point in the history
  • Loading branch information
lptr committed Feb 1, 2024
1 parent 911d2fa commit 6c868ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/peripherals/valve/ValveScheduler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ class ValveSchedule {
return duration;
}

const time_point<system_clock> start;
const seconds period;
const seconds duration;
private:
time_point<system_clock> start;
seconds period;
seconds duration;
};

struct ValveStateUpdate {
Expand Down
6 changes: 3 additions & 3 deletions test/ValveSchedulerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6c868ac

Please sign in to comment.