mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 11:43:29 +01:00
Removed copy ctor, assignment operator and swap from TestCaseInfo
This commit is contained in:
parent
602b62f037
commit
41afd0c3d4
@ -39,8 +39,6 @@ namespace Catch {
|
|||||||
std::set<std::string> const& _tags,
|
std::set<std::string> const& _tags,
|
||||||
SourceLineInfo const& _lineInfo );
|
SourceLineInfo const& _lineInfo );
|
||||||
|
|
||||||
TestCaseInfo( TestCaseInfo const& other );
|
|
||||||
|
|
||||||
friend void setTags( TestCaseInfo& testCaseInfo, std::set<std::string> const& tags );
|
friend void setTags( TestCaseInfo& testCaseInfo, std::set<std::string> const& tags );
|
||||||
|
|
||||||
bool isHidden() const;
|
bool isHidden() const;
|
||||||
@ -62,7 +60,6 @@ namespace Catch {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
TestCase( ITestCase* testCase, TestCaseInfo const& info );
|
TestCase( ITestCase* testCase, TestCaseInfo const& info );
|
||||||
TestCase( TestCase const& other );
|
|
||||||
|
|
||||||
TestCase withName( std::string const& _newName ) const;
|
TestCase withName( std::string const& _newName ) const;
|
||||||
|
|
||||||
@ -70,10 +67,8 @@ namespace Catch {
|
|||||||
|
|
||||||
TestCaseInfo const& getTestCaseInfo() const;
|
TestCaseInfo const& getTestCaseInfo() const;
|
||||||
|
|
||||||
void swap( TestCase& other );
|
|
||||||
bool operator == ( TestCase const& other ) const;
|
bool operator == ( TestCase const& other ) const;
|
||||||
bool operator < ( TestCase const& other ) const;
|
bool operator < ( TestCase const& other ) const;
|
||||||
TestCase& operator = ( TestCase const& other );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ptr<ITestCase> test;
|
Ptr<ITestCase> test;
|
||||||
|
@ -122,17 +122,6 @@ namespace Catch {
|
|||||||
setTags( *this, _tags );
|
setTags( *this, _tags );
|
||||||
}
|
}
|
||||||
|
|
||||||
TestCaseInfo::TestCaseInfo( TestCaseInfo const& other )
|
|
||||||
: name( other.name ),
|
|
||||||
className( other.className ),
|
|
||||||
description( other.description ),
|
|
||||||
tags( other.tags ),
|
|
||||||
lcaseTags( other.lcaseTags ),
|
|
||||||
tagsAsString( other.tagsAsString ),
|
|
||||||
lineInfo( other.lineInfo ),
|
|
||||||
properties( other.properties )
|
|
||||||
{}
|
|
||||||
|
|
||||||
bool TestCaseInfo::isHidden() const {
|
bool TestCaseInfo::isHidden() const {
|
||||||
return ( properties & IsHidden ) != 0;
|
return ( properties & IsHidden ) != 0;
|
||||||
}
|
}
|
||||||
@ -149,10 +138,6 @@ namespace Catch {
|
|||||||
|
|
||||||
TestCase::TestCase( ITestCase* testCase, TestCaseInfo const& info ) : TestCaseInfo( info ), test( testCase ) {}
|
TestCase::TestCase( ITestCase* testCase, TestCaseInfo const& info ) : TestCaseInfo( info ), test( testCase ) {}
|
||||||
|
|
||||||
TestCase::TestCase( TestCase const& other )
|
|
||||||
: TestCaseInfo( other ),
|
|
||||||
test( other.test )
|
|
||||||
{}
|
|
||||||
|
|
||||||
TestCase TestCase::withName( std::string const& _newName ) const {
|
TestCase TestCase::withName( std::string const& _newName ) const {
|
||||||
TestCase other( *this );
|
TestCase other( *this );
|
||||||
@ -160,18 +145,6 @@ namespace Catch {
|
|||||||
return other;
|
return other;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestCase::swap( TestCase& other ) {
|
|
||||||
test.swap( other.test );
|
|
||||||
name.swap( other.name );
|
|
||||||
className.swap( other.className );
|
|
||||||
description.swap( other.description );
|
|
||||||
tags.swap( other.tags );
|
|
||||||
lcaseTags.swap( other.lcaseTags );
|
|
||||||
tagsAsString.swap( other.tagsAsString );
|
|
||||||
std::swap( TestCaseInfo::properties, static_cast<TestCaseInfo&>( other ).properties );
|
|
||||||
std::swap( lineInfo, other.lineInfo );
|
|
||||||
}
|
|
||||||
|
|
||||||
void TestCase::invoke() const {
|
void TestCase::invoke() const {
|
||||||
test->invoke();
|
test->invoke();
|
||||||
}
|
}
|
||||||
@ -185,11 +158,6 @@ namespace Catch {
|
|||||||
bool TestCase::operator < ( TestCase const& other ) const {
|
bool TestCase::operator < ( TestCase const& other ) const {
|
||||||
return name < other.name;
|
return name < other.name;
|
||||||
}
|
}
|
||||||
TestCase& TestCase::operator = ( TestCase const& other ) {
|
|
||||||
TestCase temp( other );
|
|
||||||
swap( temp );
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
TestCaseInfo const& TestCase::getTestCaseInfo() const
|
TestCaseInfo const& TestCase::getTestCaseInfo() const
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user