svunit / svmock

A mock framework for use with SVUnit
Apache License 2.0
15 stars 4 forks source link

Add possibility to collect multiple expected arguments #6

Closed tudortimi-ifx closed 6 years ago

tudortimi-ifx commented 6 years ago

Whenever a new call to 'with_args(...)' is made, the previous expectation is overwritten. Expectations should be collected.

nosnhojn commented 6 years ago

I was on the fence for this one, partly b/c I'm having a hard time seeing how we can weave together all the EXPECT_CALL possibilities from googlemock. you reckon it'll best to have users queue up a set of multiple expectations? I don't mind that except then it means expectations automatically expire after 1 usage... which now that I think about it might be what we want anyway...?

tudortimi-ifx commented 6 years ago

GoogleMock also has this functionality:

https://chromium.googlesource.com/external/github.com/google/googletest/+/HEAD/googlemock/docs/ForDummies.md#using-multiple-expectations

In our case we don't match on arguments, since we only use `ON_CALL.

In GoogleMock, expectations also "expire" after one usage.

nosnhojn commented 6 years ago

expectations are buffered now, each applies exactly once. errors are flagged en masse on 'check()'. they're also cleared on 'check()'.