diff options
Diffstat (limited to 'lib/gtest/src/gtest-printers.cc')
-rw-r--r-- | lib/gtest/src/gtest-printers.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/gtest/src/gtest-printers.cc b/lib/gtest/src/gtest-printers.cc index 898d61d81d..75fa408100 100644 --- a/lib/gtest/src/gtest-printers.cc +++ b/lib/gtest/src/gtest-printers.cc @@ -176,7 +176,7 @@ static CharFormat PrintAsCharLiteralTo(Char c, ostream* os) { *os << static_cast<char>(c); return kAsIs; } else { - *os << String::Format("\\x%X", static_cast<UnsignedChar>(c)); + *os << "\\x" + String::FormatHexInt(static_cast<UnsignedChar>(c)); return kHexEscape; } } @@ -221,7 +221,7 @@ void PrintCharAndCodeTo(Char c, ostream* os) { // obvious). if (c == 0) return; - *os << " (" << String::Format("%d", c).c_str(); + *os << " (" << static_cast<int>(c); // For more convenience, we print c's code again in hexidecimal, // unless c was already printed in the form '\x##' or the code is in @@ -229,8 +229,7 @@ void PrintCharAndCodeTo(Char c, ostream* os) { if (format == kHexEscape || (1 <= c && c <= 9)) { // Do nothing. } else { - *os << String::Format(", 0x%X", - static_cast<UnsignedChar>(c)).c_str(); + *os << ", 0x" << String::FormatHexInt(static_cast<UnsignedChar>(c)); } *os << ")"; } |