7 #include <objc/Protocol.h>
11 // Class Protocol is always a subclass of NSObject
13 testassert(objc_getClass("NSObject"));
15 Class cls = objc_getClass("Protocol");
16 testassert(class_getInstanceMethod(cls, sel_registerName("isProxy")));
17 testassert(class_getSuperclass(cls) == objc_getClass("NSObject"));
25 #include <objc/Protocol.h>
29 // Class Protocol is never a subclass of NSObject
30 // CoreFoundation adds NSObject methods to Protocol when it loads
32 testassert(objc_getClass("NSObject"));
34 Class cls = objc_getClass("Protocol");
35 testassert(!class_getInstanceMethod(cls, sel_registerName("isProxy")));
36 testassert(class_getSuperclass(cls) != objc_getClass("NSObject"));
38 void *dl = dlopen("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation", RTLD_LAZY);
41 testassert(class_getInstanceMethod(cls, sel_registerName("isProxy")));
42 testassert(class_getSuperclass(cls) != objc_getClass("NSObject"));