vmanucharyan / googlemock

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

Support for throw (...) in method mock generator macros #74

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
An interface containing methods with throw() specifier is not possible to
mock. E.g. to mock the following:

   class IFoo {
   public:
     virtual void foo() throw (MyException);
   };

one would need macros like

   class MockFoo : public IFoo {
   public:
     MOCK_METHOD0_THROW(foo, void(), throw(MyException));
   };

Original issue reported on code.google.com by levon...@gmail.com on 22 Sep 2009 at 12:48

GoogleCodeExporter commented 9 years ago

Original comment by zhanyong...@gmail.com on 22 Sep 2009 at 7:20

GoogleCodeExporter commented 9 years ago
I think MOCK_THROW_METHODx is a better name, analogous to MOCK_CONST_METHODx.

Original comment by joel.ros...@gmail.com on 3 Dec 2009 at 2:23

GoogleCodeExporter commented 9 years ago
Probably not worth the complexity.

Original comment by w...@google.com on 6 Mar 2010 at 5:50

GoogleCodeExporter commented 9 years ago
Note that throw spec has just been deprecated by the C++ standard committee.

Original comment by w...@google.com on 23 Mar 2010 at 7:31

GoogleCodeExporter commented 9 years ago
Don't forget to provide the makro MOCK_CONST_THROW_METHODx

Original comment by rtoore...@gmail.com on 31 May 2010 at 8:27

GoogleCodeExporter commented 9 years ago
We decided not to support this:

- it's relatively rarely needed.
- throw spec has been deprecated by the C++ standard committe.
- we don't have enough resources to do it.

Original comment by w...@google.com on 1 Jun 2010 at 6:20