Open martijnthe opened 7 years ago
Hi Martijn, Sounds like an interesting use case. Do you have an implementation in mind? I'd love to take a look. Cheers, Mike
I don't have an implementation in mind, but just want to chime in that I too have a use case for this. I have several functions who's purpose is to generate a buffer on the stack and then pass that buffer to a second function. I would like to fake the second function and test for proper content in these buffers, but as @martijnthe points out the only good way to do this currently seems to be a custom fake.
Any updates? I have:
+1 to this. Having to create a custom fake just to copy out the value pointed to by a pointer argument is not ideal. It'd be really great if the arg history contained copies of the dereferenced pointer args.
What's the best way to mock functions that take references/pointer arguments that usually point to temporary (stack allocated) variables? If you have a lot of this in your code, making custom fakes for everything lowers the value of using FFF in the first place...
Can you see a way to support dereferencing pointer arguments and copying the actual values to the history? It would have to be on a per-argument basis because often you also don't want to deref the pointer (i.e. an out-pointer).