Lines Matching refs:FILE
234 // TODO(wan@google.com): fix the source file location in the
427 const char kUnknownFile[] = "unknown file";
429 // Formats a source file path and a line number as they would appear
431 GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) {
432 const char* const file_name = file == NULL ? kUnknownFile : file;
444 // Formats a file location for compiler-independent XML output.
448 // to the file location it produces, unlike FormatFileLocation().
450 const char* file, int line) {
451 const char* const file_name = file == NULL ? kUnknownFile : file;
460 GTestLog::GTestLog(GTestLogSeverity severity, const char* file, int line)
467 file, line).c_str() << ": ";
490 // The ctor redirects the stream to a temporary file.
500 0, // Generate unique file name.
503 << "Unable to create a temporary file in " << temp_dir_path;
505 GTEST_CHECK_(captured_fd != -1) << "Unable to open temporary file "
516 // current directory, so we create the temporary file in the /tmp
540 FILE* const file = posix::FOpen(filename_.c_str(), "r");
541 const String content = ReadEntireFile(file);
542 posix::FClose(file);
547 // Reads the entire content of a file as a String.
548 static String ReadEntireFile(FILE* file);
550 // Returns the size (in bytes) of a file.
551 static size_t GetFileSize(FILE* file);
555 // Name of the temporary file holding the stderr output.
561 // Returns the size (in bytes) of a file.
562 size_t CapturedStream::GetFileSize(FILE* file) {
563 fseek(file, 0, SEEK_END);
564 return static_cast<size_t>(ftell(file));
567 // Reads the entire content of a file as a string.
568 String CapturedStream::ReadEntireFile(FILE* file) {
569 const size_t file_size = GetFileSize(file);
575 fseek(file, 0, SEEK_SET);
577 // Keeps reading the file until we cannot read further or the
578 // pre-determined file size is reached.
580 bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file);