Closed GoogleCodeExporter closed 9 years ago
(In the future, it's best to send questions to googlemock@googlegroups.com
instead of the issue tracker.)
MOCK_METHOD* relies on tr1::tuple for storing the arguments. Many tr1::tuple
implementations limit the number of fields to 10, so you'll run into problems
if you try to extend MOCK_METHOD* to more than 10 arguments.
A function with more than 10 arguments isn't readable. At the call site, it's
very hard to tell which argument is for what. Usually we suggest to limit the
arguments to under 6.
I understand that you cannot change CreateService, but you can create a wrapper
for it. The wrapper can take a struct argument, which can hold the arguments
that are less interesting. Then you can keep the total number of arguments
under 10, and then you can mock the wrapper.
Original comment by w...@google.com
on 22 Jul 2010 at 4:47
Dear Google Mock Owners,
Thank you for your explanation.
I think I can change my design for this exception.
BTW, sorry for issuing question as tracker, next time I will send to
googlemock@googlegroups.com first.
Thank you.
Original comment by liucc...@gmail.com
on 23 Jul 2010 at 6:58
Is there any sample of how to write the wrapper? I have the same problem.
Original comment by hla...@gmail.com
on 1 Oct 2012 at 10:08
Original issue reported on code.google.com by
liucc...@gmail.com
on 22 Jul 2010 at 11:51