MCPcopy Create free account
hub / github.com/apache/thrift / registerTestMethods

Function registerTestMethods

compiler/cpp/tests/catch/catch.hpp:3351–3380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3349 }
3350
3351 inline size_t registerTestMethods() {
3352 size_t noTestMethods = 0;
3353 int noClasses = objc_getClassList( CATCH_NULL, 0 );
3354
3355 Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses);
3356 objc_getClassList( classes, noClasses );
3357
3358 for( int c = 0; c < noClasses; c++ ) {
3359 Class cls = classes[c];
3360 {
3361 u_int count;
3362 Method* methods = class_copyMethodList( cls, &count );
3363 for( u_int m = 0; m < count ; m++ ) {
3364 SEL selector = method_getName(methods[m]);
3365 std::string methodName = sel_getName(selector);
3366 if( startsWith( methodName, "Catch_TestCase_" ) ) {
3367 std::string testCaseName = methodName.substr( 15 );
3368 std::string name = Detail::getAnnotation( cls, "Name", testCaseName );
3369 std::string desc = Detail::getAnnotation( cls, "Description", testCaseName );
3370 const char* className = class_getName( cls );
3371
3372 getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, name.c_str(), desc.c_str(), SourceLineInfo() ) );
3373 noTestMethods++;
3374 }
3375 }
3376 free(methods);
3377 }
3378 }
3379 return noTestMethods;
3380 }
3381
3382 namespace Matchers {
3383 namespace Impl {

Callers 1

mainFunction · 0.85

Calls 6

startsWithFunction · 0.85
getAnnotationFunction · 0.85
makeTestCaseFunction · 0.85
SourceLineInfoClass · 0.85
substrMethod · 0.45
registerTestMethod · 0.45

Tested by

no test coverage detected