mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-24 13:35:40 +02:00
Changed some names in test case registry
- in preparation for a bigger refactoring
This commit is contained in:
@@ -125,24 +125,16 @@ namespace Catch {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class FreeFunctionTestCase : public ITestCase {
|
||||
class TestInvokerAsFunction : public ITestInvoker {
|
||||
void(*m_testAsFunction)();
|
||||
public:
|
||||
TestInvokerAsFunction( void(*testAsFunction)() ) : m_testAsFunction( testAsFunction ) {}
|
||||
|
||||
FreeFunctionTestCase( TestFunction fun ) : m_fun( fun ) {}
|
||||
|
||||
virtual void invoke() const {
|
||||
m_fun();
|
||||
void invoke() const override {
|
||||
m_testAsFunction();
|
||||
}
|
||||
|
||||
private:
|
||||
virtual ~FreeFunctionTestCase();
|
||||
|
||||
TestFunction m_fun;
|
||||
};
|
||||
|
||||
FreeFunctionTestCase::~FreeFunctionTestCase() {}
|
||||
|
||||
|
||||
inline std::string extractClassName( std::string const& classOrQualifiedMethodName ) {
|
||||
std::string className = classOrQualifiedMethodName;
|
||||
if( startsWith( className, '&' ) )
|
||||
@@ -157,7 +149,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
void registerTestCase
|
||||
( ITestCase* testCase,
|
||||
( ITestInvoker* testCase,
|
||||
char const* classOrQualifiedMethodName,
|
||||
NameAndDesc const& nameAndDesc,
|
||||
SourceLineInfo const& lineInfo ) {
|
||||
@@ -178,7 +170,7 @@ namespace Catch {
|
||||
( TestFunction function,
|
||||
SourceLineInfo const& lineInfo,
|
||||
NameAndDesc const& nameAndDesc ) {
|
||||
registerTestCase( new FreeFunctionTestCase( function ), "", nameAndDesc, lineInfo );
|
||||
registerTestCase( new TestInvokerAsFunction( function ), "", nameAndDesc, lineInfo );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user