mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Renamed toStringUncached -> describe
This commit is contained in:
		| @@ -22,12 +22,12 @@ namespace Matchers { | |||||||
|         public: |         public: | ||||||
|             std::string toString() const { |             std::string toString() const { | ||||||
|                 if( m_cachedToString.empty() ) |                 if( m_cachedToString.empty() ) | ||||||
|                     m_cachedToString = toStringUncached(); |                     m_cachedToString = describe(); | ||||||
|                 return m_cachedToString; |                 return m_cachedToString; | ||||||
|             } |             } | ||||||
|  |  | ||||||
|         protected: |         protected: | ||||||
|             virtual std::string toStringUncached() const = 0; |             virtual std::string describe() const = 0; | ||||||
|             mutable std::string m_cachedToString; |             mutable std::string m_cachedToString; | ||||||
|         }; |         }; | ||||||
|  |  | ||||||
| @@ -50,7 +50,7 @@ namespace Matchers { | |||||||
|                 } |                 } | ||||||
|                 return true; |                 return true; | ||||||
|             } |             } | ||||||
|             virtual std::string toStringUncached() const CATCH_OVERRIDE { |             virtual std::string describe() const CATCH_OVERRIDE { | ||||||
|                 std::string description; |                 std::string description; | ||||||
|                 description.reserve( 4 + m_matchers.size()*32 ); |                 description.reserve( 4 + m_matchers.size()*32 ); | ||||||
|                 description += "( "; |                 description += "( "; | ||||||
| @@ -80,7 +80,7 @@ namespace Matchers { | |||||||
|                 } |                 } | ||||||
|                 return false; |                 return false; | ||||||
|             } |             } | ||||||
|             virtual std::string toStringUncached() const CATCH_OVERRIDE { |             virtual std::string describe() const CATCH_OVERRIDE { | ||||||
|                 std::string description; |                 std::string description; | ||||||
|                 description.reserve( 4 + m_matchers.size()*32 ); |                 description.reserve( 4 + m_matchers.size()*32 ); | ||||||
|                 description += "( "; |                 description += "( "; | ||||||
| @@ -110,7 +110,7 @@ namespace Matchers { | |||||||
|                 return !m_underlyingMatcher.match( arg ); |                 return !m_underlyingMatcher.match( arg ); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             virtual std::string toStringUncached() const CATCH_OVERRIDE { |             virtual std::string describe() const CATCH_OVERRIDE { | ||||||
|                 return "not " + m_underlyingMatcher.toString(); |                 return "not " + m_underlyingMatcher.toString(); | ||||||
|             } |             } | ||||||
|             MatcherBase<ArgT> const& m_underlyingMatcher; |             MatcherBase<ArgT> const& m_underlyingMatcher; | ||||||
|   | |||||||
| @@ -27,7 +27,7 @@ namespace Matchers { | |||||||
|  |  | ||||||
|         struct StringMatcherBase : Impl::MatcherBase<std::string> { |         struct StringMatcherBase : Impl::MatcherBase<std::string> { | ||||||
|             StringMatcherBase( std::string operation, CasedString const& comparator ); |             StringMatcherBase( std::string operation, CasedString const& comparator ); | ||||||
|             virtual std::string toStringUncached() const CATCH_OVERRIDE; |             virtual std::string describe() const CATCH_OVERRIDE; | ||||||
|  |  | ||||||
|             CasedString m_comparator; |             CasedString m_comparator; | ||||||
|             std::string m_operation; |             std::string m_operation; | ||||||
|   | |||||||
| @@ -34,7 +34,7 @@ namespace Matchers { | |||||||
|           m_operation( operation ) { |           m_operation( operation ) { | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         std::string StringMatcherBase::toStringUncached() const { |         std::string StringMatcherBase::describe() const { | ||||||
|             std::string description; |             std::string description; | ||||||
|             description.reserve(5 + m_operation.size() + m_comparator.m_str.size() + |             description.reserve(5 + m_operation.size() + m_comparator.m_str.size() + | ||||||
|                                         m_comparator.caseSensitivitySuffix().size()); |                                         m_comparator.caseSensitivitySuffix().size()); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash