MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / OpenFileForWriting

Function OpenFileForWriting

source/test/gtest/src/gtest.cc:200–212  ·  view source on GitHub ↗

Utility function to Open File for Writing

Source from the content-addressed store, hash-verified

198#if GTEST_HAS_FILE_SYSTEM
199// Utility function to Open File for Writing
200static FILE* OpenFileForWriting(const std::string& output_file) {
201 FILE* fileout = nullptr;
202 FilePath output_file_path(output_file);
203 FilePath output_dir(output_file_path.RemoveFileName());
204
205 if (output_dir.CreateDirectoriesRecursively()) {
206 fileout = posix::FOpen(output_file.c_str(), "w");
207 }
208 if (fileout == nullptr) {
209 GTEST_LOG_(FATAL) << "Unable to open file \"" << output_file << "\"";
210 }
211 return fileout;
212}
213#endif // GTEST_HAS_FILE_SYSTEM
214
215} // namespace internal

Callers 2

OnTestIterationEndMethod · 0.85

Calls 4

FOpenFunction · 0.85
RemoveFileNameMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected