diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 8ca86b7e..2b6f704f 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -5,14 +5,12 @@ ThermalController::ThermalController(object_id_t objectId, object_id_t parentId) sensorTemperatures(this), componentTemperatures(this) {} -ReturnValue_t ThermalController::perform() { return HasReturnvaluesIF::RETURN_FAILED; } +ReturnValue_t ThermalController::initialize() { return ControllerBase::initialize(); } ReturnValue_t ThermalController::handleCommandMessage(CommandMessage* message) { return RETURN_FAILED; } void ThermalController::performControlOperation() { - sif::info << "tc performOperation()" << std::endl; - ReturnValue_t result = sensorTemperatures.read(); if (result != RETURN_OK) { return; diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 58e147e3..b52796d6 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -8,7 +8,7 @@ class ThermalController : public ExtendedControllerBase { public: ThermalController(object_id_t objectId, object_id_t parentId); - ReturnValue_t perform(); + ReturnValue_t initialize() override; protected: virtual ReturnValue_t handleCommandMessage(CommandMessage* message) override; diff --git a/unittest/controller/testThermalController.cpp b/unittest/controller/testThermalController.cpp index 47826cb1..6d599475 100644 --- a/unittest/controller/testThermalController.cpp +++ b/unittest/controller/testThermalController.cpp @@ -13,8 +13,8 @@ TEST_CASE("Thermal Controller", "[ThermalController]") { const object_id_t THERMAL_CONTROLLER_ID = 0x123; ThermalController controller(THERMAL_CONTROLLER_ID, objects::NO_OBJECT); - - controller.initializeAfterTaskCreation(); + REQUIRE(controller.initialize() == HasReturnvaluesIF::RETURN_OK); + REQUIRE(controller.initializeAfterTaskCreation() == HasReturnvaluesIF::RETURN_OK); EventManagerMock* eventmanager = ObjectManager::instance()->get(objects::EVENT_MANAGER); @@ -34,7 +34,9 @@ TEST_CASE("Thermal Controller", "[ThermalController]") { REQUIRE(controller.performOperation(0) == HasReturnvaluesIF::RETURN_OK); - eventmanager->clearEventList(); + REQUIRE(eventmanager->isEventInEventList(THERMAL_CONTROLLER_ID, HasModesIF::MODE_INFO, + ControllerBase::MODE_NORMAL, + HasModesIF::SUBMODE_NONE) == true); thermalControllerDefinitions::ComponentTemperatures componentTemperatures(THERMAL_CONTROLLER_ID); diff --git a/unittest/initTests.cpp b/unittest/initTests.cpp index f3a069ac..5d30bdca 100644 --- a/unittest/initTests.cpp +++ b/unittest/initTests.cpp @@ -23,7 +23,4 @@ enum MESSAGE_TYPE { void clearMissionMessage(CommandMessage* message); } // namespace messagetypes - -void messagetypes::clearMissionMessage(CommandMessage* message) { - -} +void messagetypes::clearMissionMessage(CommandMessage* message) {}