windows compiles, some unittests give exceptions
This commit is contained in:
@ -20,11 +20,12 @@
|
||||
class FilesystemMock : public HasFileSystemIF {
|
||||
public:
|
||||
struct FileWriteInfo {
|
||||
FileWriteInfo(std::string filename, size_t offset, const uint8_t *data, size_t len)
|
||||
: filename(std::move(filename)), 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);
|
||||
}
|
||||
std::string filename;
|
||||
std::basic_string<std::filesystem::path::value_type> filename;
|
||||
size_t offset;
|
||||
std::vector<uint8_t> data;
|
||||
};
|
||||
@ -35,7 +36,7 @@ class FilesystemMock : public HasFileSystemIF {
|
||||
std::vector<uint8_t> fileRaw;
|
||||
};
|
||||
|
||||
std::map<std::string, FileInfo> fileMap;
|
||||
std::map<std::basic_string<std::filesystem::path::value_type>, FileInfo> fileMap;
|
||||
|
||||
struct DirInfo {
|
||||
size_t createCallCount = 0;
|
||||
@ -43,18 +44,20 @@ class FilesystemMock : public HasFileSystemIF {
|
||||
std::queue<bool> wihParentDir;
|
||||
std::queue<bool> recursiveDeletion;
|
||||
};
|
||||
std::map<std::string, DirInfo> dirMap;
|
||||
std::map<std::basic_string<std::filesystem::path::value_type>, DirInfo> dirMap;
|
||||
|
||||
struct RenameInfo {
|
||||
RenameInfo(std::string oldName, std::string 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::string oldName;
|
||||
std::string newName;
|
||||
std::basic_string<std::filesystem::path::value_type> oldName;
|
||||
std::basic_string<std::filesystem::path::value_type> newName;
|
||||
};
|
||||
std::queue<RenameInfo> renameQueue;
|
||||
std::string truncateCalledOnFile;
|
||||
ReturnValue_t feedFile(const std::string &filename, std::ifstream &file);
|
||||
std::basic_string<std::filesystem::path::value_type> truncateCalledOnFile;
|
||||
ReturnValue_t feedFile(const std::string &filename,
|
||||
std::ifstream &file);
|
||||
|
||||
bool fileExists(FilesystemParams params) override;
|
||||
ReturnValue_t truncateFile(FilesystemParams params) override;
|
||||
@ -63,10 +66,13 @@ 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 std::filesystem::path::value_type *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 std::filesystem::path::value_type *oldPath,
|
||||
const std::filesystem::path::value_type *newPath,
|
||||
FileSystemArgsIF *args) override;
|
||||
|
||||
void reset();
|
||||
|
||||
|
Reference in New Issue
Block a user