From 006aafd982a48f179a5e8b498c613fd4636d27ee Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 20 Jun 2014 18:05:31 +0100 Subject: [PATCH] Some clean-ups for string handling in Objective-C --- include/internal/catch_objc.hpp | 8 ++++---- include/internal/catch_tostring.hpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/internal/catch_objc.hpp b/include/internal/catch_objc.hpp index 85181f44..88b5ef78 100644 --- a/include/internal/catch_objc.hpp +++ b/include/internal/catch_objc.hpp @@ -125,7 +125,7 @@ namespace Catch { } virtual std::string toString() const { - return "equals string: \"" + Catch::toString( m_substr ) + "\""; + return "equals string: " + Catch::toString( m_substr ); } }; @@ -138,7 +138,7 @@ namespace Catch { } virtual std::string toString() const { - return "contains string: \"" + Catch::toString( m_substr ) + "\""; + return "contains string: " + Catch::toString( m_substr ); } }; @@ -151,7 +151,7 @@ namespace Catch { } virtual std::string toString() const { - return "starts with: \"" + Catch::toString( m_substr ) + "\""; + return "starts with: " + Catch::toString( m_substr ); } }; struct EndsWith : StringHolder { @@ -163,7 +163,7 @@ namespace Catch { } virtual std::string toString() const { - return "ends with: \"" + Catch::toString( m_substr ) + "\""; + return "ends with: " + Catch::toString( m_substr ); } }; diff --git a/include/internal/catch_tostring.hpp b/include/internal/catch_tostring.hpp index 0b35f9d6..b957dd50 100644 --- a/include/internal/catch_tostring.hpp +++ b/include/internal/catch_tostring.hpp @@ -146,12 +146,12 @@ std::string toString( std::nullptr_t ) { std::string toString( NSString const * const& nsstring ) { if( !nsstring ) return "nil"; - return std::string( "@\"" ) + [nsstring UTF8String] + "\""; + return "@" + toString([nsstring UTF8String]); } std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ) { if( !nsstring ) return "nil"; - return std::string( "@\"" ) + [nsstring UTF8String] + "\""; + return "@" + toString([nsstring UTF8String]); } std::string toString( NSObject* const& nsObject ) { return toString( [nsObject description] );