fsfw/unittests/mock/PusServiceBaseMock.h

33 lines
975 B
C
Raw Permalink Normal View History

2022-07-26 13:59:09 +02:00
#ifndef FSFW_TESTS_PUSSERVICEBASEMOCK_H
#define FSFW_TESTS_PUSSERVICEBASEMOCK_H
#include <queue>
#include "fsfw/tmtcservices/PusServiceBase.h"
class PsbMock : public PusServiceBase {
public:
explicit PsbMock(PsbParams params);
2022-07-26 13:59:09 +02:00
unsigned int handleRequestCallCnt = 0;
std::queue<uint8_t> subserviceQueue;
unsigned int performServiceCallCnt = 0;
2022-07-26 18:46:28 +02:00
static void setStaticPusDistributor(object_id_t pusDistributor);
static object_id_t getStaticPusDistributor();
static void setStaticTmDest(object_id_t tmDest);
static object_id_t getStaticTmDest();
PsbParams& getParams();
2022-07-26 13:59:09 +02:00
std::pair<bool, ReturnValue_t> handleReqFailPair;
std::pair<bool, ReturnValue_t> performServiceFailPair;
ReturnValue_t handleRequest(uint8_t subservice) override;
ReturnValue_t performService() override;
void makeNextHandleReqCallFail(ReturnValue_t retval);
bool getAndPopNextSubservice(uint8_t& subservice);
2022-07-26 13:59:09 +02:00
void reset();
};
#endif // FSFW_TESTS_PUSSERVICEBASEMOCK_H