added some more basic tests
This commit is contained in:
@ -1,6 +1,15 @@
|
||||
#include "RemoteConfigTableMock.h"
|
||||
|
||||
bool cfdp::RemoteConfigTableMock::getRemoteCfg(cfdp::EntityId remoteId,
|
||||
cfdp::RemoteEntityCfg *cfg) {
|
||||
return false;
|
||||
void cfdp::RemoteConfigTableMock::addRemoteConfig(const cfdp::RemoteEntityCfg& cfg) {
|
||||
remoteCfgTable.emplace(cfg.remoteId, cfg);
|
||||
}
|
||||
|
||||
bool cfdp::RemoteConfigTableMock::getRemoteCfg(const cfdp::EntityId& remoteId,
|
||||
cfdp::RemoteEntityCfg** cfg) {
|
||||
auto iter = remoteCfgTable.find(remoteId);
|
||||
if (iter == remoteCfgTable.end()) {
|
||||
return false;
|
||||
}
|
||||
*cfg = &iter->second;
|
||||
return true;
|
||||
}
|
||||
|
@ -1,13 +1,18 @@
|
||||
#ifndef FSFW_TESTS_CFDP_REMOTCONFIGTABLEMOCK_H
|
||||
#define FSFW_TESTS_CFDP_REMOTCONFIGTABLEMOCK_H
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "fsfw/cfdp/handler/RemoteConfigTableIF.h"
|
||||
|
||||
namespace cfdp {
|
||||
|
||||
class RemoteConfigTableMock : public RemoteConfigTableIF {
|
||||
public:
|
||||
bool getRemoteCfg(EntityId remoteId, RemoteEntityCfg *cfg) override;
|
||||
void addRemoteConfig(const RemoteEntityCfg& cfg);
|
||||
bool getRemoteCfg(const cfdp::EntityId& remoteId, cfdp::RemoteEntityCfg** cfg) override;
|
||||
|
||||
std::map<EntityId, RemoteEntityCfg> remoteCfgTable;
|
||||
};
|
||||
|
||||
} // namespace cfdp
|
||||
|
@ -5,9 +5,9 @@
|
||||
namespace cfdp {
|
||||
|
||||
class UserMock : public UserBase {
|
||||
public:
|
||||
explicit UserMock(HasFileSystemIF& vfs);
|
||||
|
||||
public:
|
||||
void transactionIndication(TransactionId id) override;
|
||||
void eofSentIndication(TransactionId id) override;
|
||||
void abandonedIndication(TransactionId id, ConditionCode code, size_t progress) override;
|
||||
|
Reference in New Issue
Block a user