Ulrich Mohr
3400c538b3
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
45 lines
1.5 KiB
C++
45 lines
1.5 KiB
C++
#include <fsfw/events/EventManagerIF.h>
|
|
#include <fsfw/health/HealthTable.h>
|
|
#include <fsfw/housekeeping/AcceptsHkPacketsIF.h>
|
|
#include <fsfw/internalerror/InternalErrorReporter.h>
|
|
#include <fsfw/ipc/QueueFactory.h>
|
|
#include <mission/controller/ThermalController.h>
|
|
|
|
#include <catch2/catch_test_macros.hpp>
|
|
|
|
|
|
|
|
TEST_CASE("Thermal Controller", "[ThermalController]") {
|
|
const object_id_t THERMAL_CONTROLLER_ID = 0x123;
|
|
|
|
ThermalController controller(THERMAL_CONTROLLER_ID, objects::NO_OBJECT);
|
|
|
|
controller.initializeAfterTaskCreation();
|
|
|
|
MessageQueueId_t controllerQueue = controller.getCommandQueue();
|
|
|
|
CommandMessage modeMessage;
|
|
|
|
ModeMessage::setModeMessage(&modeMessage, ModeMessage::CMD_MODE_COMMAND,
|
|
ControllerBase::MODE_NORMAL, HasModesIF::SUBMODE_NONE);
|
|
|
|
MessageQueueIF* commandQueue = QueueFactory::instance()->createMessageQueue(
|
|
5, MessageQueueMessage::MAX_MESSAGE_SIZE);
|
|
|
|
commandQueue->sendMessage(controllerQueue,&modeMessage);
|
|
|
|
REQUIRE(controller.performOperation(0) == HasReturnvaluesIF::RETURN_OK);
|
|
|
|
thermalControllerDefinitions::ComponentTemperatures componentTemperatures(THERMAL_CONTROLLER_ID);
|
|
|
|
componentTemperatures.read();
|
|
REQUIRE(componentTemperatures.rw == 0);
|
|
|
|
componentTemperatures.commit();
|
|
|
|
ExecutableObjectIF *eventmanager = ObjectManager::instance()->get<ExecutableObjectIF>(objects::EVENT_MANAGER);
|
|
eventmanager->performOperation();
|
|
|
|
|
|
QueueFactory::instance()->deleteMessageQueue(commandQueue);
|
|
} |