| 27 | { |
| 28 | |
| 29 | void write_to_file(const std::string &filename, const std::string &content) |
| 30 | { |
| 31 | std::ofstream fs(filename, std::ofstream::binary); |
| 32 | if (fs.fail()) |
| 33 | throw std::runtime_error("Cannot open file \"" + filename + "\".\n"); |
| 34 | if (fs.write(content.c_str(), content.size()).fail()) |
| 35 | throw std::runtime_error("Failed to write data to file \"" + filename + "\".\n"); |
| 36 | } |
| 37 | |
| 38 | class EqualizePatternReadTest : public ::testing::Test |
| 39 | { |