Merge branch 'master' of github.com:philsquared/Catch

This commit is contained in:
Phil Nash
2012-08-23 19:54:08 +01:00
3 changed files with 29 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ namespace Catch {
TestCaseInfo( const TestCaseInfo& other, const std::string& name );
TestCaseInfo( const TestCaseInfo& other );
void invoke() const;
const std::string& getName() const;
@@ -37,6 +38,7 @@ namespace Catch {
void swap( TestCaseInfo& other );
bool operator == ( const TestCaseInfo& other ) const;
bool operator < ( const TestCaseInfo& other ) const;
TestCaseInfo& operator = ( const TestCaseInfo& other );
private:
Ptr<ITestCase> m_test;

View File

@@ -36,6 +36,13 @@ namespace Catch {
m_lineInfo( other.m_lineInfo )
{}
TestCaseInfo::TestCaseInfo( const TestCaseInfo& other )
: m_test( other.m_test ),
m_name( other.m_name ),
m_description( other.m_description ),
m_lineInfo( other.m_lineInfo )
{}
void TestCaseInfo::invoke() const {
m_test->invoke();
}
@@ -70,6 +77,11 @@ namespace Catch {
bool TestCaseInfo::operator < ( const TestCaseInfo& other ) const {
return m_name < other.m_name;
}
TestCaseInfo& TestCaseInfo::operator = ( const TestCaseInfo& other ) {
TestCaseInfo temp( other );
swap( temp );
return *this;
}
}
#endif // TWOBLUECUBES_CATCH_TESTCASEINFO_HPP_INCLUDED