Skip to content

Commit

Permalink
tests: use enums instead of magic numbers for weekdays
Browse files Browse the repository at this point in the history
  • Loading branch information
franku committed Feb 20, 2020
1 parent 2d2659d commit 94d7f72
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions core/src/tests/scheduler.cc
Expand Up @@ -280,16 +280,27 @@ static void TestWithConfig(std::string path_to_config_file,
delete my_config;
}

enum
{
kMonday = 1,
kTuesday = 2,
kWednesday = 3,
kThursday = 4,
kFriday = 5,
kSaturday = 6,
kSunday = 7
};

TEST_F(SchedulerTest, on_time)
{
std::vector<uint8_t> wdays{1, 1, 1};
std::vector<uint8_t> wdays{kMonday, kMonday, kMonday};
TestWithConfig(RELATIVE_PROJECT_SOURCE_DIR "/configs/scheduler-on-time",
wdays);
}

TEST_F(SchedulerTest, on_time_noday)
{
std::vector<uint8_t> wdays{4, 5, 6};
std::vector<uint8_t> wdays{kThursday, kFriday, kSaturday};
TestWithConfig(RELATIVE_PROJECT_SOURCE_DIR "/configs/scheduler-on-time-noday",
wdays);
}
Expand Down

0 comments on commit 94d7f72

Please sign in to comment.