mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
Renamed toStringUncached -> describe
This commit is contained in:
parent
1400127d6f
commit
a5a013811c
@ -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());
|
||||||
|
Loading…
Reference in New Issue
Block a user