aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32F1xx/SPI/mcuconf.h
blob: b6c0eb62b2321e30350736874f78e61d228b7380 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
/*
    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

#ifndef MCUCONF_H
#define MCUCONF_H

#define STM32F103_MCUCONF

/*
 * STM32F103 drivers configuration.
 * The following settings override the default settings present in
 * the various device driver implementation headers.
 * Note that the settings for each driver only have effect if the whole
 * driver is enabled in halconf.h.
 *
 * IRQ priorities:
 * 15...0       Lowest...Highest.
 *
 * DMA priorities:
 * 0...3        Lowest...Highest.
 */

/*
 * HAL driver system settings.
 */
#define STM32_NO_INIT                       FALSE
#define STM32_HSI_ENABLED                   TRUE
#define STM32_LSI_ENABLED                   FALSE
#define STM32_HSE_ENABLED                   TRUE
#define STM32_LSE_ENABLED                   FALSE
#define STM32_SW                            STM32_SW_PLL
#define STM32_PLLSRC                        STM32_PLLSRC_HSE
#define STM32_PLLXTPRE                      STM32_PLLXTPRE_DIV1
#define STM32_PLLMUL_VALUE                  9
#define STM32_HPRE                          STM32_HPRE_DIV1
#define STM32_PPRE1                         STM32_PPRE1_DIV2
#define STM32_PPRE2                         STM32_PPRE2_DIV2
#define STM32_ADCPRE                        STM32_ADCPRE_DIV4
#define STM32_USB_CLOCK_REQUIRED            TRUE
#define STM32_USBPRE                        STM32_USBPRE_DIV1P5
#define STM32_MCOSEL                        STM32_MCOSEL_NOCLOCK
#define STM32_RTCSEL                        STM32_RTCSEL_HSEDIV
#define STM32_PVD_ENABLE                    FALSE
#define STM32_PLS                           STM32_PLS_LEV0

/*
 * ADC driver system settings.
 */
#define STM32_ADC_USE_ADC1                  FALSE
#define STM32_ADC_ADC1_DMA_PRIORITY         2
#define STM32_ADC_ADC1_IRQ_PRIORITY         6

/*
 * CAN driver system settings.
 */
#define STM32_CAN_USE_CAN1                  FALSE
#define STM32_CAN_CAN1_IRQ_PRIORITY         11

/*
 * EXT driver system settings.
 */
#define STM32_EXT_EXTI0_IRQ_PRIORITY        6
#define STM32_EXT_EXTI1_IRQ_PRIORITY        6
#define STM32_EXT_EXTI2_IRQ_PRIORITY        6
#define STM32_EXT_EXTI3_IRQ_PRIORITY        6
#define STM32_EXT_EXTI4_IRQ_PRIORITY        6
#define STM32_EXT_EXTI5_9_IRQ_PRIORITY      6
#define STM32_EXT_EXTI10_15_IRQ_PRIORITY    6
#define STM32_EXT_EXTI16_IRQ_PRIORITY       6
#define STM32_EXT_EXTI17_IRQ_PRIORITY       6
#define STM32_EXT_EXTI18_IRQ_PRIORITY       6
#define STM32_EXT_EXTI19_IRQ_PRIORITY       6

/*
 * GPT driver system settings.
 */
#define STM32_GPT_USE_TIM1                  FALSE
#define STM32_GPT_USE_TIM2                  FALSE
#define STM32_GPT_USE_TIM3                  FALSE
#define STM32_GPT_USE_TIM4                  FALSE
#define STM32_GPT_USE_TIM5                  FALSE
#define STM32_GPT_USE_TIM8                  FALSE
#define STM32_GPT_TIM1_IRQ_PRIORITY         7
#define STM32_GPT_TIM2_IRQ_PRIORITY         7
#define STM32_GPT_TIM3_IRQ_PRIORITY         7
#define STM32_GPT_TIM4_IRQ_PRIORITY         7
#define STM32_GPT_TIM5_IRQ_PRIORITY         7
#define STM32_GPT_TIM8_IRQ_PRIORITY         7

/*
 * I2C driver system settings.
 */
#define STM32_I2C_USE_I2C1                  FALSE
#define STM32_I2C_USE_I2C2                  FALSE
#define STM32_I2C_BUSY_TIMEOUT              50
#define STM32_I2C_I2C1_IRQ_PRIORITY         5
#define STM32_I2C_I2C2_IRQ_PRIORITY         5
#define STM32_I2C_I2C1_DMA_PRIORITY         3
#define STM32_I2C_I2C2_DMA_PRIORITY         3
#define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")

/*
 * ICU driver system settings.
 */
#define STM32_ICU_USE_TIM1                  FALSE
#define STM32_ICU_USE_TIM2                  FALSE
#define STM32_ICU_USE_TIM3                  FALSE
#define STM32_ICU_USE_TIM4                  FALSE
#define STM32_ICU_USE_TIM5                  FALSE
#define STM32_ICU_USE_TIM8                  FALSE
#define STM32_ICU_TIM1_IRQ_PRIORITY         7
#define STM32_ICU_TIM2_IRQ_PRIORITY         7
#define STM32_ICU_TIM3_IRQ_PRIORITY         7
#define STM32_ICU_TIM4_IRQ_PRIORITY         7
#define STM32_ICU_TIM5_IRQ_PRIORITY         7
#define STM32_ICU_TIM8_IRQ_PRIORITY         7

/*
 * PWM driver system settings.
 */
#define STM32_PWM_USE_ADVANCED              FALSE
#define STM32_PWM_USE_TIM1                  FALSE
#define STM32_PWM_USE_TIM2                  FALSE
#define STM32_PWM_USE_TIM3                  FALSE
#define STM32_PWM_USE_TIM4                  FALSE
#define STM32_PWM_USE_TIM5                  FALSE
#define STM32_PWM_USE_TIM8                  FALSE
#define STM32_PWM_TIM1_IRQ_PRIORITY         7
#define STM32_PWM_TIM2_IRQ_PRIORITY         7
#define STM32_PWM_TIM3_IRQ_PRIORITY         7
#define STM32_PWM_TIM4_IRQ_PRIORITY         7
#define STM32_PWM_TIM5_IRQ_PRIORITY         7
#define STM32_PWM_TIM8_IRQ_PRIORITY         7

/*
 * RTC driver system settings.
 */
#define STM32_RTC_IRQ_PRIORITY              15

/*
 * SERIAL driver system settings.
 */
#define STM32_SERIAL_USE_USART1             FALSE
#define STM32_SERIAL_USE_USART2             FALSE
#define STM32_SERIAL_USE_USART3             FALSE
#define STM32_SERIAL_USE_UART4              FALSE
#define STM32_SERIAL_USE_UART5              FALSE
#define STM32_SERIAL_USART1_PRIORITY        12
#define STM32_SERIAL_USART2_PRIORITY        12
#define STM32_SERIAL_USART3_PRIORITY        12
#define STM32_SERIAL_UART4_PRIORITY         12
#define STM32_SERIAL_UART5_PRIORITY         12

/*
 * SPI driver system settings.
 */
#define STM32_SPI_USE_SPI1                  TRUE
#define STM32_SPI_USE_SPI2                  TRUE
#define STM32_SPI_USE_SPI3                  FALSE
#define STM32_SPI_SPI1_DMA_PRIORITY         1
#define STM32_SPI_SPI2_DMA_PRIORITY         1
#define STM32_SPI_SPI3_DMA_PRIORITY         1
#define STM32_SPI_SPI1_IRQ_PRIORITY         10
#define STM32_SPI_SPI2_IRQ_PRIORITY         10
#define STM32_SPI_SPI3_IRQ_PRIORITY         10
#define STM32_SPI_DMA_ERROR_HOOK(spip)      osalSysHalt("DMA failure")

/*
 * ST driver system settings.
 */
#define STM32_ST_IRQ_PRIORITY               8
#define STM32_ST_USE_TIMER                  2

/*
 * UART driver system settings.
 */
#define STM32_UART_USE_USART1               FALSE
#define STM32_UART_USE_USART2               FALSE
#define STM32_UART_USE_USART3               FALSE
#define STM32_UART_USART1_IRQ_PRIORITY      12
#define STM32_UART_USART2_IRQ_PRIORITY      12
#define STM32_UART_USART3_IRQ_PRIORITY      12
#define STM32_UART_USART1_DMA_PRIORITY      0
#define STM32_UART_USART2_DMA_PRIORITY      0
#define STM32_UART_USART3_DMA_PRIORITY      0
#define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")

/*
 * USB driver system settings.
 */
#define STM32_USB_USE_USB1                  FALSE
#define STM32_USB_LOW_POWER_ON_SUSPEND      FALSE
#define STM32_USB_USB1_HP_IRQ_PRIORITY      13
#define STM32_USB_USB1_LP_IRQ_PRIORITY      14

/*
 * WDG driver system settings.
 */
#define STM32_WDG_USE_IWDG                  FALSE

#endif /* MCUCONF_H */
f='#n730'>730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379
// This file was GENERATED by command:
//     pump.py gmock-generated-function-mockers.h.pump
// DO NOT EDIT BY HAND!!!

// Copyright 2007, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)

// Google Mock - a framework for writing C++ mock classes.
//
// This file implements function mockers of various arities.

#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_

#include "gmock/gmock-spec-builders.h"
#include "gmock/internal/gmock-internal-utils.h"

#if GTEST_HAS_STD_FUNCTION_
# include <functional>
#endif

namespace testing {
namespace internal {

template <typename F>
class FunctionMockerBase;

// Note: class FunctionMocker really belongs to the ::testing
// namespace.  However if we define it in ::testing, MSVC will
// complain when classes in ::testing::internal declare it as a
// friend class template.  To workaround this compiler bug, we define
// FunctionMocker in ::testing::internal and import it into ::testing.
template <typename F>
class FunctionMocker;

template <typename R>
class FunctionMocker<R()> : public
    internal::FunctionMockerBase<R()> {
 public:
  typedef R F();
  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

  MockSpec<F> With() {
    return MockSpec<F>(this, ::testing::make_tuple());
  }

  R Invoke() {
    // Even though gcc and MSVC don't enforce it, 'this->' is required
    // by the C++ standard [14.6.4] here, as the base class type is
    // dependent on the template argument (and thus shouldn't be
    // looked into when resolving InvokeWith).
    return this->InvokeWith(ArgumentTuple());
  }
};

template <typename R, typename A1>
class FunctionMocker<R(A1)> : public
    internal::FunctionMockerBase<R(A1)> {
 public:
  typedef R F(A1);
  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

  MockSpec<F> With(const Matcher<A1>& m1) {
    return MockSpec<F>(this, ::testing::make_tuple(m1));
  }

  R Invoke(A1 a1) {
    // Even though gcc and MSVC don't enforce it, 'this->' is required
    // by the C++ standard [14.6.4] here, as the base class type is
    // dependent on the template argument (and thus shouldn't be
    // looked into when resolving InvokeWith).
    return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1)));
  }
};

template <typename R, typename A1, typename A2>
class FunctionMocker<R(A1, A2)> : public
    internal::FunctionMockerBase<R(A1, A2)> {
 public:
  typedef R F(A1, A2);
  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

  MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2) {
    return MockSpec<F>(this, ::testing::make_tuple(m1, m2));
  }

  R Invoke(A1 a1, A2 a2) {
    // Even though gcc and MSVC don't enforce it, 'this->' is required
    // by the C++ standard [14.6.4] here, as the base class type is
    // dependent on the template argument (and thus shouldn't be
    // looked into when resolving InvokeWith).
    return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1),
        internal::forward<A2>(a2)));
  }
};

template <typename R, typename A1, typename A2, typename A3>
class FunctionMocker<R(A1, A2, A3)> : public
    internal::FunctionMockerBase<R(A1, A2, A3)> {
 public:
  typedef R F(A1, A2, A3);
  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

  MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2,
      const Matcher<A3>& m3) {
    return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3));
  }

  R Invoke(A1 a1, A2 a2, A3 a3) {
    // Even though gcc and MSVC don't enforce it, 'this->' is required
    // by the C++ standard [14.6.4] here, as the base class type is
    // dependent on the template argument (and thus shouldn't be
    // looked into when resolving InvokeWith).
    return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1),
        internal::forward<A2>(a2), internal::forward<A3>(a3)));
  }
};

template <typename R, typename A1, typename A2, typename A3, typename A4>
class FunctionMocker<R(A1, A2, A3, A4)> : public
    internal::FunctionMockerBase<R(A1, A2, A3, A4)> {
 public:
  typedef R F(A1, A2, A3, A4);
  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

  MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2,
      const Matcher<A3>& m3, const Matcher<A4>& m4) {
    return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4));
  }

  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4) {
    // Even though gcc and MSVC don't enforce it, 'this->' is required
    // by the C++ standard [14.6.4] here, as the base class type is
    // dependent on the template argument (and thus shouldn't be
    // looked into when resolving InvokeWith).
    return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1),
        internal::forward<A2>(a2), internal::forward<A3>(a3),
        internal::forward<A4>(a4)));
  }
};

template <typename R, typename A1, typename A2, typename A3, typename A4,
    typename A5>
class FunctionMocker<R(A1, A2, A3, A4, A5)> : public
    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5)> {
 public:
  typedef R F(A1, A2, A3, A4, A5);
  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

  MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2,
      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5) {
    return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5));
  }

  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
    // Even though gcc and MSVC don't enforce it, 'this->' is required
    // by the C++ standard [14.6.4] here, as the base class type is
    // dependent on the template argument (and thus shouldn't be
    // looked into when resolving InvokeWith).
    return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1),
        internal::forward<A2>(a2), internal::forward<A3>(a3),
        internal::forward<A4>(a4), internal::forward<A5>(a5)));
  }
};

template <typename R, typename A1, typename A2, typename A3, typename A4,
    typename A5, typename A6>
class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public
    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6)> {
 public:
  typedef R F(A1, A2, A3, A4, A5, A6);
  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

  MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2,
      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
      const Matcher<A6>& m6) {
    return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6));
  }

  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
    // Even though gcc and MSVC don't enforce it, 'this->' is required
    // by the C++ standard [14.6.4] here, as the base class type is
    // dependent on the template argument (and thus shouldn't be
    // looked into when resolving InvokeWith).
    return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1),
        internal::forward<A2>(a2), internal::forward<A3>(a3),
        internal::forward<A4>(a4), internal::forward<A5>(a5),
        internal::forward<A6>(a6)));
  }
};

template <typename R, typename A1, typename A2, typename A3, typename A4,
    typename A5, typename A6, typename A7>
class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public
    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7)> {
 public:
  typedef R F(A1, A2, A3, A4, A5, A6, A7);
  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

  MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2,
      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
      const Matcher<A6>& m6, const Matcher<A7>& m7) {
    return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7));
  }

  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) {
    // Even though gcc and MSVC don't enforce it, 'this->' is required
    // by the C++ standard [14.6.4] here, as the base class type is
    // dependent on the template argument (and thus shouldn't be
    // looked into when resolving InvokeWith).
    return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1),
        internal::forward<A2>(a2), internal::forward<A3>(a3),
        internal::forward<A4>(a4), internal::forward<A5>(a5),
        internal::forward<A6>(a6), internal::forward<A7>(a7)));
  }
};

template <typename R, typename A1, typename A2, typename A3, typename A4,
    typename A5, typename A6, typename A7, typename A8>
class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public
    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
 public:
  typedef R F(A1, A2, A3, A4, A5, A6, A7, A8);
  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

  MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2,
      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
      const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8) {
    return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7,
        m8));
  }

  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) {
    // Even though gcc and MSVC don't enforce it, 'this->' is required
    // by the C++ standard [14.6.4] here, as the base class type is
    // dependent on the template argument (and thus shouldn't be
    // looked into when resolving InvokeWith).
    return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1),
        internal::forward<A2>(a2), internal::forward<A3>(a3),
        internal::forward<A4>(a4), internal::forward<A5>(a5),
        internal::forward<A6>(a6), internal::forward<A7>(a7),
        internal::forward<A8>(a8)));
  }
};

template <typename R, typename A1, typename A2, typename A3, typename A4,
    typename A5, typename A6, typename A7, typename A8, typename A9>
class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public
    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
 public:
  typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9);
  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

  MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2,
      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
      const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
      const Matcher<A9>& m9) {
    return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7,
        m8, m9));
  }

  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) {
    // Even though gcc and MSVC don't enforce it, 'this->' is required
    // by the C++ standard [14.6.4] here, as the base class type is
    // dependent on the template argument (and thus shouldn't be
    // looked into when resolving InvokeWith).
    return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1),
        internal::forward<A2>(a2), internal::forward<A3>(a3),
        internal::forward<A4>(a4), internal::forward<A5>(a5),
        internal::forward<A6>(a6), internal::forward<A7>(a7),
        internal::forward<A8>(a8), internal::forward<A9>(a9)));
  }
};

template <typename R, typename A1, typename A2, typename A3, typename A4,
    typename A5, typename A6, typename A7, typename A8, typename A9,
    typename A10>
class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> {
 public:
  typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

  MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2,
      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
      const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
      const Matcher<A9>& m9, const Matcher<A10>& m10) {
    return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7,
        m8, m9, m10));
  }

  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9,
      A10 a10) {
    // Even though gcc and MSVC don't enforce it, 'this->' is required
    // by the C++ standard [14.6.4] here, as the base class type is
    // dependent on the template argument (and thus shouldn't be
    // looked into when resolving InvokeWith).
    return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1),
        internal::forward<A2>(a2), internal::forward<A3>(a3),
        internal::forward<A4>(a4), internal::forward<A5>(a5),
        internal::forward<A6>(a6), internal::forward<A7>(a7),
        internal::forward<A8>(a8), internal::forward<A9>(a9),
        internal::forward<A10>(a10)));
  }
};

// Removes the given pointer; this is a helper for the expectation setter method
// for parameterless matchers.
//
// We want to make sure that the user cannot set a parameterless expectation on
// overloaded methods, including methods which are overloaded on const. Example:
//
//   class MockClass {
//     MOCK_METHOD0(GetName, string&());
//     MOCK_CONST_METHOD0(GetName, const string&());
//   };
//
//   TEST() {
//     // This should be an error, as it's not clear which overload is expected.
//     EXPECT_CALL(mock, GetName).WillOnce(ReturnRef(value));
//   }
//
// Here are the generated expectation-setter methods:
//
//   class MockClass {
//     // Overload 1
//     MockSpec<string&()> gmock_GetName() { … }
//     // Overload 2. Declared const so that the compiler will generate an
//     // error when trying to resolve between this and overload 4 in
//     // 'gmock_GetName(WithoutMatchers(), nullptr)'.
//     MockSpec<string&()> gmock_GetName(
//         const WithoutMatchers&, const Function<string&()>*) const {
//       // Removes const from this, calls overload 1
//       return AdjustConstness_(this)->gmock_GetName();
//     }
//
//     // Overload 3
//     const string& gmock_GetName() const { … }
//     // Overload 4
//     MockSpec<const string&()> gmock_GetName(
//         const WithoutMatchers&, const Function<const string&()>*) const {
//       // Does not remove const, calls overload 3
//       return AdjustConstness_const(this)->gmock_GetName();
//     }
//   }
//
template <typename MockType>
const MockType* AdjustConstness_const(const MockType* mock) {
  return mock;
}

// Removes const from and returns the given pointer; this is a helper for the
// expectation setter method for parameterless matchers.
template <typename MockType>
MockType* AdjustConstness_(const MockType* mock) {
  return const_cast<MockType*>(mock);
}

}  // namespace internal

// The style guide prohibits "using" statements in a namespace scope
// inside a header file.  However, the FunctionMocker class template
// is meant to be defined in the ::testing namespace.  The following
// line is just a trick for working around a bug in MSVC 8.0, which
// cannot handle it if we define FunctionMocker in ::testing.
using internal::FunctionMocker;

// GMOCK_RESULT_(tn, F) expands to the result type of function type F.
// We define this as a variadic macro in case F contains unprotected
// commas (the same reason that we use variadic macros in other places
// in this file).
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_RESULT_(tn, ...) \
    tn ::testing::internal::Function<__VA_ARGS__>::Result

// The type of argument N of the given function type.
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_ARG_(tn, N, ...) \
    tn ::testing::internal::Function<__VA_ARGS__>::Argument##N

// The matcher type for argument N of the given function type.
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_MATCHER_(tn, N, ...) \
    const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>&

// The variable for mocking the given method.
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_MOCKER_(arity, constness, Method) \
    GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)

// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD0_(tn, constness, ct, Method, ...)                       \
  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method() constness {                     \
    GTEST_COMPILE_ASSERT_(                                                   \
        (::testing::tuple_size<tn ::testing::internal::Function<             \
             __VA_ARGS__>::ArgumentTuple>::value == 0),                      \
        this_method_does_not_take_0_arguments);                              \
    GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method);      \
    return GMOCK_MOCKER_(0, constness, Method).Invoke();                     \
  }                                                                          \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method() constness {              \
    GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this);                 \
    return GMOCK_MOCKER_(0, constness, Method).With();                       \
  }                                                                          \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                           \
      const ::testing::internal::WithoutMatchers&,                           \
      constness ::testing::internal::Function<__VA_ARGS__>*) const {         \
    return ::testing::internal::AdjustConstness_##constness(this)            \
        ->gmock_##Method();                                                  \
  }                                                                          \
  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness, \
                                                               Method)

// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD1_(tn, constness, ct, Method, ...)                        \
  GMOCK_RESULT_(tn, __VA_ARGS__)                                              \
  ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness {              \
    GTEST_COMPILE_ASSERT_(                                                    \
        (::testing::tuple_size<tn ::testing::internal::Function<              \
             __VA_ARGS__>::ArgumentTuple>::value == 1),                       \
        this_method_does_not_take_1_argument);                                \
    GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method);       \
    return GMOCK_MOCKER_(1, constness, Method)                                \
        .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
            gmock_a1));                                                       \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness {                \
    GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this);                  \
    return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1);                \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      const ::testing::internal::WithoutMatchers&,                            \
      constness ::testing::internal::Function<__VA_ARGS__>*) const {          \
    return ::testing::internal::AdjustConstness_##constness(this)             \
        ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>());     \
  }                                                                           \
  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness,  \
                                                               Method)

// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD2_(tn, constness, ct, Method, ...)                        \
  GMOCK_RESULT_(tn, __VA_ARGS__)                                              \
  ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1,                          \
            GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness {              \
    GTEST_COMPILE_ASSERT_(                                                    \
        (::testing::tuple_size<tn ::testing::internal::Function<              \
             __VA_ARGS__>::ArgumentTuple>::value == 2),                       \
        this_method_does_not_take_2_arguments);                               \
    GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method);       \
    return GMOCK_MOCKER_(2, constness, Method)                                \
        .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
                    gmock_a1),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
                    gmock_a2));                                               \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1,                            \
      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness {                \
    GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this);                  \
    return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2);      \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      const ::testing::internal::WithoutMatchers&,                            \
      constness ::testing::internal::Function<__VA_ARGS__>*) const {          \
    return ::testing::internal::AdjustConstness_##constness(this)             \
        ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>());     \
  }                                                                           \
  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness,  \
                                                               Method)

// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD3_(tn, constness, ct, Method, ...)                        \
  GMOCK_RESULT_(tn, __VA_ARGS__)                                              \
  ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1,                          \
            GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2,                          \
            GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness {              \
    GTEST_COMPILE_ASSERT_(                                                    \
        (::testing::tuple_size<tn ::testing::internal::Function<              \
             __VA_ARGS__>::ArgumentTuple>::value == 3),                       \
        this_method_does_not_take_3_arguments);                               \
    GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method);       \
    return GMOCK_MOCKER_(3, constness, Method)                                \
        .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
                    gmock_a1),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
                    gmock_a2),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
                    gmock_a3));                                               \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1,                            \
      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2,                            \
      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness {                \
    GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this);                  \
    return GMOCK_MOCKER_(3, constness, Method)                                \
        .With(gmock_a1, gmock_a2, gmock_a3);                                  \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      const ::testing::internal::WithoutMatchers&,                            \
      constness ::testing::internal::Function<__VA_ARGS__>*) const {          \
    return ::testing::internal::AdjustConstness_##constness(this)             \
        ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>());     \
  }                                                                           \
  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness,  \
                                                               Method)

// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD4_(tn, constness, ct, Method, ...)                        \
  GMOCK_RESULT_(tn, __VA_ARGS__)                                              \
  ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1,                          \
            GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2,                          \
            GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3,                          \
            GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness {              \
    GTEST_COMPILE_ASSERT_(                                                    \
        (::testing::tuple_size<tn ::testing::internal::Function<              \
             __VA_ARGS__>::ArgumentTuple>::value == 4),                       \
        this_method_does_not_take_4_arguments);                               \
    GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method);       \
    return GMOCK_MOCKER_(4, constness, Method)                                \
        .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
                    gmock_a1),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
                    gmock_a2),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
                    gmock_a3),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
                    gmock_a4));                                               \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1,                            \
      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2,                            \
      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3,                            \
      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness {                \
    GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this);                  \
    return GMOCK_MOCKER_(4, constness, Method)                                \
        .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4);                        \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      const ::testing::internal::WithoutMatchers&,                            \
      constness ::testing::internal::Function<__VA_ARGS__>*) const {          \
    return ::testing::internal::AdjustConstness_##constness(this)             \
        ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>());     \
  }                                                                           \
  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness,  \
                                                               Method)

// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD5_(tn, constness, ct, Method, ...)                        \
  GMOCK_RESULT_(tn, __VA_ARGS__)                                              \
  ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1,                          \
            GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2,                          \
            GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3,                          \
            GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4,                          \
            GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness {              \
    GTEST_COMPILE_ASSERT_(                                                    \
        (::testing::tuple_size<tn ::testing::internal::Function<              \
             __VA_ARGS__>::ArgumentTuple>::value == 5),                       \
        this_method_does_not_take_5_arguments);                               \
    GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method);       \
    return GMOCK_MOCKER_(5, constness, Method)                                \
        .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
                    gmock_a1),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
                    gmock_a2),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
                    gmock_a3),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
                    gmock_a4),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
                    gmock_a5));                                               \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1,                            \
      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2,                            \
      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3,                            \
      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4,                            \
      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness {                \
    GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this);                  \
    return GMOCK_MOCKER_(5, constness, Method)                                \
        .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5);              \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      const ::testing::internal::WithoutMatchers&,                            \
      constness ::testing::internal::Function<__VA_ARGS__>*) const {          \
    return ::testing::internal::AdjustConstness_##constness(this)             \
        ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>());     \
  }                                                                           \
  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness,  \
                                                               Method)

// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD6_(tn, constness, ct, Method, ...)                        \
  GMOCK_RESULT_(tn, __VA_ARGS__)                                              \
  ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1,                          \
            GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2,                          \
            GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3,                          \
            GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4,                          \
            GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5,                          \
            GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness {              \
    GTEST_COMPILE_ASSERT_(                                                    \
        (::testing::tuple_size<tn ::testing::internal::Function<              \
             __VA_ARGS__>::ArgumentTuple>::value == 6),                       \
        this_method_does_not_take_6_arguments);                               \
    GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method);       \
    return GMOCK_MOCKER_(6, constness, Method)                                \
        .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
                    gmock_a1),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
                    gmock_a2),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
                    gmock_a3),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
                    gmock_a4),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
                    gmock_a5),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \
                    gmock_a6));                                               \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1,                            \
      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2,                            \
      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3,                            \
      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4,                            \
      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5,                            \
      GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness {                \
    GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this);                  \
    return GMOCK_MOCKER_(6, constness, Method)                                \
        .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6);    \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      const ::testing::internal::WithoutMatchers&,                            \
      constness ::testing::internal::Function<__VA_ARGS__>*) const {          \
    return ::testing::internal::AdjustConstness_##constness(this)             \
        ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>());     \
  }                                                                           \
  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness,  \
                                                               Method)

// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD7_(tn, constness, ct, Method, ...)                        \
  GMOCK_RESULT_(tn, __VA_ARGS__)                                              \
  ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1,                          \
            GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2,                          \
            GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3,                          \
            GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4,                          \
            GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5,                          \
            GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6,                          \
            GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness {              \
    GTEST_COMPILE_ASSERT_(                                                    \
        (::testing::tuple_size<tn ::testing::internal::Function<              \
             __VA_ARGS__>::ArgumentTuple>::value == 7),                       \
        this_method_does_not_take_7_arguments);                               \
    GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method);       \
    return GMOCK_MOCKER_(7, constness, Method)                                \
        .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
                    gmock_a1),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
                    gmock_a2),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
                    gmock_a3),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
                    gmock_a4),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
                    gmock_a5),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \
                    gmock_a6),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \
                    gmock_a7));                                               \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1,                            \
      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2,                            \
      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3,                            \
      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4,                            \
      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5,                            \
      GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6,                            \
      GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness {                \
    GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this);                  \
    return GMOCK_MOCKER_(7, constness, Method)                                \
        .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6,     \
              gmock_a7);                                                      \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      const ::testing::internal::WithoutMatchers&,                            \
      constness ::testing::internal::Function<__VA_ARGS__>*) const {          \
    return ::testing::internal::AdjustConstness_##constness(this)             \
        ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>());     \
  }                                                                           \
  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness,  \
                                                               Method)

// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD8_(tn, constness, ct, Method, ...)                        \
  GMOCK_RESULT_(tn, __VA_ARGS__)                                              \
  ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1,                          \
            GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2,                          \
            GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3,                          \
            GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4,                          \
            GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5,                          \
            GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6,                          \
            GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7,                          \
            GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness {              \
    GTEST_COMPILE_ASSERT_(                                                    \
        (::testing::tuple_size<tn ::testing::internal::Function<              \
             __VA_ARGS__>::ArgumentTuple>::value == 8),                       \
        this_method_does_not_take_8_arguments);                               \
    GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method);       \
    return GMOCK_MOCKER_(8, constness, Method)                                \
        .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
                    gmock_a1),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
                    gmock_a2),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
                    gmock_a3),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
                    gmock_a4),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
                    gmock_a5),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \
                    gmock_a6),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \
                    gmock_a7),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>( \
                    gmock_a8));                                               \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1,                            \
      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2,                            \
      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3,                            \
      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4,                            \
      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5,                            \
      GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6,                            \
      GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7,                            \
      GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness {                \
    GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this);                  \
    return GMOCK_MOCKER_(8, constness, Method)                                \
        .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6,     \
              gmock_a7, gmock_a8);                                            \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      const ::testing::internal::WithoutMatchers&,                            \
      constness ::testing::internal::Function<__VA_ARGS__>*) const {          \
    return ::testing::internal::AdjustConstness_##constness(this)             \
        ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>());     \
  }                                                                           \
  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness,  \
                                                               Method)

// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD9_(tn, constness, ct, Method, ...)                        \
  GMOCK_RESULT_(tn, __VA_ARGS__)                                              \
  ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1,                          \
            GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2,                          \
            GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3,                          \
            GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4,                          \
            GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5,                          \
            GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6,                          \
            GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7,                          \
            GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8,                          \
            GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness {              \
    GTEST_COMPILE_ASSERT_(                                                    \
        (::testing::tuple_size<tn ::testing::internal::Function<              \
             __VA_ARGS__>::ArgumentTuple>::value == 9),                       \
        this_method_does_not_take_9_arguments);                               \
    GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method);       \
    return GMOCK_MOCKER_(9, constness, Method)                                \
        .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
                    gmock_a1),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
                    gmock_a2),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
                    gmock_a3),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
                    gmock_a4),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
                    gmock_a5),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \
                    gmock_a6),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \
                    gmock_a7),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>( \
                    gmock_a8),                                                \
                ::testing::internal::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>( \
                    gmock_a9));                                               \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1,                            \
      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2,                            \
      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3,                            \
      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4,                            \
      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5,                            \
      GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6,                            \
      GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7,                            \
      GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8,                            \
      GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness {                \
    GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this);                  \
    return GMOCK_MOCKER_(9, constness, Method)                                \
        .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6,     \
              gmock_a7, gmock_a8, gmock_a9);                                  \
  }                                                                           \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                            \
      const ::testing::internal::WithoutMatchers&,                            \
      constness ::testing::internal::Function<__VA_ARGS__>*) const {          \
    return ::testing::internal::AdjustConstness_##constness(this)             \
        ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(),      \
                         ::testing::A<GMOCK_ARG_(tn, 9, __VA_ARGS__)>());     \
  }                                                                           \
  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness,  \
                                                               Method)

// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
#define GMOCK_METHOD10_(tn, constness, ct, Method, ...)                        \
  GMOCK_RESULT_(tn, __VA_ARGS__)                                               \
  ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1,                           \
            GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2,                           \
            GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3,                           \
            GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4,                           \
            GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5,                           \
            GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6,                           \
            GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7,                           \
            GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8,                           \
            GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9,                           \
            GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness {             \
    GTEST_COMPILE_ASSERT_(                                                     \
        (::testing::tuple_size<tn ::testing::internal::Function<               \
             __VA_ARGS__>::ArgumentTuple>::value == 10),                       \
        this_method_does_not_take_10_arguments);                               \
    GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method);       \
    return GMOCK_MOCKER_(10, constness, Method)                                \
        .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(  \
                    gmock_a1),                                                 \
                ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(  \
                    gmock_a2),                                                 \
                ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(  \
                    gmock_a3),                                                 \
                ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(  \
                    gmock_a4),                                                 \
                ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(  \
                    gmock_a5),                                                 \
                ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(  \
                    gmock_a6),                                                 \
                ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(  \
                    gmock_a7),                                                 \
                ::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(  \
                    gmock_a8),                                                 \
                ::testing::internal::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(  \
                    gmock_a9),                                                 \
                ::testing::internal::forward<GMOCK_ARG_(tn, 10, __VA_ARGS__)>( \
                    gmock_a10));                                               \
  }                                                                            \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                             \
      GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1,                             \
      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2,                             \
      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3,                             \
      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4,                             \
      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5,                             \
      GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6,                             \
      GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7,                             \
      GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8,                             \
      GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9,                             \
      GMOCK_MATCHER_(tn, 10, __VA_ARGS__) gmock_a10) constness {               \
    GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this);                  \
    return GMOCK_MOCKER_(10, constness, Method)                                \
        .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6,      \
              gmock_a7, gmock_a8, gmock_a9, gmock_a10);                        \
  }                                                                            \
  ::testing::MockSpec<__VA_ARGS__> gmock_##Method(                             \
      const ::testing::internal::WithoutMatchers&,                             \
      constness ::testing::internal::Function<__VA_ARGS__>*) const {           \
    return ::testing::internal::AdjustConstness_##constness(this)              \
        ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(),       \
                         ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(),       \
                         ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(),       \
                         ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(),       \
                         ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(),       \
                         ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(),       \
                         ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(),       \
                         ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(),       \
                         ::testing::A<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(),       \
                         ::testing::A<GMOCK_ARG_(tn, 10, __VA_ARGS__)>());     \
  }                                                                            \
  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness,  \
                                                               Method)

#define MOCK_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__)
#define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__)
#define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__)
#define MOCK_METHOD3(m, ...) GMOCK_METHOD3_(, , , m, __VA_ARGS__)
#define MOCK_METHOD4(m, ...) GMOCK_METHOD4_(, , , m, __VA_ARGS__)
#define MOCK_METHOD5(m, ...) GMOCK_METHOD5_(, , , m, __VA_ARGS__)
#define MOCK_METHOD6(m, ...) GMOCK_METHOD6_(, , , m, __VA_ARGS__)
#define MOCK_METHOD7(m, ...) GMOCK_METHOD7_(, , , m, __VA_ARGS__)
#define MOCK_METHOD8(m, ...) GMOCK_METHOD8_(, , , m, __VA_ARGS__)
#define MOCK_METHOD9(m, ...) GMOCK_METHOD9_(, , , m, __VA_ARGS__)
#define MOCK_METHOD10(m, ...) GMOCK_METHOD10_(, , , m, __VA_ARGS__)

#define MOCK_CONST_METHOD0(m, ...) GMOCK_METHOD0_(, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD1(m, ...) GMOCK_METHOD1_(, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD2(m, ...) GMOCK_METHOD2_(, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD3(m, ...) GMOCK_METHOD3_(, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD4(m, ...) GMOCK_METHOD4_(, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD5(m, ...) GMOCK_METHOD5_(, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD6(m, ...) GMOCK_METHOD6_(, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD7(m, ...) GMOCK_METHOD7_(, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD8(m, ...) GMOCK_METHOD8_(, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD9(m, ...) GMOCK_METHOD9_(, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD10(m, ...) GMOCK_METHOD10_(, const, , m, __VA_ARGS__)

