all tests running again
fsfw/fsfw/pipeline/pr-development There was a failure building this commit Details

This commit is contained in:
Robin Müller 2022-07-25 19:49:19 +02:00
parent 935e135f1c
commit a88f767cca
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
8 changed files with 22 additions and 24 deletions

View File

@ -3,5 +3,4 @@ target_sources(${FSFW_TEST_TGT} PRIVATE
testLocalPoolVector.cpp
testDataSet.cpp
testLocalPoolManager.cpp
LocalPoolOwnerBase.cpp
)

View File

@ -9,11 +9,12 @@
#include <catch2/catch_test_macros.hpp>
#include "CatchDefinitions.h"
#include "LocalPoolOwnerBase.h"
#include "mocks/LocalPoolOwnerBase.h"
#include "mocks/MessageQueueMock.h"
#include "tests/TestsConfig.h"
TEST_CASE("DataSetTest", "[DataSetTest]") {
auto queue = MessageQueueMockBase();
auto queue = MessageQueueMock();
LocalPoolOwnerBase poolOwner(queue, objects::TEST_LOCAL_POOL_OWNER_BASE);
REQUIRE(poolOwner.initializeHkManager() == retval::CATCH_OK);
REQUIRE(poolOwner.initializeHkManagerAfterTaskCreation() == retval::CATCH_OK);

View File

@ -12,7 +12,7 @@
#include <iostream>
#include "CatchDefinitions.h"
#include "LocalPoolOwnerBase.h"
#include "mocks/LocalPoolOwnerBase.h"
#include "mocks/HkReceiverMock.h"
TEST_CASE("Local Pool Manager Tests", "[LocManTest]") {
@ -20,12 +20,12 @@ TEST_CASE("Local Pool Manager Tests", "[LocManTest]") {
const MessageQueueId_t hkDest = defaultDestId;
const MessageQueueId_t subscriberId = 2;
auto hkReceiver = HkReceiverMock(hkDest);
auto queue = MessageQueueMockBase();
auto queue = MessageQueueMock();
LocalPoolOwnerBase poolOwner(queue, objects::TEST_LOCAL_POOL_OWNER_BASE);
REQUIRE(poolOwner.initializeHkManager() == retval::CATCH_OK);
REQUIRE(poolOwner.initializeHkManagerAfterTaskCreation() == retval::CATCH_OK);
MessageQueueMockBase& poolOwnerMock = poolOwner.getMockQueueHandle();
MessageQueueMock& poolOwnerMock = poolOwner.getMockQueueHandle();
// TODO: This is ugly. This should be an arbitrary ctor argument. Fix this in the pool
// manager

View File

@ -4,15 +4,14 @@
#include <catch2/catch_test_macros.hpp>
#include "CatchDefinitions.h"
#include "LocalPoolOwnerBase.h"
#include "mocks/LocalPoolOwnerBase.h"
#include "tests/TestsConfig.h"
TEST_CASE("LocalPoolVariable", "[LocPoolVarTest]") {
auto* poolOwner =
ObjectManager::instance()->get<LocalPoolOwnerBase>(objects::TEST_LOCAL_POOL_OWNER_BASE);
REQUIRE(poolOwner != nullptr);
REQUIRE(poolOwner->initializeHkManager() == retval::CATCH_OK);
REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == retval::CATCH_OK);
auto queue = MessageQueueMock();
LocalPoolOwnerBase poolOwner(queue, objects::TEST_LOCAL_POOL_OWNER_BASE);
REQUIRE(poolOwner.initializeHkManager() == retval::CATCH_OK);
REQUIRE(poolOwner.initializeHkManagerAfterTaskCreation() == retval::CATCH_OK);
SECTION("Basic Tests") {
/* very basic test. */
@ -106,6 +105,4 @@ TEST_CASE("LocalPoolVariable", "[LocPoolVarTest]") {
lp_var_t<uint8_t> invalidObjectVar2 = lp_var_t<uint8_t>(globPoolId);
lp_var_t<uint8_t> invalidObjectVar3 = lp_var_t<uint8_t>(nullptr, lpool::uint8VarId);
}
CHECK(poolOwner->reset() == retval::CATCH_OK);
}

View File

@ -8,11 +8,10 @@
#include "tests/TestsConfig.h"
TEST_CASE("LocalPoolVector", "[LocPoolVecTest]") {
auto* poolOwner =
ObjectManager::instance()->get<LocalPoolOwnerBase>(objects::TEST_LOCAL_POOL_OWNER_BASE);
REQUIRE(poolOwner != nullptr);
REQUIRE(poolOwner->initializeHkManager() == retval::CATCH_OK);
REQUIRE(poolOwner->initializeHkManagerAfterTaskCreation() == retval::CATCH_OK);
auto queue = MessageQueueMock();
LocalPoolOwnerBase poolOwner(queue, objects::TEST_LOCAL_POOL_OWNER_BASE);
REQUIRE(poolOwner.initializeHkManager() == retval::CATCH_OK);
REQUIRE(poolOwner.initializeHkManagerAfterTaskCreation() == retval::CATCH_OK);
SECTION("BasicTest") {
// very basic test.
@ -106,5 +105,4 @@ TEST_CASE("LocalPoolVector", "[LocPoolVecTest]") {
objects::TEST_LOCAL_POOL_OWNER_BASE, lpool::uint16Vec3Id, nullptr, pool_rwm_t::VAR_READ);
REQUIRE(readOnlyVec.commit() == static_cast<int>(PoolVariableIF::INVALID_READ_WRITE_MODE));
}
poolOwner->reset();
}

View File

@ -6,4 +6,5 @@ target_sources(${FSFW_TEST_TGT} PRIVATE
ComIFMock.cpp
MessageQueueMock.cpp
InternalErrorReporterMock.cpp
LocalPoolOwnerBase.cpp
)

View File

@ -98,8 +98,8 @@ class LocalPoolOwnerBase : public SystemObject, public HasLocalDataPoolIF {
LocalPoolObjectBase* getPoolObjectHandle(lp_id_t localPoolId) override;
[[nodiscard]] MessageQueueMockBase& getMockQueueHandle() const {
return dynamic_cast<MessageQueueMockBase&>(queue);
[[nodiscard]] MessageQueueMock& getMockQueueHandle() const {
return dynamic_cast<MessageQueueMock&>(queue);
}
ReturnValue_t subscribePeriodicHk(bool enableReporting) {

View File

@ -1,4 +1,5 @@
#include <catch2/catch_test_macros.hpp>
#include <iostream>
#include "fsfw/tmtcservices/TmSendHelper.h"
#include "mocks/InternalErrorReporterMock.h"
@ -6,8 +7,9 @@
TEST_CASE("TM Send Helper", "[tm-send-helper]") {
auto errReporter = InternalErrorReporterMock();
auto msgQueue = MessageQueueMockBase();
auto msgQueue = MessageQueueMock();
TmSendHelper sendHelper(&msgQueue, &errReporter);
SECTION("State") {}
SECTION("State") {
}
}