Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
testing::internal::ScopedPrematureExitFile Class Reference

Public Member Functions

 ScopedPrematureExitFile (const char *premature_exit_filepath)
 
 ~ScopedPrematureExitFile ()
 

Detailed Description

Definition at line 4255 of file gtest.cc.

Constructor & Destructor Documentation

◆ ScopedPrematureExitFile()

testing::internal::ScopedPrematureExitFile::ScopedPrematureExitFile ( const char * premature_exit_filepath)
inlineexplicit

Definition at line 4257 of file gtest.cc.

4258 : premature_exit_filepath_(premature_exit_filepath ?
4259 premature_exit_filepath : "") {
4260 // If a path to the premature-exit file is specified...
4261 if (!premature_exit_filepath_.empty()) {
4262 // create the file with a single "0" character in it. I/O
4263 // errors are ignored as there's nothing better we can do and we
4264 // don't want to fail the test because of this.
4265 FILE* pfile = posix::FOpen(premature_exit_filepath, "w");
4266 fwrite("0", 1, 1, pfile);
4267 fclose(pfile);
4268 }
4269 }
FILE * FOpen(const char *path, const char *mode)

◆ ~ScopedPrematureExitFile()

testing::internal::ScopedPrematureExitFile::~ScopedPrematureExitFile ( )
inline

Definition at line 4271 of file gtest.cc.

4271 {
4272 if (!premature_exit_filepath_.empty()) {
4273 int retval = remove(premature_exit_filepath_.c_str());
4274 if (retval) {
4275 GTEST_LOG_(ERROR) << "Failed to remove premature exit filepath \""
4276 << premature_exit_filepath_ << "\" with error "
4277 << retval;
4278 }
4279 }
4280 }
#define GTEST_LOG_(severity)
return retval
Definition CLI11.hpp:1754
bool remove(const path &p)

The documentation for this class was generated from the following file: