tesseract v5.3.3.20231005
testing::internal::ScopedPrematureExitFile Class Reference

Public Member Functions

 ScopedPrematureExitFile (const char *premature_exit_filepath)
 
 ~ScopedPrematureExitFile ()
 

Detailed Description

Definition at line 5005 of file gtest.cc.

Constructor & Destructor Documentation

◆ ScopedPrematureExitFile()

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

Definition at line 5007 of file gtest.cc.

5008 : premature_exit_filepath_(premature_exit_filepath ?
5009 premature_exit_filepath : "") {
5010 // If a path to the premature-exit file is specified...
5011 if (!premature_exit_filepath_.empty()) {
5012 // create the file with a single "0" character in it. I/O
5013 // errors are ignored as there's nothing better we can do and we
5014 // don't want to fail the test because of this.
5015 FILE* pfile = posix::FOpen(premature_exit_filepath, "w");
5016 fwrite("0", 1, 1, pfile);
5017 fclose(pfile);
5018 }
5019 }
FILE * FOpen(const char *path, const char *mode)
Definition: gtest-port.h:2075

◆ ~ScopedPrematureExitFile()

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

Definition at line 5021 of file gtest.cc.

5021 {
5022#if !defined GTEST_OS_ESP8266
5023 if (!premature_exit_filepath_.empty()) {
5024 int retval = remove(premature_exit_filepath_.c_str());
5025 if (retval) {
5026 GTEST_LOG_(ERROR) << "Failed to remove premature exit filepath \""
5027 << premature_exit_filepath_ << "\" with error "
5028 << retval;
5029 }
5030 }
5031#endif
5032 }
@ ERROR
Definition: log.h:28
#define GTEST_LOG_(severity)
Definition: gtest-port.h:984

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