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 "...".
| 6385 | // max_length characters, only prints the first max_length characters |
| 6386 | // and "...". |
| 6387 | static 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. |
| 6406 | void UnitTestImpl::ListTestsMatchingFilter() { |
no outgoing calls
no test coverage detected