MCPcopy Create free account
hub / github.com/OpenCppCoverage/OpenCppCoverage / CreateFile

Function CreateFile

ToolsTest/MappedFileTest.cpp:28–36  ·  view source on GitHub ↗

---------------------------------------------------------------------

Source from the content-addressed store, hash-verified

26 {
27 //---------------------------------------------------------------------
28 std::unique_ptr<TestHelper::TemporaryPath> CreateFile(const std::vector<std::string>& lines)
29 {
30 auto path = std::make_unique<TestHelper::TemporaryPath>();
31 std::ofstream ofs(path->GetPath().string(), std::ios::binary);
32
33 for (const auto& line : lines)
34 ofs.write(line.c_str(), line.size());
35 return path;
36 }
37
38 //---------------------------------------------------------------------
39 std::vector<std::string> GetLines(const std::filesystem::path& path)

Callers 2

TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected