psb unittests almost complete
This commit is contained in:
@ -1,5 +1,13 @@
|
||||
#include "PusVerificationReporterMock.h"
|
||||
|
||||
#include "fsfw/objectmanager/frameworkObjects.h"
|
||||
|
||||
PusVerificationReporterMock::PusVerificationReporterMock()
|
||||
: SystemObject(objects::NO_OBJECT, false) {}
|
||||
|
||||
PusVerificationReporterMock::PusVerificationReporterMock(object_id_t registeredId)
|
||||
: SystemObject(registeredId) {}
|
||||
|
||||
size_t PusVerificationReporterMock::successCallCount() const { return successParams.size(); }
|
||||
size_t PusVerificationReporterMock::failCallCount() const { return failParams.size(); }
|
||||
|
||||
|
@ -3,13 +3,15 @@
|
||||
|
||||
#include <queue>
|
||||
|
||||
#include "fsfw/objectmanager/SystemObject.h"
|
||||
#include "fsfw/tmtcservices/VerificationReporterIF.h"
|
||||
|
||||
class PusVerificationReporterMock : public VerificationReporterIF {
|
||||
class PusVerificationReporterMock : public SystemObject, public VerificationReporterIF {
|
||||
public:
|
||||
std::queue<VerifSuccessParams> successParams;
|
||||
std::queue<VerifFailureParams> failParams;
|
||||
|
||||
PusVerificationReporterMock();
|
||||
explicit PusVerificationReporterMock(object_id_t registeredId);
|
||||
[[nodiscard]] size_t successCallCount() const;
|
||||
VerifSuccessParams& getNextSuccessCallParams();
|
||||
void popNextSuccessParams();
|
||||
|
@ -161,6 +161,15 @@ TEST_CASE("Pus Service Base", "[pus-service-base]") {
|
||||
REQUIRE(sendHelper.getDefaultDestination() == msgQueue.getDefaultDestination());
|
||||
}
|
||||
|
||||
SECTION("TM Store And Send Helper Initializer") {
|
||||
TmStoreHelper storeHelper(0);
|
||||
TmSendHelper sendHelper;
|
||||
psb.initializeTmHelpers(sendHelper, storeHelper);
|
||||
REQUIRE(sendHelper.getMsgQueue() == &msgQueue);
|
||||
REQUIRE(sendHelper.getDefaultDestination() == msgQueue.getDefaultDestination());
|
||||
REQUIRE(storeHelper.getApid() == apid);
|
||||
}
|
||||
|
||||
SECTION("TM Send Helper Initializer With Error Reporter") {
|
||||
TmSendHelper sendHelper;
|
||||
auto errReporter = InternalErrorReporterMock();
|
||||
@ -195,4 +204,19 @@ TEST_CASE("Pus Service Base", "[pus-service-base]") {
|
||||
auto& p = psb2.getParams();
|
||||
REQUIRE(p.tmReceiver == &packetDest);
|
||||
}
|
||||
|
||||
SECTION("Auto Initialize Verification Reporter") {
|
||||
psbParams.verifReporter = nullptr;
|
||||
psbParams.objectId = 1;
|
||||
object_id_t reporterId = objects::TC_VERIFICATOR;
|
||||
PusVerificationReporterMock otherReporter(reporterId);
|
||||
auto psb2 = PsbMock(psbParams);
|
||||
REQUIRE(psb2.initialize() == retval::OK);
|
||||
auto& p = psb2.getParams();
|
||||
REQUIRE(p.verifReporter == &otherReporter);
|
||||
}
|
||||
|
||||
SECTION("Auto Initialize TC Pool") {}
|
||||
|
||||
SECTION("Invalid Verification Reporter") {}
|
||||
}
|
||||
|
Reference in New Issue
Block a user