include/cppunit/tools/StringHelper.h | 10 ++++++++++ 1 file changed, 10 insertions(+)
New commits: commit 85d24152f81bfcd463356330f1cc6257f485535f Author: Stephan Bergmann <[email protected]> Date: Tue Jul 18 15:09:18 2017 +0200 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 <[email protected]> Tested-by: David Tardon <[email protected]> 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<std::is_enum<T>::value, std::string>::type toString(cons return ost.str(); } +template<> inline std::string toString(const signed char& x) +{ + return toString(static_cast<int>(x)); +} + +template<> inline std::string toString(const unsigned char& x) +{ + return toString(static_cast<unsigned int>(x)); +} + } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
