device fdir mock
This commit is contained in:
parent
bf673c56c6
commit
2fa4fd61d0
8
tests/src/fsfw_tests/unit/devicehandler/CMakeLists.txt
Normal file
8
tests/src/fsfw_tests/unit/devicehandler/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
target_sources(${FSFW_TEST_TGT} PRIVATE
|
||||||
|
CookieIFMock.cpp
|
||||||
|
ComIFMock.cpp
|
||||||
|
DeviceHandlerCommander.cpp
|
||||||
|
DeviceHandlerMock.cpp
|
||||||
|
DeviceFdirMock.cpp
|
||||||
|
TestDeviceHandlerBase.cpp
|
||||||
|
)
|
18
tests/src/fsfw_tests/unit/devicehandler/DeviceFdirMock.cpp
Normal file
18
tests/src/fsfw_tests/unit/devicehandler/DeviceFdirMock.cpp
Normal 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),
|
||||||
|
¶meterWrapper, nullptr, 0);
|
||||||
|
uint32_t missedReplyCount = 0;
|
||||||
|
parameterWrapper.getElement(&missedReplyCount);
|
||||||
|
return missedReplyCount;
|
||||||
|
}
|
18
tests/src/fsfw_tests/unit/devicehandler/DeviceFdirMock.h
Normal file
18
tests/src/fsfw_tests/unit/devicehandler/DeviceFdirMock.h
Normal 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_ */
|
Loading…
Reference in New Issue
Block a user