PSB unittests complete

This commit is contained in:
Robin Müller 2022-07-26 19:08:12 +02:00
parent 152c01b2ec
commit 681738dcc6
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
2 changed files with 23 additions and 7 deletions

View File

@ -34,11 +34,6 @@ void Factory::produceFrameworkObjects(void* args) {
new HealthTable(objects::HEALTH_TABLE);
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER);
{
PoolManager::LocalPoolConfig poolCfg = {{100, 16}, {50, 32}, {25, 64}, {15, 128}, {5, 1024}};
new PoolManager(objects::TC_STORE, poolCfg);
}
{
PoolManager::LocalPoolConfig poolCfg = {{100, 16}, {50, 32}, {25, 64}, {15, 128}, {5, 1024}};
new PoolManager(objects::TM_STORE, poolCfg);

View File

@ -2,6 +2,7 @@
#include "fsfw/ipc/QueueFactory.h"
#include "fsfw/storagemanager/LocalPool.h"
#include "fsfw/storagemanager/PoolManager.h"
#include "mocks/AcceptsTmMock.h"
#include "mocks/CdsShortTimestamperMock.h"
#include "mocks/InternalErrorReporterMock.h"
@ -216,7 +217,27 @@ TEST_CASE("Pus Service Base", "[pus-service-base]") {
REQUIRE(p.verifReporter == &otherReporter);
}
SECTION("Auto Initialize TC Pool") {}
SECTION("Invalid Verification Reporter") {}
SECTION("Auto Initialize TC Pool") {
PoolManager tcStoreGlobal(objects::TC_STORE, cfg);
psbParams.tcPool = nullptr;
psbParams.objectId = 1;
auto psb2 = PsbMock(psbParams);
REQUIRE(psb2.initialize() == retval::OK);
auto& p = psb2.getParams();
REQUIRE(p.tcPool == &tcStoreGlobal);
}
SECTION("Invalid Verification Reporter") {
psbParams.verifReporter = nullptr;
psbParams.objectId = 1;
auto psb2 = PsbMock(psbParams);
REQUIRE(psb2.initialize() == ObjectManagerIF::CHILD_INIT_FAILED);
}
SECTION("Invalid TC Store") {
psbParams.tcPool = nullptr;
psbParams.objectId = 1;
auto psb2 = PsbMock(psbParams);
REQUIRE(psb2.initialize() == ObjectManagerIF::CHILD_INIT_FAILED);
}
}