| 8712 | // elements, starting at address 'begin'. |
| 8713 | template <typename T> |
| 8714 | void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) { |
| 8715 | if (len == 0) { |
| 8716 | *os << "{}"; |
| 8717 | } else { |
| 8718 | *os << "{ "; |
| 8719 | const size_t kThreshold = 18; |
| 8720 | const size_t kChunkSize = 8; |
| 8721 | // If the array has more than kThreshold elements, we'll have to |
| 8722 | // omit some details by printing only the first and the last |
| 8723 | // kChunkSize elements. |
| 8724 | if (len <= kThreshold) { |
| 8725 | PrintRawArrayTo(begin, len, os); |
| 8726 | } else { |
| 8727 | PrintRawArrayTo(begin, kChunkSize, os); |
| 8728 | *os << ", ..., "; |
| 8729 | PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); |
| 8730 | } |
| 8731 | *os << " }"; |
| 8732 | } |
| 8733 | } |
| 8734 | // This overload prints a (const) char array compactly. |
| 8735 | GTEST_API_ void UniversalPrintArray( |
| 8736 | const char* begin, size_t len, ::std::ostream* os); |
nothing calls this directly
no test coverage detected