Problem with setTo: and C byRef params

Discussion of the OCMock framework. If you have patches we would prefer you to send them to the mailing list, but attaching them to a topic is possible, too.

Problem with setTo: and C byRef params

Postby Glenn_Austin » 05 Jun 2012, 00:00

I found that I could not use setTo: with non-Objective-C parameters (such as for -[NSFIleManager fileExistsAtPath:(NSString*)path isDirectory:(BOOL*)isDirectory])

On my local copy, I added a setValueTo: which takes an NSValue, creates an OCMPassCTypeByRefSetter (copied from OCMPassByRefSetter), and use that to set the resulting C value in OCMockRecorder.

Patch available upon request.
Glenn_Austin
 
Posts: 2
Joined: 04 Jun 2012, 23:54

Re: Problem with setTo: and C byRef params

Postby erik » 05 Jun 2012, 17:31

Interesting. Could you create a pull request on Github? Or send the patch to erik@doernenburg.com? Thanks!
erik
 
Posts: 90
Joined: 10 Oct 2009, 15:22
Location: Hamburg, Germany

Re: Problem with setTo: and C byRef params

Postby Glenn_Austin » 05 Jun 2012, 18:49

Done.
Glenn_Austin
 
Posts: 2
Joined: 04 Jun 2012, 23:54


Return to OCMock