This commit is contained in:
2023-01-26 13:40:44 +01:00
parent 941bf61f28
commit e37af4fe70
32 changed files with 94 additions and 104 deletions

View File

@ -20,8 +20,9 @@
class FilesystemMock : public HasFileSystemIF {
public:
struct FileWriteInfo {
FileWriteInfo(std::basic_string<std::filesystem::path::value_type> filename, size_t offset, const uint8_t *data, size_t len)
: offset(offset) {
FileWriteInfo(std::basic_string<std::filesystem::path::value_type> filename, size_t offset,
const uint8_t *data, size_t len)
: offset(offset) {
this->filename = filename;
this->data.insert(this->data.end(), data, data + len);
}
@ -47,8 +48,8 @@ class FilesystemMock : public HasFileSystemIF {
std::map<std::basic_string<std::filesystem::path::value_type>, DirInfo> dirMap;
struct RenameInfo {
RenameInfo(std::basic_string < std::filesystem::path::value_type> oldName,
std::basic_string < std::filesystem::path::value_type> newName)
RenameInfo(std::basic_string<std::filesystem::path::value_type> oldName,
std::basic_string<std::filesystem::path::value_type> newName)
: oldName(std::move(oldName)), newName(std::move(newName)) {}
std::basic_string<std::filesystem::path::value_type> oldName;
@ -56,8 +57,7 @@ class FilesystemMock : public HasFileSystemIF {
};
std::queue<RenameInfo> renameQueue;
std::basic_string<std::filesystem::path::value_type> truncateCalledOnFile;
ReturnValue_t feedFile(const std::string &filename,
std::ifstream &file);
ReturnValue_t feedFile(const std::string &filename, std::ifstream &file);
bool fileExists(FilesystemParams params) override;
ReturnValue_t truncateFile(FilesystemParams params) override;