MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / GetCapturedString

Method GetCapturedString

test/common/gtest/gtest.cpp:9606–9619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9604 }
9605
9606 std::string GetCapturedString() {
9607 if (uncaptured_fd_ != -1) {
9608 // Restores the original stream.
9609 fflush(NULL);
9610 dup2(uncaptured_fd_, fd_);
9611 close(uncaptured_fd_);
9612 uncaptured_fd_ = -1;
9613 }
9614
9615 FILE* const file = posix::FOpen(filename_.c_str(), "r");
9616 const std::string content = ReadEntireFile(file);
9617 posix::FClose(file);
9618 return content;
9619 }
9620
9621 private:
9622 // 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