MCPcopy Create free account
hub / github.com/Profactor/cv-plot / registerTestMethods

Function registerTestMethods

CvPlot/ext/catch2/inc/catch.hpp:4850–4879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4848 }
4849
4850 inline std::size_t registerTestMethods() {
4851 std::size_t noTestMethods = 0;
4852 int noClasses = objc_getClassList( nullptr, 0 );
4853
4854 Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses);
4855 objc_getClassList( classes, noClasses );
4856
4857 for( int c = 0; c < noClasses; c++ ) {
4858 Class cls = classes[c];
4859 {
4860 u_int count;
4861 Method* methods = class_copyMethodList( cls, &count );
4862 for( u_int m = 0; m < count ; m++ ) {
4863 SEL selector = method_getName(methods[m]);
4864 std::string methodName = sel_getName(selector);
4865 if( startsWith( methodName, "Catch_TestCase_" ) ) {
4866 std::string testCaseName = methodName.substr( 15 );
4867 std::string name = Detail::getAnnotation( cls, "Name", testCaseName );
4868 std::string desc = Detail::getAnnotation( cls, "Description", testCaseName );
4869 const char* className = class_getName( cls );
4870
4871 getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, NameAndTags( name.c_str(), desc.c_str() ), SourceLineInfo("",0) ) );
4872 noTestMethods++;
4873 }
4874 }
4875 free(methods);
4876 }
4877 }
4878 return noTestMethods;
4879 }
4880
4881#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
4882

Callers 1

mainFunction · 0.85

Calls 8

startsWithFunction · 0.85
getAnnotationFunction · 0.85
makeTestCaseFunction · 0.85
NameAndTagsClass · 0.85
SourceLineInfoClass · 0.85
substrMethod · 0.80
c_strMethod · 0.80
registerTestMethod · 0.45

Tested by

no test coverage detected