Are you trying to copy the string into the memory pointed by func's parameter? What SetArgPointee does is essentially the assignment *func_arg = action_param. This will copy a char* pointer, provided func is declared as void func(const char**), but it will not copy a string into a location pointed by a const char* pointer. If you want that, you either need to have func be declared void func(string*) or have a custom action:
ACTION_P(StrCpyToArg0, str) { strcpy(arg0, str); }
or
ACTION_TEMPLATE(
StrCpyToArg,
HAS_1_TEMPLATE_PARAMS(int, k),
AND_1_VALUE_PARAMS(str)) {
strcpy(std::tr1::get<k>(args), str);
}
Then you will be able to write:
EXPECT_CALL(myClass, func(_)).WillOnce(StrCpyToArg<0>("Hello"));
The recent changes in gMock simply enabled one to pass literal strings into SetArgPointee. Prior to those changes, such attempt resulted in a compile error.
HTH,
Vlad