add FS mock and improve HasFilesystemIF
This commit is contained in:
@ -2,12 +2,13 @@
|
||||
|
||||
#include "fsfw/cfdp.h"
|
||||
#include "mocks/cfdp/FaultHandlerMock.h"
|
||||
|
||||
#include "mocks/cfdp/UserMock.h"
|
||||
TEST_CASE("CFDP Dest Handler", "[cfdp]") {
|
||||
using namespace cfdp;
|
||||
EntityId localId = EntityId(UnsignedByteField<uint16_t>(2));
|
||||
auto fhMock = FaultHandlerMock();
|
||||
auto localEntityCfg = LocalEntityCfg(localId, IndicationCfg(), fhMock);
|
||||
// auto userMock = UserMock();
|
||||
|
||||
SECTION("State") {}
|
||||
}
|
@ -14,6 +14,7 @@ target_sources(
|
||||
PusDistributorMock.cpp
|
||||
CcsdsCheckerMock.cpp
|
||||
AcceptsTcMock.cpp
|
||||
StorageManagerMock.cpp)
|
||||
StorageManagerMock.cpp
|
||||
FilesystemMock.cpp)
|
||||
|
||||
add_subdirectory(cfdp)
|
||||
|
22
unittests/mocks/FilesystemMock.cpp
Normal file
22
unittests/mocks/FilesystemMock.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
#include "FilesystemMock.h"
|
||||
|
||||
ReturnValue_t FilesystemMock::writeToFile(FileOpParams params, const uint8_t *data) { return 0; }
|
||||
ReturnValue_t FilesystemMock::readFromFile(FileOpParams fileOpInfo, uint8_t **buffer,
|
||||
size_t &readSize, size_t maxSize) {
|
||||
return 0;
|
||||
}
|
||||
ReturnValue_t FilesystemMock::createFile(FilesystemParams params, const uint8_t *data,
|
||||
size_t size) {
|
||||
return 0;
|
||||
}
|
||||
ReturnValue_t FilesystemMock::removeFile(const char *path, FileSystemArgsIF *args) { return 0; }
|
||||
ReturnValue_t FilesystemMock::createDirectory(FilesystemParams params, bool createParentDirs) {
|
||||
return 0;
|
||||
}
|
||||
ReturnValue_t FilesystemMock::removeDirectory(FilesystemParams params, bool deleteRecurively) {
|
||||
return 0;
|
||||
}
|
||||
ReturnValue_t FilesystemMock::renameFile(const char *oldPath, char *newPath,
|
||||
FileSystemArgsIF *args) {
|
||||
return 0;
|
||||
}
|
19
unittests/mocks/FilesystemMock.h
Normal file
19
unittests/mocks/FilesystemMock.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef FSFW_MOCKS_FILESYSTEMMOCK_H
|
||||
#define FSFW_MOCKS_FILESYSTEMMOCK_H
|
||||
|
||||
#include "fsfw/filesystem.h"
|
||||
|
||||
class FilesystemMock : public HasFileSystemIF {
|
||||
public:
|
||||
MessageQueueId_t getCommandQueue() const override;
|
||||
ReturnValue_t writeToFile(FileOpParams params, const uint8_t *data) override;
|
||||
ReturnValue_t readFromFile(FileOpParams fileOpInfo, uint8_t **buffer, size_t &readSize,
|
||||
size_t maxSize) override;
|
||||
ReturnValue_t createFile(FilesystemParams params, const uint8_t *data, size_t size) override;
|
||||
ReturnValue_t removeFile(const char *path, FileSystemArgsIF *args) override;
|
||||
ReturnValue_t createDirectory(FilesystemParams params, bool createParentDirs) override;
|
||||
ReturnValue_t removeDirectory(FilesystemParams params, bool deleteRecurively) override;
|
||||
ReturnValue_t renameFile(const char *oldPath, char *newPath, FileSystemArgsIF *args) override;
|
||||
};
|
||||
|
||||
#endif // FSFW_MOCKS_FILESYSTEMMOCK_H
|
Reference in New Issue
Block a user