Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2012-08-23 08:38:27 +0100
committerPhil Nash2012-08-23 08:38:27 +0100
commitc2675b5d49fe566a3ec6dc402079b7975fe9f96b (patch)
treee9b0b781064fc09622159bad162657e1cd23421d /include
parentd5fbe2ec5dcc2382afcd44a09cd4cb93c7464dd0 (diff)
downloadcatch3-c2675b5d49fe566a3ec6dc402079b7975fe9f96b.tar.gz
Added copy actor and operator = back to TestCaseInfo
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_test_case_info.h2
-rw-r--r--include/internal/catch_test_case_info.hpp12
2 files changed, 14 insertions, 0 deletions
diff --git a/include/internal/catch_test_case_info.h b/include/internal/catch_test_case_info.h
index 5e5a64d8..b7b9bc5d 100644
--- a/include/internal/catch_test_case_info.h
+++ b/include/internal/catch_test_case_info.h
@@ -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;
diff --git a/include/internal/catch_test_case_info.hpp b/include/internal/catch_test_case_info.hpp
index ab6ec782..51258a7d 100644
--- a/include/internal/catch_test_case_info.hpp
+++ b/include/internal/catch_test_case_info.hpp
@@ -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