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

Function FormatDeathTestOutput

test/common/gtest/gtest.cpp:7421–7434  ·  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

7419// This makes distinguishing death test output lines from regular log lines
7420// much easier.
7421static ::std::string FormatDeathTestOutput(const ::std::string& output) {
7422 ::std::string ret;
7423 for (size_t at = 0; ; ) {
7424 const size_t line_end = output.find('\n', at);
7425 ret += "[ DEATH ] ";
7426 if (line_end == ::std::string::npos) {
7427 ret += output.substr(at);
7428 break;
7429 }
7430 ret += output.substr(at, line_end + 1 - at);
7431 at = line_end + 1;
7432 }
7433 return ret;
7434}
7435
7436// Assesses the success or failure of a death test, using both private
7437// members which have previously been set, and one argument:

Callers 1

PassedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected