Home | History | Annotate | Download | only in googletest

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 "
510 // current directory, so we create the temporary file in the /tmp
534 FILE* const file = posix::FOpen(filename_.c_str(), "r");
535 const String content = ReadEntireFile(file);
536 posix::FClose(file);
541 // Reads the entire content of a file as a String.
542 static String ReadEntireFile(FILE* file);
544 // Returns the size (in bytes) of a file.
545 static size_t GetFileSize(FILE* file);
549 // Name of the temporary file holding the stderr output.
555 // Returns the size (in bytes) of a file.
556 size_t CapturedStream::GetFileSize(FILE* file) {
557 fseek(file, 0, SEEK_END);
558 return static_cast<size_t>(ftell(file));
561 // Reads the entire content of a file as a string.
562 String CapturedStream::ReadEntireFile(FILE* file) {
563 const size_t file_size = GetFileSize(file);
569 fseek(file, 0, SEEK_SET);
571 // Keeps reading the file until we cannot read further or the
572 // pre-determined file size is reached.
574 bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file);