c++ - mock method with 11 parameters with gmock -
I'm using gmock to mimic my dependencies in legacy code with one of 11 parameters in the class The method is when I tried to use MOCK_METHOD11_WITH_CALLTYPE to mock, then I found that this macro is not present. Gmock supoort only up to 10 parameters What do you suggest for this? Do I apply this method with the dummy body? Or copy & amp; Extension of macro? Thanks!
PS, I do not need to test this method anymore, but there is a need to do this in the future.
Best regards,
Problems in ways with more than 10 parameters The sign can be that I can suggest an alternative solution which will help in your specific case, but that can be a good idea besides jokes. Take several parameters that are understood as a group, and collect them in one structure, then give an example of that structure in the form of logic of the method. So instead of 11 arguments, you can have 3 or 4. It does not help you with your fake library problem, it can improve the usefulness of your class, because the methods of many arguments are usually difficult to read.
Comments
Post a Comment