Prints a segment of bytes in the given object.
| 11161 | |
| 11162 | // Prints a segment of bytes in the given object. |
| 11163 | GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ |
| 11164 | GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ |
| 11165 | GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_ |
| 11166 | GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ |
| 11167 | void PrintByteSegmentInObjectTo(const unsigned char* obj_bytes, size_t start, |
| 11168 | size_t count, ostream* os) { |
| 11169 | char text[5] = ""; |
| 11170 | for (size_t i = 0; i != count; i++) { |
| 11171 | const size_t j = start + i; |
| 11172 | if (i != 0) { |
| 11173 | // Organizes the bytes into groups of 2 for easy parsing by |
| 11174 | // human. |
| 11175 | if ((j % 2) == 0) |
| 11176 | *os << ' '; |
| 11177 | else |
| 11178 | *os << '-'; |
| 11179 | } |
| 11180 | GTEST_SNPRINTF_(text, sizeof(text), "%02X", obj_bytes[j]); |
| 11181 | *os << text; |
| 11182 | } |
| 11183 | } |
| 11184 | |
| 11185 | // Prints the bytes in the given value to the given ostream. |
| 11186 | void PrintBytesInObjectToImpl(const unsigned char* obj_bytes, size_t count, |
no outgoing calls
no test coverage detected