umock-c icon indicating copy to clipboard operation
umock-c copied to clipboard

WTB better validation than ValidateArgumentBuffer

Open anporumb opened this issue 5 years ago • 0 comments

  1. ValidateArgumentBuffer does not have a "a name" (doesn't expand to ValidateArgumentBuffer_result where "result" is the name of the parameter)

  2. Would be nice to have ValidateArgumentBuffer understand structures. ValidateArgumentBuffer_result_some_struct_field(&is_true, sizeof(bool)) would make a KILLING feature!

  3. At least ValidateArgumentBuffer should have a way to validate from offset 3, 4 bytes. That would allow validating arguments that are struct fields... in an archaic way, but workable. Maybe this is the easiest to implement proposal :)

The current workaround is to have a "hook_" and register it with REGISTER_GLOBAL_MOCK_HOOK, some global variables and validate inside the hook_ function that the globals match the actual parameters. So maybe thsi suggestion should not be exactly top of the priority list.

Best Regards, Andrei Porumb

anporumb avatar Mar 12 '20 23:03 anporumb