MCPcopy Create free account
hub / github.com/audeering/opensmile / registerTestMethods

Function registerTestMethods

progsrc/include/tests/catch2/catch.hpp:4901–4930  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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