diff options
author | zhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386> | 2009-07-21 23:26:31 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386> | 2009-07-21 23:26:31 +0000 |
commit | 1afe1c7971e649ae8b85a39fc1ab6ac595e1dd58 (patch) | |
tree | 89211fcb578f2e2cb40e6c2570866d969feee655 /include/gmock/gmock-generated-actions.h | |
parent | 387bdd551d4a88383246841ac3f70324b8d42772 (diff) | |
download | googletest-1afe1c7971e649ae8b85a39fc1ab6ac595e1dd58.tar.gz googletest-1afe1c7971e649ae8b85a39fc1ab6ac595e1dd58.tar.bz2 googletest-1afe1c7971e649ae8b85a39fc1ab6ac595e1dd58.zip |
Adds the ReturnArg<k>() action (by Tim Hockin); refactors gmock-matchers.h (by Zhanyong Wan).
Diffstat (limited to 'include/gmock/gmock-generated-actions.h')
-rw-r--r-- | include/gmock/gmock-generated-actions.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/gmock/gmock-generated-actions.h b/include/gmock/gmock-generated-actions.h index c0097175..06d9449e 100644 --- a/include/gmock/gmock-generated-actions.h +++ b/include/gmock/gmock-generated-actions.h @@ -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, |