added last unittests
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
Robin Müller 2022-02-28 20:27:24 +01:00
parent 165e6e829e
commit 1c17aac544
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -232,6 +232,24 @@ TEST_CASE( "Core Controller Reboot File Handling", "[reboot-file]" ) {
// Should be on 0 0 now // Should be on 0 0 now
CHECK(CoreController::CURRENT_CHIP == xsc::CHIP_0); CHECK(CoreController::CURRENT_CHIP == xsc::CHIP_0);
CHECK(CoreController::CURRENT_COPY == xsc::COPY_0); CHECK(CoreController::CURRENT_COPY == xsc::COPY_0);
ctrl.performRebootFileHandling(false);
ctrl.parseRebootFile(REBOOT_FILE, rf);
REQUIRE(rf.enabled == 1);
REQUIRE(rf.img00Cnt == 1);
REQUIRE(rf.img01Cnt == 0);
REQUIRE(rf.img10Cnt == 5);
REQUIRE(rf.img11Cnt == 3);
// Now reset all reboot counters manually
ctrl.executeAction(CoreController::RESET_REBOOT_COUNTER_00, 0, nullptr, 0);
ctrl.executeAction(CoreController::RESET_REBOOT_COUNTER_10, 0, nullptr, 0);
ctrl.executeAction(CoreController::RESET_REBOOT_COUNTER_11, 0, nullptr, 0);
ctrl.parseRebootFile(REBOOT_FILE, rf);
REQUIRE(rf.enabled == 1);
REQUIRE(rf.img00Cnt == 0);
REQUIRE(rf.img01Cnt == 0);
REQUIRE(rf.img10Cnt == 0);
REQUIRE(rf.img11Cnt == 0);
} }
if(std::filesystem::exists(CONF_PATH)) { if(std::filesystem::exists(CONF_PATH)) {
std::uintmax_t n = std::filesystem::remove_all(CONF_PATH); std::uintmax_t n = std::filesystem::remove_all(CONF_PATH);