[Libreoffice-commits] cppunit.git: include/cppunit
Stephan Bergmann
sbergman at redhat.com
Thu Jul 20 08:32:55 UTC 2017
include/cppunit/tools/StringHelper.h | 10 ++++++++++
1 file changed, 10 insertions(+)
New commits:
commit 85d24152f81bfcd463356330f1cc6257f485535f
Author: Stephan Bergmann <sbergman at redhat.com>
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 <dtardon at redhat.com>
Tested-by: David Tardon <dtardon at redhat.com>
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));
+}
+
}
More information about the Libreoffice-commits
mailing list