mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-03 21:49:32 +01:00 
			
		
		
		
	Some toString cleanups
This commit is contained in:
		@@ -81,8 +81,7 @@ namespace Detail {
 | 
			
		||||
    };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template<>
 | 
			
		||||
inline std::string toString<Detail::Approx>( Detail::Approx const& value ) {
 | 
			
		||||
inline std::string toString( Detail::Approx const& value ) {
 | 
			
		||||
    return value.toString();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -35,7 +35,7 @@ namespace Catch {
 | 
			
		||||
                    throw;
 | 
			
		||||
                }
 | 
			
		||||
                @catch (NSException *exception) {
 | 
			
		||||
                    return toString( [exception description] );
 | 
			
		||||
                    return Catch::toString( [exception description] );
 | 
			
		||||
                }
 | 
			
		||||
#else
 | 
			
		||||
                throw;
 | 
			
		||||
 
 | 
			
		||||
@@ -219,10 +219,9 @@ std::string toString( std::nullptr_t );
 | 
			
		||||
        std::ostringstream oss;
 | 
			
		||||
        oss << "{ ";
 | 
			
		||||
        if( first != last ) {
 | 
			
		||||
            oss << toString( *first );
 | 
			
		||||
            for( ++first ; first != last ; ++first ) {
 | 
			
		||||
                oss << ", " << toString( *first );
 | 
			
		||||
            }
 | 
			
		||||
            oss << Catch::toString( *first );
 | 
			
		||||
            for( ++first ; first != last ; ++first )
 | 
			
		||||
                oss << ", " << Catch::toString( *first );
 | 
			
		||||
        }
 | 
			
		||||
        oss << " }";
 | 
			
		||||
        return oss.str();
 | 
			
		||||
 
 | 
			
		||||
@@ -75,7 +75,7 @@ std::string toString( std::wstring const& value ) {
 | 
			
		||||
    s.reserve( value.size() );
 | 
			
		||||
    for(size_t i = 0; i < value.size(); ++i )
 | 
			
		||||
        s += value[i] <= 0xff ? static_cast<char>( value[i] ) : '?';
 | 
			
		||||
    return toString( s );
 | 
			
		||||
    return Catch::toString( s );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
std::string toString( const char* const value ) {
 | 
			
		||||
@@ -112,7 +112,7 @@ std::string toString( unsigned long value ) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
std::string toString( unsigned int value ) {
 | 
			
		||||
    return toString( static_cast<unsigned long>( value ) );
 | 
			
		||||
    return Catch::toString( static_cast<unsigned long>( value ) );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template<typename T>
 | 
			
		||||
 
 | 
			
		||||
@@ -135,7 +135,7 @@ namespace Catch {
 | 
			
		||||
                    xml.writeAttribute( "classname", className );
 | 
			
		||||
                    xml.writeAttribute( "name", name );
 | 
			
		||||
                }
 | 
			
		||||
                xml.writeAttribute( "time", toString( sectionNode.stats.durationInSeconds ) );
 | 
			
		||||
                xml.writeAttribute( "time", Catch::toString( sectionNode.stats.durationInSeconds ) );
 | 
			
		||||
 | 
			
		||||
                writeAssertions( sectionNode );
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user