MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / registerTestMethods

Function registerTestMethods

deps/Catch/catch.hpp:4911–4940  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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