Changed some names in test case registry

- in preparation for a bigger refactoring
This commit is contained in:
Phil Nash
2017-07-12 18:01:54 +01:00
parent 10c36aa74c
commit 79627cdcdb
7 changed files with 25 additions and 38 deletions

View File

@@ -15,20 +15,15 @@
namespace Catch {
template<typename C>
class MethodTestCase : public ITestCase {
class TestInvokerAsMethod : public ITestInvoker {
void (C::*m_testAsMethod)();
public:
MethodTestCase( void (C::*method)() ) : m_method( method ) {}
TestInvokerAsMethod( void (C::*testAsMethod)() ) : m_testAsMethod( testAsMethod ) {}
virtual void invoke() const {
void invoke() const override {
C obj;
(obj.*m_method)();
(obj.*m_testAsMethod)();
}
private:
virtual ~MethodTestCase() {}
void (C::*m_method)();
};
typedef void(*TestFunction)();
@@ -43,7 +38,7 @@ struct NameAndDesc {
};
void registerTestCase
( ITestCase* testCase,
( ITestInvoker* testCase,
char const* className,
NameAndDesc const& nameAndDesc,
SourceLineInfo const& lineInfo );
@@ -63,7 +58,7 @@ struct AutoReg {
SourceLineInfo const& lineInfo ) {
registerTestCase
( new MethodTestCase<C>( method ),
( new TestInvokerAsMethod<C>( method ),
className,
nameAndDesc,
lineInfo );