michaelernst / googlemock

Automatically exported from code.google.com/p/googlemock
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Automatically generate mock pure virtual functions #104

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a class with 30 pure virtual functions that I'm trying to create a 
mock for. In the mock subclass, I have to define 30 MOCK_METHODs, even 
though only a few will be called in my test, because otherwise the compiler 
says that the subclass is abstract and not instantiable. Can we have gmock 
automatically define the other functions? These implicitly mocked functions 
can do anything, including aborting the process, because they won't be 
called, anyway.

Original issue reported on code.google.com by k...@google.com on 17 Mar 2010 at 4:32

GoogleCodeExporter commented 9 years ago
Please use the mailing list for questions.  Thanks.

Original comment by w...@google.com on 17 Mar 2010 at 4:41

GoogleCodeExporter commented 9 years ago
This was not a question but a a feature request. Sorry for not setting the type 
correctly.

Original comment by k...@google.com on 17 Mar 2010 at 4:57

GoogleCodeExporter commented 9 years ago
Take a look at scripts/generator/gmock_gen.py.

Original comment by vl...@google.com on 17 Mar 2010 at 5:15

GoogleCodeExporter commented 9 years ago
Thanks!

Original comment by k...@google.com on 17 Mar 2010 at 5:30