appsquickly / typhoon

Powerful dependency injection for Objective-C ✨✨ (https://PILGRIM.PH is the pure Swift successor to Typhoon!!)✨✨
https://pilgrim.ph
Apache License 2.0
2.7k stars 269 forks source link

#456-Wrapping primitive values NSInvocation #518

Closed vasilenkoigor closed 8 years ago

vasilenkoigor commented 8 years ago

This PR solving issue As a result, in TCFWrapValues category of NSInvocation was implemented method that returns returnValue of current invocation and wrap primitive value if needed. And used for resultOfInvokingOn:, because if function [self getReturnValue:] returns primitive value, id type is will be wrong.

alexgarbarev commented 8 years ago

This looks good! thanks @vasilenkoigor! Reviewed and this looks fine to me.

alexgarbarev commented 8 years ago

@vasilenkoigor Hm.. It looks like this commits makes tests broken. Can you please take a look?

TyphoonInvocationUtilsTests
    . test_arc_object_returns_retained_on_not_new_or_init_method (0.001 seconds)
    . test_block_argument_is_malloc (0.001 seconds)
    x test_cluster_autorelease, ((retainCount(object)) equal to (1)) failed: ("2") is not equal to ("1")
    . test_cluster_nil (0.001 seconds)
    x test_cluster_release, ((retainCount(object)) equal to (1)) failed: ("2") is not equal to ("1")
    . test_object_new_autorelease (0.000 seconds)
    x test_object_new_retained, ((retainCount(object)) equal to (1)) failed: ("2") is not equal to ("1")
    x test_regular_object, ((retainCount(object)) equal to (1)) failed: ("2") is not equal to ("1")
    . test_retained_and_autoreleased_class_method_initializers (0.002 seconds)