Great work on turtle, I like you made it easy to also mock template functions.
How do I set an expectation that uses more than one argument from the call?
Eg.
MOCK_CONST_METHOD(Foo, 2, void (std::list<int>::const_iterator begin, std::list<int>::const_iterator end), Foo)
And if I setup:
const std::list<int> expected_foos = boost::assign::list_of(0)(1);
How do I setup an expectation that the contents of (begin, end) equals expected_foos?
Cheers,
Louis
Hi Louis,
Thanks for your feedback!
As for the issue you're raising I must admit it has never come up before and there is no built-in solution for this.
I will add the feature as soon as possible but in the meantime I'm afraid you're stuck with a workaround along the following:
This is not very satisfactory especially because upon error it won't point to the correct location, but I'm afraid it's the only way for now...
I'm starting the work on integrating this feature into turtle right away.
Thanks for pointing that out!
Regards,
MAT.
Hi,
Just a quick update to say that the feature has been added to turtle https://github.com/mat007/turtle/commit/02468ee43a1fa91f5bdefb4e25298a09556a17f5 and will be part of the next release.
For a more concrete example of the usage, see https://github.com/mat007/turtle/commit/1f1e143b06e556c5792be716c885426dd91ebc62
Thanks for your help and feel free to point out any issue I may have overlooked while implementing it.
Cheers,
MAT.