aboutsummaryrefslogtreecommitdiffstats
path: root/include/gmock/gmock-more-actions.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/gmock/gmock-more-actions.h')
-rw-r--r--include/gmock/gmock-more-actions.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/gmock/gmock-more-actions.h b/include/gmock/gmock-more-actions.h
index e418505a..a547a648 100644
--- a/include/gmock/gmock-more-actions.h
+++ b/include/gmock/gmock-more-actions.h
@@ -36,6 +36,8 @@
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
+#include <algorithm>
+
#include "gmock/gmock-generated-actions.h"
namespace testing {
@@ -153,6 +155,14 @@ ACTION_TEMPLATE(SaveArg,
*pointer = ::std::tr1::get<k>(args);
}
+// Action SaveArgPointee<k>(pointer) saves the value pointed to
+// by the k-th (0-based) argument of the mock function to *pointer.
+ACTION_TEMPLATE(SaveArgPointee,
+ HAS_1_TEMPLATE_PARAMS(int, k),
+ AND_1_VALUE_PARAMS(pointer)) {
+ *pointer = *::std::tr1::get<k>(args);
+}
+
// Action SetArgReferee<k>(value) assigns 'value' to the variable
// referenced by the k-th (0-based) argument of the mock function.
ACTION_TEMPLATE(SetArgReferee,