MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / PrintByteSegmentInObjectTo

Function PrintByteSegmentInObjectTo

tests/gtest/gtest-all.cc:11163–11183  ·  view source on GitHub ↗

Prints a segment of bytes in the given object.

Source from the content-addressed store, hash-verified

11161
11162// Prints a segment of bytes in the given object.
11163GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
11164GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
11165GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
11166GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
11167void 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.
11186void PrintBytesInObjectToImpl(const unsigned char* obj_bytes, size_t count,

Callers 1

PrintBytesInObjectToImplFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected