Hi,
You can use SetArgPointee to set out parameters. This way you don't
have to write custom action. This works very well for base classes,
however it does not work for derived classes. I believe for derived
classes you need to write some custom action as described by Greg.
pseudo code (Sorry, I don't have access to Visual Studio from home)
Blah blah;
blah.a = 1;
blah.b = 2;
EXPECT_CALL(foo, DoBlah(::testing::_)).WillOnce(SetArgPointee(0)
(blah));
Thanks,
Mano
On Oct 21, 6:39 am, Greg Miller <
j...@google.com> wrote:
> Hi, Kenneth.
>
> I'm not sure I completely understand what you're describing. It might help
> if you can provide the function signature that you'd like to mock, and a
> description of what you'd like to happen.
>
> My guess, is that you'd like to have an action that given a pointer to a
> class, sets a particular field of that class. One way to do that would be
> with a simple custom
> action<
http://code.google.com/p/googlemock/wiki/CookBook#Writing_New_Actions...>.