]> git.saurik.com Git - apple/objc4.git/blobdiff - test/method_getName.m
objc4-437.tar.gz
[apple/objc4.git] / test / method_getName.m
diff --git a/test/method_getName.m b/test/method_getName.m
new file mode 100644 (file)
index 0000000..fe6793d
--- /dev/null
@@ -0,0 +1,20 @@
+#include "test.h"
+#include <Foundation/NSObject.h>
+#include <objc/runtime.h>
+#include "../runtime/objc-rtp.h"
+
+int main() {
+  unsigned i;
+  Class c = [NSObject class];
+  unsigned numMethods;
+  Method *methods = class_copyMethodList(c, &numMethods);
+
+  for (i=0; i<numMethods; ++i) {
+      // <rdar://problem/6190950> method_getName crash on NSObject method when GC is enabled
+      SEL aMethod = method_getName(methods[i]);
+      if (aMethod == (SEL)kIgnore)
+         fail(__FILE__);
+  }
+
+  succeed(__FILE__);
+}