WTB better validation than ValidateArgumentBuffer
- Dominant language
- C
- Stars
- 36
- Forks
- 27
- Avg merge
- 32m
- Merged PRs (30d)
- 3
Description
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
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the existing ValidateArgumentBuffer implementation and how REGISTER_GLOBAL_MOCK_HOOK is used as the current workaround. Compare the three proposed directions—named parameters, structure-field validation, and offset-based validation—but the issue does not select an approach or identify tests, so the completed scope remains undefined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100