meekrosoft / fff

A testing micro framework for creating function test doubles
Other
766 stars 167 forks source link

Add documentation and tests for VARARG fakes #29

Closed usr42 closed 6 years ago

usr42 commented 7 years ago

FFF also supports faking VARARG functions, e.g. void voidfunc3var(const char *fmt, int argc, ...); could be faked with FAKE_VOID_FUNC_VARARG(voidfunc3var, char *, int, ...);

But how to use this is not described in the readme. Additionally the unit tests for VARARGs are not sufficient. There are no assertions. I think there should be at least be a test for argument capturing. Also the custom_fake for VARARGs should be covered by unit tests.

rubiot commented 7 years ago

I just submitted a pull request adding a section in the README explaining how to fake variadic functions. Please check it.

usr42 commented 7 years ago

Thank you! I like the explanation with printf very much.

usr42 commented 7 years ago

@rubiot I just improved the vararg tests. I'll open a pull request to your branch.

usr42 commented 7 years ago

The pull request is open: https://github.com/rubiot/fff/pull/1

rubiot commented 7 years ago

Very nice!