eive-obsw/unittest/main.cpp

38 lines
1.1 KiB
C++
Raw Normal View History

#include <fsfw/events/EventManager.h>
#include <fsfw/health/HealthTable.h>
#include <fsfw/housekeeping/AcceptsHkPacketsIF.h>
#include <fsfw/internalerror/InternalErrorReporter.h>
#include <fsfw/objectmanager/ObjectManager.h>
#include <fsfw/storagemanager/PoolManager.h>
#include <fsfw/timemanager/TimeStamper.h>
2022-02-10 18:15:33 +01:00
#include <catch2/catch_session.hpp>
2021-09-29 10:52:36 +02:00
#include "mocks/EventManagerMock.h"
#include "mocks/HouseKeepingMock.h"
2022-02-10 18:15:33 +01:00
void factory(void* args) {
new HouseKeepingMock();
new EventManagerMock();
new HealthTable(objects::HEALTH_TABLE);
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER);
new TimeStamper(objects::TIME_STAMPER);
2022-02-10 18:15:33 +01:00
{
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);
}
2021-09-29 10:52:36 +02:00
}
int main(int argc, char* argv[]) {
ObjectManager::instance()->setObjectFactoryFunction(factory, nullptr);
ObjectManager::instance()->initialize();
// Catch internal function call
int result = Catch::Session().run(argc, argv);
// global clean-up
return result;
}