fcoulombe / googlemock

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

gmock_gen.py does not reproduce "const" for const return type #44

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
execute gmock_gen.py on a class containing the following type of method:

class AbstractObject{

public:

virtual const char* getObject() const = 0;
};

file MockBug.h containing a class with this type of method is attached.

What is the expected output? 

MOCK_CONST_METHOD0(getObject, const char*() );

What do you see instead?

MOCK_CONST_METHOD0(getObject, char*() );

file mock_test_output.txt is attached.

What version of the product are you using? On what operating system?

googlemock 1.1.0
python 2.6
windows xp

Used this googlemock cookbook example as a reference that const should be
included:

for method in the cookbook:  virtual const Bar& GetBar() const;
cookbook example:  MOCK_CONST_METHOD0(GetBar, const Bar&());

Original issue reported on code.google.com by marlena....@gmail.com on 28 Apr 2009 at 9:18

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by zhanyong...@gmail.com on 1 May 2009 at 7:46

GoogleCodeExporter commented 9 years ago

Original comment by zhanyong...@gmail.com on 1 May 2009 at 4:19

GoogleCodeExporter commented 9 years ago
Thanks for the report.  I'll take a look.

Original comment by nnorw...@gmail.com on 1 May 2009 at 4:23

GoogleCodeExporter commented 9 years ago
Committed revision 145.  You can use the upgraded script by downloading it 
here: 
http://googlemock.googlecode.com/svn/trunk/scripts/generator/cpp/gmock_class.py

Install that file over top of the existing gmock_class.py file and that should 
fix
this problem.  Let me know if you have more issues.

Thanks again for the bug report.

Original comment by nnorw...@gmail.com on 6 May 2009 at 5:04