added EventManagerMock, to be extended and moved into fsfw some day
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
@ -3,45 +3,17 @@
|
||||
#include <fsfw/housekeeping/AcceptsHkPacketsIF.h>
|
||||
#include <fsfw/internalerror/InternalErrorReporter.h>
|
||||
#include <fsfw/ipc/QueueFactory.h>
|
||||
#include <fsfw/objectmanager.h>
|
||||
#include <fsfw/storagemanager/PoolManager.h>
|
||||
#include <fsfw/timemanager/TimeStamper.h>
|
||||
#include <mission/controller/ThermalController.h>
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
class HkDummy : public SystemObject, public AcceptsHkPacketsIF {
|
||||
public:
|
||||
HkDummy() : SystemObject(objects::PUS_SERVICE_3_HOUSEKEEPING) {}
|
||||
|
||||
virtual MessageQueueId_t getHkQueue() const { return MessageQueueIF::NO_QUEUE; }
|
||||
};
|
||||
|
||||
void factory(void* args) {
|
||||
new HkDummy();
|
||||
|
||||
new HealthTable(objects::HEALTH_TABLE);
|
||||
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER);
|
||||
new TimeStamper(objects::TIME_STAMPER);
|
||||
|
||||
{
|
||||
PoolManager::LocalPoolConfig poolCfg = {{300, 16}, {200, 32}, {150, 64}, {150, 128},
|
||||
{100, 256}, {50, 512}, {50, 1024}, {10, 2048}};
|
||||
new PoolManager(objects::IPC_STORE, poolCfg);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Thermal Controller", "[ThermalController]") {
|
||||
|
||||
const object_id_t THERMAL_CONTROLLER_ID = 0x123;
|
||||
|
||||
|
||||
ThermalController controller(THERMAL_CONTROLLER_ID, objects::NO_OBJECT);
|
||||
|
||||
ObjectManager::instance()->setObjectFactoryFunction(factory, nullptr);
|
||||
ObjectManager::instance()->initialize();
|
||||
ObjectManager::instance()->printList();
|
||||
|
||||
controller.initializeAfterTaskCreation();
|
||||
|
||||
MessageQueueId_t controllerQueue = controller.getCommandQueue();
|
||||
@ -65,5 +37,9 @@ TEST_CASE("Thermal Controller", "[ThermalController]") {
|
||||
|
||||
componentTemperatures.commit();
|
||||
|
||||
ExecutableObjectIF *eventmanager = ObjectManager::instance()->get<ExecutableObjectIF>(objects::EVENT_MANAGER);
|
||||
eventmanager->performOperation();
|
||||
|
||||
|
||||
QueueFactory::instance()->deleteMessageQueue(commandQueue);
|
||||
}
|
Reference in New Issue
Block a user