fsfw/unittests/mocks/PusVerificationReporterMock.cpp

43 lines
1.3 KiB
C++
Raw Normal View History

2022-07-26 14:10:24 +02:00
#include "PusVerificationReporterMock.h"
2022-07-26 18:58:36 +02:00
#include "fsfw/objectmanager/frameworkObjects.h"
PusVerificationReporterMock::PusVerificationReporterMock()
: SystemObject(objects::NO_OBJECT, false) {}
PusVerificationReporterMock::PusVerificationReporterMock(object_id_t registeredId)
: SystemObject(registeredId) {}
2022-07-26 14:10:24 +02:00
size_t PusVerificationReporterMock::successCallCount() const { return successParams.size(); }
size_t PusVerificationReporterMock::failCallCount() const { return failParams.size(); }
VerifSuccessParams& PusVerificationReporterMock::getNextSuccessCallParams() {
return successParams.front();
}
void PusVerificationReporterMock::popNextFailParams() {
if (not failParams.empty()) {
failParams.pop();
}
}
VerifFailureParams& PusVerificationReporterMock::getNextFailCallParams() {
return failParams.front();
}
2022-07-26 14:10:24 +02:00
void PusVerificationReporterMock::popNextSuccessParams() {
if (not successParams.empty()) {
successParams.pop();
}
}
ReturnValue_t PusVerificationReporterMock::sendSuccessReport(VerifSuccessParams params) {
successParams.push(params);
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t PusVerificationReporterMock::sendFailureReport(VerifFailureParams params) {
failParams.push(params);
return HasReturnvaluesIF::RETURN_OK;
}