fsfw/unittests/mocks/PusVerificationReporterMock.cpp

43 lines
1.2 KiB
C++
Raw Permalink 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);
2022-08-16 01:08:26 +02:00
return returnvalue::OK;
}
ReturnValue_t PusVerificationReporterMock::sendFailureReport(VerifFailureParams params) {
failParams.push(params);
2022-08-16 01:08:26 +02:00
return returnvalue::OK;
}