Add member first_in_month and first_in_year to ScheduleState

This commit is contained in:
Joakim Hove
2021-03-10 09:45:58 +01:00
parent b151c85f6c
commit d673f2e555
3 changed files with 27 additions and 0 deletions

View File

@@ -143,10 +143,17 @@ END
"Must write restart information for included step " << stepID);
}
std::vector<bool> first_in_month{true, false, false, false, false, true, false, true, true, true, true, true, true, true, true, true, false, true, false};
std::vector<std::size_t> month_num{ 0,0,0,0,0, 1, 1, 2, 3, 4, 5, 6, 7, 10, 12, 17, 17, 18, 18 };
for (std::size_t index = 0; index < sched.size(); index++) {
const auto& state = sched[index];
BOOST_CHECK_EQUAL( state.month_num(), month_num[index] );
BOOST_CHECK_EQUAL( state.first_in_month(), first_in_month[index] );
if (index == 0 || index == 11 || index == 17)
BOOST_CHECK( state.first_in_year());
else
BOOST_CHECK(!state.first_in_year());
}
}