mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
Renamed MutableResultInfo to ResultInfoBuilder
This commit is contained in:
parent
b5d367206b
commit
e83f839741
@ -34,7 +34,7 @@ public:
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
Expression
|
||||
(
|
||||
MutableResultInfo& result,
|
||||
ResultInfoBuilder& result,
|
||||
T lhs
|
||||
)
|
||||
: m_result( result ),
|
||||
@ -44,7 +44,7 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
template<typename RhsT>
|
||||
MutableResultInfo& operator ==
|
||||
ResultInfoBuilder& operator ==
|
||||
(
|
||||
const RhsT& rhs
|
||||
)
|
||||
@ -54,7 +54,7 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
template<typename RhsT>
|
||||
MutableResultInfo& operator !=
|
||||
ResultInfoBuilder& operator !=
|
||||
(
|
||||
const RhsT& rhs
|
||||
)
|
||||
@ -64,7 +64,7 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
template<typename RhsT>
|
||||
MutableResultInfo& operator <
|
||||
ResultInfoBuilder& operator <
|
||||
(
|
||||
const RhsT& rhs
|
||||
)
|
||||
@ -74,7 +74,7 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
template<typename RhsT>
|
||||
MutableResultInfo& operator >
|
||||
ResultInfoBuilder& operator >
|
||||
(
|
||||
const RhsT& rhs
|
||||
)
|
||||
@ -84,7 +84,7 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
template<typename RhsT>
|
||||
MutableResultInfo& operator <=
|
||||
ResultInfoBuilder& operator <=
|
||||
(
|
||||
const RhsT& rhs
|
||||
)
|
||||
@ -94,7 +94,7 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
template<typename RhsT>
|
||||
MutableResultInfo& operator >=
|
||||
ResultInfoBuilder& operator >=
|
||||
(
|
||||
const RhsT& rhs
|
||||
)
|
||||
@ -103,7 +103,7 @@ public:
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
MutableResultInfo& operator ==
|
||||
ResultInfoBuilder& operator ==
|
||||
(
|
||||
bool rhs
|
||||
)
|
||||
@ -112,7 +112,7 @@ public:
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
MutableResultInfo& operator !=
|
||||
ResultInfoBuilder& operator !=
|
||||
(
|
||||
bool rhs
|
||||
)
|
||||
@ -121,7 +121,7 @@ public:
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
operator MutableResultInfo&
|
||||
operator ResultInfoBuilder&
|
||||
()
|
||||
{
|
||||
return m_result.captureBoolExpression( m_lhs );
|
||||
@ -142,7 +142,7 @@ public:
|
||||
);
|
||||
|
||||
private:
|
||||
MutableResultInfo& m_result;
|
||||
ResultInfoBuilder& m_result;
|
||||
T m_lhs;
|
||||
};
|
||||
|
||||
@ -154,7 +154,7 @@ public:
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
PtrExpression
|
||||
(
|
||||
MutableResultInfo& result,
|
||||
ResultInfoBuilder& result,
|
||||
const LhsT* lhs
|
||||
)
|
||||
: m_result( &result ),
|
||||
@ -163,7 +163,7 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
template<typename RhsT>
|
||||
MutableResultInfo& operator ==
|
||||
ResultInfoBuilder& operator ==
|
||||
(
|
||||
const RhsT* rhs
|
||||
)
|
||||
@ -173,7 +173,7 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// This catches NULL
|
||||
MutableResultInfo& operator ==
|
||||
ResultInfoBuilder& operator ==
|
||||
(
|
||||
LhsT* rhs
|
||||
)
|
||||
@ -183,7 +183,7 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
template<typename RhsT>
|
||||
MutableResultInfo& operator !=
|
||||
ResultInfoBuilder& operator !=
|
||||
(
|
||||
const RhsT* rhs
|
||||
)
|
||||
@ -193,7 +193,7 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// This catches NULL
|
||||
MutableResultInfo& operator !=
|
||||
ResultInfoBuilder& operator !=
|
||||
(
|
||||
LhsT* rhs
|
||||
)
|
||||
@ -202,7 +202,7 @@ public:
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
operator MutableResultInfo&
|
||||
operator ResultInfoBuilder&
|
||||
()
|
||||
{
|
||||
return m_result->captureBoolExpression( m_lhs );
|
||||
@ -210,7 +210,7 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
MutableResultInfo* m_result;
|
||||
ResultInfoBuilder* m_result;
|
||||
const LhsT* m_lhs;
|
||||
};
|
||||
|
||||
@ -348,7 +348,7 @@ public:
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
operator MutableResultInfo&
|
||||
operator ResultInfoBuilder&
|
||||
()
|
||||
{
|
||||
m_result.setMessage( m_messageStream.str() );
|
||||
@ -356,7 +356,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
MutableResultInfo m_result;
|
||||
ResultInfoBuilder m_result;
|
||||
std::ostringstream m_messageStream;
|
||||
|
||||
};
|
||||
|
@ -20,7 +20,7 @@ namespace Catch
|
||||
{
|
||||
class TestCaseInfo;
|
||||
class ScopedInfo;
|
||||
class MutableResultInfo;
|
||||
class ResultInfoBuilder;
|
||||
class ResultInfo;
|
||||
|
||||
struct IResultCapture
|
||||
@ -58,7 +58,7 @@ namespace Catch
|
||||
( ResultWas::OfType result
|
||||
) = 0;
|
||||
virtual ResultAction::Value acceptExpression
|
||||
( const MutableResultInfo& resultInfo
|
||||
( const ResultInfoBuilder& resultInfo
|
||||
) = 0;
|
||||
virtual void acceptMessage
|
||||
( const std::string& msg
|
||||
|
@ -19,13 +19,13 @@ namespace Catch
|
||||
|
||||
struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison;
|
||||
|
||||
class MutableResultInfo : public ResultInfo
|
||||
class ResultInfoBuilder : public ResultInfo
|
||||
{
|
||||
public:
|
||||
|
||||
MutableResultInfo() {}
|
||||
ResultInfoBuilder() {}
|
||||
|
||||
MutableResultInfo( const char* expr,
|
||||
ResultInfoBuilder( const char* expr,
|
||||
bool isNot,
|
||||
const SourceLineInfo& lineInfo,
|
||||
const char* macroName,
|
||||
@ -81,7 +81,7 @@ private:
|
||||
|
||||
template<typename T> friend class PtrExpression;
|
||||
|
||||
MutableResultInfo& captureBoolExpression( bool result ) {
|
||||
ResultInfoBuilder& captureBoolExpression( bool result ) {
|
||||
m_lhs = Catch::toString( result );
|
||||
m_op = m_isNot ? "!" : "";
|
||||
setResultType( result ? ResultWas::Ok : ResultWas::ExpressionFailed );
|
||||
@ -89,7 +89,7 @@ private:
|
||||
}
|
||||
|
||||
template<Internal::Operator Op, typename T1, typename T2>
|
||||
MutableResultInfo& captureExpression( const T1& lhs, const T2& rhs ) {
|
||||
ResultInfoBuilder& captureExpression( const T1& lhs, const T2& rhs ) {
|
||||
setResultType( Internal::compare<Op>( lhs, rhs ) ? ResultWas::Ok : ResultWas::ExpressionFailed );
|
||||
m_lhs = Catch::toString( lhs );
|
||||
m_rhs = Catch::toString( rhs );
|
||||
@ -98,7 +98,7 @@ private:
|
||||
}
|
||||
|
||||
template<Internal::Operator Op, typename T>
|
||||
MutableResultInfo& captureExpression( const T* lhs, int rhs ) {
|
||||
ResultInfoBuilder& captureExpression( const T* lhs, int rhs ) {
|
||||
return captureExpression<Op>( lhs, reinterpret_cast<const T*>( rhs ) );
|
||||
}
|
||||
};
|
||||
|
@ -198,7 +198,7 @@ namespace Catch
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
virtual ResultAction::Value acceptExpression
|
||||
(
|
||||
const MutableResultInfo& resultInfo
|
||||
const ResultInfoBuilder& resultInfo
|
||||
)
|
||||
{
|
||||
m_currentResult = resultInfo;
|
||||
@ -328,7 +328,7 @@ namespace Catch
|
||||
testEnded( m_currentResult );
|
||||
m_lastResult = m_currentResult;
|
||||
|
||||
m_currentResult = MutableResultInfo();
|
||||
m_currentResult = ResultInfoBuilder();
|
||||
if( m_lastResult.ok() )
|
||||
return ResultAction::None;
|
||||
else if( shouldDebugBreak() )
|
||||
@ -373,7 +373,7 @@ namespace Catch
|
||||
|
||||
private:
|
||||
RunningTest* m_runningTest;
|
||||
MutableResultInfo m_currentResult;
|
||||
ResultInfoBuilder m_currentResult;
|
||||
ResultInfo m_lastResult;
|
||||
|
||||
const Config& m_config;
|
||||
|
Loading…
Reference in New Issue
Block a user