More than 10 parameters

638 views
Skip to first unread message

sukrit singh

unread,
Nov 18, 2011, 1:22:33 AM11/18/11
to googlemock

I want to Mock a method which has more than 10 parameters. Can I do that without changing gmock source code ?

Regards
--
Sukrit Singh Raghuvanshi(Mr.)
Year 3
Computer Engineering (CEG)
National University of Singapore (NUS)
HP: (+65) 81656631

Greg Miller

unread,
Nov 18, 2011, 9:45:55 AM11/18/11
to sukrit singh, googlemock
Hi, Sukrit.

The short answer is no. GMock's default arity maximum is 10. This is because some max has to be chosen, and often times a method taking more than 10 arguments should be refactored.

My advice would be to consider refactoring your function. If that's not an option, consider writing a wrapper that takes fewer arguments and mock that one. I would not recommend changing gmock's source code locally.

HTH,

Greg
Reply all
Reply to author
Forward
0 new messages