erikdoe/ocmock — pull request #44 by carllindberg (2013-08-11 19:59:03+00:00)
Title: Cleanup forwarding implementation, and other improvements

I refactored the method to return the forwarding IMP to a class method on NSMethodSignature (which makes use of the other new method). I then called it from OCClassMockObject as well.

I think I fixed the TODO about not using the method_getTypeEncoding(); I fall back to looking up method signatures.

When frames have structure pointers, the -frameLength from NSMethodSignature is not necessarily appropriate to pull it out. X86_64 seems to be a constant 224 bytes for that value so it's generally safe, but i386 has a much smaller size, and will only include one pointer's worth of size for the structure reference in a stret signature.

I made it easier to compile and run the unit tests on both i386 and iOS platforms; required fixing some build warnings, and avoiding NSRect and friends on iOS (just used some #defines to CGRect). I have not yet tested on an iOS device but all the tests pass on the simulator, and on i386 on 10.8. I added some architecture-dependent unit tests for the new stret method.

I cleaned up some of the existing NSInvocation category methods and their test cases, and fixed the structure and char * formatting versions. I added support for long double as that seems to be supported by NSMethodSignature/NSInvocation. [__int128_t on 64-bit platforms seems to be supported by NSMethodSignature but not NSInvocation.]

I did not include the pbxproj changes to compile fat by default, and adding the iOS test target and scheme. I could add that if you want, but for now I just have it locally for testing.