Fixed leak

This commit is contained in:
Phil Nash 2010-11-11 20:37:46 +00:00
parent 5cf94a8043
commit 92f2d32f74
3 changed files with 18 additions and 5 deletions

View File

@ -41,3 +41,11 @@ TEST_CASE( "succeeding/Tricky/complex lhs", "Where the LHS is not a simple value
// This only captures part of the expression, but issues a warning about the rest
EXPECT( a == 2 || b == 2 );
}
TEST_CASE( "succeeding/Tricky/complex lhs/2", "Where the LHS is not a simple value" )
{
int a = 1;
// This only captures part of the expression, but issues a warning about the rest
// EXPECT( a + 1 == 2);
}

View File

@ -67,7 +67,6 @@ public:
return *this;
}
private:
friend class ResultBuilder;
void setLhs( const std::string& lhs )

View File

@ -48,9 +48,8 @@ namespace Catch
TestCaseInfo& operator = ( const TestCaseInfo& other )
{
test = other.test->clone();
name = other.name;
description = description;
TestCaseInfo temp( other );
swap( temp );
return *this;
}
@ -73,6 +72,13 @@ namespace Catch
return description;
}
void swap( TestCaseInfo& other )
{
std::swap( test, other.test );
name.swap( other.name );
description.swap( other.description );
}
private:
TestCase* test;
std::string name;