Adds the ReturnArg<k>() action (by Tim Hockin); refactors gmock-matchers.h (by Zhanyong Wan).

This commit is contained in:
zhanyong.wan
2009-07-21 23:26:31 +00:00
parent 387bdd551d
commit 1afe1c7971
6 changed files with 249 additions and 444 deletions

View File

@@ -2441,6 +2441,13 @@ ACTION_TEMPLATE(InvokeArgument,
::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
}
// Action ReturnArg<k>() returns the k-th argument of the mock function.
ACTION_TEMPLATE(ReturnArg,
HAS_1_TEMPLATE_PARAMS(int, k),
AND_0_VALUE_PARAMS()) {
return std::tr1::get<k>(args);
}
// Action SaveArg<k>(pointer) saves the k-th (0-based) argument of the
// mock function to *pointer.
ACTION_TEMPLATE(SaveArg,