MCPcopy Create free account
hub / github.com/diasurgical/devilution / WriteDummyFile

Function WriteDummyFile

SourceT/file_util_test.cpp:11–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9namespace {
10
11void WriteDummyFile(const char *name, std::uintmax_t size)
12{
13 std::ofstream test_file(name, std::ios::out | std::ios::trunc | std::ios::binary);
14 ASSERT_FALSE(test_file.fail());
15 const char c = '\0';
16 for (std::uintmax_t i = 0; i < size; ++i) {
17 test_file.write(&c, 1);
18 ASSERT_FALSE(test_file.fail());
19 }
20}
21
22std::string GetTmpPathName(const char *suffix = ".tmp")
23{

Callers 1

TESTFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected