summaryrefslogtreecommitdiffstats
path: root/googlemock/include/gmock/gmock-actions.h
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2020-01-14 16:20:24 (GMT)
committervslashg <gfalcon@google.com>2020-01-16 18:55:54 (GMT)
commit7a8591e6e4e206b748feb052f620c45278e686d0 (patch)
tree99047d33ff47aab60327d40f95d9724a520417c4 /googlemock/include/gmock/gmock-actions.h
parent0b024bd91a14a77a7e7d6072ccd88e09c86ddeaa (diff)
downloadgoogletest-7a8591e6e4e206b748feb052f620c45278e686d0.zip
googletest-7a8591e6e4e206b748feb052f620c45278e686d0.tar.gz
googletest-7a8591e6e4e206b748feb052f620c45278e686d0.tar.bz2
Googletest export
Use GMOCK_PP to generate args boilerplate. Move common args describing part to separate macroses that uses GMOCK_PP to generate sequences. PiperOrigin-RevId: 289655624
Diffstat (limited to 'googlemock/include/gmock/gmock-actions.h')
-rw-r--r--googlemock/include/gmock/gmock-actions.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h
index a7b84d1..7b1a14c 100644
--- a/googlemock/include/gmock/gmock-actions.h
+++ b/googlemock/include/gmock/gmock-actions.h
@@ -50,6 +50,7 @@
#include "gmock/internal/gmock-internal-utils.h"
#include "gmock/internal/gmock-port.h"
+#include "gmock/internal/gmock-pp.h"
#ifdef _MSC_VER
# pragma warning(push)
@@ -1275,6 +1276,21 @@ auto InvokeArgumentAdl(AdlTag, F f, Args... args) -> decltype(f(args...)) {
}
} // namespace invoke_argument
+
+#define GMOCK_INTERNAL_ARG_UNUSED(N, data, el) \
+ , const arg##N##_type& arg##N GTEST_ATTRIBUTE_UNUSED_
+#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_ \
+ const args_type& args GTEST_ATTRIBUTE_UNUSED_ GMOCK_PP_REPEAT( \
+ GMOCK_INTERNAL_ARG_UNUSED, , 10)
+
+#define GMOCK_INTERNAL_ARG(N, data, el) , const arg##N##_type& arg##N
+#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_ \
+ const args_type& args GMOCK_PP_REPEAT(GMOCK_INTERNAL_ARG, , 10)
+
+#define GMOCK_INTERNAL_TEMPLATE_ARG(N, data, el) , typename arg##N##_type
+#define GMOCK_ACTION_TEMPLATE_ARGS_NAMES_ \
+ GMOCK_PP_TAIL(GMOCK_PP_REPEAT(GMOCK_INTERNAL_TEMPLATE_ARG, , 10))
+
} // namespace internal
} // namespace testing