MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / registerTestMethods

Function registerTestMethods

test/expected/catch.hpp:4852–4881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.85

Calls 8

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

Tested by

no test coverage detected