alternative to ReturnNew
Closed this issue · 4 comments
GoogleCodeExporter commented
As an alternative to ReturnNew, another action could be implemented that,
instead of returning a newly created object, would rather assign the address of
newly created object to method parameter:
my_method (Object ** obj);
An action that I would propose to call "CreateAndPass" would then do the
assignment:
*obj = new Object(...contructor params...);
Piotr
Original issue reported on code.google.com by pgo...@gmail.com
on 20 Nov 2010 at 4:57
GoogleCodeExporter commented
I wanted to make this an enhancement, not a defect.
Original comment by pgo...@gmail.com
on 20 Nov 2010 at 5:00
GoogleCodeExporter commented
I think this is too specialized to be added to gmock. Please define a custom
action instead. See the cook book wiki for how to do that.
Also, a friendly reminder that we use the the issue tracker for bug reports and
approved feature requests. For new feature requests, please use the mailing
list. Thanks.
Original comment by w...@google.com
on 22 Nov 2010 at 8:30
- Changed state: WontFix
- Added labels: OpSys-All, Priority-Low, Type-Enhancement
- Removed labels: Priority-Medium, Type-Defect
GoogleCodeExporter commented
My point was to add this as a new feature request and then contribute the
code that adds this functionality. If you think, however, that it is too
specialized, I will only keep this as my own custom action.
Piotr
Original comment by pgo...@gmail.com
on 22 Nov 2010 at 8:39
GoogleCodeExporter commented
Thanks for offering to contribute! The mailing list will be a great venue for
discussions like this, as it reaches far more many people.
Yes, I think this is a bit too specialized.
Original comment by w...@google.com
on 22 Nov 2010 at 9:01