From e1c927afcee6c7ae95b0ccaa0169a05776aa63db Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Sat, 8 Aug 2015 18:04:24 +0200 Subject: Minor refactoring of existing Matchers --- src/tests/catchy/catchy_tests.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/tests/catchy') diff --git a/src/tests/catchy/catchy_tests.h b/src/tests/catchy/catchy_tests.h index f1170fa71..c60a790d9 100644 --- a/src/tests/catchy/catchy_tests.h +++ b/src/tests/catchy/catchy_tests.h @@ -21,11 +21,12 @@ namespace Matchers { namespace StdVector { template - struct Equals : MatcherImpl, std::vector > { + struct Equals : MatcherImpl, std::vector > + { Equals( std::vector const& vec ) : m_vector( vec ){} Equals( Equals const& other ) : m_vector( other.m_vector ){} - virtual ~Equals() {}; + virtual ~Equals() {} virtual bool match( std::vector const& expr ) const { return m_vector == expr; @@ -39,17 +40,18 @@ namespace Matchers { } // namespace StdVector namespace Boolean { - struct Equals : MatcherImpl { + struct Equals : MatcherImpl + { Equals( const bool expected ) : m_expected( expected ){} Equals( Equals const& other ) : m_expected( other.m_expected ){} - virtual ~Equals() override {}; + virtual ~Equals() override {} virtual bool match( bool const& expr ) const { return m_expected == expr; } virtual std::string toString() const { - return " == " + Catch::toString(m_expected); + return "== " + Catch::toString(m_expected); } bool m_expected; @@ -58,11 +60,12 @@ namespace Matchers { namespace Integer { template - struct Equals : MatcherImpl, T> { + struct Equals : MatcherImpl, T> + { Equals( const T expected ) : m_expected( expected ){} Equals( Equals const& other ) : m_expected( other.m_expected ){} - virtual ~Equals() override {}; + virtual ~Equals() override {} virtual bool match( T const& expr ) const { return m_expected == expr; -- cgit v1.2.3