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 "...".
| 6972 | // max_length characters, only prints the first max_length characters |
| 6973 | // and "...". |
| 6974 | static void PrintOnOneLine(const char* str, int max_length) { |
| 6975 | if (str != nullptr) { |
| 6976 | for (int i = 0; *str != '\0'; ++str) { |
| 6977 | if (i >= max_length) { |
| 6978 | printf("..."); |
| 6979 | break; |
| 6980 | } |
| 6981 | if (*str == '\n') { |
| 6982 | printf("\\n"); |
| 6983 | i += 2; |
| 6984 | } else { |
| 6985 | printf("%c", *str); |
| 6986 | ++i; |
| 6987 | } |
| 6988 | } |
| 6989 | } |
| 6990 | } |
| 6991 | |
| 6992 | // Prints the names of the tests matching the user-specified filter flag. |
| 6993 | void UnitTestImpl::ListTestsMatchingFilter() { |
no outgoing calls
no test coverage detected