MCPcopy Create free account
hub / github.com/RenderKit/oidn / registerTestMethods

Function registerTestMethods

external/catch.hpp:4902–4931  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4900 }
4901
4902 inline std::size_t registerTestMethods() {
4903 std::size_t noTestMethods = 0;
4904 int noClasses = objc_getClassList( nullptr, 0 );
4905
4906 Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses);
4907 objc_getClassList( classes, noClasses );
4908
4909 for( int c = 0; c < noClasses; c++ ) {
4910 Class cls = classes[c];
4911 {
4912 u_int count;
4913 Method* methods = class_copyMethodList( cls, &count );
4914 for( u_int m = 0; m < count ; m++ ) {
4915 SEL selector = method_getName(methods[m]);
4916 std::string methodName = sel_getName(selector);
4917 if( startsWith( methodName, "Catch_TestCase_" ) ) {
4918 std::string testCaseName = methodName.substr( 15 );
4919 std::string name = Detail::getAnnotation( cls, "Name", testCaseName );
4920 std::string desc = Detail::getAnnotation( cls, "Description", testCaseName );
4921 const char* className = class_getName( cls );
4922
4923 getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, NameAndTags( name.c_str(), desc.c_str() ), SourceLineInfo("",0) ) );
4924 noTestMethods++;
4925 }
4926 }
4927 free(methods);
4928 }
4929 }
4930 return noTestMethods;
4931 }
4932
4933#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
4934

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