uia 0.0.5 → 0.0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/ChangeLog +5 -1
  2. data/lib/uia/version.rb +1 -1
  3. data/uia.gemspec +3 -1
  4. metadata +1 -48
  5. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/gmock-actions.h +0 -1078
  6. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/gmock-cardinalities.h +0 -147
  7. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/gmock-generated-actions.h +0 -2415
  8. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/gmock-generated-actions.h.pump +0 -821
  9. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/gmock-generated-function-mockers.h +0 -991
  10. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/gmock-generated-function-mockers.h.pump +0 -265
  11. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/gmock-generated-matchers.h +0 -2190
  12. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/gmock-generated-matchers.h.pump +0 -674
  13. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/gmock-generated-nice-strict.h +0 -397
  14. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/gmock-generated-nice-strict.h.pump +0 -161
  15. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/gmock-matchers.h +0 -3986
  16. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/gmock-more-actions.h +0 -233
  17. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/gmock-more-matchers.h +0 -58
  18. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/gmock-spec-builders.h +0 -1791
  19. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/gmock.h +0 -94
  20. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/internal/gmock-generated-internal-utils.h +0 -279
  21. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/internal/gmock-generated-internal-utils.h.pump +0 -136
  22. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/internal/gmock-internal-utils.h +0 -498
  23. data/ext/UiaDll/UiaDll.Test/gmock/include/gmock/internal/gmock-port.h +0 -78
  24. data/ext/UiaDll/UiaDll.Test/gmock/lib/gmock.lib +0 -0
  25. data/ext/UiaDll/UiaDll.Test/gmock/lib/gmockd.lib +0 -0
  26. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/gtest-death-test.h +0 -294
  27. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/gtest-message.h +0 -250
  28. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/gtest-param-test.h +0 -1421
  29. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/gtest-param-test.h.pump +0 -487
  30. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/gtest-printers.h +0 -855
  31. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/gtest-spi.h +0 -232
  32. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/gtest-test-part.h +0 -179
  33. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/gtest-typed-test.h +0 -259
  34. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/gtest.h +0 -2291
  35. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/gtest_pred_impl.h +0 -358
  36. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/gtest_prod.h +0 -58
  37. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/internal/gtest-death-test-internal.h +0 -319
  38. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/internal/gtest-filepath.h +0 -206
  39. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/internal/gtest-internal.h +0 -1158
  40. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/internal/gtest-linked_ptr.h +0 -233
  41. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/internal/gtest-param-util-generated.h +0 -5143
  42. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/internal/gtest-param-util-generated.h.pump +0 -301
  43. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/internal/gtest-param-util.h +0 -619
  44. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/internal/gtest-port.h +0 -1947
  45. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/internal/gtest-string.h +0 -167
  46. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/internal/gtest-tuple.h +0 -1012
  47. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/internal/gtest-tuple.h.pump +0 -339
  48. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/internal/gtest-type-util.h +0 -3331
  49. data/ext/UiaDll/UiaDll.Test/gtest/include/gtest/internal/gtest-type-util.h.pump +0 -297
  50. data/ext/UiaDll/UiaDll.Test/gtest/lib/gtest.lib +0 -0
  51. data/ext/UiaDll/UiaDll.Test/gtest/lib/gtestd.lib +0 -0
