Open ChiefGokhlayeh opened 4 years ago
:white_check_mark: Build fff 83-appveyor completed (commit https://github.com/meekrosoft/fff/commit/3b92adddab by @ChiefGokhlayeh)
:white_check_mark: Build fff 84-appveyor completed (commit https://github.com/meekrosoft/fff/commit/7dd95b55b5 by @ChiefGokhlayeh)
This is brilliant! This always annoyed me as well. Why isn't this merged yet? Now, is there any reason the code for FFF_RESET_CALLED_FAKES
should not be called automatically from FFF_RESET_HISTORY
? I never had the need to reset individual fakes in any of my projects.
@rubiot,
Thought about that, but as far as I remember FFF_RESET_HISTORY
strictly resets the global call history (fff.call_history_idx = 0
) and is not tied to any fakes. I agree, it makes more sense to merge these two together and have a single FFF_RESET_ALL
(or simply FFF_RESET
?).
Regarding why this hasn't been merged yet, I don't know. To my own discredit, I didn't follow up on this PR very diligently.
Rebased source branch to fix merge conflicts.
Hi! long time user of fff but one thing always annoyed me:
_Why do we have to call
RESET_FAKE()
for each fake function individually? Wouldn't it be nice to have a reset all fakes macro?_Personally I don't see a reason why not. So I went ahead and implemented a crude solution I thought I'd share.
This PR adds a
FFF_RESET_CALLED_FAKES()
macro which, similar toFFF_RESET_HISTORY()
can be placed in the global setup section of your unit-test. Internally we maintain areset_list
inside the globalfff
struct. Once a fake function is called, the respective_reset
function pointer is placed in this list.FFF_RESET_CALLED_FAKES
simply invokes every function insidefff.reset_list
.Best regards
PS: FFF is awesome!