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

Function FormatDeathTestOutput

test/gtest/gtest-all.cc:6987–7000  ·  view source on GitHub ↗

Returns an indented copy of stderr output for a death test. This makes distinguishing death test output lines from regular log lines much easier.

Source from the content-addressed store, hash-verified

6985// This makes distinguishing death test output lines from regular log lines
6986// much easier.
6987static ::std::string FormatDeathTestOutput(const ::std::string& output) {
6988 ::std::string ret;
6989 for (size_t at = 0; ; ) {
6990 const size_t line_end = output.find('\n', at);
6991 ret += "[ DEATH ] ";
6992 if (line_end == ::std::string::npos) {
6993 ret += output.substr(at);
6994 break;
6995 }
6996 ret += output.substr(at, line_end + 1 - at);
6997 at = line_end + 1;
6998 }
6999 return ret;
7000}
7001
7002// Assesses the success or failure of a death test, using both private
7003// members which have previously been set, and one argument:

Callers 1

PassedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected