Doc: Check parameters of a variadic function?
I'm wondering if there's a way to use expect_check()
to check the variable arguments passed to a variadic function. I'm 90% sure the answer is "no," due to both the difficulties of passing the variable arguments to a check function and the difficulty of comparing each item against a check value (especially since types may be inter-mixed)... but maybe there's a solution that hasn't occurred to me. If so, could it be documented?
For example, in mocking snprintf()
, I can check the first three arguments but I'd like to also check the variable arguments at the end.
int
__wrap_snprintf(char *restrict str, size_t size, const char *restrict format,
...)
...
check_expected_ptr(str);
check_expected(size);
check_expected_ptr(format);
// check_expected(...) ?