1
0
forked from fsfw/fsfw

clang -Weverything -Wno-gnu-anonymous-struct

This commit is contained in:
2023-01-26 23:22:13 +01:00
parent 9589d702dd
commit bc312243df
39 changed files with 97 additions and 86 deletions

View File

@ -1,12 +1,12 @@
#ifndef FSFW_MOCKS_FILESYSTEMMOCK_H
#define FSFW_MOCKS_FILESYSTEMMOCK_H
#include <filesystem>
#include <fstream>
#include <map>
#include <queue>
#include <string>
#include <utility>
#include <filesystem>
#include "fsfw/filesystem.h"
@ -21,8 +21,8 @@
class FilesystemMock : public HasFileSystemIF {
public:
struct FileWriteInfo {
FileWriteInfo(std::filesystem::path::string_type filename, size_t offset,
const uint8_t *data, size_t len)
FileWriteInfo(std::filesystem::path::string_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);
@ -49,14 +49,14 @@ class FilesystemMock : public HasFileSystemIF {
std::map<std::filesystem::path::string_type, DirInfo> dirMap;
struct RenameInfo {
RenameInfo(const char* oldName, const char *newName)
RenameInfo(const char *oldName, const char *newName)
: oldName(std::move(oldName)), newName(std::move(newName)) {}
const char *oldName;
const char *newName;
};
std::queue<RenameInfo> renameQueue;
const char* truncateCalledOnFile;
const char *truncateCalledOnFile;
ReturnValue_t feedFile(const std::string &filename, std::ifstream &file);
bool fileExists(FilesystemParams params) override;
@ -66,13 +66,10 @@ class FilesystemMock : public HasFileSystemIF {
ReturnValue_t readFromFile(FileOpParams params, 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 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 rename(const char *oldPath,
const char *newPath,
FileSystemArgsIF *args) override;
ReturnValue_t rename(const char *oldPath, const char *newPath, FileSystemArgsIF *args) override;
void reset();