MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/TriangleMeshDistance / registerTestMethods

Function registerTestMethods

tests/catch.hpp:3993–4022  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3991 }
3992
3993 inline std::size_t registerTestMethods() {
3994 std::size_t noTestMethods = 0;
3995 int noClasses = objc_getClassList( nullptr, 0 );
3996
3997 Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses);
3998 objc_getClassList( classes, noClasses );
3999
4000 for( int c = 0; c < noClasses; c++ ) {
4001 Class cls = classes[c];
4002 {
4003 u_int count;
4004 Method* methods = class_copyMethodList( cls, &count );
4005 for( u_int m = 0; m < count ; m++ ) {
4006 SEL selector = method_getName(methods[m]);
4007 std::string methodName = sel_getName(selector);
4008 if( startsWith( methodName, "Catch_TestCase_" ) ) {
4009 std::string testCaseName = methodName.substr( 15 );
4010 std::string name = Detail::getAnnotation( cls, "Name", testCaseName );
4011 std::string desc = Detail::getAnnotation( cls, "Description", testCaseName );
4012 const char* className = class_getName( cls );
4013
4014 getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, NameAndTags( name.c_str(), desc.c_str() ), SourceLineInfo("",0) ) );
4015 noTestMethods++;
4016 }
4017 }
4018 free(methods);
4019 }
4020 }
4021 return noTestMethods;
4022 }
4023
4024#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
4025

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