MCPcopy Create free account
hub / github.com/apache/singa / GetCapturedString

Method GetCapturedString

test/gtest/gtest-all.cc:8778–8791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8776 }
8777
8778 std::string GetCapturedString() {
8779 if (uncaptured_fd_ != -1) {
8780 // Restores the original stream.
8781 fflush(NULL);
8782 dup2(uncaptured_fd_, fd_);
8783 close(uncaptured_fd_);
8784 uncaptured_fd_ = -1;
8785 }
8786
8787 FILE* const file = posix::FOpen(filename_.c_str(), "r");
8788 const std::string content = ReadEntireFile(file);
8789 posix::FClose(file);
8790 return content;
8791 }
8792
8793 private:
8794 // Reads the entire content of a file as an std::string.

Callers 1

GetCapturedStreamFunction · 0.80

Calls 2

FOpenFunction · 0.85
FCloseFunction · 0.85

Tested by

no test coverage detected