From 1afe1c7971e649ae8b85a39fc1ab6ac595e1dd58 Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Tue, 21 Jul 2009 23:26:31 +0000 Subject: Adds the ReturnArg() action (by Tim Hockin); refactors gmock-matchers.h (by Zhanyong Wan). --- include/gmock/gmock-generated-actions.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/gmock/gmock-generated-actions.h') 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(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9); } +// Action ReturnArg() 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(args); +} + // Action SaveArg(pointer) saves the k-th (0-based) argument of the // mock function to *pointer. ACTION_TEMPLATE(SaveArg, -- cgit v1.2.3