From 85d24152f81bfcd463356330f1cc6257f485535f Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 18 Jul 2017 15:09:18 +0200 Subject: Report (un)signed char values numerically ...instead of as characters, as those values often represent numerical values (e.g., sal_uInt8 aka unsigned char in LibreOffice), and often even have values outside the printing ASCII range Change-Id: I72727e98f5af616f6b0c03c57fc1119c0c11c1fc Reviewed-on: https://gerrit.libreoffice.org/40138 Reviewed-by: David Tardon Tested-by: David Tardon --- include/cppunit/tools/StringHelper.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/cppunit') diff --git a/include/cppunit/tools/StringHelper.h b/include/cppunit/tools/StringHelper.h index 3301045..3b7a38e 100644 --- a/include/cppunit/tools/StringHelper.h +++ b/include/cppunit/tools/StringHelper.h @@ -36,6 +36,16 @@ typename std::enable_if::value, std::string>::type toString(cons return ost.str(); } +template<> inline std::string toString(const signed char& x) +{ + return toString(static_cast(x)); +} + +template<> inline std::string toString(const unsigned char& x) +{ + return toString(static_cast(x)); +} + } -- cgit v1.2.1