Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2012-06-06 08:06:40 +0100
committerPhil Nash2012-06-06 08:06:40 +0100
commit78372d09d469590b3e57e14d2fa8f41667cbdc77 (patch)
treed56e337a11a23fa9e2b62632bd769e3422a10157 /include
parente463687725b1880c60260a548ca1a3a5fb32d2eb (diff)
downloadcatch3-78372d09d469590b3e57e14d2fa8f41667cbdc77.tar.gz
Added toString overload for chars
(and, by extension, Obj-C's BOOL)
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_tostring.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/internal/catch_tostring.hpp b/include/internal/catch_tostring.hpp
index 551bafbc..9b4cf9b3 100644
--- a/include/internal/catch_tostring.hpp
+++ b/include/internal/catch_tostring.hpp
@@ -115,6 +115,16 @@ inline std::string toString( bool value ) {
return value ? "true" : "false";
}
+inline std::string toString( char value ) {
+ return value < ' '
+ ? toString( (unsigned int)value )
+ : Detail::makeString( value );
+}
+
+inline std::string toString( signed char value ) {
+ return toString( static_cast<char>( value ) );
+}
+
#ifdef CATCH_CONFIG_CPP11_NULLPTR
inline std::string toString( std::nullptr_t ) {
return "nullptr";