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

Function PrintOnOneLine

test/common/gtest/gtest.cpp:6387–6403  ·  view source on GitHub ↗

Prints the given C-string on a single line by replacing all '\n' characters with string "\\n". If the output takes more than max_length characters, only prints the first max_length characters and "...".

Source from the content-addressed store, hash-verified

6385// max_length characters, only prints the first max_length characters
6386// and "...".
6387static void PrintOnOneLine(const char* str, int max_length) {
6388 if (str != NULL) {
6389 for (int i = 0; *str != '\0'; ++str) {
6390 if (i >= max_length) {
6391 printf("...");
6392 break;
6393 }
6394 if (*str == '\n') {
6395 printf("\\n");
6396 i += 2;
6397 } else {
6398 printf("%c", *str);
6399 ++i;
6400 }
6401 }
6402 }
6403}
6404
6405// Prints the names of the tests matching the user-specified filter flag.
6406void UnitTestImpl::ListTestsMatchingFilter() {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected