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 "...".
| 5994 | // max_length characters, only prints the first max_length characters |
| 5995 | // and "...". |
| 5996 | static void PrintOnOneLine(const char* str, int max_length) { |
| 5997 | if (str != NULL) { |
| 5998 | for (int i = 0; *str != '\0'; ++str) { |
| 5999 | if (i >= max_length) { |
| 6000 | printf("..."); |
| 6001 | break; |
| 6002 | } |
| 6003 | if (*str == '\n') { |
| 6004 | printf("\\n"); |
| 6005 | i += 2; |
| 6006 | } else { |
| 6007 | printf("%c", *str); |
| 6008 | ++i; |
| 6009 | } |
| 6010 | } |
| 6011 | } |
| 6012 | } |
| 6013 | |
| 6014 | // Prints the names of the tests matching the user-specified filter flag. |
| 6015 | void UnitTestImpl::ListTestsMatchingFilter() { |
no outgoing calls
no test coverage detected