@@ -1,265 +0,0 @@
1
- $$ -*- mode: c++; -*-
2
- $$ This is a Pump source file. Please use Pump to convert it to
3
- $$ gmock-generated-function-mockers.h.
4
- $$
5
- $var n = 10 $$ The maximum arity we support.
6
- // Copyright 2007, Google Inc.
7
- // All rights reserved.
8
- //
9
- // Redistribution and use in source and binary forms, with or without
10
- // modification, are permitted provided that the following conditions are
11
- // met:
12
- //
13
- // * Redistributions of source code must retain the above copyright
14
- // notice, this list of conditions and the following disclaimer.
15
- // * Redistributions in binary form must reproduce the above
16
- // copyright notice, this list of conditions and the following disclaimer
17
- // in the documentation and/or other materials provided with the
18
- // distribution.
19
- // * Neither the name of Google Inc. nor the names of its
20
- // contributors may be used to endorse or promote products derived from
21
- // this software without specific prior written permission.
22
- //
23
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
- //
35
- // Author: wan@google.com (Zhanyong Wan)
36
-
37
- // Google Mock - a framework for writing C++ mock classes.
38
- //
39
- // This file implements function mockers of various arities.
40
-
41
- #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
42
- #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
43
-
44
- #include "gmock/gmock-spec-builders.h"
45
- #include "gmock/internal/gmock-internal-utils.h"
46
-
47
- namespace testing {
48
- namespace internal {
49
-
50
- template <typename F>
51
- class FunctionMockerBase;
52
-
53
- // Note: class FunctionMocker really belongs to the ::testing
54
- // namespace. However if we define it in ::testing, MSVC will
55
- // complain when classes in ::testing::internal declare it as a
56
- // friend class template. To workaround this compiler bug, we define
57
- // FunctionMocker in ::testing::internal and import it into ::testing.
58
- template <typename F>
59
- class FunctionMocker;
60
-
61
-
62
- $range i 0..n
63
- $for i [[
64
- $range j 1..i
65
- $var typename_As = [[$for j [[, typename A$j]]]]
66
- $var As = [[$for j, [[A$j]]]]
67
- $var as = [[$for j, [[a$j]]]]
68
- $var Aas = [[$for j, [[A$j a$j]]]]
69
- $var ms = [[$for j, [[m$j]]]]
70
- $var matchers = [[$for j, [[const Matcher<A$j>& m$j]]]]
71
- template <typename R$typename_As>
72
- class FunctionMocker<R($As)> : public
73
- internal::FunctionMockerBase<R($As)> {
74
- public:
75
- typedef R F($As);
76
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
77
-
78
- MockSpec<F>& With($matchers) {
79
-
80
- $if i >= 1 [[
81
- this->current_spec().SetMatchers(::std::tr1::make_tuple($ms));
82
-
83
- ]]
84
- return this->current_spec();
85
- }
86
-
87
- R Invoke($Aas) {
88
- // Even though gcc and MSVC don't enforce it, 'this->' is required
89
- // by the C++ standard [14.6.4] here, as the base class type is
90
- // dependent on the template argument (and thus shouldn't be
91
- // looked into when resolving InvokeWith).
92
- return this->InvokeWith(ArgumentTuple($as));
93
- }
94
- };
95
-
96
-
97
- ]]
98
- } // namespace internal
99
-
100
- // The style guide prohibits "using" statements in a namespace scope
101
- // inside a header file. However, the FunctionMocker class template
102
- // is meant to be defined in the ::testing namespace. The following
103
- // line is just a trick for working around a bug in MSVC 8.0, which
104
- // cannot handle it if we define FunctionMocker in ::testing.
105
- using internal::FunctionMocker;
106
-
107
- // GMOCK_RESULT_(tn, F) expands to the result type of function type F.
108
- // We define this as a variadic macro in case F contains unprotected
109
- // commas (the same reason that we use variadic macros in other places
110
- // in this file).
111
- // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
112
- #define GMOCK_RESULT_(tn, ...) \
113
- tn ::testing::internal::Function<__VA_ARGS__>::Result
114
-
115
- // The type of argument N of the given function type.
116
- // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
117
- #define GMOCK_ARG_(tn, N, ...) \
118
- tn ::testing::internal::Function<__VA_ARGS__>::Argument##N
119
-
120
- // The matcher type for argument N of the given function type.
121
- // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
122
- #define GMOCK_MATCHER_(tn, N, ...) \
123
- const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>&
124
-
125
- // The variable for mocking the given method.
126
- // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
127
- #define GMOCK_MOCKER_(arity, constness, Method) \
128
- GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)
129
-
130
-
131
- $for i [[
132
- $range j 1..i
133
- $var arg_as = [[$for j, \
134
- [[GMOCK_ARG_(tn, $j, __VA_ARGS__) gmock_a$j]]]]
135
- $var as = [[$for j, [[gmock_a$j]]]]
136
- $var matcher_as = [[$for j, \
137
- [[GMOCK_MATCHER_(tn, $j, __VA_ARGS__) gmock_a$j]]]]
138
- // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
139
- #define GMOCK_METHOD$i[[]]_(tn, constness, ct, Method, ...) \
140
- GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
141
- $arg_as) constness { \
142
- GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \
143
- tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value == $i), \
144
- this_method_does_not_take_$i[[]]_argument[[$if i != 1 [[s]]]]); \
145
- GMOCK_MOCKER_($i, constness, Method).SetOwnerAndName(this, #Method); \
146
- return GMOCK_MOCKER_($i, constness, Method).Invoke($as); \
147
- } \
148
- ::testing::MockSpec<__VA_ARGS__>& \
149
- gmock_##Method($matcher_as) constness { \
150
- GMOCK_MOCKER_($i, constness, Method).RegisterOwner(this); \
151
- return GMOCK_MOCKER_($i, constness, Method).With($as); \
152
- } \
153
- mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_($i, constness, Method)
154
-
155
-
156
- ]]
157
- $for i [[
158
- #define MOCK_METHOD$i(m, ...) GMOCK_METHOD$i[[]]_(, , , m, __VA_ARGS__)
159
-
160
- ]]
161
-
162
-
163
- $for i [[
164
- #define MOCK_CONST_METHOD$i(m, ...) GMOCK_METHOD$i[[]]_(, const, , m, __VA_ARGS__)
165
-
166
- ]]
167
-
168
-
169
- $for i [[
170
- #define MOCK_METHOD$i[[]]_T(m, ...) GMOCK_METHOD$i[[]]_(typename, , , m, __VA_ARGS__)
171
-
172
- ]]
173
-
174
-
175
- $for i [[
176
- #define MOCK_CONST_METHOD$i[[]]_T(m, ...) \
177
- GMOCK_METHOD$i[[]]_(typename, const, , m, __VA_ARGS__)
178
-
179
- ]]
180
-
181
-
182
- $for i [[
183
- #define MOCK_METHOD$i[[]]_WITH_CALLTYPE(ct, m, ...) \
184
- GMOCK_METHOD$i[[]]_(, , ct, m, __VA_ARGS__)
185
-
186
- ]]
187
-
188
-
189
- $for i [[
190
- #define MOCK_CONST_METHOD$i[[]]_WITH_CALLTYPE(ct, m, ...) \
191
- GMOCK_METHOD$i[[]]_(, const, ct, m, __VA_ARGS__)
192
-
193
- ]]
194
-
195
-
196
- $for i [[
197
- #define MOCK_METHOD$i[[]]_T_WITH_CALLTYPE(ct, m, ...) \
198
- GMOCK_METHOD$i[[]]_(typename, , ct, m, __VA_ARGS__)
199
-
200
- ]]
201
-
202
-
203
- $for i [[
204
- #define MOCK_CONST_METHOD$i[[]]_T_WITH_CALLTYPE(ct, m, ...) \
205
- GMOCK_METHOD$i[[]]_(typename, const, ct, m, __VA_ARGS__)
206
-
207
- ]]
208
-
209
- // A MockFunction<F> class has one mock method whose type is F. It is
210
- // useful when you just want your test code to emit some messages and
211
- // have Google Mock verify the right messages are sent (and perhaps at
212
- // the right times). For example, if you are exercising code:
213
- //
214
- // Foo(1);
215
- // Foo(2);
216
- // Foo(3);
217
- //
218
- // and want to verify that Foo(1) and Foo(3) both invoke
219
- // mock.Bar("a"), but Foo(2) doesn't invoke anything, you can write:
220
- //
221
- // TEST(FooTest, InvokesBarCorrectly) {
222
- // MyMock mock;
223
- // MockFunction<void(string check_point_name)> check;
224
- // {
225
- // InSequence s;
226
- //
227
- // EXPECT_CALL(mock, Bar("a"));
228
- // EXPECT_CALL(check, Call("1"));
229
- // EXPECT_CALL(check, Call("2"));
230
- // EXPECT_CALL(mock, Bar("a"));
231
- // }
232
- // Foo(1);
233
- // check.Call("1");
234
- // Foo(2);
235
- // check.Call("2");
236
- // Foo(3);
237
- // }
238
- //
239
- // The expectation spec says that the first Bar("a") must happen
240
- // before check point "1", the second Bar("a") must happen after check
241
- // point "2", and nothing should happen between the two check
242
- // points. The explicit check points make it easy to tell which
243
- // Bar("a") is called by which call to Foo().
244
- template <typename F>
245
- class MockFunction;
246
-
247
-
248
- $for i [[
249
- $range j 0..i-1
250
- template <typename R$for j [[, typename A$j]]>
251
- class MockFunction<R($for j, [[A$j]])> {
252
- public:
253
- MockFunction() {}
254
-
255
- MOCK_METHOD$i[[]]_T(Call, R($for j, [[A$j]]));
256
-
257
- private:
258
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
259
- };
260
-
261
-
262
- ]]
263
- } // namespace testing
264
-
265
- #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
@@ -1,2190 +0,0 @@
1
- // This file was GENERATED by command:
2
- // pump.py gmock-generated-matchers.h.pump
3
- // DO NOT EDIT BY HAND!!!
4
-
5
- // Copyright 2008, Google Inc.
6
- // All rights reserved.
7
- //
8
- // Redistribution and use in source and binary forms, with or without
9
- // modification, are permitted provided that the following conditions are
10
- // met:
11
- //
12
- // * Redistributions of source code must retain the above copyright
13
- // notice, this list of conditions and the following disclaimer.
14
- // * Redistributions in binary form must reproduce the above
15
- // copyright notice, this list of conditions and the following disclaimer
16
- // in the documentation and/or other materials provided with the
17
- // distribution.
18
- // * Neither the name of Google Inc. nor the names of its
19
- // contributors may be used to endorse or promote products derived from
20
- // this software without specific prior written permission.
21
- //
22
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
-
34
- // Google Mock - a framework for writing C++ mock classes.
35
- //
36
- // This file implements some commonly used variadic matchers.
37
-
38
- #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
39
- #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
40
-
41
- #include <iterator>
42
- #include <sstream>
43
- #include <string>
44
- #include <vector>
45
- #include "gmock/gmock-matchers.h"
46
-
47
- namespace testing {
48
- namespace internal {
49
-
50
- // The type of the i-th (0-based) field of Tuple.
51
- #define GMOCK_FIELD_TYPE_(Tuple, i) \
52
- typename ::std::tr1::tuple_element<i, Tuple>::type
53
-
54
- // TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
55
- // tuple of type Tuple. It has two members:
56
- //
57
- // type: a tuple type whose i-th field is the ki-th field of Tuple.
58
- // GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple.
59
- //
60
- // For example, in class TupleFields<tuple<bool, char, int>, 2, 0>, we have:
61
- //
62
- // type is tuple<int, bool>, and
63
- // GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true).
64
-
65
- template <class Tuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,
66
- int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
67
- int k9 = -1>
68
- class TupleFields;
69
-
70
- // This generic version is used when there are 10 selectors.
71
- template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
72
- int k7, int k8, int k9>
73
- class TupleFields {
74
- public:
75
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
76
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
77
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
78
- GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
79
- GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8),
80
- GMOCK_FIELD_TYPE_(Tuple, k9)> type;
81
- static type GetSelectedFields(const Tuple& t) {
82
- using ::std::tr1::get;
83
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
84
- get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t), get<k9>(t));
85
- }
86
- };
87
-
88
- // The following specialization is used for 0 ~ 9 selectors.
89
-
90
- template <class Tuple>
91
- class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
92
- public:
93
- typedef ::std::tr1::tuple<> type;
94
- static type GetSelectedFields(const Tuple& /* t */) {
95
- using ::std::tr1::get;
96
- return type();
97
- }
98
- };
99
-
100
- template <class Tuple, int k0>
101
- class TupleFields<Tuple, k0, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
102
- public:
103
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0)> type;
104
- static type GetSelectedFields(const Tuple& t) {
105
- using ::std::tr1::get;
106
- return type(get<k0>(t));
107
- }
108
- };
109
-
110
- template <class Tuple, int k0, int k1>
111
- class TupleFields<Tuple, k0, k1, -1, -1, -1, -1, -1, -1, -1, -1> {
112
- public:
113
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
114
- GMOCK_FIELD_TYPE_(Tuple, k1)> type;
115
- static type GetSelectedFields(const Tuple& t) {
116
- using ::std::tr1::get;
117
- return type(get<k0>(t), get<k1>(t));
118
- }
119
- };
120
-
121
- template <class Tuple, int k0, int k1, int k2>
122
- class TupleFields<Tuple, k0, k1, k2, -1, -1, -1, -1, -1, -1, -1> {
123
- public:
124
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
125
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2)> type;
126
- static type GetSelectedFields(const Tuple& t) {
127
- using ::std::tr1::get;
128
- return type(get<k0>(t), get<k1>(t), get<k2>(t));
129
- }
130
- };
131
-
132
- template <class Tuple, int k0, int k1, int k2, int k3>
133
- class TupleFields<Tuple, k0, k1, k2, k3, -1, -1, -1, -1, -1, -1> {
134
- public:
135
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
136
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
137
- GMOCK_FIELD_TYPE_(Tuple, k3)> type;
138
- static type GetSelectedFields(const Tuple& t) {
139
- using ::std::tr1::get;
140
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t));
141
- }
142
- };
143
-
144
- template <class Tuple, int k0, int k1, int k2, int k3, int k4>
145
- class TupleFields<Tuple, k0, k1, k2, k3, k4, -1, -1, -1, -1, -1> {
146
- public:
147
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
148
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
149
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4)> type;
150
- static type GetSelectedFields(const Tuple& t) {
151
- using ::std::tr1::get;
152
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t));
153
- }
154
- };
155
-
156
- template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5>
157
- class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, -1, -1, -1, -1> {
158
- public:
159
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
160
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
161
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
162
- GMOCK_FIELD_TYPE_(Tuple, k5)> type;
163
- static type GetSelectedFields(const Tuple& t) {
164
- using ::std::tr1::get;
165
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
166
- get<k5>(t));
167
- }
168
- };
169
-
170
- template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6>
171
- class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, -1, -1, -1> {
172
- public:
173
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
174
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
175
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
176
- GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6)> type;
177
- static type GetSelectedFields(const Tuple& t) {
178
- using ::std::tr1::get;
179
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
180
- get<k5>(t), get<k6>(t));
181
- }
182
- };
183
-
184
- template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
185
- int k7>
186
- class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, -1, -1> {
187
- public:
188
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
189
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
190
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
191
- GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
192
- GMOCK_FIELD_TYPE_(Tuple, k7)> type;
193
- static type GetSelectedFields(const Tuple& t) {
194
- using ::std::tr1::get;
195
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
196
- get<k5>(t), get<k6>(t), get<k7>(t));
197
- }
198
- };
199
-
200
- template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
201
- int k7, int k8>
202
- class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, -1> {
203
- public:
204
- typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
205
- GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
206
- GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
207
- GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
208
- GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8)> type;
209
- static type GetSelectedFields(const Tuple& t) {
210
- using ::std::tr1::get;
211
- return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
212
- get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t));
213
- }
214
- };
215
-
216
- #undef GMOCK_FIELD_TYPE_
217
-
218
- // Implements the Args() matcher.
219
- template <class ArgsTuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,
220
- int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
221
- int k9 = -1>
222
- class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
223
- public:
224
- // ArgsTuple may have top-level const or reference modifiers.
225
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(ArgsTuple) RawArgsTuple;
226
- typedef typename internal::TupleFields<RawArgsTuple, k0, k1, k2, k3, k4, k5,
227
- k6, k7, k8, k9>::type SelectedArgs;
228
- typedef Matcher<const SelectedArgs&> MonomorphicInnerMatcher;
229
-
230
- template <typename InnerMatcher>
231
- explicit ArgsMatcherImpl(const InnerMatcher& inner_matcher)
232
- : inner_matcher_(SafeMatcherCast<const SelectedArgs&>(inner_matcher)) {}
233
-
234
- virtual bool MatchAndExplain(ArgsTuple args,
235
- MatchResultListener* listener) const {
236
- const SelectedArgs& selected_args = GetSelectedArgs(args);
237
- if (!listener->IsInterested())
238
- return inner_matcher_.Matches(selected_args);
239
-
240
- PrintIndices(listener->stream());
241
- *listener << "are " << PrintToString(selected_args);
242
-
243
- StringMatchResultListener inner_listener;
244
- const bool match = inner_matcher_.MatchAndExplain(selected_args,
245
- &inner_listener);
246
- PrintIfNotEmpty(inner_listener.str(), listener->stream());
247
- return match;
248
- }
249
-
250
- virtual void DescribeTo(::std::ostream* os) const {
251
- *os << "are a tuple ";
252
- PrintIndices(os);
253
- inner_matcher_.DescribeTo(os);
254
- }
255
-
256
- virtual void DescribeNegationTo(::std::ostream* os) const {
257
- *os << "are a tuple ";
258
- PrintIndices(os);
259
- inner_matcher_.DescribeNegationTo(os);
260
- }
261
-
262
- private:
263
- static SelectedArgs GetSelectedArgs(ArgsTuple args) {
264
- return TupleFields<RawArgsTuple, k0, k1, k2, k3, k4, k5, k6, k7, k8,
265
- k9>::GetSelectedFields(args);
266
- }
267
-
268
- // Prints the indices of the selected fields.
269
- static void PrintIndices(::std::ostream* os) {
270
- *os << "whose fields (";
271
- const int indices[10] = { k0, k1, k2, k3, k4, k5, k6, k7, k8, k9 };
272
- for (int i = 0; i < 10; i++) {
273
- if (indices[i] < 0)
274
- break;
275
-
276
- if (i >= 1)
277
- *os << ", ";
278
-
279
- *os << "#" << indices[i];
280
- }
281
- *os << ") ";
282
- }
283
-
284
- const MonomorphicInnerMatcher inner_matcher_;
285
-
286
- GTEST_DISALLOW_ASSIGN_(ArgsMatcherImpl);
287
- };
288
-
289
- template <class InnerMatcher, int k0 = -1, int k1 = -1, int k2 = -1,
290
- int k3 = -1, int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1,
291
- int k8 = -1, int k9 = -1>
292
- class ArgsMatcher {
293
- public:
294
- explicit ArgsMatcher(const InnerMatcher& inner_matcher)
295
- : inner_matcher_(inner_matcher) {}
296
-
297
- template <typename ArgsTuple>
298
- operator Matcher<ArgsTuple>() const {
299
- return MakeMatcher(new ArgsMatcherImpl<ArgsTuple, k0, k1, k2, k3, k4, k5,
300
- k6, k7, k8, k9>(inner_matcher_));
301
- }
302
-
303
- private:
304
- const InnerMatcher inner_matcher_;
305
-
306
- GTEST_DISALLOW_ASSIGN_(ArgsMatcher);
307
- };
308
-
309
- // A set of metafunctions for computing the result type of AllOf.
310
- // AllOf(m1, ..., mN) returns
311
- // AllOfResultN<decltype(m1), ..., decltype(mN)>::type.
312
-
313
- // Although AllOf isn't defined for one argument, AllOfResult1 is defined
314
- // to simplify the implementation.
315
- template <typename M1>
316
- struct AllOfResult1 {
317
- typedef M1 type;
318
- };
319
-
320
- template <typename M1, typename M2>
321
- struct AllOfResult2 {
322
- typedef BothOfMatcher<
323
- typename AllOfResult1<M1>::type,
324
- typename AllOfResult1<M2>::type
325
- > type;
326
- };
327
-
328
- template <typename M1, typename M2, typename M3>
329
- struct AllOfResult3 {
330
- typedef BothOfMatcher<
331
- typename AllOfResult1<M1>::type,
332
- typename AllOfResult2<M2, M3>::type
333
- > type;
334
- };
335
-
336
- template <typename M1, typename M2, typename M3, typename M4>
337
- struct AllOfResult4 {
338
- typedef BothOfMatcher<
339
- typename AllOfResult2<M1, M2>::type,
340
- typename AllOfResult2<M3, M4>::type
341
- > type;
342
- };
343
-
344
- template <typename M1, typename M2, typename M3, typename M4, typename M5>
345
- struct AllOfResult5 {
346
- typedef BothOfMatcher<
347
- typename AllOfResult2<M1, M2>::type,
348
- typename AllOfResult3<M3, M4, M5>::type
349
- > type;
350
- };
351
-
352
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
353
- typename M6>
354
- struct AllOfResult6 {
355
- typedef BothOfMatcher<
356
- typename AllOfResult3<M1, M2, M3>::type,
357
- typename AllOfResult3<M4, M5, M6>::type
358
- > type;
359
- };
360
-
361
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
362
- typename M6, typename M7>
363
- struct AllOfResult7 {
364
- typedef BothOfMatcher<
365
- typename AllOfResult3<M1, M2, M3>::type,
366
- typename AllOfResult4<M4, M5, M6, M7>::type
367
- > type;
368
- };
369
-
370
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
371
- typename M6, typename M7, typename M8>
372
- struct AllOfResult8 {
373
- typedef BothOfMatcher<
374
- typename AllOfResult4<M1, M2, M3, M4>::type,
375
- typename AllOfResult4<M5, M6, M7, M8>::type
376
- > type;
377
- };
378
-
379
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
380
- typename M6, typename M7, typename M8, typename M9>
381
- struct AllOfResult9 {
382
- typedef BothOfMatcher<
383
- typename AllOfResult4<M1, M2, M3, M4>::type,
384
- typename AllOfResult5<M5, M6, M7, M8, M9>::type
385
- > type;
386
- };
387
-
388
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
389
- typename M6, typename M7, typename M8, typename M9, typename M10>
390
- struct AllOfResult10 {
391
- typedef BothOfMatcher<
392
- typename AllOfResult5<M1, M2, M3, M4, M5>::type,
393
- typename AllOfResult5<M6, M7, M8, M9, M10>::type
394
- > type;
395
- };
396
-
397
- // A set of metafunctions for computing the result type of AnyOf.
398
- // AnyOf(m1, ..., mN) returns
399
- // AnyOfResultN<decltype(m1), ..., decltype(mN)>::type.
400
-
401
- // Although AnyOf isn't defined for one argument, AnyOfResult1 is defined
402
- // to simplify the implementation.
403
- template <typename M1>
404
- struct AnyOfResult1 {
405
- typedef M1 type;
406
- };
407
-
408
- template <typename M1, typename M2>
409
- struct AnyOfResult2 {
410
- typedef EitherOfMatcher<
411
- typename AnyOfResult1<M1>::type,
412
- typename AnyOfResult1<M2>::type
413
- > type;
414
- };
415
-
416
- template <typename M1, typename M2, typename M3>
417
- struct AnyOfResult3 {
418
- typedef EitherOfMatcher<
419
- typename AnyOfResult1<M1>::type,
420
- typename AnyOfResult2<M2, M3>::type
421
- > type;
422
- };
423
-
424
- template <typename M1, typename M2, typename M3, typename M4>
425
- struct AnyOfResult4 {
426
- typedef EitherOfMatcher<
427
- typename AnyOfResult2<M1, M2>::type,
428
- typename AnyOfResult2<M3, M4>::type
429
- > type;
430
- };
431
-
432
- template <typename M1, typename M2, typename M3, typename M4, typename M5>
433
- struct AnyOfResult5 {
434
- typedef EitherOfMatcher<
435
- typename AnyOfResult2<M1, M2>::type,
436
- typename AnyOfResult3<M3, M4, M5>::type
437
- > type;
438
- };
439
-
440
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
441
- typename M6>
442
- struct AnyOfResult6 {
443
- typedef EitherOfMatcher<
444
- typename AnyOfResult3<M1, M2, M3>::type,
445
- typename AnyOfResult3<M4, M5, M6>::type
446
- > type;
447
- };
448
-
449
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
450
- typename M6, typename M7>
451
- struct AnyOfResult7 {
452
- typedef EitherOfMatcher<
453
- typename AnyOfResult3<M1, M2, M3>::type,
454
- typename AnyOfResult4<M4, M5, M6, M7>::type
455
- > type;
456
- };
457
-
458
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
459
- typename M6, typename M7, typename M8>
460
- struct AnyOfResult8 {
461
- typedef EitherOfMatcher<
462
- typename AnyOfResult4<M1, M2, M3, M4>::type,
463
- typename AnyOfResult4<M5, M6, M7, M8>::type
464
- > type;
465
- };
466
-
467
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
468
- typename M6, typename M7, typename M8, typename M9>
469
- struct AnyOfResult9 {
470
- typedef EitherOfMatcher<
471
- typename AnyOfResult4<M1, M2, M3, M4>::type,
472
- typename AnyOfResult5<M5, M6, M7, M8, M9>::type
473
- > type;
474
- };
475
-
476
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
477
- typename M6, typename M7, typename M8, typename M9, typename M10>
478
- struct AnyOfResult10 {
479
- typedef EitherOfMatcher<
480
- typename AnyOfResult5<M1, M2, M3, M4, M5>::type,
481
- typename AnyOfResult5<M6, M7, M8, M9, M10>::type
482
- > type;
483
- };
484
-
485
- } // namespace internal
486
-
487
- // Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected
488
- // fields of it matches a_matcher. C++ doesn't support default
489
- // arguments for function templates, so we have to overload it.
490
- template <typename InnerMatcher>
491
- inline internal::ArgsMatcher<InnerMatcher>
492
- Args(const InnerMatcher& matcher) {
493
- return internal::ArgsMatcher<InnerMatcher>(matcher);
494
- }
495
-
496
- template <int k1, typename InnerMatcher>
497
- inline internal::ArgsMatcher<InnerMatcher, k1>
498
- Args(const InnerMatcher& matcher) {
499
- return internal::ArgsMatcher<InnerMatcher, k1>(matcher);
500
- }
501
-
502
- template <int k1, int k2, typename InnerMatcher>
503
- inline internal::ArgsMatcher<InnerMatcher, k1, k2>
504
- Args(const InnerMatcher& matcher) {
505
- return internal::ArgsMatcher<InnerMatcher, k1, k2>(matcher);
506
- }
507
-
508
- template <int k1, int k2, int k3, typename InnerMatcher>
509
- inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3>
510
- Args(const InnerMatcher& matcher) {
511
- return internal::ArgsMatcher<InnerMatcher, k1, k2, k3>(matcher);
512
- }
513
-
514
- template <int k1, int k2, int k3, int k4, typename InnerMatcher>
515
- inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4>
516
- Args(const InnerMatcher& matcher) {
517
- return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4>(matcher);
518
- }
519
-
520
- template <int k1, int k2, int k3, int k4, int k5, typename InnerMatcher>
521
- inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5>
522
- Args(const InnerMatcher& matcher) {
523
- return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5>(matcher);
524
- }
525
-
526
- template <int k1, int k2, int k3, int k4, int k5, int k6, typename InnerMatcher>
527
- inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6>
528
- Args(const InnerMatcher& matcher) {
529
- return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6>(matcher);
530
- }
531
-
532
- template <int k1, int k2, int k3, int k4, int k5, int k6, int k7,
533
- typename InnerMatcher>
534
- inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7>
535
- Args(const InnerMatcher& matcher) {
536
- return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6,
537
- k7>(matcher);
538
- }
539
-
540
- template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
541
- typename InnerMatcher>
542
- inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8>
543
- Args(const InnerMatcher& matcher) {
544
- return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7,
545
- k8>(matcher);
546
- }
547
-
548
- template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
549
- int k9, typename InnerMatcher>
550
- inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8, k9>
551
- Args(const InnerMatcher& matcher) {
552
- return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8,
553
- k9>(matcher);
554
- }
555
-
556
- template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
557
- int k9, int k10, typename InnerMatcher>
558
- inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8, k9,
559
- k10>
560
- Args(const InnerMatcher& matcher) {
561
- return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8,
562
- k9, k10>(matcher);
563
- }
564
-
565
- // ElementsAre(e_1, e_2, ... e_n) matches an STL-style container with
566
- // n elements, where the i-th element in the container must
567
- // match the i-th argument in the list. Each argument of
568
- // ElementsAre() can be either a value or a matcher. We support up to
569
- // 10 arguments.
570
- //
571
- // The use of DecayArray in the implementation allows ElementsAre()
572
- // to accept string literals, whose type is const char[N], but we
573
- // want to treat them as const char*.
574
- //
575
- // NOTE: Since ElementsAre() cares about the order of the elements, it
576
- // must not be used with containers whose elements's order is
577
- // undefined (e.g. hash_map).
578
-
579
- inline internal::ElementsAreMatcher<
580
- std::tr1::tuple<> >
581
- ElementsAre() {
582
- typedef std::tr1::tuple<> Args;
583
- return internal::ElementsAreMatcher<Args>(Args());
584
- }
585
-
586
- template <typename T1>
587
- inline internal::ElementsAreMatcher<
588
- std::tr1::tuple<
589
- typename internal::DecayArray<T1>::type> >
590
- ElementsAre(const T1& e1) {
591
- typedef std::tr1::tuple<
592
- typename internal::DecayArray<T1>::type> Args;
593
- return internal::ElementsAreMatcher<Args>(Args(e1));
594
- }
595
-
596
- template <typename T1, typename T2>
597
- inline internal::ElementsAreMatcher<
598
- std::tr1::tuple<
599
- typename internal::DecayArray<T1>::type,
600
- typename internal::DecayArray<T2>::type> >
601
- ElementsAre(const T1& e1, const T2& e2) {
602
- typedef std::tr1::tuple<
603
- typename internal::DecayArray<T1>::type,
604
- typename internal::DecayArray<T2>::type> Args;
605
- return internal::ElementsAreMatcher<Args>(Args(e1, e2));
606
- }
607
-
608
- template <typename T1, typename T2, typename T3>
609
- inline internal::ElementsAreMatcher<
610
- std::tr1::tuple<
611
- typename internal::DecayArray<T1>::type,
612
- typename internal::DecayArray<T2>::type,
613
- typename internal::DecayArray<T3>::type> >
614
- ElementsAre(const T1& e1, const T2& e2, const T3& e3) {
615
- typedef std::tr1::tuple<
616
- typename internal::DecayArray<T1>::type,
617
- typename internal::DecayArray<T2>::type,
618
- typename internal::DecayArray<T3>::type> Args;
619
- return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3));
620
- }
621
-
622
- template <typename T1, typename T2, typename T3, typename T4>
623
- inline internal::ElementsAreMatcher<
624
- std::tr1::tuple<
625
- typename internal::DecayArray<T1>::type,
626
- typename internal::DecayArray<T2>::type,
627
- typename internal::DecayArray<T3>::type,
628
- typename internal::DecayArray<T4>::type> >
629
- ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) {
630
- typedef std::tr1::tuple<
631
- typename internal::DecayArray<T1>::type,
632
- typename internal::DecayArray<T2>::type,
633
- typename internal::DecayArray<T3>::type,
634
- typename internal::DecayArray<T4>::type> Args;
635
- return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4));
636
- }
637
-
638
- template <typename T1, typename T2, typename T3, typename T4, typename T5>
639
- inline internal::ElementsAreMatcher<
640
- std::tr1::tuple<
641
- typename internal::DecayArray<T1>::type,
642
- typename internal::DecayArray<T2>::type,
643
- typename internal::DecayArray<T3>::type,
644
- typename internal::DecayArray<T4>::type,
645
- typename internal::DecayArray<T5>::type> >
646
- ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
647
- const T5& e5) {
648
- typedef std::tr1::tuple<
649
- typename internal::DecayArray<T1>::type,
650
- typename internal::DecayArray<T2>::type,
651
- typename internal::DecayArray<T3>::type,
652
- typename internal::DecayArray<T4>::type,
653
- typename internal::DecayArray<T5>::type> Args;
654
- return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5));
655
- }
656
-
657
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
658
- typename T6>
659
- inline internal::ElementsAreMatcher<
660
- std::tr1::tuple<
661
- typename internal::DecayArray<T1>::type,
662
- typename internal::DecayArray<T2>::type,
663
- typename internal::DecayArray<T3>::type,
664
- typename internal::DecayArray<T4>::type,
665
- typename internal::DecayArray<T5>::type,
666
- typename internal::DecayArray<T6>::type> >
667
- ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
668
- const T5& e5, const T6& e6) {
669
- typedef std::tr1::tuple<
670
- typename internal::DecayArray<T1>::type,
671
- typename internal::DecayArray<T2>::type,
672
- typename internal::DecayArray<T3>::type,
673
- typename internal::DecayArray<T4>::type,
674
- typename internal::DecayArray<T5>::type,
675
- typename internal::DecayArray<T6>::type> Args;
676
- return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6));
677
- }
678
-
679
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
680
- typename T6, typename T7>
681
- inline internal::ElementsAreMatcher<
682
- std::tr1::tuple<
683
- typename internal::DecayArray<T1>::type,
684
- typename internal::DecayArray<T2>::type,
685
- typename internal::DecayArray<T3>::type,
686
- typename internal::DecayArray<T4>::type,
687
- typename internal::DecayArray<T5>::type,
688
- typename internal::DecayArray<T6>::type,
689
- typename internal::DecayArray<T7>::type> >
690
- ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
691
- const T5& e5, const T6& e6, const T7& e7) {
692
- typedef std::tr1::tuple<
693
- typename internal::DecayArray<T1>::type,
694
- typename internal::DecayArray<T2>::type,
695
- typename internal::DecayArray<T3>::type,
696
- typename internal::DecayArray<T4>::type,
697
- typename internal::DecayArray<T5>::type,
698
- typename internal::DecayArray<T6>::type,
699
- typename internal::DecayArray<T7>::type> Args;
700
- return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7));
701
- }
702
-
703
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
704
- typename T6, typename T7, typename T8>
705
- inline internal::ElementsAreMatcher<
706
- std::tr1::tuple<
707
- typename internal::DecayArray<T1>::type,
708
- typename internal::DecayArray<T2>::type,
709
- typename internal::DecayArray<T3>::type,
710
- typename internal::DecayArray<T4>::type,
711
- typename internal::DecayArray<T5>::type,
712
- typename internal::DecayArray<T6>::type,
713
- typename internal::DecayArray<T7>::type,
714
- typename internal::DecayArray<T8>::type> >
715
- ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
716
- const T5& e5, const T6& e6, const T7& e7, const T8& e8) {
717
- typedef std::tr1::tuple<
718
- typename internal::DecayArray<T1>::type,
719
- typename internal::DecayArray<T2>::type,
720
- typename internal::DecayArray<T3>::type,
721
- typename internal::DecayArray<T4>::type,
722
- typename internal::DecayArray<T5>::type,
723
- typename internal::DecayArray<T6>::type,
724
- typename internal::DecayArray<T7>::type,
725
- typename internal::DecayArray<T8>::type> Args;
726
- return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7,
727
- e8));
728
- }
729
-
730
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
731
- typename T6, typename T7, typename T8, typename T9>
732
- inline internal::ElementsAreMatcher<
733
- std::tr1::tuple<
734
- typename internal::DecayArray<T1>::type,
735
- typename internal::DecayArray<T2>::type,
736
- typename internal::DecayArray<T3>::type,
737
- typename internal::DecayArray<T4>::type,
738
- typename internal::DecayArray<T5>::type,
739
- typename internal::DecayArray<T6>::type,
740
- typename internal::DecayArray<T7>::type,
741
- typename internal::DecayArray<T8>::type,
742
- typename internal::DecayArray<T9>::type> >
743
- ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
744
- const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) {
745
- typedef std::tr1::tuple<
746
- typename internal::DecayArray<T1>::type,
747
- typename internal::DecayArray<T2>::type,
748
- typename internal::DecayArray<T3>::type,
749
- typename internal::DecayArray<T4>::type,
750
- typename internal::DecayArray<T5>::type,
751
- typename internal::DecayArray<T6>::type,
752
- typename internal::DecayArray<T7>::type,
753
- typename internal::DecayArray<T8>::type,
754
- typename internal::DecayArray<T9>::type> Args;
755
- return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7,
756
- e8, e9));
757
- }
758
-
759
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
760
- typename T6, typename T7, typename T8, typename T9, typename T10>
761
- inline internal::ElementsAreMatcher<
762
- std::tr1::tuple<
763
- typename internal::DecayArray<T1>::type,
764
- typename internal::DecayArray<T2>::type,
765
- typename internal::DecayArray<T3>::type,
766
- typename internal::DecayArray<T4>::type,
767
- typename internal::DecayArray<T5>::type,
768
- typename internal::DecayArray<T6>::type,
769
- typename internal::DecayArray<T7>::type,
770
- typename internal::DecayArray<T8>::type,
771
- typename internal::DecayArray<T9>::type,
772
- typename internal::DecayArray<T10>::type> >
773
- ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
774
- const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9,
775
- const T10& e10) {
776
- typedef std::tr1::tuple<
777
- typename internal::DecayArray<T1>::type,
778
- typename internal::DecayArray<T2>::type,
779
- typename internal::DecayArray<T3>::type,
780
- typename internal::DecayArray<T4>::type,
781
- typename internal::DecayArray<T5>::type,
782
- typename internal::DecayArray<T6>::type,
783
- typename internal::DecayArray<T7>::type,
784
- typename internal::DecayArray<T8>::type,
785
- typename internal::DecayArray<T9>::type,
786
- typename internal::DecayArray<T10>::type> Args;
787
- return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7,
788
- e8, e9, e10));
789
- }
790
-
791
- // UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension
792
- // that matches n elements in any order. We support up to n=10 arguments.
793
-
794
- inline internal::UnorderedElementsAreMatcher<
795
- std::tr1::tuple<> >
796
- UnorderedElementsAre() {
797
- typedef std::tr1::tuple<> Args;
798
- return internal::UnorderedElementsAreMatcher<Args>(Args());
799
- }
800
-
801
- template <typename T1>
802
- inline internal::UnorderedElementsAreMatcher<
803
- std::tr1::tuple<
804
- typename internal::DecayArray<T1>::type> >
805
- UnorderedElementsAre(const T1& e1) {
806
- typedef std::tr1::tuple<
807
- typename internal::DecayArray<T1>::type> Args;
808
- return internal::UnorderedElementsAreMatcher<Args>(Args(e1));
809
- }
810
-
811
- template <typename T1, typename T2>
812
- inline internal::UnorderedElementsAreMatcher<
813
- std::tr1::tuple<
814
- typename internal::DecayArray<T1>::type,
815
- typename internal::DecayArray<T2>::type> >
816
- UnorderedElementsAre(const T1& e1, const T2& e2) {
817
- typedef std::tr1::tuple<
818
- typename internal::DecayArray<T1>::type,
819
- typename internal::DecayArray<T2>::type> Args;
820
- return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2));
821
- }
822
-
823
- template <typename T1, typename T2, typename T3>
824
- inline internal::UnorderedElementsAreMatcher<
825
- std::tr1::tuple<
826
- typename internal::DecayArray<T1>::type,
827
- typename internal::DecayArray<T2>::type,
828
- typename internal::DecayArray<T3>::type> >
829
- UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3) {
830
- typedef std::tr1::tuple<
831
- typename internal::DecayArray<T1>::type,
832
- typename internal::DecayArray<T2>::type,
833
- typename internal::DecayArray<T3>::type> Args;
834
- return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3));
835
- }
836
-
837
- template <typename T1, typename T2, typename T3, typename T4>
838
- inline internal::UnorderedElementsAreMatcher<
839
- std::tr1::tuple<
840
- typename internal::DecayArray<T1>::type,
841
- typename internal::DecayArray<T2>::type,
842
- typename internal::DecayArray<T3>::type,
843
- typename internal::DecayArray<T4>::type> >
844
- UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) {
845
- typedef std::tr1::tuple<
846
- typename internal::DecayArray<T1>::type,
847
- typename internal::DecayArray<T2>::type,
848
- typename internal::DecayArray<T3>::type,
849
- typename internal::DecayArray<T4>::type> Args;
850
- return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4));
851
- }
852
-
853
- template <typename T1, typename T2, typename T3, typename T4, typename T5>
854
- inline internal::UnorderedElementsAreMatcher<
855
- std::tr1::tuple<
856
- typename internal::DecayArray<T1>::type,
857
- typename internal::DecayArray<T2>::type,
858
- typename internal::DecayArray<T3>::type,
859
- typename internal::DecayArray<T4>::type,
860
- typename internal::DecayArray<T5>::type> >
861
- UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
862
- const T5& e5) {
863
- typedef std::tr1::tuple<
864
- typename internal::DecayArray<T1>::type,
865
- typename internal::DecayArray<T2>::type,
866
- typename internal::DecayArray<T3>::type,
867
- typename internal::DecayArray<T4>::type,
868
- typename internal::DecayArray<T5>::type> Args;
869
- return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5));
870
- }
871
-
872
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
873
- typename T6>
874
- inline internal::UnorderedElementsAreMatcher<
875
- std::tr1::tuple<
876
- typename internal::DecayArray<T1>::type,
877
- typename internal::DecayArray<T2>::type,
878
- typename internal::DecayArray<T3>::type,
879
- typename internal::DecayArray<T4>::type,
880
- typename internal::DecayArray<T5>::type,
881
- typename internal::DecayArray<T6>::type> >
882
- UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
883
- const T5& e5, const T6& e6) {
884
- typedef std::tr1::tuple<
885
- typename internal::DecayArray<T1>::type,
886
- typename internal::DecayArray<T2>::type,
887
- typename internal::DecayArray<T3>::type,
888
- typename internal::DecayArray<T4>::type,
889
- typename internal::DecayArray<T5>::type,
890
- typename internal::DecayArray<T6>::type> Args;
891
- return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
892
- e6));
893
- }
894
-
895
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
896
- typename T6, typename T7>
897
- inline internal::UnorderedElementsAreMatcher<
898
- std::tr1::tuple<
899
- typename internal::DecayArray<T1>::type,
900
- typename internal::DecayArray<T2>::type,
901
- typename internal::DecayArray<T3>::type,
902
- typename internal::DecayArray<T4>::type,
903
- typename internal::DecayArray<T5>::type,
904
- typename internal::DecayArray<T6>::type,
905
- typename internal::DecayArray<T7>::type> >
906
- UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
907
- const T5& e5, const T6& e6, const T7& e7) {
908
- typedef std::tr1::tuple<
909
- typename internal::DecayArray<T1>::type,
910
- typename internal::DecayArray<T2>::type,
911
- typename internal::DecayArray<T3>::type,
912
- typename internal::DecayArray<T4>::type,
913
- typename internal::DecayArray<T5>::type,
914
- typename internal::DecayArray<T6>::type,
915
- typename internal::DecayArray<T7>::type> Args;
916
- return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
917
- e6, e7));
918
- }
919
-
920
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
921
- typename T6, typename T7, typename T8>
922
- inline internal::UnorderedElementsAreMatcher<
923
- std::tr1::tuple<
924
- typename internal::DecayArray<T1>::type,
925
- typename internal::DecayArray<T2>::type,
926
- typename internal::DecayArray<T3>::type,
927
- typename internal::DecayArray<T4>::type,
928
- typename internal::DecayArray<T5>::type,
929
- typename internal::DecayArray<T6>::type,
930
- typename internal::DecayArray<T7>::type,
931
- typename internal::DecayArray<T8>::type> >
932
- UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
933
- const T5& e5, const T6& e6, const T7& e7, const T8& e8) {
934
- typedef std::tr1::tuple<
935
- typename internal::DecayArray<T1>::type,
936
- typename internal::DecayArray<T2>::type,
937
- typename internal::DecayArray<T3>::type,
938
- typename internal::DecayArray<T4>::type,
939
- typename internal::DecayArray<T5>::type,
940
- typename internal::DecayArray<T6>::type,
941
- typename internal::DecayArray<T7>::type,
942
- typename internal::DecayArray<T8>::type> Args;
943
- return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
944
- e6, e7, e8));
945
- }
946
-
947
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
948
- typename T6, typename T7, typename T8, typename T9>
949
- inline internal::UnorderedElementsAreMatcher<
950
- std::tr1::tuple<
951
- typename internal::DecayArray<T1>::type,
952
- typename internal::DecayArray<T2>::type,
953
- typename internal::DecayArray<T3>::type,
954
- typename internal::DecayArray<T4>::type,
955
- typename internal::DecayArray<T5>::type,
956
- typename internal::DecayArray<T6>::type,
957
- typename internal::DecayArray<T7>::type,
958
- typename internal::DecayArray<T8>::type,
959
- typename internal::DecayArray<T9>::type> >
960
- UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
961
- const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) {
962
- typedef std::tr1::tuple<
963
- typename internal::DecayArray<T1>::type,
964
- typename internal::DecayArray<T2>::type,
965
- typename internal::DecayArray<T3>::type,
966
- typename internal::DecayArray<T4>::type,
967
- typename internal::DecayArray<T5>::type,
968
- typename internal::DecayArray<T6>::type,
969
- typename internal::DecayArray<T7>::type,
970
- typename internal::DecayArray<T8>::type,
971
- typename internal::DecayArray<T9>::type> Args;
972
- return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
973
- e6, e7, e8, e9));
974
- }
975
-
976
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
977
- typename T6, typename T7, typename T8, typename T9, typename T10>
978
- inline internal::UnorderedElementsAreMatcher<
979
- std::tr1::tuple<
980
- typename internal::DecayArray<T1>::type,
981
- typename internal::DecayArray<T2>::type,
982
- typename internal::DecayArray<T3>::type,
983
- typename internal::DecayArray<T4>::type,
984
- typename internal::DecayArray<T5>::type,
985
- typename internal::DecayArray<T6>::type,
986
- typename internal::DecayArray<T7>::type,
987
- typename internal::DecayArray<T8>::type,
988
- typename internal::DecayArray<T9>::type,
989
- typename internal::DecayArray<T10>::type> >
990
- UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
991
- const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9,
992
- const T10& e10) {
993
- typedef std::tr1::tuple<
994
- typename internal::DecayArray<T1>::type,
995
- typename internal::DecayArray<T2>::type,
996
- typename internal::DecayArray<T3>::type,
997
- typename internal::DecayArray<T4>::type,
998
- typename internal::DecayArray<T5>::type,
999
- typename internal::DecayArray<T6>::type,
1000
- typename internal::DecayArray<T7>::type,
1001
- typename internal::DecayArray<T8>::type,
1002
- typename internal::DecayArray<T9>::type,
1003
- typename internal::DecayArray<T10>::type> Args;
1004
- return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
1005
- e6, e7, e8, e9, e10));
1006
- }
1007
-
1008
- // AllOf(m1, m2, ..., mk) matches any value that matches all of the given
1009
- // sub-matchers. AllOf is called fully qualified to prevent ADL from firing.
1010
-
1011
- template <typename M1, typename M2>
1012
- inline typename internal::AllOfResult2<M1, M2>::type
1013
- AllOf(M1 m1, M2 m2) {
1014
- return typename internal::AllOfResult2<M1, M2>::type(
1015
- m1,
1016
- m2);
1017
- }
1018
-
1019
- template <typename M1, typename M2, typename M3>
1020
- inline typename internal::AllOfResult3<M1, M2, M3>::type
1021
- AllOf(M1 m1, M2 m2, M3 m3) {
1022
- return typename internal::AllOfResult3<M1, M2, M3>::type(
1023
- m1,
1024
- ::testing::AllOf(m2, m3));
1025
- }
1026
-
1027
- template <typename M1, typename M2, typename M3, typename M4>
1028
- inline typename internal::AllOfResult4<M1, M2, M3, M4>::type
1029
- AllOf(M1 m1, M2 m2, M3 m3, M4 m4) {
1030
- return typename internal::AllOfResult4<M1, M2, M3, M4>::type(
1031
- ::testing::AllOf(m1, m2),
1032
- ::testing::AllOf(m3, m4));
1033
- }
1034
-
1035
- template <typename M1, typename M2, typename M3, typename M4, typename M5>
1036
- inline typename internal::AllOfResult5<M1, M2, M3, M4, M5>::type
1037
- AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) {
1038
- return typename internal::AllOfResult5<M1, M2, M3, M4, M5>::type(
1039
- ::testing::AllOf(m1, m2),
1040
- ::testing::AllOf(m3, m4, m5));
1041
- }
1042
-
1043
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
1044
- typename M6>
1045
- inline typename internal::AllOfResult6<M1, M2, M3, M4, M5, M6>::type
1046
- AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) {
1047
- return typename internal::AllOfResult6<M1, M2, M3, M4, M5, M6>::type(
1048
- ::testing::AllOf(m1, m2, m3),
1049
- ::testing::AllOf(m4, m5, m6));
1050
- }
1051
-
1052
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
1053
- typename M6, typename M7>
1054
- inline typename internal::AllOfResult7<M1, M2, M3, M4, M5, M6, M7>::type
1055
- AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) {
1056
- return typename internal::AllOfResult7<M1, M2, M3, M4, M5, M6, M7>::type(
1057
- ::testing::AllOf(m1, m2, m3),
1058
- ::testing::AllOf(m4, m5, m6, m7));
1059
- }
1060
-
1061
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
1062
- typename M6, typename M7, typename M8>
1063
- inline typename internal::AllOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type
1064
- AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) {
1065
- return typename internal::AllOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type(
1066
- ::testing::AllOf(m1, m2, m3, m4),
1067
- ::testing::AllOf(m5, m6, m7, m8));
1068
- }
1069
-
1070
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
1071
- typename M6, typename M7, typename M8, typename M9>
1072
- inline typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, M9>::type
1073
- AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) {
1074
- return typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8,
1075
- M9>::type(
1076
- ::testing::AllOf(m1, m2, m3, m4),
1077
- ::testing::AllOf(m5, m6, m7, m8, m9));
1078
- }
1079
-
1080
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
1081
- typename M6, typename M7, typename M8, typename M9, typename M10>
1082
- inline typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
1083
- M10>::type
1084
- AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
1085
- return typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
1086
- M10>::type(
1087
- ::testing::AllOf(m1, m2, m3, m4, m5),
1088
- ::testing::AllOf(m6, m7, m8, m9, m10));
1089
- }
1090
-
1091
- // AnyOf(m1, m2, ..., mk) matches any value that matches any of the given
1092
- // sub-matchers. AnyOf is called fully qualified to prevent ADL from firing.
1093
-
1094
- template <typename M1, typename M2>
1095
- inline typename internal::AnyOfResult2<M1, M2>::type
1096
- AnyOf(M1 m1, M2 m2) {
1097
- return typename internal::AnyOfResult2<M1, M2>::type(
1098
- m1,
1099
- m2);
1100
- }
1101
-
1102
- template <typename M1, typename M2, typename M3>
1103
- inline typename internal::AnyOfResult3<M1, M2, M3>::type
1104
- AnyOf(M1 m1, M2 m2, M3 m3) {
1105
- return typename internal::AnyOfResult3<M1, M2, M3>::type(
1106
- m1,
1107
- ::testing::AnyOf(m2, m3));
1108
- }
1109
-
1110
- template <typename M1, typename M2, typename M3, typename M4>
1111
- inline typename internal::AnyOfResult4<M1, M2, M3, M4>::type
1112
- AnyOf(M1 m1, M2 m2, M3 m3, M4 m4) {
1113
- return typename internal::AnyOfResult4<M1, M2, M3, M4>::type(
1114
- ::testing::AnyOf(m1, m2),
1115
- ::testing::AnyOf(m3, m4));
1116
- }
1117
-
1118
- template <typename M1, typename M2, typename M3, typename M4, typename M5>
1119
- inline typename internal::AnyOfResult5<M1, M2, M3, M4, M5>::type
1120
- AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) {
1121
- return typename internal::AnyOfResult5<M1, M2, M3, M4, M5>::type(
1122
- ::testing::AnyOf(m1, m2),
1123
- ::testing::AnyOf(m3, m4, m5));
1124
- }
1125
-
1126
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
1127
- typename M6>
1128
- inline typename internal::AnyOfResult6<M1, M2, M3, M4, M5, M6>::type
1129
- AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) {
1130
- return typename internal::AnyOfResult6<M1, M2, M3, M4, M5, M6>::type(
1131
- ::testing::AnyOf(m1, m2, m3),
1132
- ::testing::AnyOf(m4, m5, m6));
1133
- }
1134
-
1135
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
1136
- typename M6, typename M7>
1137
- inline typename internal::AnyOfResult7<M1, M2, M3, M4, M5, M6, M7>::type
1138
- AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) {
1139
- return typename internal::AnyOfResult7<M1, M2, M3, M4, M5, M6, M7>::type(
1140
- ::testing::AnyOf(m1, m2, m3),
1141
- ::testing::AnyOf(m4, m5, m6, m7));
1142
- }
1143
-
1144
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
1145
- typename M6, typename M7, typename M8>
1146
- inline typename internal::AnyOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type
1147
- AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) {
1148
- return typename internal::AnyOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type(
1149
- ::testing::AnyOf(m1, m2, m3, m4),
1150
- ::testing::AnyOf(m5, m6, m7, m8));
1151
- }
1152
-
1153
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
1154
- typename M6, typename M7, typename M8, typename M9>
1155
- inline typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, M9>::type
1156
- AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) {
1157
- return typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8,
1158
- M9>::type(
1159
- ::testing::AnyOf(m1, m2, m3, m4),
1160
- ::testing::AnyOf(m5, m6, m7, m8, m9));
1161
- }
1162
-
1163
- template <typename M1, typename M2, typename M3, typename M4, typename M5,
1164
- typename M6, typename M7, typename M8, typename M9, typename M10>
1165
- inline typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
1166
- M10>::type
1167
- AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
1168
- return typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
1169
- M10>::type(
1170
- ::testing::AnyOf(m1, m2, m3, m4, m5),
1171
- ::testing::AnyOf(m6, m7, m8, m9, m10));
1172
- }
1173
-
1174
- } // namespace testing
1175
-
1176
-
1177
- // The MATCHER* family of macros can be used in a namespace scope to
1178
- // define custom matchers easily.
1179
- //
1180
- // Basic Usage
1181
- // ===========
1182
- //
1183
- // The syntax
1184
- //
1185
- // MATCHER(name, description_string) { statements; }
1186
- //
1187
- // defines a matcher with the given name that executes the statements,
1188
- // which must return a bool to indicate if the match succeeds. Inside
1189
- // the statements, you can refer to the value being matched by 'arg',
1190
- // and refer to its type by 'arg_type'.
1191
- //
1192
- // The description string documents what the matcher does, and is used
1193
- // to generate the failure message when the match fails. Since a
1194
- // MATCHER() is usually defined in a header file shared by multiple
1195
- // C++ source files, we require the description to be a C-string
1196
- // literal to avoid possible side effects. It can be empty, in which
1197
- // case we'll use the sequence of words in the matcher name as the
1198
- // description.
1199
- //
1200
- // For example:
1201
- //
1202
- // MATCHER(IsEven, "") { return (arg % 2) == 0; }
1203
- //
1204
- // allows you to write
1205
- //
1206
- // // Expects mock_foo.Bar(n) to be called where n is even.
1207
- // EXPECT_CALL(mock_foo, Bar(IsEven()));
1208
- //
1209
- // or,
1210
- //
1211
- // // Verifies that the value of some_expression is even.
1212
- // EXPECT_THAT(some_expression, IsEven());
1213
- //
1214
- // If the above assertion fails, it will print something like:
1215
- //
1216
- // Value of: some_expression
1217
- // Expected: is even
1218
- // Actual: 7
1219
- //
1220
- // where the description "is even" is automatically calculated from the
1221
- // matcher name IsEven.
1222
- //
1223
- // Argument Type
1224
- // =============
1225
- //
1226
- // Note that the type of the value being matched (arg_type) is
1227
- // determined by the context in which you use the matcher and is
1228
- // supplied to you by the compiler, so you don't need to worry about
1229
- // declaring it (nor can you). This allows the matcher to be
1230
- // polymorphic. For example, IsEven() can be used to match any type
1231
- // where the value of "(arg % 2) == 0" can be implicitly converted to
1232
- // a bool. In the "Bar(IsEven())" example above, if method Bar()
1233
- // takes an int, 'arg_type' will be int; if it takes an unsigned long,
1234
- // 'arg_type' will be unsigned long; and so on.
1235
- //
1236
- // Parameterizing Matchers
1237
- // =======================
1238
- //
1239
- // Sometimes you'll want to parameterize the matcher. For that you
1240
- // can use another macro:
1241
- //
1242
- // MATCHER_P(name, param_name, description_string) { statements; }
1243
- //
1244
- // For example:
1245
- //
1246
- // MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }
1247
- //
1248
- // will allow you to write:
1249
- //
1250
- // EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));
1251
- //
1252
- // which may lead to this message (assuming n is 10):
1253
- //
1254
- // Value of: Blah("a")
1255
- // Expected: has absolute value 10
1256
- // Actual: -9
1257
- //
1258
- // Note that both the matcher description and its parameter are
1259
- // printed, making the message human-friendly.
1260
- //
1261
- // In the matcher definition body, you can write 'foo_type' to
1262
- // reference the type of a parameter named 'foo'. For example, in the
1263
- // body of MATCHER_P(HasAbsoluteValue, value) above, you can write
1264
- // 'value_type' to refer to the type of 'value'.
1265
- //
1266
- // We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P10 to
1267
- // support multi-parameter matchers.
1268
- //
1269
- // Describing Parameterized Matchers
1270
- // =================================
1271
- //
1272
- // The last argument to MATCHER*() is a string-typed expression. The
1273
- // expression can reference all of the matcher's parameters and a
1274
- // special bool-typed variable named 'negation'. When 'negation' is
1275
- // false, the expression should evaluate to the matcher's description;
1276
- // otherwise it should evaluate to the description of the negation of
1277
- // the matcher. For example,
1278
- //
1279
- // using testing::PrintToString;
1280
- //
1281
- // MATCHER_P2(InClosedRange, low, hi,
1282
- // string(negation ? "is not" : "is") + " in range [" +
1283
- // PrintToString(low) + ", " + PrintToString(hi) + "]") {
1284
- // return low <= arg && arg <= hi;
1285
- // }
1286
- // ...
1287
- // EXPECT_THAT(3, InClosedRange(4, 6));
1288
- // EXPECT_THAT(3, Not(InClosedRange(2, 4)));
1289
- //
1290
- // would generate two failures that contain the text:
1291
- //
1292
- // Expected: is in range [4, 6]
1293
- // ...
1294
- // Expected: is not in range [2, 4]
1295
- //
1296
- // If you specify "" as the description, the failure message will
1297
- // contain the sequence of words in the matcher name followed by the
1298
- // parameter values printed as a tuple. For example,
1299
- //
1300
- // MATCHER_P2(InClosedRange, low, hi, "") { ... }
1301
- // ...
1302
- // EXPECT_THAT(3, InClosedRange(4, 6));
1303
- // EXPECT_THAT(3, Not(InClosedRange(2, 4)));
1304
- //
1305
- // would generate two failures that contain the text:
1306
- //
1307
- // Expected: in closed range (4, 6)
1308
- // ...
1309
- // Expected: not (in closed range (2, 4))
1310
- //
1311
- // Types of Matcher Parameters
1312
- // ===========================
1313
- //
1314
- // For the purpose of typing, you can view
1315
- //
1316
- // MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }
1317
- //
1318
- // as shorthand for
1319
- //
1320
- // template <typename p1_type, ..., typename pk_type>
1321
- // FooMatcherPk<p1_type, ..., pk_type>
1322
- // Foo(p1_type p1, ..., pk_type pk) { ... }
1323
- //
1324
- // When you write Foo(v1, ..., vk), the compiler infers the types of
1325
- // the parameters v1, ..., and vk for you. If you are not happy with
1326
- // the result of the type inference, you can specify the types by
1327
- // explicitly instantiating the template, as in Foo<long, bool>(5,
1328
- // false). As said earlier, you don't get to (or need to) specify
1329
- // 'arg_type' as that's determined by the context in which the matcher
1330
- // is used. You can assign the result of expression Foo(p1, ..., pk)
1331
- // to a variable of type FooMatcherPk<p1_type, ..., pk_type>. This
1332
- // can be useful when composing matchers.
1333
- //
1334
- // While you can instantiate a matcher template with reference types,
1335
- // passing the parameters by pointer usually makes your code more
1336
- // readable. If, however, you still want to pass a parameter by
1337
- // reference, be aware that in the failure message generated by the
1338
- // matcher you will see the value of the referenced object but not its
1339
- // address.
1340
- //
1341
- // Explaining Match Results
1342
- // ========================
1343
- //
1344
- // Sometimes the matcher description alone isn't enough to explain why
1345
- // the match has failed or succeeded. For example, when expecting a
1346
- // long string, it can be very helpful to also print the diff between
1347
- // the expected string and the actual one. To achieve that, you can
1348
- // optionally stream additional information to a special variable
1349
- // named result_listener, whose type is a pointer to class
1350
- // MatchResultListener:
1351
- //
1352
- // MATCHER_P(EqualsLongString, str, "") {
1353
- // if (arg == str) return true;
1354
- //
1355
- // *result_listener << "the difference: "
1356
- /// << DiffStrings(str, arg);
1357
- // return false;
1358
- // }
1359
- //
1360
- // Overloading Matchers
1361
- // ====================
1362
- //
1363
- // You can overload matchers with different numbers of parameters:
1364
- //
1365
- // MATCHER_P(Blah, a, description_string1) { ... }
1366
- // MATCHER_P2(Blah, a, b, description_string2) { ... }
1367
- //
1368
- // Caveats
1369
- // =======
1370
- //
1371
- // When defining a new matcher, you should also consider implementing
1372
- // MatcherInterface or using MakePolymorphicMatcher(). These
1373
- // approaches require more work than the MATCHER* macros, but also
1374
- // give you more control on the types of the value being matched and
1375
- // the matcher parameters, which may leads to better compiler error
1376
- // messages when the matcher is used wrong. They also allow
1377
- // overloading matchers based on parameter types (as opposed to just
1378
- // based on the number of parameters).
1379
- //
1380
- // MATCHER*() can only be used in a namespace scope. The reason is
1381
- // that C++ doesn't yet allow function-local types to be used to
1382
- // instantiate templates. The up-coming C++0x standard will fix this.
1383
- // Once that's done, we'll consider supporting using MATCHER*() inside
1384
- // a function.
1385
- //
1386
- // More Information
1387
- // ================
1388
- //
1389
- // To learn more about using these macros, please search for 'MATCHER'
1390
- // on http://code.google.com/p/googlemock/wiki/CookBook.
1391
-
1392
- #define MATCHER(name, description)\
1393
- class name##Matcher {\
1394
- public:\
1395
- template <typename arg_type>\
1396
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1397
- public:\
1398
- gmock_Impl()\
1399
- {}\
1400
- virtual bool MatchAndExplain(\
1401
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1402
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
1403
- *gmock_os << FormatDescription(false);\
1404
- }\
1405
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1406
- *gmock_os << FormatDescription(true);\
1407
- }\
1408
- private:\
1409
- ::testing::internal::string FormatDescription(bool negation) const {\
1410
- const ::testing::internal::string gmock_description = (description);\
1411
- if (!gmock_description.empty())\
1412
- return gmock_description;\
1413
- return ::testing::internal::FormatMatcherDescription(\
1414
- negation, #name, \
1415
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1416
- ::std::tr1::tuple<>()));\
1417
- }\
1418
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1419
- };\
1420
- template <typename arg_type>\
1421
- operator ::testing::Matcher<arg_type>() const {\
1422
- return ::testing::Matcher<arg_type>(\
1423
- new gmock_Impl<arg_type>());\
1424
- }\
1425
- name##Matcher() {\
1426
- }\
1427
- private:\
1428
- GTEST_DISALLOW_ASSIGN_(name##Matcher);\
1429
- };\
1430
- inline name##Matcher name() {\
1431
- return name##Matcher();\
1432
- }\
1433
- template <typename arg_type>\
1434
- bool name##Matcher::gmock_Impl<arg_type>::MatchAndExplain(\
1435
- arg_type arg, \
1436
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1437
- const
1438
-
1439
- #define MATCHER_P(name, p0, description)\
1440
- template <typename p0##_type>\
1441
- class name##MatcherP {\
1442
- public:\
1443
- template <typename arg_type>\
1444
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1445
- public:\
1446
- explicit gmock_Impl(p0##_type gmock_p0)\
1447
- : p0(gmock_p0) {}\
1448
- virtual bool MatchAndExplain(\
1449
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1450
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
1451
- *gmock_os << FormatDescription(false);\
1452
- }\
1453
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1454
- *gmock_os << FormatDescription(true);\
1455
- }\
1456
- p0##_type p0;\
1457
- private:\
1458
- ::testing::internal::string FormatDescription(bool negation) const {\
1459
- const ::testing::internal::string gmock_description = (description);\
1460
- if (!gmock_description.empty())\
1461
- return gmock_description;\
1462
- return ::testing::internal::FormatMatcherDescription(\
1463
- negation, #name, \
1464
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1465
- ::std::tr1::tuple<p0##_type>(p0)));\
1466
- }\
1467
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1468
- };\
1469
- template <typename arg_type>\
1470
- operator ::testing::Matcher<arg_type>() const {\
1471
- return ::testing::Matcher<arg_type>(\
1472
- new gmock_Impl<arg_type>(p0));\
1473
- }\
1474
- name##MatcherP(p0##_type gmock_p0) : p0(gmock_p0) {\
1475
- }\
1476
- p0##_type p0;\
1477
- private:\
1478
- GTEST_DISALLOW_ASSIGN_(name##MatcherP);\
1479
- };\
1480
- template <typename p0##_type>\
1481
- inline name##MatcherP<p0##_type> name(p0##_type p0) {\
1482
- return name##MatcherP<p0##_type>(p0);\
1483
- }\
1484
- template <typename p0##_type>\
1485
- template <typename arg_type>\
1486
- bool name##MatcherP<p0##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1487
- arg_type arg, \
1488
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1489
- const
1490
-
1491
- #define MATCHER_P2(name, p0, p1, description)\
1492
- template <typename p0##_type, typename p1##_type>\
1493
- class name##MatcherP2 {\
1494
- public:\
1495
- template <typename arg_type>\
1496
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1497
- public:\
1498
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\
1499
- : p0(gmock_p0), p1(gmock_p1) {}\
1500
- virtual bool MatchAndExplain(\
1501
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1502
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
1503
- *gmock_os << FormatDescription(false);\
1504
- }\
1505
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1506
- *gmock_os << FormatDescription(true);\
1507
- }\
1508
- p0##_type p0;\
1509
- p1##_type p1;\
1510
- private:\
1511
- ::testing::internal::string FormatDescription(bool negation) const {\
1512
- const ::testing::internal::string gmock_description = (description);\
1513
- if (!gmock_description.empty())\
1514
- return gmock_description;\
1515
- return ::testing::internal::FormatMatcherDescription(\
1516
- negation, #name, \
1517
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1518
- ::std::tr1::tuple<p0##_type, p1##_type>(p0, p1)));\
1519
- }\
1520
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1521
- };\
1522
- template <typename arg_type>\
1523
- operator ::testing::Matcher<arg_type>() const {\
1524
- return ::testing::Matcher<arg_type>(\
1525
- new gmock_Impl<arg_type>(p0, p1));\
1526
- }\
1527
- name##MatcherP2(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \
1528
- p1(gmock_p1) {\
1529
- }\
1530
- p0##_type p0;\
1531
- p1##_type p1;\
1532
- private:\
1533
- GTEST_DISALLOW_ASSIGN_(name##MatcherP2);\
1534
- };\
1535
- template <typename p0##_type, typename p1##_type>\
1536
- inline name##MatcherP2<p0##_type, p1##_type> name(p0##_type p0, \
1537
- p1##_type p1) {\
1538
- return name##MatcherP2<p0##_type, p1##_type>(p0, p1);\
1539
- }\
1540
- template <typename p0##_type, typename p1##_type>\
1541
- template <typename arg_type>\
1542
- bool name##MatcherP2<p0##_type, \
1543
- p1##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1544
- arg_type arg, \
1545
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1546
- const
1547
-
1548
- #define MATCHER_P3(name, p0, p1, p2, description)\
1549
- template <typename p0##_type, typename p1##_type, typename p2##_type>\
1550
- class name##MatcherP3 {\
1551
- public:\
1552
- template <typename arg_type>\
1553
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1554
- public:\
1555
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\
1556
- : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\
1557
- virtual bool MatchAndExplain(\
1558
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1559
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
1560
- *gmock_os << FormatDescription(false);\
1561
- }\
1562
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1563
- *gmock_os << FormatDescription(true);\
1564
- }\
1565
- p0##_type p0;\
1566
- p1##_type p1;\
1567
- p2##_type p2;\
1568
- private:\
1569
- ::testing::internal::string FormatDescription(bool negation) const {\
1570
- const ::testing::internal::string gmock_description = (description);\
1571
- if (!gmock_description.empty())\
1572
- return gmock_description;\
1573
- return ::testing::internal::FormatMatcherDescription(\
1574
- negation, #name, \
1575
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1576
- ::std::tr1::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, \
1577
- p2)));\
1578
- }\
1579
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1580
- };\
1581
- template <typename arg_type>\
1582
- operator ::testing::Matcher<arg_type>() const {\
1583
- return ::testing::Matcher<arg_type>(\
1584
- new gmock_Impl<arg_type>(p0, p1, p2));\
1585
- }\
1586
- name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \
1587
- p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {\
1588
- }\
1589
- p0##_type p0;\
1590
- p1##_type p1;\
1591
- p2##_type p2;\
1592
- private:\
1593
- GTEST_DISALLOW_ASSIGN_(name##MatcherP3);\
1594
- };\
1595
- template <typename p0##_type, typename p1##_type, typename p2##_type>\
1596
- inline name##MatcherP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
1597
- p1##_type p1, p2##_type p2) {\
1598
- return name##MatcherP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
1599
- }\
1600
- template <typename p0##_type, typename p1##_type, typename p2##_type>\
1601
- template <typename arg_type>\
1602
- bool name##MatcherP3<p0##_type, p1##_type, \
1603
- p2##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1604
- arg_type arg, \
1605
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1606
- const
1607
-
1608
- #define MATCHER_P4(name, p0, p1, p2, p3, description)\
1609
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
1610
- typename p3##_type>\
1611
- class name##MatcherP4 {\
1612
- public:\
1613
- template <typename arg_type>\
1614
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1615
- public:\
1616
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1617
- p3##_type gmock_p3)\
1618
- : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3) {}\
1619
- virtual bool MatchAndExplain(\
1620
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1621
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
1622
- *gmock_os << FormatDescription(false);\
1623
- }\
1624
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1625
- *gmock_os << FormatDescription(true);\
1626
- }\
1627
- p0##_type p0;\
1628
- p1##_type p1;\
1629
- p2##_type p2;\
1630
- p3##_type p3;\
1631
- private:\
1632
- ::testing::internal::string FormatDescription(bool negation) const {\
1633
- const ::testing::internal::string gmock_description = (description);\
1634
- if (!gmock_description.empty())\
1635
- return gmock_description;\
1636
- return ::testing::internal::FormatMatcherDescription(\
1637
- negation, #name, \
1638
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1639
- ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, \
1640
- p3##_type>(p0, p1, p2, p3)));\
1641
- }\
1642
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1643
- };\
1644
- template <typename arg_type>\
1645
- operator ::testing::Matcher<arg_type>() const {\
1646
- return ::testing::Matcher<arg_type>(\
1647
- new gmock_Impl<arg_type>(p0, p1, p2, p3));\
1648
- }\
1649
- name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \
1650
- p2##_type gmock_p2, p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), \
1651
- p2(gmock_p2), p3(gmock_p3) {\
1652
- }\
1653
- p0##_type p0;\
1654
- p1##_type p1;\
1655
- p2##_type p2;\
1656
- p3##_type p3;\
1657
- private:\
1658
- GTEST_DISALLOW_ASSIGN_(name##MatcherP4);\
1659
- };\
1660
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
1661
- typename p3##_type>\
1662
- inline name##MatcherP4<p0##_type, p1##_type, p2##_type, \
1663
- p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
1664
- p3##_type p3) {\
1665
- return name##MatcherP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \
1666
- p1, p2, p3);\
1667
- }\
1668
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
1669
- typename p3##_type>\
1670
- template <typename arg_type>\
1671
- bool name##MatcherP4<p0##_type, p1##_type, p2##_type, \
1672
- p3##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1673
- arg_type arg, \
1674
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1675
- const
1676
-
1677
- #define MATCHER_P5(name, p0, p1, p2, p3, p4, description)\
1678
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
1679
- typename p3##_type, typename p4##_type>\
1680
- class name##MatcherP5 {\
1681
- public:\
1682
- template <typename arg_type>\
1683
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1684
- public:\
1685
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1686
- p3##_type gmock_p3, p4##_type gmock_p4)\
1687
- : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
1688
- p4(gmock_p4) {}\
1689
- virtual bool MatchAndExplain(\
1690
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1691
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
1692
- *gmock_os << FormatDescription(false);\
1693
- }\
1694
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1695
- *gmock_os << FormatDescription(true);\
1696
- }\
1697
- p0##_type p0;\
1698
- p1##_type p1;\
1699
- p2##_type p2;\
1700
- p3##_type p3;\
1701
- p4##_type p4;\
1702
- private:\
1703
- ::testing::internal::string FormatDescription(bool negation) const {\
1704
- const ::testing::internal::string gmock_description = (description);\
1705
- if (!gmock_description.empty())\
1706
- return gmock_description;\
1707
- return ::testing::internal::FormatMatcherDescription(\
1708
- negation, #name, \
1709
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1710
- ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
1711
- p4##_type>(p0, p1, p2, p3, p4)));\
1712
- }\
1713
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1714
- };\
1715
- template <typename arg_type>\
1716
- operator ::testing::Matcher<arg_type>() const {\
1717
- return ::testing::Matcher<arg_type>(\
1718
- new gmock_Impl<arg_type>(p0, p1, p2, p3, p4));\
1719
- }\
1720
- name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \
1721
- p2##_type gmock_p2, p3##_type gmock_p3, \
1722
- p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
1723
- p3(gmock_p3), p4(gmock_p4) {\
1724
- }\
1725
- p0##_type p0;\
1726
- p1##_type p1;\
1727
- p2##_type p2;\
1728
- p3##_type p3;\
1729
- p4##_type p4;\
1730
- private:\
1731
- GTEST_DISALLOW_ASSIGN_(name##MatcherP5);\
1732
- };\
1733
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
1734
- typename p3##_type, typename p4##_type>\
1735
- inline name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1736
- p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
1737
- p4##_type p4) {\
1738
- return name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1739
- p4##_type>(p0, p1, p2, p3, p4);\
1740
- }\
1741
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
1742
- typename p3##_type, typename p4##_type>\
1743
- template <typename arg_type>\
1744
- bool name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1745
- p4##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1746
- arg_type arg, \
1747
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1748
- const
1749
-
1750
- #define MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)\
1751
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
1752
- typename p3##_type, typename p4##_type, typename p5##_type>\
1753
- class name##MatcherP6 {\
1754
- public:\
1755
- template <typename arg_type>\
1756
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1757
- public:\
1758
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1759
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5)\
1760
- : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
1761
- p4(gmock_p4), p5(gmock_p5) {}\
1762
- virtual bool MatchAndExplain(\
1763
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1764
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
1765
- *gmock_os << FormatDescription(false);\
1766
- }\
1767
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1768
- *gmock_os << FormatDescription(true);\
1769
- }\
1770
- p0##_type p0;\
1771
- p1##_type p1;\
1772
- p2##_type p2;\
1773
- p3##_type p3;\
1774
- p4##_type p4;\
1775
- p5##_type p5;\
1776
- private:\
1777
- ::testing::internal::string FormatDescription(bool negation) const {\
1778
- const ::testing::internal::string gmock_description = (description);\
1779
- if (!gmock_description.empty())\
1780
- return gmock_description;\
1781
- return ::testing::internal::FormatMatcherDescription(\
1782
- negation, #name, \
1783
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1784
- ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
1785
- p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\
1786
- }\
1787
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1788
- };\
1789
- template <typename arg_type>\
1790
- operator ::testing::Matcher<arg_type>() const {\
1791
- return ::testing::Matcher<arg_type>(\
1792
- new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5));\
1793
- }\
1794
- name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \
1795
- p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1796
- p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
1797
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {\
1798
- }\
1799
- p0##_type p0;\
1800
- p1##_type p1;\
1801
- p2##_type p2;\
1802
- p3##_type p3;\
1803
- p4##_type p4;\
1804
- p5##_type p5;\
1805
- private:\
1806
- GTEST_DISALLOW_ASSIGN_(name##MatcherP6);\
1807
- };\
1808
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
1809
- typename p3##_type, typename p4##_type, typename p5##_type>\
1810
- inline name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
1811
- p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
1812
- p3##_type p3, p4##_type p4, p5##_type p5) {\
1813
- return name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
1814
- p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
1815
- }\
1816
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
1817
- typename p3##_type, typename p4##_type, typename p5##_type>\
1818
- template <typename arg_type>\
1819
- bool name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1820
- p5##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1821
- arg_type arg, \
1822
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1823
- const
1824
-
1825
- #define MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)\
1826
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
1827
- typename p3##_type, typename p4##_type, typename p5##_type, \
1828
- typename p6##_type>\
1829
- class name##MatcherP7 {\
1830
- public:\
1831
- template <typename arg_type>\
1832
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1833
- public:\
1834
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1835
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1836
- p6##_type gmock_p6)\
1837
- : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
1838
- p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) {}\
1839
- virtual bool MatchAndExplain(\
1840
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1841
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
1842
- *gmock_os << FormatDescription(false);\
1843
- }\
1844
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1845
- *gmock_os << FormatDescription(true);\
1846
- }\
1847
- p0##_type p0;\
1848
- p1##_type p1;\
1849
- p2##_type p2;\
1850
- p3##_type p3;\
1851
- p4##_type p4;\
1852
- p5##_type p5;\
1853
- p6##_type p6;\
1854
- private:\
1855
- ::testing::internal::string FormatDescription(bool negation) const {\
1856
- const ::testing::internal::string gmock_description = (description);\
1857
- if (!gmock_description.empty())\
1858
- return gmock_description;\
1859
- return ::testing::internal::FormatMatcherDescription(\
1860
- negation, #name, \
1861
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1862
- ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
1863
- p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \
1864
- p6)));\
1865
- }\
1866
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1867
- };\
1868
- template <typename arg_type>\
1869
- operator ::testing::Matcher<arg_type>() const {\
1870
- return ::testing::Matcher<arg_type>(\
1871
- new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6));\
1872
- }\
1873
- name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \
1874
- p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1875
- p5##_type gmock_p5, p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), \
1876
- p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \
1877
- p6(gmock_p6) {\
1878
- }\
1879
- p0##_type p0;\
1880
- p1##_type p1;\
1881
- p2##_type p2;\
1882
- p3##_type p3;\
1883
- p4##_type p4;\
1884
- p5##_type p5;\
1885
- p6##_type p6;\
1886
- private:\
1887
- GTEST_DISALLOW_ASSIGN_(name##MatcherP7);\
1888
- };\
1889
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
1890
- typename p3##_type, typename p4##_type, typename p5##_type, \
1891
- typename p6##_type>\
1892
- inline name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
1893
- p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
1894
- p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
1895
- p6##_type p6) {\
1896
- return name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
1897
- p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
1898
- }\
1899
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
1900
- typename p3##_type, typename p4##_type, typename p5##_type, \
1901
- typename p6##_type>\
1902
- template <typename arg_type>\
1903
- bool name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1904
- p5##_type, p6##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1905
- arg_type arg, \
1906
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1907
- const
1908
-
1909
- #define MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)\
1910
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
1911
- typename p3##_type, typename p4##_type, typename p5##_type, \
1912
- typename p6##_type, typename p7##_type>\
1913
- class name##MatcherP8 {\
1914
- public:\
1915
- template <typename arg_type>\
1916
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1917
- public:\
1918
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1919
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1920
- p6##_type gmock_p6, p7##_type gmock_p7)\
1921
- : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
1922
- p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7) {}\
1923
- virtual bool MatchAndExplain(\
1924
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1925
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
1926
- *gmock_os << FormatDescription(false);\
1927
- }\
1928
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1929
- *gmock_os << FormatDescription(true);\
1930
- }\
1931
- p0##_type p0;\
1932
- p1##_type p1;\
1933
- p2##_type p2;\
1934
- p3##_type p3;\
1935
- p4##_type p4;\
1936
- p5##_type p5;\
1937
- p6##_type p6;\
1938
- p7##_type p7;\
1939
- private:\
1940
- ::testing::internal::string FormatDescription(bool negation) const {\
1941
- const ::testing::internal::string gmock_description = (description);\
1942
- if (!gmock_description.empty())\
1943
- return gmock_description;\
1944
- return ::testing::internal::FormatMatcherDescription(\
1945
- negation, #name, \
1946
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1947
- ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
1948
- p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, \
1949
- p3, p4, p5, p6, p7)));\
1950
- }\
1951
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1952
- };\
1953
- template <typename arg_type>\
1954
- operator ::testing::Matcher<arg_type>() const {\
1955
- return ::testing::Matcher<arg_type>(\
1956
- new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7));\
1957
- }\
1958
- name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \
1959
- p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1960
- p5##_type gmock_p5, p6##_type gmock_p6, \
1961
- p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
1962
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
1963
- p7(gmock_p7) {\
1964
- }\
1965
- p0##_type p0;\
1966
- p1##_type p1;\
1967
- p2##_type p2;\
1968
- p3##_type p3;\
1969
- p4##_type p4;\
1970
- p5##_type p5;\
1971
- p6##_type p6;\
1972
- p7##_type p7;\
1973
- private:\
1974
- GTEST_DISALLOW_ASSIGN_(name##MatcherP8);\
1975
- };\
1976
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
1977
- typename p3##_type, typename p4##_type, typename p5##_type, \
1978
- typename p6##_type, typename p7##_type>\
1979
- inline name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
1980
- p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
1981
- p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
1982
- p6##_type p6, p7##_type p7) {\
1983
- return name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
1984
- p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
1985
- p6, p7);\
1986
- }\
1987
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
1988
- typename p3##_type, typename p4##_type, typename p5##_type, \
1989
- typename p6##_type, typename p7##_type>\
1990
- template <typename arg_type>\
1991
- bool name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1992
- p5##_type, p6##_type, \
1993
- p7##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1994
- arg_type arg, \
1995
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1996
- const
1997
-
1998
- #define MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)\
1999
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
2000
- typename p3##_type, typename p4##_type, typename p5##_type, \
2001
- typename p6##_type, typename p7##_type, typename p8##_type>\
2002
- class name##MatcherP9 {\
2003
- public:\
2004
- template <typename arg_type>\
2005
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
2006
- public:\
2007
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
2008
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
2009
- p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8)\
2010
- : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
2011
- p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
2012
- p8(gmock_p8) {}\
2013
- virtual bool MatchAndExplain(\
2014
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
2015
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
2016
- *gmock_os << FormatDescription(false);\
2017
- }\
2018
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
2019
- *gmock_os << FormatDescription(true);\
2020
- }\
2021
- p0##_type p0;\
2022
- p1##_type p1;\
2023
- p2##_type p2;\
2024
- p3##_type p3;\
2025
- p4##_type p4;\
2026
- p5##_type p5;\
2027
- p6##_type p6;\
2028
- p7##_type p7;\
2029
- p8##_type p8;\
2030
- private:\
2031
- ::testing::internal::string FormatDescription(bool negation) const {\
2032
- const ::testing::internal::string gmock_description = (description);\
2033
- if (!gmock_description.empty())\
2034
- return gmock_description;\
2035
- return ::testing::internal::FormatMatcherDescription(\
2036
- negation, #name, \
2037
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
2038
- ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
2039
- p4##_type, p5##_type, p6##_type, p7##_type, \
2040
- p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\
2041
- }\
2042
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
2043
- };\
2044
- template <typename arg_type>\
2045
- operator ::testing::Matcher<arg_type>() const {\
2046
- return ::testing::Matcher<arg_type>(\
2047
- new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8));\
2048
- }\
2049
- name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \
2050
- p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
2051
- p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
2052
- p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
2053
- p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
2054
- p8(gmock_p8) {\
2055
- }\
2056
- p0##_type p0;\
2057
- p1##_type p1;\
2058
- p2##_type p2;\
2059
- p3##_type p3;\
2060
- p4##_type p4;\
2061
- p5##_type p5;\
2062
- p6##_type p6;\
2063
- p7##_type p7;\
2064
- p8##_type p8;\
2065
- private:\
2066
- GTEST_DISALLOW_ASSIGN_(name##MatcherP9);\
2067
- };\
2068
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
2069
- typename p3##_type, typename p4##_type, typename p5##_type, \
2070
- typename p6##_type, typename p7##_type, typename p8##_type>\
2071
- inline name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
2072
- p4##_type, p5##_type, p6##_type, p7##_type, \
2073
- p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
2074
- p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
2075
- p8##_type p8) {\
2076
- return name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
2077
- p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
2078
- p3, p4, p5, p6, p7, p8);\
2079
- }\
2080
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
2081
- typename p3##_type, typename p4##_type, typename p5##_type, \
2082
- typename p6##_type, typename p7##_type, typename p8##_type>\
2083
- template <typename arg_type>\
2084
- bool name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
2085
- p5##_type, p6##_type, p7##_type, \
2086
- p8##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
2087
- arg_type arg, \
2088
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
2089
- const
2090
-
2091
- #define MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)\
2092
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
2093
- typename p3##_type, typename p4##_type, typename p5##_type, \
2094
- typename p6##_type, typename p7##_type, typename p8##_type, \
2095
- typename p9##_type>\
2096
- class name##MatcherP10 {\
2097
- public:\
2098
- template <typename arg_type>\
2099
- class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
2100
- public:\
2101
- gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
2102
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
2103
- p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
2104
- p9##_type gmock_p9)\
2105
- : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
2106
- p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
2107
- p8(gmock_p8), p9(gmock_p9) {}\
2108
- virtual bool MatchAndExplain(\
2109
- arg_type arg, ::testing::MatchResultListener* result_listener) const;\
2110
- virtual void DescribeTo(::std::ostream* gmock_os) const {\
2111
- *gmock_os << FormatDescription(false);\
2112
- }\
2113
- virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
2114
- *gmock_os << FormatDescription(true);\
2115
- }\
2116
- p0##_type p0;\
2117
- p1##_type p1;\
2118
- p2##_type p2;\
2119
- p3##_type p3;\
2120
- p4##_type p4;\
2121
- p5##_type p5;\
2122
- p6##_type p6;\
2123
- p7##_type p7;\
2124
- p8##_type p8;\
2125
- p9##_type p9;\
2126
- private:\
2127
- ::testing::internal::string FormatDescription(bool negation) const {\
2128
- const ::testing::internal::string gmock_description = (description);\
2129
- if (!gmock_description.empty())\
2130
- return gmock_description;\
2131
- return ::testing::internal::FormatMatcherDescription(\
2132
- negation, #name, \
2133
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
2134
- ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
2135
- p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
2136
- p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\
2137
- }\
2138
- GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
2139
- };\
2140
- template <typename arg_type>\
2141
- operator ::testing::Matcher<arg_type>() const {\
2142
- return ::testing::Matcher<arg_type>(\
2143
- new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9));\
2144
- }\
2145
- name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \
2146
- p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
2147
- p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
2148
- p8##_type gmock_p8, p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), \
2149
- p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
2150
- p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {\
2151
- }\
2152
- p0##_type p0;\
2153
- p1##_type p1;\
2154
- p2##_type p2;\
2155
- p3##_type p3;\
2156
- p4##_type p4;\
2157
- p5##_type p5;\
2158
- p6##_type p6;\
2159
- p7##_type p7;\
2160
- p8##_type p8;\
2161
- p9##_type p9;\
2162
- private:\
2163
- GTEST_DISALLOW_ASSIGN_(name##MatcherP10);\
2164
- };\
2165
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
2166
- typename p3##_type, typename p4##_type, typename p5##_type, \
2167
- typename p6##_type, typename p7##_type, typename p8##_type, \
2168
- typename p9##_type>\
2169
- inline name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
2170
- p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
2171
- p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
2172
- p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
2173
- p9##_type p9) {\
2174
- return name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
2175
- p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
2176
- p1, p2, p3, p4, p5, p6, p7, p8, p9);\
2177
- }\
2178
- template <typename p0##_type, typename p1##_type, typename p2##_type, \
2179
- typename p3##_type, typename p4##_type, typename p5##_type, \
2180
- typename p6##_type, typename p7##_type, typename p8##_type, \
2181
- typename p9##_type>\
2182
- template <typename arg_type>\
2183
- bool name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
2184
- p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
2185
- p9##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
2186
- arg_type arg, \
2187
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
2188
- const
2189
-
2190
- #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_