16 #ifndef CPU_FEATURES_TEST_FILESYSTEM_FOR_TESTING_H_
17 #define CPU_FEATURES_TEST_FILESYSTEM_FOR_TESTING_H_
21 #include <unordered_map>
29 explicit FakeFile(
int file_descriptor,
const char* content);
34 int Read(
int fd,
void* buf,
size_t count);
39 const int file_descriptor_;
40 const std::string content_;
42 size_t head_index_ = 0;
53 int next_file_descriptor_ = 0;
54 std::unordered_map<std::string, std::unique_ptr<FakeFile>> files_;
Definition: filesystem_for_testing.h:27
~FakeFile()
Definition: filesystem_for_testing.cc:28
int Read(int fd, void *buf, size_t count)
Definition: filesystem_for_testing.cc:40
int GetFileDescriptor() const
Definition: filesystem_for_testing.h:36
FakeFile(int file_descriptor, const char *content)
Definition: filesystem_for_testing.cc:25
void Close()
Definition: filesystem_for_testing.cc:35
void Open()
Definition: filesystem_for_testing.cc:30
Definition: filesystem_for_testing.h:45
void Reset()
Definition: filesystem_for_testing.cc:51
FakeFile * FindFileOrDie(const int file_descriptor) const
Definition: filesystem_for_testing.cc:66
FakeFile * FindFileOrNull(const std::string &filename) const
Definition: filesystem_for_testing.cc:61
FakeFile * CreateFile(const std::string &filename, const char *content)
Definition: filesystem_for_testing.cc:53
Definition: bit_utils_test.cc:19
FakeFilesystem & GetEmptyFilesystem()
Definition: filesystem_for_testing.cc:79
string filename
Definition: plot_best_vs_generic.py:31