#define MOCK_METHOD0_T(m, ...) GMOCK_METHOD0_(typename, , , m, __VA_ARGS__)
#define MOCK_METHOD1_T(m, ...) GMOCK_METHOD1_(typename, , , m, __VA_ARGS__)
#define MOCK_METHOD2_T(m, ...) GMOCK_METHOD2_(typename, , , m, __VA_ARGS__)
#define MOCK_METHOD3_T(m, ...) GMOCK_METHOD3_(typename, , , m, __VA_ARGS__)
#define MOCK_METHOD4_T(m, ...) GMOCK_METHOD4_(typename, , , m, __VA_ARGS__)
#define MOCK_METHOD5_T(m, ...) GMOCK_METHOD5_(typename, , , m, __VA_ARGS__)
#define MOCK_METHOD6_T(m, ...) GMOCK_METHOD6_(typename, , , m, __VA_ARGS__)
#define MOCK_METHOD7_T(m, ...) GMOCK_METHOD7_(typename, , , m, __VA_ARGS__)
#define MOCK_METHOD8_T(m, ...) GMOCK_METHOD8_(typename, , , m, __VA_ARGS__)
#define MOCK_METHOD9_T(m, ...) GMOCK_METHOD9_(typename, , , m, __VA_ARGS__)
#define MOCK_METHOD10_T(m, ...) GMOCK_METHOD10_(typename, , , m, __VA_ARGS__)

