From e8e5f1e254c8f5905a5834cd74d188d65ca39dc2 Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Sun, 27 Dec 2015 15:36:30 +0100 Subject: [PATCH] Try calling the IMP directly before calling it indirectly in the block-as-method test. This makes debugging *much* easier! --- Test/BlockImpTest.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Test/BlockImpTest.m b/Test/BlockImpTest.m index 190779a..ce9931a 100644 --- a/Test/BlockImpTest.m +++ b/Test/BlockImpTest.m @@ -33,8 +33,9 @@ int main(void) char *type = block_copyIMPTypeEncoding_np(blk); assert(NULL != type); class_addMethod((objc_getMetaClass("Foo")), @selector(count:), imp, type); + Class cls = objc_getClass("Foo"); + assert(2 == ((int(*)(id,SEL,int))imp)(cls, @selector(count:), 2)); free(type); - assert(2 == [Foo count: 2]); assert(4 == [Foo count: 2]); assert(6 == [Foo count: 2]); assert(imp_getBlock(imp) == (blk));