device fdir mock

This commit is contained in:
Jakob Meier 2022-06-05 12:54:13 +02:00
parent bf673c56c6
commit 2fa4fd61d0
3 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,8 @@
target_sources(${FSFW_TEST_TGT} PRIVATE
CookieIFMock.cpp
ComIFMock.cpp
DeviceHandlerCommander.cpp
DeviceHandlerMock.cpp
DeviceFdirMock.cpp
TestDeviceHandlerBase.cpp
)

View File

@ -0,0 +1,18 @@
#include "DeviceFdirMock.h"
#include <tests/src/fsfw_tests/unit/devicehandler/DeviceFdirMock.h>
DeviceFdirMock::DeviceFdirMock(object_id_t owner, object_id_t parent)
: DeviceHandlerFailureIsolation(owner, parent) {}
DeviceFdirMock::~DeviceFdirMock() {}
uint32_t DeviceFdirMock::getMissedReplyCount() {
ParameterWrapper parameterWrapper;
this->getParameter(MISSED_REPLY_DOMAIN_ID,
static_cast<uint8_t>(FaultCounter::ParameterIds::FAULT_COUNT),
&parameterWrapper, nullptr, 0);
uint32_t missedReplyCount = 0;
parameterWrapper.getElement(&missedReplyCount);
return missedReplyCount;
}

View File

@ -0,0 +1,18 @@
#ifndef TESTS_SRC_FSFW_TESTS_UNIT_DEVICEHANDLER_DEVICEFDIRMOCK_H_
#define TESTS_SRC_FSFW_TESTS_UNIT_DEVICEHANDLER_DEVICEFDIRMOCK_H_
#include "fsfw/devicehandlers/DeviceHandlerFailureIsolation.h"
class DeviceFdirMock : public DeviceHandlerFailureIsolation {
public:
DeviceFdirMock(object_id_t owner, object_id_t parent);
virtual ~DeviceFdirMock();
uint32_t getMissedReplyCount();
private:
static const uint8_t STRANGE_REPLY_DOMAIN_ID = 0xF0;
static const uint8_t MISSED_REPLY_DOMAIN_ID = 0xF1;
};
#endif /* TESTS_SRC_FSFW_TESTS_UNIT_DEVICEHANDLER_DEVICEFDIRMOCK_H_ */