#define MOCK_CONST_METHOD0_T(m, ...) \
    GMOCK_METHOD0_(typename, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD1_T(m, ...) \
    GMOCK_METHOD1_(typename, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD2_T(m, ...) \
    GMOCK_METHOD2_(typename, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD3_T(m, ...) \
    GMOCK_METHOD3_(typename, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD4_T(m, ...) \
    GMOCK_METHOD4_(typename, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD5_T(m, ...) \
    GMOCK_METHOD5_(typename, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD6_T(m, ...) \
    GMOCK_METHOD6_(typename, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD7_T(m, ...) \
    GMOCK_METHOD7_(typename, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD8_T(m, ...) \
    GMOCK_METHOD8_(typename, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD9_T(m, ...) \
    GMOCK_METHOD9_(typename, const, , m, __VA_ARGS__)
#define MOCK_CONST_METHOD10_T(m, ...) \
    GMOCK_METHOD10_(typename, const, , m, __VA_ARGS__)

#define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD0_(, , ct, m, __VA_ARGS__)
#define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD1_(, , ct, m, __VA_ARGS__)
#define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD2_(, , ct, m, __VA_ARGS__)
#define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD3_(, , ct, m, __VA_ARGS__)
#define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD4_(, , ct, m, __VA_ARGS__)
#define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD5_(, , ct, m, __VA_ARGS__)
#define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD6_(, , ct, m, __VA_ARGS__)
#define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD7_(, , ct, m, __VA_ARGS__)
#define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD8_(, , ct, m, __VA_ARGS__)
#define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD9_(, , ct, m, __VA_ARGS__)
#define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD10_(, , ct, m, __VA_ARGS__)

#define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD0_(, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD1_(, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD2_(, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD3_(, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD4_(, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD5_(, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD6_(, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD7_(, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD8_(, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD9_(, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD10_(, const, ct, m, __VA_ARGS__)

#define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD0_(typename, , ct, m, __VA_ARGS__)
#define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD1_(typename, , ct, m, __VA_ARGS__)
#define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD2_(typename, , ct, m, __VA_ARGS__)
#define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD3_(typename, , ct, m, __VA_ARGS__)
#define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD4_(typename, , ct, m, __VA_ARGS__)
#define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD5_(typename, , ct, m, __VA_ARGS__)
#define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD6_(typename, , ct, m, __VA_ARGS__)
#define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD7_(typename, , ct, m, __VA_ARGS__)
#define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD8_(typename, , ct, m, __VA_ARGS__)
#define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD9_(typename, , ct, m, __VA_ARGS__)
#define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD10_(typename, , ct, m, __VA_ARGS__)

#define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD0_(typename, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD1_(typename, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD2_(typename, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD3_(typename, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD4_(typename, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD5_(typename, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD6_(typename, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD7_(typename, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD8_(typename, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD9_(typename, const, ct, m, __VA_ARGS__)
#define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
    GMOCK_METHOD10_(typename, const, ct, m, __VA_ARGS__)

// A MockFunction<F> class has one mock method whose type is F.  It is
// useful when you just want your test code to emit some messages and
// have Google Mock verify the right messages are sent (and perhaps at
// the right times).  For example, if you are exercising code:
//
//   Foo(1);
//   Foo(2);
//   Foo(3);
//
// and want to verify that Foo(1) and Foo(3) both invoke
// mock.Bar("a"), but Foo(2) doesn't invoke anything, you can write:
//
// TEST(FooTest, InvokesBarCorrectly) {
//   MyMock mock;
//   MockFunction<void(string check_point_name)> check;
//   {
//     InSequence s;
//
//     EXPECT_CALL(mock, Bar("a"));
//     EXPECT_CALL(check, Call("1"));
//     EXPECT_CALL(check, Call("2"));
//     EXPECT_CALL(mock, Bar("a"));
//   }
//   Foo(1);
//   check.Call("1");
//   Foo(2);
//   check.Call("2");
//   Foo(3);
// }
//
// The expectation spec says that the first Bar("a") must happen
// before check point "1", the second Bar("a") must happen after check
// point "2", and nothing should happen between the two check
// points. The explicit check points make it easy to tell which
// Bar("a") is called by which call to Foo().
//
// MockFunction<F> can also be used to exercise code that accepts
// std::function<F> callbacks. To do so, use AsStdFunction() method
// to create std::function proxy forwarding to original object's Call.
// Example:
//
// TEST(FooTest, RunsCallbackWithBarArgument) {
//   MockFunction<int(string)> callback;
//   EXPECT_CALL(callback, Call("bar")).WillOnce(Return(1));
//   Foo(callback.AsStdFunction());
// }
template <typename F>
class MockFunction;

template <typename R>
class MockFunction<R()> {
 public:
  MockFunction() {}

  MOCK_METHOD0_T(Call, R());

#if GTEST_HAS_STD_FUNCTION_
  ::std::function<R()> AsStdFunction() {
    return [this]() -> R {
      return this->Call();
    };
  }
#endif  // GTEST_HAS_STD_FUNCTION_

 private:
  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
};

template <typename R, typename A0>
class MockFunction<R(A0)> {
 public:
  MockFunction() {}

  MOCK_METHOD1_T(Call, R(A0));

#if GTEST_HAS_STD_FUNCTION_
  ::std::function<R(A0)> AsStdFunction() {
    return [this](A0 a0) -> R {
      return this->Call(::std::move(a0));
    };
  }
#endif  // GTEST_HAS_STD_FUNCTION_

 private:
  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
};

template <typename R, typename A0, typename A1>
class MockFunction<R(A0, A1)> {
 public:
  MockFunction() {}

  MOCK_METHOD2_T(Call, R(A0, A1));

#if GTEST_HAS_STD_FUNCTION_
  ::std::function<R(A0, A1)> AsStdFunction() {
    return [this](A0 a0, A1 a1) -> R {
      return this->Call(::std::move(a0), ::std::move(a1));
    };
  }
#endif  // GTEST_HAS_STD_FUNCTION_

 private:
  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
};

template <typename R, typename A0, typename A1, typename A2>
class MockFunction<R(A0, A1, A2)> {
 public:
  MockFunction() {}

  MOCK_METHOD3_T(Call, R(A0, A1, A2));

#if GTEST_HAS_STD_FUNCTION_
  ::std::function<R(A0, A1, A2)> AsStdFunction() {
    return [this](A0 a0, A1 a1, A2 a2) -> R {
      return this->Call(::std::move(a0), ::std::move(a1), ::std::move(a2));
    };
  }
#endif  // GTEST_HAS_STD_FUNCTION_

 private:
  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
};

template <typename R, typename A0, typename A1, typename A2, typename A3>
class MockFunction<R(A0, A1, A2, A3)> {
 public:
  MockFunction() {}

  MOCK_METHOD4_T(Call, R(A0, A1, A2, A3));

#if GTEST_HAS_STD_FUNCTION_
  ::std::function<R(A0, A1, A2, A3)> AsStdFunction() {
    return [this](A0 a0, A1 a1, A2 a2, A3 a3) -> R {
      return this->Call(::std::move(a0), ::std::move(a1), ::std::move(a2),
          ::std::move(a3));
    };
  }
#endif  // GTEST_HAS_STD_FUNCTION_

 private:
  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
};

template <typename R, typename A0, typename A1, typename A2, typename A3,
    typename A4>
class MockFunction<R(A0, A1, A2, A3, A4)> {
 public:
  MockFunction() {}

  MOCK_METHOD5_T(Call, R(A0, A1, A2, A3, A4));

#if GTEST_HAS_STD_FUNCTION_
  ::std::function<R(A0, A1, A2, A3, A4)> AsStdFunction() {
    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) -> R {
      return this->Call(::std::move(a0), ::std::move(a1), ::std::move(a2),
          ::std::move(a3), ::std::move(a4));
    };
  }
#endif  // GTEST_HAS_STD_FUNCTION_

 private:
  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
};

template <typename R, typename A0, typename A1, typename A2, typename A3,
    typename A4, typename A5>
class MockFunction<R(A0, A1, A2, A3, A4, A5)> {
 public:
  MockFunction() {}

  MOCK_METHOD6_T(Call, R(A0, A1, A2, A3, A4, A5));

#if GTEST_HAS_STD_FUNCTION_
  ::std::function<R(A0, A1, A2, A3, A4, A5)> AsStdFunction() {
    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -> R {
      return this->Call(::std::move(a0), ::std::move(a1), ::std::move(a2),
          ::std::move(a3), ::std::move(a4), ::std::move(a5));
    };
  }
#endif  // GTEST_HAS_STD_FUNCTION_

 private:
  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
};

template <typename R, typename A0, typename A1, typename A2, typename A3,
    typename A4, typename A5, typename A6>
class MockFunction<R(A0, A1, A2, A3, A4, A5, A6)> {
 public:
  MockFunction() {}

  MOCK_METHOD7_T(Call, R(A0, A1, A2, A3, A4, A5, A6));

#if GTEST_HAS_STD_FUNCTION_
  ::std::function<R(A0, A1, A2, A3, A4, A5, A6)> AsStdFunction() {
    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -> R {
      return this->Call(::std::move(a0), ::std::move(a1), ::std::move(a2),
          ::std::move(a3), ::std::move(a4), ::std::move(a5), ::std::move(a6));
    };
  }
#endif  // GTEST_HAS_STD_FUNCTION_

 private:
  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
};

template <typename R, typename A0, typename A1, typename A2, typename A3,
    typename A4, typename A5, typename A6, typename A7>
class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7)> {
 public:
  MockFunction() {}

  MOCK_METHOD8_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7));

#if GTEST_HAS_STD_FUNCTION_
  ::std::function<R(A0, A1, A2, A3, A4, A5, A6, A7)> AsStdFunction() {
    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -> R {
      return this->Call(::std::move(a0), ::std::move(a1), ::std::move(a2),
          ::std::move(a3), ::std::move(a4), ::std::move(a5), ::std::move(a6),
          ::std::move(a7));
    };
  }
#endif  // GTEST_HAS_STD_FUNCTION_

 private:
  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
};

template <typename R, typename A0, typename A1, typename A2, typename A3,
    typename A4, typename A5, typename A6, typename A7, typename A8>
class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> {
 public:
  MockFunction() {}

  MOCK_METHOD9_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8));

#if GTEST_HAS_STD_FUNCTION_
  ::std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> AsStdFunction() {
    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
        A8 a8) -> R {
      return this->Call(::std::move(a0), ::std::move(a1), ::std::move(a2),
          ::std::move(a3), ::std::move(a4), ::std::move(a5), ::std::move(a6),
          ::std::move(a7), ::std::move(a8));
    };
  }
#endif  // GTEST_HAS_STD_FUNCTION_

 private:
  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
};

template <typename R, typename A0, typename A1, typename A2, typename A3,
    typename A4, typename A5, typename A6, typename A7, typename A8,
    typename A9>
class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
 public:
  MockFunction() {}

  MOCK_METHOD10_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9));

#if GTEST_HAS_STD_FUNCTION_
  ::std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> AsStdFunction() {
    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
        A8 a8, A9 a9) -> R {
      return this->Call(::std::move(a0), ::std::move(a1), ::std::move(a2),
          ::std::move(a3), ::std::move(a4), ::std::move(a5), ::std::move(a6),
          ::std::move(a7), ::std::move(a8), ::std::move(a9));
    };
  }
#endif  // GTEST_HAS_STD_FUNCTION_

 private:
  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
};

}  // namespace testing

#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_