4 Feb 2003 18:18
[PATCH] NSInvocation + tests
Willem Rein Oudshoorn <woudshoo <at> xs4all.nl>
2003-02-04 17:18:56 GMT
2003-02-04 17:18:56 GMT
I mailed about a week ago about an incompatibility of NSInvocation in GNUstep and Apple's WebObjects. This mail contains a few files 1 - A patch for gnustep-base. See ChangeLog below for what is changed. 2 - Patch for InvokeTarget in the tests project, to support new tests 3 - New file greg test file for the NSInvocation PROBLEM DESCRIPTION ------------------- A - NSInvocations in GNUstep do not retain their return values. In Apple's WebObjects they are retained. This is usefull if you use NSInvocations to communicate between threads. B - The logic for the _validReturn flag logic is broken. See the testcases. But basically the flag is set to YES after the first invocation and never reset to NO. The Patch below fixes both of them. Note that I have not tested the patch for GSFFIInvocation, because I use GSFFCallIncocation. Changelog for these fixes: 2003-02-04 Willem Rein Oudshoorn <woudshoo <at> xs4all.nl> * Headers/gnustep/base/GSInvocation.h (CLEAR_RETURN_VALUE_IF_OBJECT): New macro, if invocation returns object release it. (RETAIN_RETURN_VALUE): New macro, if invocation returns object release it. * Source/NSInvocation.m ([NSInvocation -dealloc]): Implement RELEASE return object ([NSInvocation -setReturnValue:]) Implement RETAIN/RELEASE on return object ([NSInvocation -invokeWithTarget:]): Implement RETAIN/RELEASE on return object, fixed _validReturn flag setting * Source/GSFFIInvocation.m ([GSFFIInvocation -invokeWithTarget:]): Fix _validReturn flag setting, Implement RETAIN/RELEASE on return object. * Source/GSFFCallInvocation.m ([GSFFCallInvocation -invokeWithTarget:]): Fix _validReturn flag setting. Implement RETAIN/RELEASE on return object. NEW TESTS --------- Test the fixes above. Without the patch I get 3 FAILS in the new tests. 2 of those tests belong to the bug described in B above. 1 is a new test for the situation described in A. Changelog for the patch and the new file: 2003-02-04 Willem Rein Oudshoorn <woudshoo <at> xs4all.nl> * Resources/InvokeProxy.m ([InvokeTarget -returnIdButThrowException]): New method * NSInvocation/test01.scm: New file, containing simple retain/release and getting return value test Wim Oudshoorn.
_______________________________________________ Bug-gnustep mailing list Bug-gnustep <at> gnu.org http://mail.gnu.org/mailman/listinfo/bug-gnustep