mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Initial support for variadic macros
This commit is contained in:
		| @@ -29,7 +29,7 @@ namespace Catch { | ||||
|             std::string name = testCase.getTestCaseInfo().name; | ||||
|             if( name == "" ) { | ||||
|                 std::ostringstream oss; | ||||
|                 oss << name << "unnamed/" << ++m_unnamedCount; | ||||
|                 oss << "Anonymous test case " << ++m_unnamedCount; | ||||
|                 return registerTest( testCase.withName( oss.str() ) ); | ||||
|             } | ||||
|  | ||||
| @@ -124,22 +124,25 @@ namespace Catch { | ||||
|      | ||||
|     /////////////////////////////////////////////////////////////////////////// | ||||
|      | ||||
|     AutoReg::AutoReg(   TestFunction function,  | ||||
|                         const char* name, | ||||
|                         const char* description, | ||||
|                         const SourceLineInfo& lineInfo ) { | ||||
|         registerTestCase( new FreeFunctionTestCase( function ), "global", name, description, lineInfo ); | ||||
|     AutoReg::AutoReg(   TestFunction function, | ||||
|                         SourceLineInfo const& lineInfo, | ||||
|                         NameAndDesc const& nameAndDesc ) { | ||||
|         registerTestCase( new FreeFunctionTestCase( function ), "global", nameAndDesc, lineInfo ); | ||||
|     }     | ||||
|      | ||||
|     AutoReg::~AutoReg() {} | ||||
|      | ||||
|     void AutoReg::registerTestCase( ITestCase* testCase, | ||||
|                                     const char* classOrQualifiedMethodName, | ||||
|                                     const char* name, | ||||
|                                     const char* description, | ||||
|                                     const SourceLineInfo& lineInfo ) { | ||||
|                                     char const* classOrQualifiedMethodName, | ||||
|                                     NameAndDesc const& nameAndDesc, | ||||
|                                     SourceLineInfo const& lineInfo ) { | ||||
|          | ||||
|         getMutableRegistryHub().registerTest( makeTestCase( testCase, extractClassName( classOrQualifiedMethodName ), name, description, lineInfo ) ); | ||||
|         getMutableRegistryHub().registerTest | ||||
|             ( makeTestCase( testCase, | ||||
|                             extractClassName( classOrQualifiedMethodName ), | ||||
|                             nameAndDesc.name, | ||||
|                             nameAndDesc.description, | ||||
|                             lineInfo ) ); | ||||
|     } | ||||
|      | ||||
| } // end namespace Catch | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash