MCPcopy Create free account
hub / github.com/Samsung/ONE / write_to_file

Function write_to_file

compiler/fme-apply/src/EqualizePatternRead.test.cpp:29–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27{
28
29void 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
38class EqualizePatternReadTest : public ::testing::Test
39{

Callers 1

TEST_FFunction · 0.85

Calls 4

failMethod · 0.45
writeMethod · 0.45
c_strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected