Prints a segment of bytes in the given object.
| 9070 | |
| 9071 | // Prints a segment of bytes in the given object. |
| 9072 | void PrintByteSegmentInObjectTo(const unsigned char* obj_bytes, size_t start, |
| 9073 | size_t count, ostream* os) { |
| 9074 | char text[5] = ""; |
| 9075 | for (size_t i = 0; i != count; i++) { |
| 9076 | const size_t j = start + i; |
| 9077 | if (i != 0) { |
| 9078 | // Organizes the bytes into groups of 2 for easy parsing by |
| 9079 | // human. |
| 9080 | if ((j % 2) == 0) |
| 9081 | *os << ' '; |
| 9082 | else |
| 9083 | *os << '-'; |
| 9084 | } |
| 9085 | GTEST_SNPRINTF_(text, sizeof(text), "%02X", obj_bytes[j]); |
| 9086 | *os << text; |
| 9087 | } |
| 9088 | } |
| 9089 | |
| 9090 | // Prints the bytes in the given value to the given ostream. |
| 9091 | void PrintBytesInObjectToImpl(const unsigned char* obj_bytes, size_t count, |
no outgoing calls
no test coverage detected