1 | // Copyright 2005, Google Inc. |
2 | // All rights reserved. |
3 | // |
4 | // Redistribution and use in source and binary forms, with or without |
5 | // modification, are permitted provided that the following conditions are |
6 | // met: |
7 | // |
8 | // * Redistributions of source code must retain the above copyright |
9 | // notice, this list of conditions and the following disclaimer. |
10 | // * Redistributions in binary form must reproduce the above |
11 | // copyright notice, this list of conditions and the following disclaimer |
12 | // in the documentation and/or other materials provided with the |
13 | // distribution. |
14 | // * Neither the name of Google Inc. nor the names of its |
15 | // contributors may be used to endorse or promote products derived from |
16 | // this software without specific prior written permission. |
17 | // |
18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 | // |
30 | // Author: wan@google.com (Zhanyong Wan) |
31 | // |
32 | // The Google C++ Testing Framework (Google Test) |
33 | // |
34 | // This header file defines the public API for Google Test. It should be |
35 | // included by any test program that uses Google Test. |
36 | // |
37 | // IMPORTANT NOTE: Due to limitation of the C++ language, we have to |
38 | // leave some internal implementation details in this header file. |
39 | // They are clearly marked by comments like this: |
40 | // |
41 | // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
42 | // |
43 | // Such code is NOT meant to be used by a user directly, and is subject |
44 | // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user |
45 | // program! |
46 | // |
47 | // Acknowledgment: Google Test borrowed the idea of automatic test |
48 | // registration from Barthelemy Dagenais' (barthelemy@prologique.com) |
49 | // easyUnit framework. |
50 | |
51 | #ifndef GTEST_INCLUDE_GTEST_GTEST_H_ |
52 | #define GTEST_INCLUDE_GTEST_GTEST_H_ |
53 | |
54 | #include <limits> |
55 | #include <ostream> |
56 | #include <vector> |
57 | |
58 | // Copyright 2005, Google Inc. |
59 | // All rights reserved. |
60 | // |
61 | // Redistribution and use in source and binary forms, with or without |
62 | // modification, are permitted provided that the following conditions are |
63 | // met: |
64 | // |
65 | // * Redistributions of source code must retain the above copyright |
66 | // notice, this list of conditions and the following disclaimer. |
67 | // * Redistributions in binary form must reproduce the above |
68 | // copyright notice, this list of conditions and the following disclaimer |
69 | // in the documentation and/or other materials provided with the |
70 | // distribution. |
71 | // * Neither the name of Google Inc. nor the names of its |
72 | // contributors may be used to endorse or promote products derived from |
73 | // this software without specific prior written permission. |
74 | // |
75 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
76 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
77 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
78 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
79 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
80 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
81 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
82 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
83 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
84 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
85 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
86 | // |
87 | // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) |
88 | // |
89 | // The Google C++ Testing Framework (Google Test) |
90 | // |
91 | // This header file declares functions and macros used internally by |
92 | // Google Test. They are subject to change without notice. |
93 | |
94 | #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ |
95 | #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ |
96 | |
97 | // Copyright 2005, Google Inc. |
98 | // All rights reserved. |
99 | // |
100 | // Redistribution and use in source and binary forms, with or without |
101 | // modification, are permitted provided that the following conditions are |
102 | // met: |
103 | // |
104 | // * Redistributions of source code must retain the above copyright |
105 | // notice, this list of conditions and the following disclaimer. |
106 | // * Redistributions in binary form must reproduce the above |
107 | // copyright notice, this list of conditions and the following disclaimer |
108 | // in the documentation and/or other materials provided with the |
109 | // distribution. |
110 | // * Neither the name of Google Inc. nor the names of its |
111 | // contributors may be used to endorse or promote products derived from |
112 | // this software without specific prior written permission. |
113 | // |
114 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
115 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
116 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
117 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
118 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
119 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
120 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
121 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
122 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
123 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
124 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
125 | // |
126 | // Authors: wan@google.com (Zhanyong Wan) |
127 | // |
128 | // Low-level types and utilities for porting Google Test to various |
129 | // platforms. They are subject to change without notice. DO NOT USE |
130 | // THEM IN USER CODE. |
131 | // |
132 | // This file is fundamental to Google Test. All other Google Test source |
133 | // files are expected to #include this. Therefore, it cannot #include |
134 | // any other Google Test header. |
135 | |
136 | #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ |
137 | #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ |
138 | |
139 | // The user can define the following macros in the build script to |
140 | // control Google Test's behavior. If the user doesn't define a macro |
141 | // in this list, Google Test will define it. |
142 | // |
143 | // GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2) |
144 | // is/isn't available. |
145 | // GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions |
146 | // are enabled. |
147 | // GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string |
148 | // is/isn't available (some systems define |
149 | // ::string, which is different to std::string). |
150 | // GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string |
151 | // is/isn't available (some systems define |
152 | // ::wstring, which is different to std::wstring). |
153 | // GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular |
154 | // expressions are/aren't available. |
155 | // GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h> |
156 | // is/isn't available. |
157 | // GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't |
158 | // enabled. |
159 | // GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that |
160 | // std::wstring does/doesn't work (Google Test can |
161 | // be used where std::wstring is unavailable). |
162 | // GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple |
163 | // is/isn't available. |
164 | // GTEST_HAS_SEH - Define it to 1/0 to indicate whether the |
165 | // compiler supports Microsoft's "Structured |
166 | // Exception Handling". |
167 | // GTEST_HAS_STREAM_REDIRECTION |
168 | // - Define it to 1/0 to indicate whether the |
169 | // platform supports I/O stream redirection using |
170 | // dup() and dup2(). |
171 | // GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google |
172 | // Test's own tr1 tuple implementation should be |
173 | // used. Unused when the user sets |
174 | // GTEST_HAS_TR1_TUPLE to 0. |
175 | // GTEST_LANG_CXX11 - Define it to 1/0 to indicate that Google Test |
176 | // is building in C++11/C++98 mode. |
177 | // GTEST_LINKED_AS_SHARED_LIBRARY |
178 | // - Define to 1 when compiling tests that use |
179 | // Google Test as a shared library (known as |
180 | // DLL on Windows). |
181 | // GTEST_CREATE_SHARED_LIBRARY |
182 | // - Define to 1 when compiling Google Test itself |
183 | // as a shared library. |
184 | |
185 | // This header defines the following utilities: |
186 | // |
187 | // Macros indicating the current platform (defined to 1 if compiled on |
188 | // the given platform; otherwise undefined): |
189 | // GTEST_OS_AIX - IBM AIX |
190 | // GTEST_OS_CYGWIN - Cygwin |
191 | // GTEST_OS_HPUX - HP-UX |
192 | // GTEST_OS_LINUX - Linux |
193 | // GTEST_OS_LINUX_ANDROID - Google Android |
194 | // GTEST_OS_MAC - Mac OS X |
195 | // GTEST_OS_IOS - iOS |
196 | // GTEST_OS_IOS_SIMULATOR - iOS simulator |
197 | // GTEST_OS_NACL - Google Native Client (NaCl) |
198 | // GTEST_OS_OPENBSD - OpenBSD |
199 | // GTEST_OS_QNX - QNX |
200 | // GTEST_OS_SOLARIS - Sun Solaris |
201 | // GTEST_OS_SYMBIAN - Symbian |
202 | // GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile) |
203 | // GTEST_OS_WINDOWS_DESKTOP - Windows Desktop |
204 | // GTEST_OS_WINDOWS_MINGW - MinGW |
205 | // GTEST_OS_WINDOWS_MOBILE - Windows Mobile |
206 | // GTEST_OS_ZOS - z/OS |
207 | // |
208 | // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the |
209 | // most stable support. Since core members of the Google Test project |
210 | // don't have access to other platforms, support for them may be less |
211 | // stable. If you notice any problems on your platform, please notify |
212 | // googletestframework@googlegroups.com (patches for fixing them are |
213 | // even more welcome!). |
214 | // |
215 | // Note that it is possible that none of the GTEST_OS_* macros are defined. |
216 | // |
217 | // Macros indicating available Google Test features (defined to 1 if |
218 | // the corresponding feature is supported; otherwise undefined): |
219 | // GTEST_HAS_COMBINE - the Combine() function (for value-parameterized |
220 | // tests) |
221 | // GTEST_HAS_DEATH_TEST - death tests |
222 | // GTEST_HAS_PARAM_TEST - value-parameterized tests |
223 | // GTEST_HAS_TYPED_TEST - typed tests |
224 | // GTEST_HAS_TYPED_TEST_P - type-parameterized tests |
225 | // GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with |
226 | // GTEST_HAS_POSIX_RE (see above) which users can |
227 | // define themselves. |
228 | // GTEST_USES_SIMPLE_RE - our own simple regex is used; |
229 | // the above two are mutually exclusive. |
230 | // GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ(). |
231 | // |
232 | // Macros for basic C++ coding: |
233 | // GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning. |
234 | // GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a |
235 | // variable don't have to be used. |
236 | // GTEST_DISALLOW_ASSIGN_ - disables operator=. |
237 | // GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=. |
238 | // GTEST_MUST_USE_RESULT_ - declares that a function's result must be used. |
239 | // |
240 | // Synchronization: |
241 | // Mutex, MutexLock, ThreadLocal, GetThreadCount() |
242 | // - synchronization primitives. |
243 | // GTEST_IS_THREADSAFE - defined to 1 to indicate that the above |
244 | // synchronization primitives have real implementations |
245 | // and Google Test is thread-safe; or 0 otherwise. |
246 | // |
247 | // Template meta programming: |
248 | // is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only. |
249 | // IteratorTraits - partial implementation of std::iterator_traits, which |
250 | // is not available in libCstd when compiled with Sun C++. |
251 | // |
252 | // Smart pointers: |
253 | // scoped_ptr - as in TR2. |
254 | // |
255 | // Regular expressions: |
256 | // RE - a simple regular expression class using the POSIX |
257 | // Extended Regular Expression syntax on UNIX-like |
258 | // platforms, or a reduced regular exception syntax on |
259 | // other platforms, including Windows. |
260 | // |
261 | // Logging: |
262 | // GTEST_LOG_() - logs messages at the specified severity level. |
263 | // LogToStderr() - directs all log messages to stderr. |
264 | // FlushInfoLog() - flushes informational log messages. |
265 | // |
266 | // Stdout and stderr capturing: |
267 | // CaptureStdout() - starts capturing stdout. |
268 | // GetCapturedStdout() - stops capturing stdout and returns the captured |
269 | // string. |
270 | // CaptureStderr() - starts capturing stderr. |
271 | // GetCapturedStderr() - stops capturing stderr and returns the captured |
272 | // string. |
273 | // |
274 | // Integer types: |
275 | // TypeWithSize - maps an integer to a int type. |
276 | // Int32, UInt32, Int64, UInt64, TimeInMillis |
277 | // - integers of known sizes. |
278 | // BiggestInt - the biggest signed integer type. |
279 | // |
280 | // Command-line utilities: |
281 | // GTEST_FLAG() - references a flag. |
282 | // GTEST_DECLARE_*() - declares a flag. |
283 | // GTEST_DEFINE_*() - defines a flag. |
284 | // GetInjectableArgvs() - returns the command line as a vector of strings. |
285 | // |
286 | // Environment variable utilities: |
287 | // GetEnv() - gets the value of an environment variable. |
288 | // BoolFromGTestEnv() - parses a bool environment variable. |
289 | // Int32FromGTestEnv() - parses an Int32 environment variable. |
290 | // StringFromGTestEnv() - parses a string environment variable. |
291 | |
292 | #include <ctype.h> // for isspace, etc |
293 | #include <stddef.h> // for ptrdiff_t |
294 | #include <stdlib.h> |
295 | #include <stdio.h> |
296 | #include <string.h> |
297 | #ifndef _WIN32_WCE |
298 | # include <sys/types.h> |
299 | # include <sys/stat.h> |
300 | #endif // !_WIN32_WCE |
301 | |
302 | #if defined __APPLE__ |
303 | # include <AvailabilityMacros.h> |
304 | # include <TargetConditionals.h> |
305 | #endif |
306 | |
307 | #include <iostream> // NOLINT |
308 | #include <sstream> // NOLINT |
309 | #include <string> // NOLINT |
310 | |
311 | #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com" |
312 | #define GTEST_FLAG_PREFIX_ "gtest_" |
313 | #define GTEST_FLAG_PREFIX_DASH_ "gtest-" |
314 | #define GTEST_FLAG_PREFIX_UPPER_ "GTEST_" |
315 | #define GTEST_NAME_ "Google Test" |
316 | #define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/" |
317 | |
318 | // Determines the version of gcc that is used to compile this. |
319 | #ifdef __GNUC__ |
320 | // 40302 means version 4.3.2. |
321 | # define GTEST_GCC_VER_ \ |
322 | (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__) |
323 | #endif // __GNUC__ |
324 | |
325 | // Determines the platform on which Google Test is compiled. |
326 | #ifdef __CYGWIN__ |
327 | # define GTEST_OS_CYGWIN 1 |
328 | #elif defined __SYMBIAN32__ |
329 | # define GTEST_OS_SYMBIAN 1 |
330 | #elif defined _WIN32 |
331 | # define GTEST_OS_WINDOWS 1 |
332 | # ifdef _WIN32_WCE |
333 | # define GTEST_OS_WINDOWS_MOBILE 1 |
334 | # elif defined(__MINGW__) || defined(__MINGW32__) |
335 | # define GTEST_OS_WINDOWS_MINGW 1 |
336 | # else |
337 | # define GTEST_OS_WINDOWS_DESKTOP 1 |
338 | # endif // _WIN32_WCE |
339 | #elif defined __APPLE__ |
340 | # define GTEST_OS_MAC 1 |
341 | # if TARGET_OS_IPHONE |
342 | # define GTEST_OS_IOS 1 |
343 | # if TARGET_IPHONE_SIMULATOR |
344 | # define GTEST_OS_IOS_SIMULATOR 1 |
345 | # endif |
346 | # endif |
347 | #elif defined __linux__ |
348 | # define GTEST_OS_LINUX 1 |
349 | # if defined __ANDROID__ |
350 | # define GTEST_OS_LINUX_ANDROID 1 |
351 | # endif |
352 | #elif defined __MVS__ |
353 | # define GTEST_OS_ZOS 1 |
354 | #elif defined(__sun) && defined(__SVR4) |
355 | # define GTEST_OS_SOLARIS 1 |
356 | #elif defined(_AIX) |
357 | # define GTEST_OS_AIX 1 |
358 | #elif defined(__hpux) |
359 | # define GTEST_OS_HPUX 1 |
360 | #elif defined __native_client__ |
361 | # define GTEST_OS_NACL 1 |
362 | #elif defined __OpenBSD__ |
363 | # define GTEST_OS_OPENBSD 1 |
364 | #elif defined __QNX__ |
365 | # define GTEST_OS_QNX 1 |
366 | #endif // __CYGWIN__ |
367 | |
368 | #ifndef GTEST_LANG_CXX11 |
369 | // gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when |
370 | // -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a |
371 | // value for __cplusplus, and recent versions of clang, gcc, and |
372 | // probably other compilers set that too in C++11 mode. |
373 | # if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L |
374 | // Compiling in at least C++11 mode. |
375 | # define GTEST_LANG_CXX11 1 |
376 | # else |
377 | # define GTEST_LANG_CXX11 0 |
378 | # endif |
379 | #endif |
380 | |
381 | // Brings in definitions for functions used in the testing::internal::posix |
382 | // namespace (read, write, close, chdir, isatty, stat). We do not currently |
383 | // use them on Windows Mobile. |
384 | #if !GTEST_OS_WINDOWS |
385 | // This assumes that non-Windows OSes provide unistd.h. For OSes where this |
386 | // is not the case, we need to include headers that provide the functions |
387 | // mentioned above. |
388 | # include <unistd.h> |
389 | # include <strings.h> |
390 | #elif !GTEST_OS_WINDOWS_MOBILE |
391 | # include <direct.h> |
392 | # include <io.h> |
393 | #endif |
394 | |
395 | #if GTEST_OS_LINUX_ANDROID |
396 | // Used to define __ANDROID_API__ matching the target NDK API level. |
397 | # include <android/api-level.h> // NOLINT |
398 | #endif |
399 | |
400 | // Defines this to true iff Google Test can use POSIX regular expressions. |
401 | #ifndef GTEST_HAS_POSIX_RE |
402 | # if GTEST_OS_LINUX_ANDROID |
403 | // On Android, <regex.h> is only available starting with Gingerbread. |
404 | # define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9) |
405 | # else |
406 | # define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS) |
407 | # endif |
408 | #endif |
409 | |
410 | #if GTEST_HAS_POSIX_RE |
411 | |
412 | // On some platforms, <regex.h> needs someone to define size_t, and |
413 | // won't compile otherwise. We can #include it here as we already |
414 | // included <stdlib.h>, which is guaranteed to define size_t through |
415 | // <stddef.h>. |
416 | # include <regex.h> // NOLINT |
417 | |
418 | # define GTEST_USES_POSIX_RE 1 |
419 | |
420 | #elif GTEST_OS_WINDOWS |
421 | |
422 | // <regex.h> is not available on Windows. Use our own simple regex |
423 | // implementation instead. |
424 | # define GTEST_USES_SIMPLE_RE 1 |
425 | |
426 | #else |
427 | |
428 | // <regex.h> may not be available on this platform. Use our own |
429 | // simple regex implementation instead. |
430 | # define GTEST_USES_SIMPLE_RE 1 |
431 | |
432 | #endif // GTEST_HAS_POSIX_RE |
433 | |
434 | #ifndef GTEST_HAS_EXCEPTIONS |
435 | // The user didn't tell us whether exceptions are enabled, so we need |
436 | // to figure it out. |
437 | # if defined(_MSC_VER) || defined(__BORLANDC__) |
438 | // MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS |
439 | // macro to enable exceptions, so we'll do the same. |
440 | // Assumes that exceptions are enabled by default. |
441 | # ifndef _HAS_EXCEPTIONS |
442 | # define _HAS_EXCEPTIONS 1 |
443 | # endif // _HAS_EXCEPTIONS |
444 | # define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS |
445 | # elif defined(__GNUC__) && __EXCEPTIONS |
446 | // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled. |
447 | # define GTEST_HAS_EXCEPTIONS 1 |
448 | # elif defined(__SUNPRO_CC) |
449 | // Sun Pro CC supports exceptions. However, there is no compile-time way of |
450 | // detecting whether they are enabled or not. Therefore, we assume that |
451 | // they are enabled unless the user tells us otherwise. |
452 | # define GTEST_HAS_EXCEPTIONS 1 |
453 | # elif defined(__IBMCPP__) && __EXCEPTIONS |
454 | // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled. |
455 | # define GTEST_HAS_EXCEPTIONS 1 |
456 | # elif defined(__HP_aCC) |
457 | // Exception handling is in effect by default in HP aCC compiler. It has to |
458 | // be turned of by +noeh compiler option if desired. |
459 | # define GTEST_HAS_EXCEPTIONS 1 |
460 | # else |
461 | // For other compilers, we assume exceptions are disabled to be |
462 | // conservative. |
463 | # define GTEST_HAS_EXCEPTIONS 0 |
464 | # endif // defined(_MSC_VER) || defined(__BORLANDC__) |
465 | #endif // GTEST_HAS_EXCEPTIONS |
466 | |
467 | #if !defined(GTEST_HAS_STD_STRING) |
468 | // Even though we don't use this macro any longer, we keep it in case |
469 | // some clients still depend on it. |
470 | # define GTEST_HAS_STD_STRING 1 |
471 | #elif !GTEST_HAS_STD_STRING |
472 | // The user told us that ::std::string isn't available. |
473 | # error "Google Test cannot be used where ::std::string isn't available." |
474 | #endif // !defined(GTEST_HAS_STD_STRING) |
475 | |
476 | #ifndef GTEST_HAS_GLOBAL_STRING |
477 | // The user didn't tell us whether ::string is available, so we need |
478 | // to figure it out. |
479 | |
480 | # define GTEST_HAS_GLOBAL_STRING 0 |
481 | |
482 | #endif // GTEST_HAS_GLOBAL_STRING |
483 | |
484 | #ifndef GTEST_HAS_STD_WSTRING |
485 | // The user didn't tell us whether ::std::wstring is available, so we need |
486 | // to figure it out. |
487 | // TODO(wan@google.com): uses autoconf to detect whether ::std::wstring |
488 | // is available. |
489 | |
490 | // Cygwin 1.7 and below doesn't support ::std::wstring. |
491 | // Solaris' libc++ doesn't support it either. Android has |
492 | // no support for it at least as recent as Froyo (2.2). |
493 | # define GTEST_HAS_STD_WSTRING \ |
494 | (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS)) |
495 | |
496 | #endif // GTEST_HAS_STD_WSTRING |
497 | |
498 | #ifndef GTEST_HAS_GLOBAL_WSTRING |
499 | // The user didn't tell us whether ::wstring is available, so we need |
500 | // to figure it out. |
501 | # define GTEST_HAS_GLOBAL_WSTRING \ |
502 | (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING) |
503 | #endif // GTEST_HAS_GLOBAL_WSTRING |
504 | |
505 | // Determines whether RTTI is available. |
506 | #ifndef GTEST_HAS_RTTI |
507 | // The user didn't tell us whether RTTI is enabled, so we need to |
508 | // figure it out. |
509 | |
510 | # ifdef _MSC_VER |
511 | |
512 | # ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled. |
513 | # define GTEST_HAS_RTTI 1 |
514 | # else |
515 | # define GTEST_HAS_RTTI 0 |
516 | # endif |
517 | |
518 | // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled. |
519 | # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302) |
520 | |
521 | # ifdef __GXX_RTTI |
522 | // When building against STLport with the Android NDK and with |
523 | // -frtti -fno-exceptions, the build fails at link time with undefined |
524 | // references to __cxa_bad_typeid. Note sure if STL or toolchain bug, |
525 | // so disable RTTI when detected. |
526 | # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \ |
527 | !defined(__EXCEPTIONS) |
528 | # define GTEST_HAS_RTTI 0 |
529 | # else |
530 | # define GTEST_HAS_RTTI 1 |
531 | # endif // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS |
532 | # else |
533 | # define GTEST_HAS_RTTI 0 |
534 | # endif // __GXX_RTTI |
535 | |
536 | // Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends |
537 | // using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the |
538 | // first version with C++ support. |
539 | # elif defined(__clang__) |
540 | |
541 | # define GTEST_HAS_RTTI __has_feature(cxx_rtti) |
542 | |
543 | // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if |
544 | // both the typeid and dynamic_cast features are present. |
545 | # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900) |
546 | |
547 | # ifdef __RTTI_ALL__ |
548 | # define GTEST_HAS_RTTI 1 |
549 | # else |
550 | # define GTEST_HAS_RTTI 0 |
551 | # endif |
552 | |
553 | # else |
554 | |
555 | // For all other compilers, we assume RTTI is enabled. |
556 | # define GTEST_HAS_RTTI 1 |
557 | |
558 | # endif // _MSC_VER |
559 | |
560 | #endif // GTEST_HAS_RTTI |
561 | |
562 | // It's this header's responsibility to #include <typeinfo> when RTTI |
563 | // is enabled. |
564 | #if GTEST_HAS_RTTI |
565 | # include <typeinfo> |
566 | #endif |
567 | |
568 | // Determines whether Google Test can use the pthreads library. |
569 | #ifndef GTEST_HAS_PTHREAD |
570 | // The user didn't tell us explicitly, so we assume pthreads support is |
571 | // available on Linux and Mac. |
572 | // |
573 | // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0 |
574 | // to your compiler flags. |
575 | # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \ |
576 | || GTEST_OS_QNX) |
577 | #endif // GTEST_HAS_PTHREAD |
578 | |
579 | #if GTEST_HAS_PTHREAD |
580 | // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is |
581 | // true. |
582 | # include <pthread.h> // NOLINT |
583 | |
584 | // For timespec and nanosleep, used below. |
585 | # include <time.h> // NOLINT |
586 | #endif |
587 | |
588 | // Determines whether Google Test can use tr1/tuple. You can define |
589 | // this macro to 0 to prevent Google Test from using tuple (any |
590 | // feature depending on tuple with be disabled in this mode). |
591 | #ifndef GTEST_HAS_TR1_TUPLE |
592 | # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) |
593 | // STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>. |
594 | # define GTEST_HAS_TR1_TUPLE 0 |
595 | # else |
596 | // The user didn't tell us not to do it, so we assume it's OK. |
597 | # define GTEST_HAS_TR1_TUPLE 1 |
598 | # endif |
599 | #endif // GTEST_HAS_TR1_TUPLE |
600 | |
601 | // Determines whether Google Test's own tr1 tuple implementation |
602 | // should be used. |
603 | #ifndef GTEST_USE_OWN_TR1_TUPLE |
604 | // The user didn't tell us, so we need to figure it out. |
605 | |
606 | // We use our own TR1 tuple if we aren't sure the user has an |
607 | // implementation of it already. At this time, libstdc++ 4.0.0+ and |
608 | // MSVC 2010 are the only mainstream standard libraries that come |
609 | // with a TR1 tuple implementation. NVIDIA's CUDA NVCC compiler |
610 | // pretends to be GCC by defining __GNUC__ and friends, but cannot |
611 | // compile GCC's tuple implementation. MSVC 2008 (9.0) provides TR1 |
612 | // tuple in a 323 MB Feature Pack download, which we cannot assume the |
613 | // user has. QNX's QCC compiler is a modified GCC but it doesn't |
614 | // support TR1 tuple. libc++ only provides std::tuple, in C++11 mode, |
615 | // and it can be used with some compilers that define __GNUC__. |
616 | # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \ |
617 | && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600 |
618 | # define GTEST_ENV_HAS_TR1_TUPLE_ 1 |
619 | # endif |
620 | |
621 | // C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used |
622 | // in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6 |
623 | // can build with clang but need to use gcc4.2's libstdc++). |
624 | # if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325) |
625 | # define GTEST_ENV_HAS_STD_TUPLE_ 1 |
626 | # endif |
627 | |
628 | # if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_ |
629 | # define GTEST_USE_OWN_TR1_TUPLE 0 |
630 | # else |
631 | # define GTEST_USE_OWN_TR1_TUPLE 1 |
632 | # endif |
633 | |
634 | #endif // GTEST_USE_OWN_TR1_TUPLE |
635 | |
636 | // To avoid conditional compilation everywhere, we make it |
637 | // gtest-port.h's responsibility to #include the header implementing |
638 | // tr1/tuple. |
639 | #if GTEST_HAS_TR1_TUPLE |
640 | |
641 | # if GTEST_USE_OWN_TR1_TUPLE |
642 | // This file was GENERATED by command: |
643 | // pump.py gtest-tuple.h.pump |
644 | // DO NOT EDIT BY HAND!!! |
645 | |
646 | // Copyright 2009 Google Inc. |
647 | // All Rights Reserved. |
648 | // |
649 | // Redistribution and use in source and binary forms, with or without |
650 | // modification, are permitted provided that the following conditions are |
651 | // met: |
652 | // |
653 | // * Redistributions of source code must retain the above copyright |
654 | // notice, this list of conditions and the following disclaimer. |
655 | // * Redistributions in binary form must reproduce the above |
656 | // copyright notice, this list of conditions and the following disclaimer |
657 | // in the documentation and/or other materials provided with the |
658 | // distribution. |
659 | // * Neither the name of Google Inc. nor the names of its |
660 | // contributors may be used to endorse or promote products derived from |
661 | // this software without specific prior written permission. |
662 | // |
663 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
664 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
665 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
666 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
667 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
668 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
669 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
670 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
671 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
672 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
673 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
674 | // |
675 | // Author: wan@google.com (Zhanyong Wan) |
676 | |
677 | // Implements a subset of TR1 tuple needed by Google Test and Google Mock. |
678 | |
679 | #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ |
680 | #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ |
681 | |
682 | #include <utility> // For ::std::pair. |
683 | |
684 | // The compiler used in Symbian has a bug that prevents us from declaring the |
685 | // tuple template as a friend (it complains that tuple is redefined). This |
686 | // hack bypasses the bug by declaring the members that should otherwise be |
687 | // private as public. |
688 | // Sun Studio versions < 12 also have the above bug. |
689 | #if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590) |
690 | # define GTEST_DECLARE_TUPLE_AS_FRIEND_ public: |
691 | #else |
692 | # define GTEST_DECLARE_TUPLE_AS_FRIEND_ \ |
693 | template <GTEST_10_TYPENAMES_(U)> friend class tuple; \ |
694 | private: |
695 | #endif |
696 | |
697 | // GTEST_n_TUPLE_(T) is the type of an n-tuple. |
698 | #define GTEST_0_TUPLE_(T) tuple<> |
699 | #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \ |
700 | void, void, void> |
701 | #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \ |
702 | void, void, void> |
703 | #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \ |
704 | void, void, void> |
705 | #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \ |
706 | void, void, void> |
707 | #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \ |
708 | void, void, void> |
709 | #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \ |
710 | void, void, void> |
711 | #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \ |
712 | void, void, void> |
713 | #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \ |
714 | T##7, void, void> |
715 | #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \ |
716 | T##7, T##8, void> |
717 | #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \ |
718 | T##7, T##8, T##9> |
719 | |
720 | // GTEST_n_TYPENAMES_(T) declares a list of n typenames. |
721 | #define GTEST_0_TYPENAMES_(T) |
722 | #define GTEST_1_TYPENAMES_(T) typename T##0 |
723 | #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1 |
724 | #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2 |
725 | #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ |
726 | typename T##3 |
727 | #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ |
728 | typename T##3, typename T##4 |
729 | #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ |
730 | typename T##3, typename T##4, typename T##5 |
731 | #define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ |
732 | typename T##3, typename T##4, typename T##5, typename T##6 |
733 | #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ |
734 | typename T##3, typename T##4, typename T##5, typename T##6, typename T##7 |
735 | #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ |
736 | typename T##3, typename T##4, typename T##5, typename T##6, \ |
737 | typename T##7, typename T##8 |
738 | #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ |
739 | typename T##3, typename T##4, typename T##5, typename T##6, \ |
740 | typename T##7, typename T##8, typename T##9 |
741 | |
742 | // In theory, defining stuff in the ::std namespace is undefined |
743 | // behavior. We can do this as we are playing the role of a standard |
744 | // library vendor. |
745 | namespace std { |
746 | namespace tr1 { |
747 | |
748 | template <typename T0 = void, typename T1 = void, typename T2 = void, |
749 | typename T3 = void, typename T4 = void, typename T5 = void, |
750 | typename T6 = void, typename T7 = void, typename T8 = void, |
751 | typename T9 = void> |
752 | class tuple; |
753 | |
754 | // Anything in namespace gtest_internal is Google Test's INTERNAL |
755 | // IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code. |
756 | namespace gtest_internal { |
757 | |
758 | // ByRef<T>::type is T if T is a reference; otherwise it's const T&. |
759 | template <typename T> |
760 | struct ByRef { typedef const T& type; }; // NOLINT |
761 | template <typename T> |
762 | struct ByRef<T&> { typedef T& type; }; // NOLINT |
763 | |
764 | // A handy wrapper for ByRef. |
765 | #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type |
766 | |
767 | // AddRef<T>::type is T if T is a reference; otherwise it's T&. This |
768 | // is the same as tr1::add_reference<T>::type. |
769 | template <typename T> |
770 | struct AddRef { typedef T& type; }; // NOLINT |
771 | template <typename T> |
772 | struct AddRef<T&> { typedef T& type; }; // NOLINT |
773 | |
774 | // A handy wrapper for AddRef. |
775 | #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type |
776 | |
777 | // A helper for implementing get<k>(). |
778 | template <int k> class Get; |
779 | |
780 | // A helper for implementing tuple_element<k, T>. kIndexValid is true |
781 | // iff k < the number of fields in tuple type T. |
782 | template <bool kIndexValid, int kIndex, class Tuple> |
783 | struct TupleElement; |
784 | |
785 | template <GTEST_10_TYPENAMES_(T)> |
786 | struct TupleElement<true, 0, GTEST_10_TUPLE_(T) > { |
787 | typedef T0 type; |
788 | }; |
789 | |
790 | template <GTEST_10_TYPENAMES_(T)> |
791 | struct TupleElement<true, 1, GTEST_10_TUPLE_(T) > { |
792 | typedef T1 type; |
793 | }; |
794 | |
795 | template <GTEST_10_TYPENAMES_(T)> |
796 | struct TupleElement<true, 2, GTEST_10_TUPLE_(T) > { |
797 | typedef T2 type; |
798 | }; |
799 | |
800 | template <GTEST_10_TYPENAMES_(T)> |
801 | struct TupleElement<true, 3, GTEST_10_TUPLE_(T) > { |
802 | typedef T3 type; |
803 | }; |
804 | |
805 | template <GTEST_10_TYPENAMES_(T)> |
806 | struct TupleElement<true, 4, GTEST_10_TUPLE_(T) > { |
807 | typedef T4 type; |
808 | }; |
809 | |
810 | template <GTEST_10_TYPENAMES_(T)> |
811 | struct TupleElement<true, 5, GTEST_10_TUPLE_(T) > { |
812 | typedef T5 type; |
813 | }; |
814 | |
815 | template <GTEST_10_TYPENAMES_(T)> |
816 | struct TupleElement<true, 6, GTEST_10_TUPLE_(T) > { |
817 | typedef T6 type; |
818 | }; |
819 | |
820 | template <GTEST_10_TYPENAMES_(T)> |
821 | struct TupleElement<true, 7, GTEST_10_TUPLE_(T) > { |
822 | typedef T7 type; |
823 | }; |
824 | |
825 | template <GTEST_10_TYPENAMES_(T)> |
826 | struct TupleElement<true, 8, GTEST_10_TUPLE_(T) > { |
827 | typedef T8 type; |
828 | }; |
829 | |
830 | template <GTEST_10_TYPENAMES_(T)> |
831 | struct TupleElement<true, 9, GTEST_10_TUPLE_(T) > { |
832 | typedef T9 type; |
833 | }; |
834 | |
835 | } // namespace gtest_internal |
836 | |
837 | template <> |
838 | class tuple<> { |
839 | public: |
840 | tuple() {} |
841 | tuple(const tuple& /* t */) {} |
842 | tuple& operator=(const tuple& /* t */) { return *this; } |
843 | }; |
844 | |
845 | template <GTEST_1_TYPENAMES_(T)> |
846 | class GTEST_1_TUPLE_(T) { |
847 | public: |
848 | template <int k> friend class gtest_internal::Get; |
849 | |
850 | tuple() : f0_() {} |
851 | |
852 | explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {} |
853 | |
854 | tuple(const tuple& t) : f0_(t.f0_) {} |
855 | |
856 | template <GTEST_1_TYPENAMES_(U)> |
857 | tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {} |
858 | |
859 | tuple& operator=(const tuple& t) { return CopyFrom(t); } |
860 | |
861 | template <GTEST_1_TYPENAMES_(U)> |
862 | tuple& operator=(const GTEST_1_TUPLE_(U)& t) { |
863 | return CopyFrom(t); |
864 | } |
865 | |
866 | GTEST_DECLARE_TUPLE_AS_FRIEND_ |
867 | |
868 | template <GTEST_1_TYPENAMES_(U)> |
869 | tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) { |
870 | f0_ = t.f0_; |
871 | return *this; |
872 | } |
873 | |
874 | T0 f0_; |
875 | }; |
876 | |
877 | template <GTEST_2_TYPENAMES_(T)> |
878 | class GTEST_2_TUPLE_(T) { |
879 | public: |
880 | template <int k> friend class gtest_internal::Get; |
881 | |
882 | tuple() : f0_(), f1_() {} |
883 | |
884 | explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0), |
885 | f1_(f1) {} |
886 | |
887 | tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {} |
888 | |
889 | template <GTEST_2_TYPENAMES_(U)> |
890 | tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {} |
891 | template <typename U0, typename U1> |
892 | tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {} |
893 | |
894 | tuple& operator=(const tuple& t) { return CopyFrom(t); } |
895 | |
896 | template <GTEST_2_TYPENAMES_(U)> |
897 | tuple& operator=(const GTEST_2_TUPLE_(U)& t) { |
898 | return CopyFrom(t); |
899 | } |
900 | template <typename U0, typename U1> |
901 | tuple& operator=(const ::std::pair<U0, U1>& p) { |
902 | f0_ = p.first; |
903 | f1_ = p.second; |
904 | return *this; |
905 | } |
906 | |
907 | GTEST_DECLARE_TUPLE_AS_FRIEND_ |
908 | |
909 | template <GTEST_2_TYPENAMES_(U)> |
910 | tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) { |
911 | f0_ = t.f0_; |
912 | f1_ = t.f1_; |
913 | return *this; |
914 | } |
915 | |
916 | T0 f0_; |
917 | T1 f1_; |
918 | }; |
919 | |
920 | template <GTEST_3_TYPENAMES_(T)> |
921 | class GTEST_3_TUPLE_(T) { |
922 | public: |
923 | template <int k> friend class gtest_internal::Get; |
924 | |
925 | tuple() : f0_(), f1_(), f2_() {} |
926 | |
927 | explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, |
928 | GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {} |
929 | |
930 | tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {} |
931 | |
932 | template <GTEST_3_TYPENAMES_(U)> |
933 | tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {} |
934 | |
935 | tuple& operator=(const tuple& t) { return CopyFrom(t); } |
936 | |
937 | template <GTEST_3_TYPENAMES_(U)> |
938 | tuple& operator=(const GTEST_3_TUPLE_(U)& t) { |
939 | return CopyFrom(t); |
940 | } |
941 | |
942 | GTEST_DECLARE_TUPLE_AS_FRIEND_ |
943 | |
944 | template <GTEST_3_TYPENAMES_(U)> |
945 | tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) { |
946 | f0_ = t.f0_; |
947 | f1_ = t.f1_; |
948 | f2_ = t.f2_; |
949 | return *this; |
950 | } |
951 | |
952 | T0 f0_; |
953 | T1 f1_; |
954 | T2 f2_; |
955 | }; |
956 | |
957 | template <GTEST_4_TYPENAMES_(T)> |
958 | class GTEST_4_TUPLE_(T) { |
959 | public: |
960 | template <int k> friend class gtest_internal::Get; |
961 | |
962 | tuple() : f0_(), f1_(), f2_(), f3_() {} |
963 | |
964 | explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, |
965 | GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2), |
966 | f3_(f3) {} |
967 | |
968 | tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {} |
969 | |
970 | template <GTEST_4_TYPENAMES_(U)> |
971 | tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), |
972 | f3_(t.f3_) {} |
973 | |
974 | tuple& operator=(const tuple& t) { return CopyFrom(t); } |
975 | |
976 | template <GTEST_4_TYPENAMES_(U)> |
977 | tuple& operator=(const GTEST_4_TUPLE_(U)& t) { |
978 | return CopyFrom(t); |
979 | } |
980 | |
981 | GTEST_DECLARE_TUPLE_AS_FRIEND_ |
982 | |
983 | template <GTEST_4_TYPENAMES_(U)> |
984 | tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) { |
985 | f0_ = t.f0_; |
986 | f1_ = t.f1_; |
987 | f2_ = t.f2_; |
988 | f3_ = t.f3_; |
989 | return *this; |
990 | } |
991 | |
992 | T0 f0_; |
993 | T1 f1_; |
994 | T2 f2_; |
995 | T3 f3_; |
996 | }; |
997 | |
998 | template <GTEST_5_TYPENAMES_(T)> |
999 | class GTEST_5_TUPLE_(T) { |
1000 | public: |
1001 | template <int k> friend class gtest_internal::Get; |
1002 | |
1003 | tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {} |
1004 | |
1005 | explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, |
1006 | GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, |
1007 | GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {} |
1008 | |
1009 | tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), |
1010 | f4_(t.f4_) {} |
1011 | |
1012 | template <GTEST_5_TYPENAMES_(U)> |
1013 | tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), |
1014 | f3_(t.f3_), f4_(t.f4_) {} |
1015 | |
1016 | tuple& operator=(const tuple& t) { return CopyFrom(t); } |
1017 | |
1018 | template <GTEST_5_TYPENAMES_(U)> |
1019 | tuple& operator=(const GTEST_5_TUPLE_(U)& t) { |
1020 | return CopyFrom(t); |
1021 | } |
1022 | |
1023 | GTEST_DECLARE_TUPLE_AS_FRIEND_ |
1024 | |
1025 | template <GTEST_5_TYPENAMES_(U)> |
1026 | tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) { |
1027 | f0_ = t.f0_; |
1028 | f1_ = t.f1_; |
1029 | f2_ = t.f2_; |
1030 | f3_ = t.f3_; |
1031 | f4_ = t.f4_; |
1032 | return *this; |
1033 | } |
1034 | |
1035 | T0 f0_; |
1036 | T1 f1_; |
1037 | T2 f2_; |
1038 | T3 f3_; |
1039 | T4 f4_; |
1040 | }; |
1041 | |
1042 | template <GTEST_6_TYPENAMES_(T)> |
1043 | class GTEST_6_TUPLE_(T) { |
1044 | public: |
1045 | template <int k> friend class gtest_internal::Get; |
1046 | |
1047 | tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {} |
1048 | |
1049 | explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, |
1050 | GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, |
1051 | GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), |
1052 | f5_(f5) {} |
1053 | |
1054 | tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), |
1055 | f4_(t.f4_), f5_(t.f5_) {} |
1056 | |
1057 | template <GTEST_6_TYPENAMES_(U)> |
1058 | tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), |
1059 | f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {} |
1060 | |
1061 | tuple& operator=(const tuple& t) { return CopyFrom(t); } |
1062 | |
1063 | template <GTEST_6_TYPENAMES_(U)> |
1064 | tuple& operator=(const GTEST_6_TUPLE_(U)& t) { |
1065 | return CopyFrom(t); |
1066 | } |
1067 | |
1068 | GTEST_DECLARE_TUPLE_AS_FRIEND_ |
1069 | |
1070 | template <GTEST_6_TYPENAMES_(U)> |
1071 | tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) { |
1072 | f0_ = t.f0_; |
1073 | f1_ = t.f1_; |
1074 | f2_ = t.f2_; |
1075 | f3_ = t.f3_; |
1076 | f4_ = t.f4_; |
1077 | f5_ = t.f5_; |
1078 | return *this; |
1079 | } |
1080 | |
1081 | T0 f0_; |
1082 | T1 f1_; |
1083 | T2 f2_; |
1084 | T3 f3_; |
1085 | T4 f4_; |
1086 | T5 f5_; |
1087 | }; |
1088 | |
1089 | template <GTEST_7_TYPENAMES_(T)> |
1090 | class GTEST_7_TUPLE_(T) { |
1091 | public: |
1092 | template <int k> friend class gtest_internal::Get; |
1093 | |
1094 | tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {} |
1095 | |
1096 | explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, |
1097 | GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, |
1098 | GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2), |
1099 | f3_(f3), f4_(f4), f5_(f5), f6_(f6) {} |
1100 | |
1101 | tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), |
1102 | f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {} |
1103 | |
1104 | template <GTEST_7_TYPENAMES_(U)> |
1105 | tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), |
1106 | f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {} |
1107 | |
1108 | tuple& operator=(const tuple& t) { return CopyFrom(t); } |
1109 | |
1110 | template <GTEST_7_TYPENAMES_(U)> |
1111 | tuple& operator=(const GTEST_7_TUPLE_(U)& t) { |
1112 | return CopyFrom(t); |
1113 | } |
1114 | |
1115 | GTEST_DECLARE_TUPLE_AS_FRIEND_ |
1116 | |
1117 | template <GTEST_7_TYPENAMES_(U)> |
1118 | tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) { |
1119 | f0_ = t.f0_; |
1120 | f1_ = t.f1_; |
1121 | f2_ = t.f2_; |
1122 | f3_ = t.f3_; |
1123 | f4_ = t.f4_; |
1124 | f5_ = t.f5_; |
1125 | f6_ = t.f6_; |
1126 | return *this; |
1127 | } |
1128 | |
1129 | T0 f0_; |
1130 | T1 f1_; |
1131 | T2 f2_; |
1132 | T3 f3_; |
1133 | T4 f4_; |
1134 | T5 f5_; |
1135 | T6 f6_; |
1136 | }; |
1137 | |
1138 | template <GTEST_8_TYPENAMES_(T)> |
1139 | class GTEST_8_TUPLE_(T) { |
1140 | public: |
1141 | template <int k> friend class gtest_internal::Get; |
1142 | |
1143 | tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {} |
1144 | |
1145 | explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, |
1146 | GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, |
1147 | GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, |
1148 | GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), |
1149 | f5_(f5), f6_(f6), f7_(f7) {} |
1150 | |
1151 | tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), |
1152 | f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {} |
1153 | |
1154 | template <GTEST_8_TYPENAMES_(U)> |
1155 | tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), |
1156 | f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {} |
1157 | |
1158 | tuple& operator=(const tuple& t) { return CopyFrom(t); } |
1159 | |
1160 | template <GTEST_8_TYPENAMES_(U)> |
1161 | tuple& operator=(const GTEST_8_TUPLE_(U)& t) { |
1162 | return CopyFrom(t); |
1163 | } |
1164 | |
1165 | GTEST_DECLARE_TUPLE_AS_FRIEND_ |
1166 | |
1167 | template <GTEST_8_TYPENAMES_(U)> |
1168 | tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) { |
1169 | f0_ = t.f0_; |
1170 | f1_ = t.f1_; |
1171 | f2_ = t.f2_; |
1172 | f3_ = t.f3_; |
1173 | f4_ = t.f4_; |
1174 | f5_ = t.f5_; |
1175 | f6_ = t.f6_; |
1176 | f7_ = t.f7_; |
1177 | return *this; |
1178 | } |
1179 | |
1180 | T0 f0_; |
1181 | T1 f1_; |
1182 | T2 f2_; |
1183 | T3 f3_; |
1184 | T4 f4_; |
1185 | T5 f5_; |
1186 | T6 f6_; |
1187 | T7 f7_; |
1188 | }; |
1189 | |
1190 | template <GTEST_9_TYPENAMES_(T)> |
1191 | class GTEST_9_TUPLE_(T) { |
1192 | public: |
1193 | template <int k> friend class gtest_internal::Get; |
1194 | |
1195 | tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {} |
1196 | |
1197 | explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, |
1198 | GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, |
1199 | GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7, |
1200 | GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), |
1201 | f5_(f5), f6_(f6), f7_(f7), f8_(f8) {} |
1202 | |
1203 | tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), |
1204 | f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {} |
1205 | |
1206 | template <GTEST_9_TYPENAMES_(U)> |
1207 | tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), |
1208 | f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {} |
1209 | |
1210 | tuple& operator=(const tuple& t) { return CopyFrom(t); } |
1211 | |
1212 | template <GTEST_9_TYPENAMES_(U)> |
1213 | tuple& operator=(const GTEST_9_TUPLE_(U)& t) { |
1214 | return CopyFrom(t); |
1215 | } |
1216 | |
1217 | GTEST_DECLARE_TUPLE_AS_FRIEND_ |
1218 | |
1219 | template <GTEST_9_TYPENAMES_(U)> |
1220 | tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) { |
1221 | f0_ = t.f0_; |
1222 | f1_ = t.f1_; |
1223 | f2_ = t.f2_; |
1224 | f3_ = t.f3_; |
1225 | f4_ = t.f4_; |
1226 | f5_ = t.f5_; |
1227 | f6_ = t.f6_; |
1228 | f7_ = t.f7_; |
1229 | f8_ = t.f8_; |
1230 | return *this; |
1231 | } |
1232 | |
1233 | T0 f0_; |
1234 | T1 f1_; |
1235 | T2 f2_; |
1236 | T3 f3_; |
1237 | T4 f4_; |
1238 | T5 f5_; |
1239 | T6 f6_; |
1240 | T7 f7_; |
1241 | T8 f8_; |
1242 | }; |
1243 | |
1244 | template <GTEST_10_TYPENAMES_(T)> |
1245 | class tuple { |
1246 | public: |
1247 | template <int k> friend class gtest_internal::Get; |
1248 | |
1249 | tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(), |
1250 | f9_() {} |
1251 | |
1252 | explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, |
1253 | GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, |
1254 | GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7, |
1255 | GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2), |
1256 | f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {} |
1257 | |
1258 | tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), |
1259 | f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {} |
1260 | |
1261 | template <GTEST_10_TYPENAMES_(U)> |
1262 | tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), |
1263 | f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), |
1264 | f9_(t.f9_) {} |
1265 | |
1266 | tuple& operator=(const tuple& t) { return CopyFrom(t); } |
1267 | |
1268 | template <GTEST_10_TYPENAMES_(U)> |
1269 | tuple& operator=(const GTEST_10_TUPLE_(U)& t) { |
1270 | return CopyFrom(t); |
1271 | } |
1272 | |
1273 | GTEST_DECLARE_TUPLE_AS_FRIEND_ |
1274 | |
1275 | template <GTEST_10_TYPENAMES_(U)> |
1276 | tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) { |
1277 | f0_ = t.f0_; |
1278 | f1_ = t.f1_; |
1279 | f2_ = t.f2_; |
1280 | f3_ = t.f3_; |
1281 | f4_ = t.f4_; |
1282 | f5_ = t.f5_; |
1283 | f6_ = t.f6_; |
1284 | f7_ = t.f7_; |
1285 | f8_ = t.f8_; |
1286 | f9_ = t.f9_; |
1287 | return *this; |
1288 | } |
1289 | |
1290 | T0 f0_; |
1291 | T1 f1_; |
1292 | T2 f2_; |
1293 | T3 f3_; |
1294 | T4 f4_; |
1295 | T5 f5_; |
1296 | T6 f6_; |
1297 | T7 f7_; |
1298 | T8 f8_; |
1299 | T9 f9_; |
1300 | }; |
1301 | |
1302 | // 6.1.3.2 Tuple creation functions. |
1303 | |
1304 | // Known limitations: we don't support passing an |
1305 | // std::tr1::reference_wrapper<T> to make_tuple(). And we don't |
1306 | // implement tie(). |
1307 | |
1308 | inline tuple<> make_tuple() { return tuple<>(); } |
1309 | |
1310 | template <GTEST_1_TYPENAMES_(T)> |
1311 | inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) { |
1312 | return GTEST_1_TUPLE_(T)(f0); |
1313 | } |
1314 | |
1315 | template <GTEST_2_TYPENAMES_(T)> |
1316 | inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) { |
1317 | return GTEST_2_TUPLE_(T)(f0, f1); |
1318 | } |
1319 | |
1320 | template <GTEST_3_TYPENAMES_(T)> |
1321 | inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) { |
1322 | return GTEST_3_TUPLE_(T)(f0, f1, f2); |
1323 | } |
1324 | |
1325 | template <GTEST_4_TYPENAMES_(T)> |
1326 | inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, |
1327 | const T3& f3) { |
1328 | return GTEST_4_TUPLE_(T)(f0, f1, f2, f3); |
1329 | } |
1330 | |
1331 | template <GTEST_5_TYPENAMES_(T)> |
1332 | inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, |
1333 | const T3& f3, const T4& f4) { |
1334 | return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4); |
1335 | } |
1336 | |
1337 | template <GTEST_6_TYPENAMES_(T)> |
1338 | inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, |
1339 | const T3& f3, const T4& f4, const T5& f5) { |
1340 | return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5); |
1341 | } |
1342 | |
1343 | template <GTEST_7_TYPENAMES_(T)> |
1344 | inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, |
1345 | const T3& f3, const T4& f4, const T5& f5, const T6& f6) { |
1346 | return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6); |
1347 | } |
1348 | |
1349 | template <GTEST_8_TYPENAMES_(T)> |
1350 | inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, |
1351 | const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) { |
1352 | return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7); |
1353 | } |
1354 | |
1355 | template <GTEST_9_TYPENAMES_(T)> |
1356 | inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, |
1357 | const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7, |
1358 | const T8& f8) { |
1359 | return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8); |
1360 | } |
1361 | |
1362 | template <GTEST_10_TYPENAMES_(T)> |
1363 | inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, |
1364 | const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7, |
1365 | const T8& f8, const T9& f9) { |
1366 | return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9); |
1367 | } |
1368 | |
1369 | // 6.1.3.3 Tuple helper classes. |
1370 | |
1371 | template <typename Tuple> struct tuple_size; |
1372 | |
1373 | template <GTEST_0_TYPENAMES_(T)> |
1374 | struct tuple_size<GTEST_0_TUPLE_(T) > { |
1375 | static const int value = 0; |
1376 | }; |
1377 | |
1378 | template <GTEST_1_TYPENAMES_(T)> |
1379 | struct tuple_size<GTEST_1_TUPLE_(T) > { |
1380 | static const int value = 1; |
1381 | }; |
1382 | |
1383 | template <GTEST_2_TYPENAMES_(T)> |
1384 | struct tuple_size<GTEST_2_TUPLE_(T) > { |
1385 | static const int value = 2; |
1386 | }; |
1387 | |
1388 | template <GTEST_3_TYPENAMES_(T)> |
1389 | struct tuple_size<GTEST_3_TUPLE_(T) > { |
1390 | static const int value = 3; |
1391 | }; |
1392 | |
1393 | template <GTEST_4_TYPENAMES_(T)> |
1394 | struct tuple_size<GTEST_4_TUPLE_(T) > { |
1395 | static const int value = 4; |
1396 | }; |
1397 | |
1398 | template <GTEST_5_TYPENAMES_(T)> |
1399 | struct tuple_size<GTEST_5_TUPLE_(T) > { |
1400 | static const int value = 5; |
1401 | }; |
1402 | |
1403 | template <GTEST_6_TYPENAMES_(T)> |
1404 | struct tuple_size<GTEST_6_TUPLE_(T) > { |
1405 | static const int value = 6; |
1406 | }; |
1407 | |
1408 | template <GTEST_7_TYPENAMES_(T)> |
1409 | struct tuple_size<GTEST_7_TUPLE_(T) > { |
1410 | static const int value = 7; |
1411 | }; |
1412 | |
1413 | template <GTEST_8_TYPENAMES_(T)> |
1414 | struct tuple_size<GTEST_8_TUPLE_(T) > { |
1415 | static const int value = 8; |
1416 | }; |
1417 | |
1418 | template <GTEST_9_TYPENAMES_(T)> |
1419 | struct tuple_size<GTEST_9_TUPLE_(T) > { |
1420 | static const int value = 9; |
1421 | }; |
1422 | |
1423 | template <GTEST_10_TYPENAMES_(T)> |
1424 | struct tuple_size<GTEST_10_TUPLE_(T) > { |
1425 | static const int value = 10; |
1426 | }; |
1427 | |
1428 | template <int k, class Tuple> |
1429 | struct tuple_element { |
1430 | typedef typename gtest_internal::TupleElement< |
1431 | k < (tuple_size<Tuple>::value), k, Tuple>::type type; |
1432 | }; |
1433 | |
1434 | #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type |
1435 | |
1436 | // 6.1.3.4 Element access. |
1437 | |
1438 | namespace gtest_internal { |
1439 | |
1440 | template <> |
1441 | class Get<0> { |
1442 | public: |
1443 | template <class Tuple> |
1444 | static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple)) |
1445 | Field(Tuple& t) { return t.f0_; } // NOLINT |
1446 | |
1447 | template <class Tuple> |
1448 | static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple)) |
1449 | ConstField(const Tuple& t) { return t.f0_; } |
1450 | }; |
1451 | |
1452 | template <> |
1453 | class Get<1> { |
1454 | public: |
1455 | template <class Tuple> |
1456 | static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple)) |
1457 | Field(Tuple& t) { return t.f1_; } // NOLINT |
1458 | |
1459 | template <class Tuple> |
1460 | static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple)) |
1461 | ConstField(const Tuple& t) { return t.f1_; } |
1462 | }; |
1463 | |
1464 | template <> |
1465 | class Get<2> { |
1466 | public: |
1467 | template <class Tuple> |
1468 | static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple)) |
1469 | Field(Tuple& t) { return t.f2_; } // NOLINT |
1470 | |
1471 | template <class Tuple> |
1472 | static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple)) |
1473 | ConstField(const Tuple& t) { return t.f2_; } |
1474 | }; |
1475 | |
1476 | template <> |
1477 | class Get<3> { |
1478 | public: |
1479 | template <class Tuple> |
1480 | static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple)) |
1481 | Field(Tuple& t) { return t.f3_; } // NOLINT |
1482 | |
1483 | template <class Tuple> |
1484 | static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple)) |
1485 | ConstField(const Tuple& t) { return t.f3_; } |
1486 | }; |
1487 | |
1488 | template <> |
1489 | class Get<4> { |
1490 | public: |
1491 | template <class Tuple> |
1492 | static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple)) |
1493 | Field(Tuple& t) { return t.f4_; } // NOLINT |
1494 | |
1495 | template <class Tuple> |
1496 | static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple)) |
1497 | ConstField(const Tuple& t) { return t.f4_; } |
1498 | }; |
1499 | |
1500 | template <> |
1501 | class Get<5> { |
1502 | public: |
1503 | template <class Tuple> |
1504 | static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple)) |
1505 | Field(Tuple& t) { return t.f5_; } // NOLINT |
1506 | |
1507 | template <class Tuple> |
1508 | static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple)) |
1509 | ConstField(const Tuple& t) { return t.f5_; } |
1510 | }; |
1511 | |
1512 | template <> |
1513 | class Get<6> { |
1514 | public: |
1515 | template <class Tuple> |
1516 | static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple)) |
1517 | Field(Tuple& t) { return t.f6_; } // NOLINT |
1518 | |
1519 | template <class Tuple> |
1520 | static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple)) |
1521 | ConstField(const Tuple& t) { return t.f6_; } |
1522 | }; |
1523 | |
1524 | template <> |
1525 | class Get<7> { |
1526 | public: |
1527 | template <class Tuple> |
1528 | static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple)) |
1529 | Field(Tuple& t) { return t.f7_; } // NOLINT |
1530 | |
1531 | template <class Tuple> |
1532 | static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple)) |
1533 | ConstField(const Tuple& t) { return t.f7_; } |
1534 | }; |
1535 | |
1536 | template <> |
1537 | class Get<8> { |
1538 | public: |
1539 | template <class Tuple> |
1540 | static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple)) |
1541 | Field(Tuple& t) { return t.f8_; } // NOLINT |
1542 | |
1543 | template <class Tuple> |
1544 | static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple)) |
1545 | ConstField(const Tuple& t) { return t.f8_; } |
1546 | }; |
1547 | |
1548 | template <> |
1549 | class Get<9> { |
1550 | public: |
1551 | template <class Tuple> |
1552 | static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple)) |
1553 | Field(Tuple& t) { return t.f9_; } // NOLINT |
1554 | |
1555 | template <class Tuple> |
1556 | static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple)) |
1557 | ConstField(const Tuple& t) { return t.f9_; } |
1558 | }; |
1559 | |
1560 | } // namespace gtest_internal |
1561 | |
1562 | template <int k, GTEST_10_TYPENAMES_(T)> |
1563 | GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T))) |
1564 | get(GTEST_10_TUPLE_(T)& t) { |
1565 | return gtest_internal::Get<k>::Field(t); |
1566 | } |
1567 | |
1568 | template <int k, GTEST_10_TYPENAMES_(T)> |
1569 | GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T))) |
1570 | get(const GTEST_10_TUPLE_(T)& t) { |
1571 | return gtest_internal::Get<k>::ConstField(t); |
1572 | } |
1573 | |
1574 | // 6.1.3.5 Relational operators |
1575 | |
1576 | // We only implement == and !=, as we don't have a need for the rest yet. |
1577 | |
1578 | namespace gtest_internal { |
1579 | |
1580 | // SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the |
1581 | // first k fields of t1 equals the first k fields of t2. |
1582 | // SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if |
1583 | // k1 != k2. |
1584 | template <int kSize1, int kSize2> |
1585 | struct SameSizeTuplePrefixComparator; |
1586 | |
1587 | template <> |
1588 | struct SameSizeTuplePrefixComparator<0, 0> { |
1589 | template <class Tuple1, class Tuple2> |
1590 | static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) { |
1591 | return true; |
1592 | } |
1593 | }; |
1594 | |
1595 | template <int k> |
1596 | struct SameSizeTuplePrefixComparator<k, k> { |
1597 | template <class Tuple1, class Tuple2> |
1598 | static bool Eq(const Tuple1& t1, const Tuple2& t2) { |
1599 | return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) && |
1600 | ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2); |
1601 | } |
1602 | }; |
1603 | |
1604 | } // namespace gtest_internal |
1605 | |
1606 | template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)> |
1607 | inline bool operator==(const GTEST_10_TUPLE_(T)& t, |
1608 | const GTEST_10_TUPLE_(U)& u) { |
1609 | return gtest_internal::SameSizeTuplePrefixComparator< |
1610 | tuple_size<GTEST_10_TUPLE_(T) >::value, |
1611 | tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u); |
1612 | } |
1613 | |
1614 | template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)> |
1615 | inline bool operator!=(const GTEST_10_TUPLE_(T)& t, |
1616 | const GTEST_10_TUPLE_(U)& u) { return !(t == u); } |
1617 | |
1618 | // 6.1.4 Pairs. |
1619 | // Unimplemented. |
1620 | |
1621 | } // namespace tr1 |
1622 | } // namespace std |
1623 | |
1624 | #undef GTEST_0_TUPLE_ |
1625 | #undef GTEST_1_TUPLE_ |
1626 | #undef GTEST_2_TUPLE_ |
1627 | #undef GTEST_3_TUPLE_ |
1628 | #undef GTEST_4_TUPLE_ |
1629 | #undef GTEST_5_TUPLE_ |
1630 | #undef GTEST_6_TUPLE_ |
1631 | #undef GTEST_7_TUPLE_ |
1632 | #undef GTEST_8_TUPLE_ |
1633 | #undef GTEST_9_TUPLE_ |
1634 | #undef GTEST_10_TUPLE_ |
1635 | |
1636 | #undef GTEST_0_TYPENAMES_ |
1637 | #undef GTEST_1_TYPENAMES_ |
1638 | #undef GTEST_2_TYPENAMES_ |
1639 | #undef GTEST_3_TYPENAMES_ |
1640 | #undef GTEST_4_TYPENAMES_ |
1641 | #undef GTEST_5_TYPENAMES_ |
1642 | #undef GTEST_6_TYPENAMES_ |
1643 | #undef GTEST_7_TYPENAMES_ |
1644 | #undef GTEST_8_TYPENAMES_ |
1645 | #undef GTEST_9_TYPENAMES_ |
1646 | #undef GTEST_10_TYPENAMES_ |
1647 | |
1648 | #undef GTEST_DECLARE_TUPLE_AS_FRIEND_ |
1649 | #undef GTEST_BY_REF_ |
1650 | #undef GTEST_ADD_REF_ |
1651 | #undef GTEST_TUPLE_ELEMENT_ |
1652 | |
1653 | #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ |
1654 | # elif GTEST_ENV_HAS_STD_TUPLE_ |
1655 | # include <tuple> |
1656 | // C++11 puts its tuple into the ::std namespace rather than |
1657 | // ::std::tr1. gtest expects tuple to live in ::std::tr1, so put it there. |
1658 | // This causes undefined behavior, but supported compilers react in |
1659 | // the way we intend. |
1660 | namespace std { |
1661 | namespace tr1 { |
1662 | using ::std::get; |
1663 | using ::std::make_tuple; |
1664 | using ::std::tuple; |
1665 | using ::std::tuple_element; |
1666 | using ::std::tuple_size; |
1667 | } |
1668 | } |
1669 | |
1670 | # elif GTEST_OS_SYMBIAN |
1671 | |
1672 | // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to |
1673 | // use STLport's tuple implementation, which unfortunately doesn't |
1674 | // work as the copy of STLport distributed with Symbian is incomplete. |
1675 | // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to |
1676 | // use its own tuple implementation. |
1677 | # ifdef BOOST_HAS_TR1_TUPLE |
1678 | # undef BOOST_HAS_TR1_TUPLE |
1679 | # endif // BOOST_HAS_TR1_TUPLE |
1680 | |
1681 | // This prevents <boost/tr1/detail/config.hpp>, which defines |
1682 | // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>. |
1683 | # define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED |
1684 | # include <tuple> |
1685 | |
1686 | # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000) |
1687 | // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does |
1688 | // not conform to the TR1 spec, which requires the header to be <tuple>. |
1689 | |
1690 | # if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302 |
1691 | // Until version 4.3.2, gcc has a bug that causes <tr1/functional>, |
1692 | // which is #included by <tr1/tuple>, to not compile when RTTI is |
1693 | // disabled. _TR1_FUNCTIONAL is the header guard for |
1694 | // <tr1/functional>. Hence the following #define is a hack to prevent |
1695 | // <tr1/functional> from being included. |
1696 | # define _TR1_FUNCTIONAL 1 |
1697 | # include <tr1/tuple> |
1698 | # undef _TR1_FUNCTIONAL // Allows the user to #include |
1699 | // <tr1/functional> if he chooses to. |
1700 | # else |
1701 | # include <tr1/tuple> // NOLINT |
1702 | # endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302 |
1703 | |
1704 | # else |
1705 | // If the compiler is not GCC 4.0+, we assume the user is using a |
1706 | // spec-conforming TR1 implementation. |
1707 | # include <tuple> // NOLINT |
1708 | # endif // GTEST_USE_OWN_TR1_TUPLE |
1709 | |
1710 | #endif // GTEST_HAS_TR1_TUPLE |
1711 | |
1712 | // Determines whether clone(2) is supported. |
1713 | // Usually it will only be available on Linux, excluding |
1714 | // Linux on the Itanium architecture. |
1715 | // Also see http://linux.die.net/man/2/clone. |
1716 | #ifndef GTEST_HAS_CLONE |
1717 | // The user didn't tell us, so we need to figure it out. |
1718 | |
1719 | # if GTEST_OS_LINUX && !defined(__ia64__) |
1720 | # if GTEST_OS_LINUX_ANDROID |
1721 | // On Android, clone() is only available on ARM starting with Gingerbread. |
1722 | # if defined(__arm__) && __ANDROID_API__ >= 9 |
1723 | # define GTEST_HAS_CLONE 1 |
1724 | # else |
1725 | # define GTEST_HAS_CLONE 0 |
1726 | # endif |
1727 | # else |
1728 | # define GTEST_HAS_CLONE 1 |
1729 | # endif |
1730 | # else |
1731 | # define GTEST_HAS_CLONE 0 |
1732 | # endif // GTEST_OS_LINUX && !defined(__ia64__) |
1733 | |
1734 | #endif // GTEST_HAS_CLONE |
1735 | |
1736 | // Determines whether to support stream redirection. This is used to test |
1737 | // output correctness and to implement death tests. |
1738 | #ifndef GTEST_HAS_STREAM_REDIRECTION |
1739 | // By default, we assume that stream redirection is supported on all |
1740 | // platforms except known mobile ones. |
1741 | # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN |
1742 | # define GTEST_HAS_STREAM_REDIRECTION 0 |
1743 | # else |
1744 | # define GTEST_HAS_STREAM_REDIRECTION 1 |
1745 | # endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN |
1746 | #endif // GTEST_HAS_STREAM_REDIRECTION |
1747 | |
1748 | // Determines whether to support death tests. |
1749 | // Google Test does not support death tests for VC 7.1 and earlier as |
1750 | // abort() in a VC 7.1 application compiled as GUI in debug config |
1751 | // pops up a dialog window that cannot be suppressed programmatically. |
1752 | #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \ |
1753 | (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \ |
1754 | (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \ |
1755 | GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \ |
1756 | GTEST_OS_OPENBSD || GTEST_OS_QNX) |
1757 | # define GTEST_HAS_DEATH_TEST 1 |
1758 | # include <vector> // NOLINT |
1759 | #endif |
1760 | |
1761 | // We don't support MSVC 7.1 with exceptions disabled now. Therefore |
1762 | // all the compilers we care about are adequate for supporting |
1763 | // value-parameterized tests. |
1764 | #define GTEST_HAS_PARAM_TEST 1 |
1765 | |
1766 | // Determines whether to support type-driven tests. |
1767 | |
1768 | // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0, |
1769 | // Sun Pro CC, IBM Visual Age, and HP aCC support. |
1770 | #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \ |
1771 | defined(__IBMCPP__) || defined(__HP_aCC) |
1772 | # define GTEST_HAS_TYPED_TEST 1 |
1773 | # define GTEST_HAS_TYPED_TEST_P 1 |
1774 | #endif |
1775 | |
1776 | // Determines whether to support Combine(). This only makes sense when |
1777 | // value-parameterized tests are enabled. The implementation doesn't |
1778 | // work on Sun Studio since it doesn't understand templated conversion |
1779 | // operators. |
1780 | #if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC) |
1781 | # define GTEST_HAS_COMBINE 1 |
1782 | #endif |
1783 | |
1784 | // Determines whether the system compiler uses UTF-16 for encoding wide strings. |
1785 | #define GTEST_WIDE_STRING_USES_UTF16_ \ |
1786 | (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX) |
1787 | |
1788 | // Determines whether test results can be streamed to a socket. |
1789 | #if GTEST_OS_LINUX |
1790 | # define GTEST_CAN_STREAM_RESULTS_ 1 |
1791 | #endif |
1792 | |
1793 | // Defines some utility macros. |
1794 | |
1795 | // The GNU compiler emits a warning if nested "if" statements are followed by |
1796 | // an "else" statement and braces are not used to explicitly disambiguate the |
1797 | // "else" binding. This leads to problems with code like: |
1798 | // |
1799 | // if (gate) |
1800 | // ASSERT_*(condition) << "Some message"; |
1801 | // |
1802 | // The "switch (0) case 0:" idiom is used to suppress this. |
1803 | #ifdef __INTEL_COMPILER |
1804 | # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ |
1805 | #else |
1806 | # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT |
1807 | #endif |
1808 | |
1809 | // Use this annotation at the end of a struct/class definition to |
1810 | // prevent the compiler from optimizing away instances that are never |
1811 | // used. This is useful when all interesting logic happens inside the |
1812 | // c'tor and / or d'tor. Example: |
1813 | // |
1814 | // struct Foo { |
1815 | // Foo() { ... } |
1816 | // } GTEST_ATTRIBUTE_UNUSED_; |
1817 | // |
1818 | // Also use it after a variable or parameter declaration to tell the |
1819 | // compiler the variable/parameter does not have to be used. |
1820 | #if defined(__GNUC__) && !defined(COMPILER_ICC) |
1821 | # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused)) |
1822 | #else |
1823 | # define GTEST_ATTRIBUTE_UNUSED_ |
1824 | #endif |
1825 | |
1826 | // A macro to disallow operator= |
1827 | // This should be used in the private: declarations for a class. |
1828 | #define GTEST_DISALLOW_ASSIGN_(type)\ |
1829 | void operator=(type const &) |
1830 | |
1831 | // A macro to disallow copy constructor and operator= |
1832 | // This should be used in the private: declarations for a class. |
1833 | #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\ |
1834 | type(type const &);\ |
1835 | GTEST_DISALLOW_ASSIGN_(type) |
1836 | |
1837 | // Tell the compiler to warn about unused return values for functions declared |
1838 | // with this macro. The macro should be used on function declarations |
1839 | // following the argument list: |
1840 | // |
1841 | // Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_; |
1842 | #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC) |
1843 | # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result)) |
1844 | #else |
1845 | # define GTEST_MUST_USE_RESULT_ |
1846 | #endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC |
1847 | |
1848 | // Determine whether the compiler supports Microsoft's Structured Exception |
1849 | // Handling. This is supported by several Windows compilers but generally |
1850 | // does not exist on any other system. |
1851 | #ifndef GTEST_HAS_SEH |
1852 | // The user didn't tell us, so we need to figure it out. |
1853 | |
1854 | # if defined(_MSC_VER) || defined(__BORLANDC__) |
1855 | // These two compilers are known to support SEH. |
1856 | # define GTEST_HAS_SEH 1 |
1857 | # else |
1858 | // Assume no SEH. |
1859 | # define GTEST_HAS_SEH 0 |
1860 | # endif |
1861 | |
1862 | #endif // GTEST_HAS_SEH |
1863 | |
1864 | #ifdef _MSC_VER |
1865 | |
1866 | # if GTEST_LINKED_AS_SHARED_LIBRARY |
1867 | # define GTEST_API_ __declspec(dllimport) |
1868 | # elif GTEST_CREATE_SHARED_LIBRARY |
1869 | # define GTEST_API_ __declspec(dllexport) |
1870 | # endif |
1871 | |
1872 | #endif // _MSC_VER |
1873 | |
1874 | #ifndef GTEST_API_ |
1875 | # define GTEST_API_ |
1876 | #endif |
1877 | |
1878 | #ifdef __GNUC__ |
1879 | // Ask the compiler to never inline a given function. |
1880 | # define GTEST_NO_INLINE_ __attribute__((noinline)) |
1881 | #else |
1882 | # define GTEST_NO_INLINE_ |
1883 | #endif |
1884 | |
1885 | // _LIBCPP_VERSION is defined by the libc++ library from the LLVM project. |
1886 | #if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION) |
1887 | # define GTEST_HAS_CXXABI_H_ 1 |
1888 | #else |
1889 | # define GTEST_HAS_CXXABI_H_ 0 |
1890 | #endif |
1891 | |
1892 | namespace testing { |
1893 | |
1894 | class Message; |
1895 | |
1896 | namespace internal { |
1897 | |
1898 | // A secret type that Google Test users don't know about. It has no |
1899 | // definition on purpose. Therefore it's impossible to create a |
1900 | // Secret object, which is what we want. |
1901 | class Secret; |
1902 | |
1903 | // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time |
1904 | // expression is true. For example, you could use it to verify the |
1905 | // size of a static array: |
1906 | // |
1907 | // GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES, |
1908 | // content_type_names_incorrect_size); |
1909 | // |
1910 | // or to make sure a struct is smaller than a certain size: |
1911 | // |
1912 | // GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large); |
1913 | // |
1914 | // The second argument to the macro is the name of the variable. If |
1915 | // the expression is false, most compilers will issue a warning/error |
1916 | // containing the name of the variable. |
1917 | |
1918 | template <bool> |
1919 | struct CompileAssert { |
1920 | }; |
1921 | |
1922 | #define GTEST_COMPILE_ASSERT_(expr, msg) \ |
1923 | typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \ |
1924 | msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_ |
1925 | |
1926 | // Implementation details of GTEST_COMPILE_ASSERT_: |
1927 | // |
1928 | // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1 |
1929 | // elements (and thus is invalid) when the expression is false. |
1930 | // |
1931 | // - The simpler definition |
1932 | // |
1933 | // #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1] |
1934 | // |
1935 | // does not work, as gcc supports variable-length arrays whose sizes |
1936 | // are determined at run-time (this is gcc's extension and not part |
1937 | // of the C++ standard). As a result, gcc fails to reject the |
1938 | // following code with the simple definition: |
1939 | // |
1940 | // int foo; |
1941 | // GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is |
1942 | // // not a compile-time constant. |
1943 | // |
1944 | // - By using the type CompileAssert<(bool(expr))>, we ensures that |
1945 | // expr is a compile-time constant. (Template arguments must be |
1946 | // determined at compile-time.) |
1947 | // |
1948 | // - The outter parentheses in CompileAssert<(bool(expr))> are necessary |
1949 | // to work around a bug in gcc 3.4.4 and 4.0.1. If we had written |
1950 | // |
1951 | // CompileAssert<bool(expr)> |
1952 | // |
1953 | // instead, these compilers will refuse to compile |
1954 | // |
1955 | // GTEST_COMPILE_ASSERT_(5 > 0, some_message); |
1956 | // |
1957 | // (They seem to think the ">" in "5 > 0" marks the end of the |
1958 | // template argument list.) |
1959 | // |
1960 | // - The array size is (bool(expr) ? 1 : -1), instead of simply |
1961 | // |
1962 | // ((expr) ? 1 : -1). |
1963 | // |
1964 | // This is to avoid running into a bug in MS VC 7.1, which |
1965 | // causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1. |
1966 | |
1967 | // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h. |
1968 | // |
1969 | // This template is declared, but intentionally undefined. |
1970 | template <typename T1, typename T2> |
1971 | struct StaticAssertTypeEqHelper; |
1972 | |
1973 | template <typename T> |
1974 | struct StaticAssertTypeEqHelper<T, T> {}; |
1975 | |
1976 | #if GTEST_HAS_GLOBAL_STRING |
1977 | typedef ::string string; |
1978 | #else |
1979 | typedef ::std::string string; |
1980 | #endif // GTEST_HAS_GLOBAL_STRING |
1981 | |
1982 | #if GTEST_HAS_GLOBAL_WSTRING |
1983 | typedef ::wstring wstring; |
1984 | #elif GTEST_HAS_STD_WSTRING |
1985 | typedef ::std::wstring wstring; |
1986 | #endif // GTEST_HAS_GLOBAL_WSTRING |
1987 | |
1988 | // A helper for suppressing warnings on constant condition. It just |
1989 | // returns 'condition'. |
1990 | GTEST_API_ bool IsTrue(bool condition); |
1991 | |
1992 | // Defines scoped_ptr. |
1993 | |
1994 | // This implementation of scoped_ptr is PARTIAL - it only contains |
1995 | // enough stuff to satisfy Google Test's need. |
1996 | template <typename T> |
1997 | class scoped_ptr { |
1998 | public: |
1999 | typedef T element_type; |
2000 | |
2001 | explicit scoped_ptr(T* p = NULL) : ptr_(p) {} |
2002 | ~scoped_ptr() { reset(); } |
2003 | |
2004 | T& operator*() const { return *ptr_; } |
2005 | T* operator->() const { return ptr_; } |
2006 | T* get() const { return ptr_; } |
2007 | |
2008 | T* release() { |
2009 | T* const ptr = ptr_; |
2010 | ptr_ = NULL; |
2011 | return ptr; |
2012 | } |
2013 | |
2014 | void reset(T* p = NULL) { |
2015 | if (p != ptr_) { |
2016 | if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type. |
2017 | delete ptr_; |
2018 | } |
2019 | ptr_ = p; |
2020 | } |
2021 | } |
2022 | |
2023 | private: |
2024 | T* ptr_; |
2025 | |
2026 | GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr); |
2027 | }; |
2028 | |
2029 | // Defines RE. |
2030 | |
2031 | // A simple C++ wrapper for <regex.h>. It uses the POSIX Extended |
2032 | // Regular Expression syntax. |
2033 | class GTEST_API_ RE { |
2034 | public: |
2035 | // A copy constructor is required by the Standard to initialize object |
2036 | // references from r-values. |
2037 | RE(const RE& other) { Init(other.pattern()); } |
2038 | |
2039 | // Constructs an RE from a string. |
2040 | RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT |
2041 | |
2042 | #if GTEST_HAS_GLOBAL_STRING |
2043 | |
2044 | RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT |
2045 | |
2046 | #endif // GTEST_HAS_GLOBAL_STRING |
2047 | |
2048 | RE(const char* regex) { Init(regex); } // NOLINT |
2049 | ~RE(); |
2050 | |
2051 | // Returns the string representation of the regex. |
2052 | const char* pattern() const { return pattern_; } |
2053 | |
2054 | // FullMatch(str, re) returns true iff regular expression re matches |
2055 | // the entire str. |
2056 | // PartialMatch(str, re) returns true iff regular expression re |
2057 | // matches a substring of str (including str itself). |
2058 | // |
2059 | // TODO(wan@google.com): make FullMatch() and PartialMatch() work |
2060 | // when str contains NUL characters. |
2061 | static bool FullMatch(const ::std::string& str, const RE& re) { |
2062 | return FullMatch(str.c_str(), re); |
2063 | } |
2064 | static bool PartialMatch(const ::std::string& str, const RE& re) { |
2065 | return PartialMatch(str.c_str(), re); |
2066 | } |
2067 | |
2068 | #if GTEST_HAS_GLOBAL_STRING |
2069 | |
2070 | static bool FullMatch(const ::string& str, const RE& re) { |
2071 | return FullMatch(str.c_str(), re); |
2072 | } |
2073 | static bool PartialMatch(const ::string& str, const RE& re) { |
2074 | return PartialMatch(str.c_str(), re); |
2075 | } |
2076 | |
2077 | #endif // GTEST_HAS_GLOBAL_STRING |
2078 | |
2079 | static bool FullMatch(const char* str, const RE& re); |
2080 | static bool PartialMatch(const char* str, const RE& re); |
2081 | |
2082 | private: |
2083 | void Init(const char* regex); |
2084 | |
2085 | // We use a const char* instead of an std::string, as Google Test used to be |
2086 | // used where std::string is not available. TODO(wan@google.com): change to |
2087 | // std::string. |
2088 | const char* pattern_; |
2089 | bool is_valid_; |
2090 | |
2091 | #if GTEST_USES_POSIX_RE |
2092 | |
2093 | regex_t full_regex_; // For FullMatch(). |
2094 | regex_t partial_regex_; // For PartialMatch(). |
2095 | |
2096 | #else // GTEST_USES_SIMPLE_RE |
2097 | |
2098 | const char* full_pattern_; // For FullMatch(); |
2099 | |
2100 | #endif |
2101 | |
2102 | GTEST_DISALLOW_ASSIGN_(RE); |
2103 | }; |
2104 | |
2105 | // Formats a source file path and a line number as they would appear |
2106 | // in an error message from the compiler used to compile this code. |
2107 | GTEST_API_ ::std::string FormatFileLocation(const char* file, int line); |
2108 | |
2109 | // Formats a file location for compiler-independent XML output. |
2110 | // Although this function is not platform dependent, we put it next to |
2111 | // FormatFileLocation in order to contrast the two functions. |
2112 | GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file, |
2113 | int line); |
2114 | |
2115 | // Defines logging utilities: |
2116 | // GTEST_LOG_(severity) - logs messages at the specified severity level. The |
2117 | // message itself is streamed into the macro. |
2118 | // LogToStderr() - directs all log messages to stderr. |
2119 | // FlushInfoLog() - flushes informational log messages. |
2120 | |
2121 | enum GTestLogSeverity { |
2122 | GTEST_INFO, |
2123 | GTEST_WARNING, |
2124 | GTEST_ERROR, |
2125 | GTEST_FATAL |
2126 | }; |
2127 | |
2128 | // Formats log entry severity, provides a stream object for streaming the |
2129 | // log message, and terminates the message with a newline when going out of |
2130 | // scope. |
2131 | class GTEST_API_ GTestLog { |
2132 | public: |
2133 | GTestLog(GTestLogSeverity severity, const char* file, int line); |
2134 | |
2135 | // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program. |
2136 | ~GTestLog(); |
2137 | |
2138 | ::std::ostream& GetStream() { return ::std::cerr; } |
2139 | |
2140 | private: |
2141 | const GTestLogSeverity severity_; |
2142 | |
2143 | GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog); |
2144 | }; |
2145 | |
2146 | #define GTEST_LOG_(severity) \ |
2147 | ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \ |
2148 | __FILE__, __LINE__).GetStream() |
2149 | |
2150 | inline void LogToStderr() {} |
2151 | inline void FlushInfoLog() { fflush(NULL); } |
2152 | |
2153 | // INTERNAL IMPLEMENTATION - DO NOT USE. |
2154 | // |
2155 | // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition |
2156 | // is not satisfied. |
2157 | // Synopsys: |
2158 | // GTEST_CHECK_(boolean_condition); |
2159 | // or |
2160 | // GTEST_CHECK_(boolean_condition) << "Additional message"; |
2161 | // |
2162 | // This checks the condition and if the condition is not satisfied |
2163 | // it prints message about the condition violation, including the |
2164 | // condition itself, plus additional message streamed into it, if any, |
2165 | // and then it aborts the program. It aborts the program irrespective of |
2166 | // whether it is built in the debug mode or not. |
2167 | #define GTEST_CHECK_(condition) \ |
2168 | GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ |
2169 | if (::testing::internal::IsTrue(condition)) \ |
2170 | ; \ |
2171 | else \ |
2172 | GTEST_LOG_(FATAL) << "Condition " #condition " failed. " |
2173 | |
2174 | // An all-mode assert to verify that the given POSIX-style function |
2175 | // call returns 0 (indicating success). Known limitation: this |
2176 | // doesn't expand to a balanced 'if' statement, so enclose the macro |
2177 | // in {} if you need to use it as the only statement in an 'if' |
2178 | // branch. |
2179 | #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ |
2180 | if (const int gtest_error = (posix_call)) \ |
2181 | GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ |
2182 | << gtest_error |
2183 | |
2184 | // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. |
2185 | // |
2186 | // Use ImplicitCast_ as a safe version of static_cast for upcasting in |
2187 | // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a |
2188 | // const Foo*). When you use ImplicitCast_, the compiler checks that |
2189 | // the cast is safe. Such explicit ImplicitCast_s are necessary in |
2190 | // surprisingly many situations where C++ demands an exact type match |
2191 | // instead of an argument type convertable to a target type. |
2192 | // |
2193 | // The syntax for using ImplicitCast_ is the same as for static_cast: |
2194 | // |
2195 | // ImplicitCast_<ToType>(expr) |
2196 | // |
2197 | // ImplicitCast_ would have been part of the C++ standard library, |
2198 | // but the proposal was submitted too late. It will probably make |
2199 | // its way into the language in the future. |
2200 | // |
2201 | // This relatively ugly name is intentional. It prevents clashes with |
2202 | // similar functions users may have (e.g., implicit_cast). The internal |
2203 | // namespace alone is not enough because the function can be found by ADL. |
2204 | template<typename To> |
2205 | inline To ImplicitCast_(To x) { return x; } |
2206 | |
2207 | // When you upcast (that is, cast a pointer from type Foo to type |
2208 | // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts |
2209 | // always succeed. When you downcast (that is, cast a pointer from |
2210 | // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because |
2211 | // how do you know the pointer is really of type SubclassOfFoo? It |
2212 | // could be a bare Foo, or of type DifferentSubclassOfFoo. Thus, |
2213 | // when you downcast, you should use this macro. In debug mode, we |
2214 | // use dynamic_cast<> to double-check the downcast is legal (we die |
2215 | // if it's not). In normal mode, we do the efficient static_cast<> |
2216 | // instead. Thus, it's important to test in debug mode to make sure |
2217 | // the cast is legal! |
2218 | // This is the only place in the code we should use dynamic_cast<>. |
2219 | // In particular, you SHOULDN'T be using dynamic_cast<> in order to |
2220 | // do RTTI (eg code like this: |
2221 | // if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo); |
2222 | // if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo); |
2223 | // You should design the code some other way not to need this. |
2224 | // |
2225 | // This relatively ugly name is intentional. It prevents clashes with |
2226 | // similar functions users may have (e.g., down_cast). The internal |
2227 | // namespace alone is not enough because the function can be found by ADL. |
2228 | template<typename To, typename From> // use like this: DownCast_<T*>(foo); |
2229 | inline To DownCast_(From* f) { // so we only accept pointers |
2230 | // Ensures that To is a sub-type of From *. This test is here only |
2231 | // for compile-time type checking, and has no overhead in an |
2232 | // optimized build at run-time, as it will be optimized away |
2233 | // completely. |
2234 | if (false) { |
2235 | const To to = NULL; |
2236 | ::testing::internal::ImplicitCast_<From*>(to); |
2237 | } |
2238 | |
2239 | #if GTEST_HAS_RTTI |
2240 | // RTTI: debug mode only! |
2241 | GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL); |
2242 | #endif |
2243 | return static_cast<To>(f); |
2244 | } |
2245 | |
2246 | // Downcasts the pointer of type Base to Derived. |
2247 | // Derived must be a subclass of Base. The parameter MUST |
2248 | // point to a class of type Derived, not any subclass of it. |
2249 | // When RTTI is available, the function performs a runtime |
2250 | // check to enforce this. |
2251 | template <class Derived, class Base> |
2252 | Derived* CheckedDowncastToActualType(Base* base) { |
2253 | #if GTEST_HAS_RTTI |
2254 | GTEST_CHECK_(typeid(*base) == typeid(Derived)); |
2255 | return dynamic_cast<Derived*>(base); // NOLINT |
2256 | #else |
2257 | return static_cast<Derived*>(base); // Poor man's downcast. |
2258 | #endif |
2259 | } |
2260 | |
2261 | #if GTEST_HAS_STREAM_REDIRECTION |
2262 | |
2263 | // Defines the stderr capturer: |
2264 | // CaptureStdout - starts capturing stdout. |
2265 | // GetCapturedStdout - stops capturing stdout and returns the captured string. |
2266 | // CaptureStderr - starts capturing stderr. |
2267 | // GetCapturedStderr - stops capturing stderr and returns the captured string. |
2268 | // |
2269 | GTEST_API_ void CaptureStdout(); |
2270 | GTEST_API_ std::string GetCapturedStdout(); |
2271 | GTEST_API_ void CaptureStderr(); |
2272 | GTEST_API_ std::string GetCapturedStderr(); |
2273 | |
2274 | #endif // GTEST_HAS_STREAM_REDIRECTION |
2275 | |
2276 | |
2277 | #if GTEST_HAS_DEATH_TEST |
2278 | |
2279 | const ::std::vector<testing::internal::string>& GetInjectableArgvs(); |
2280 | void SetInjectableArgvs(const ::std::vector<testing::internal::string>* |
2281 | new_argvs); |
2282 | |
2283 | // A copy of all command line arguments. Set by InitGoogleTest(). |
2284 | extern ::std::vector<testing::internal::string> g_argvs; |
2285 | |
2286 | #endif // GTEST_HAS_DEATH_TEST |
2287 | |
2288 | // Defines synchronization primitives. |
2289 | |
2290 | #if GTEST_HAS_PTHREAD |
2291 | |
2292 | // Sleeps for (roughly) n milli-seconds. This function is only for |
2293 | // testing Google Test's own constructs. Don't use it in user tests, |
2294 | // either directly or indirectly. |
2295 | inline void SleepMilliseconds(int n) { |
2296 | const timespec time = { |
2297 | 0, // 0 seconds. |
2298 | n * 1000L * 1000L, // And n ms. |
2299 | }; |
2300 | nanosleep(&time, NULL); |
2301 | } |
2302 | |
2303 | // Allows a controller thread to pause execution of newly created |
2304 | // threads until notified. Instances of this class must be created |
2305 | // and destroyed in the controller thread. |
2306 | // |
2307 | // This class is only for testing Google Test's own constructs. Do not |
2308 | // use it in user tests, either directly or indirectly. |
2309 | class Notification { |
2310 | public: |
2311 | Notification() : notified_(false) { |
2312 | GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL)); |
2313 | } |
2314 | ~Notification() { |
2315 | pthread_mutex_destroy(&mutex_); |
2316 | } |
2317 | |
2318 | // Notifies all threads created with this notification to start. Must |
2319 | // be called from the controller thread. |
2320 | void Notify() { |
2321 | pthread_mutex_lock(&mutex_); |
2322 | notified_ = true; |
2323 | pthread_mutex_unlock(&mutex_); |
2324 | } |
2325 | |
2326 | // Blocks until the controller thread notifies. Must be called from a test |
2327 | // thread. |
2328 | void WaitForNotification() { |
2329 | for (;;) { |
2330 | pthread_mutex_lock(&mutex_); |
2331 | const bool notified = notified_; |
2332 | pthread_mutex_unlock(&mutex_); |
2333 | if (notified) |
2334 | break; |
2335 | SleepMilliseconds(10); |
2336 | } |
2337 | } |
2338 | |
2339 | private: |
2340 | pthread_mutex_t mutex_; |
2341 | bool notified_; |
2342 | |
2343 | GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification); |
2344 | }; |
2345 | |
2346 | // As a C-function, ThreadFuncWithCLinkage cannot be templated itself. |
2347 | // Consequently, it cannot select a correct instantiation of ThreadWithParam |
2348 | // in order to call its Run(). Introducing ThreadWithParamBase as a |
2349 | // non-templated base class for ThreadWithParam allows us to bypass this |
2350 | // problem. |
2351 | class ThreadWithParamBase { |
2352 | public: |
2353 | virtual ~ThreadWithParamBase() {} |
2354 | virtual void Run() = 0; |
2355 | }; |
2356 | |
2357 | // pthread_create() accepts a pointer to a function type with the C linkage. |
2358 | // According to the Standard (7.5/1), function types with different linkages |
2359 | // are different even if they are otherwise identical. Some compilers (for |
2360 | // example, SunStudio) treat them as different types. Since class methods |
2361 | // cannot be defined with C-linkage we need to define a free C-function to |
2362 | // pass into pthread_create(). |
2363 | extern "C" inline void* ThreadFuncWithCLinkage(void* thread) { |
2364 | static_cast<ThreadWithParamBase*>(thread)->Run(); |
2365 | return NULL; |
2366 | } |
2367 | |
2368 | // Helper class for testing Google Test's multi-threading constructs. |
2369 | // To use it, write: |
2370 | // |
2371 | // void ThreadFunc(int param) { /* Do things with param */ } |
2372 | // Notification thread_can_start; |
2373 | // ... |
2374 | // // The thread_can_start parameter is optional; you can supply NULL. |
2375 | // ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start); |
2376 | // thread_can_start.Notify(); |
2377 | // |
2378 | // These classes are only for testing Google Test's own constructs. Do |
2379 | // not use them in user tests, either directly or indirectly. |
2380 | template <typename T> |
2381 | class ThreadWithParam : public ThreadWithParamBase { |
2382 | public: |
2383 | typedef void (*UserThreadFunc)(T); |
2384 | |
2385 | ThreadWithParam( |
2386 | UserThreadFunc func, T param, Notification* thread_can_start) |
2387 | : func_(func), |
2388 | param_(param), |
2389 | thread_can_start_(thread_can_start), |
2390 | finished_(false) { |
2391 | ThreadWithParamBase* const base = this; |
2392 | // The thread can be created only after all fields except thread_ |
2393 | // have been initialized. |
2394 | GTEST_CHECK_POSIX_SUCCESS_( |
2395 | pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base)); |
2396 | } |
2397 | ~ThreadWithParam() { Join(); } |
2398 | |
2399 | void Join() { |
2400 | if (!finished_) { |
2401 | GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0)); |
2402 | finished_ = true; |
2403 | } |
2404 | } |
2405 | |
2406 | virtual void Run() { |
2407 | if (thread_can_start_ != NULL) |
2408 | thread_can_start_->WaitForNotification(); |
2409 | func_(param_); |
2410 | } |
2411 | |
2412 | private: |
2413 | const UserThreadFunc func_; // User-supplied thread function. |
2414 | const T param_; // User-supplied parameter to the thread function. |
2415 | // When non-NULL, used to block execution until the controller thread |
2416 | // notifies. |
2417 | Notification* const thread_can_start_; |
2418 | bool finished_; // true iff we know that the thread function has finished. |
2419 | pthread_t thread_; // The native thread object. |
2420 | |
2421 | GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam); |
2422 | }; |
2423 | |
2424 | // MutexBase and Mutex implement mutex on pthreads-based platforms. They |
2425 | // are used in conjunction with class MutexLock: |
2426 | // |
2427 | // Mutex mutex; |
2428 | // ... |
2429 | // MutexLock lock(&mutex); // Acquires the mutex and releases it at the end |
2430 | // // of the current scope. |
2431 | // |
2432 | // MutexBase implements behavior for both statically and dynamically |
2433 | // allocated mutexes. Do not use MutexBase directly. Instead, write |
2434 | // the following to define a static mutex: |
2435 | // |
2436 | // GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex); |
2437 | // |
2438 | // You can forward declare a static mutex like this: |
2439 | // |
2440 | // GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex); |
2441 | // |
2442 | // To create a dynamic mutex, just define an object of type Mutex. |
2443 | class MutexBase { |
2444 | public: |
2445 | // Acquires this mutex. |
2446 | void Lock() { |
2447 | GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_)); |
2448 | owner_ = pthread_self(); |
2449 | has_owner_ = true; |
2450 | } |
2451 | |
2452 | // Releases this mutex. |
2453 | void Unlock() { |
2454 | // Since the lock is being released the owner_ field should no longer be |
2455 | // considered valid. We don't protect writing to has_owner_ here, as it's |
2456 | // the caller's responsibility to ensure that the current thread holds the |
2457 | // mutex when this is called. |
2458 | has_owner_ = false; |
2459 | GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_)); |
2460 | } |
2461 | |
2462 | // Does nothing if the current thread holds the mutex. Otherwise, crashes |
2463 | // with high probability. |
2464 | void AssertHeld() const { |
2465 | GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self())) |
2466 | << "The current thread is not holding the mutex @" << this; |
2467 | } |
2468 | |
2469 | // A static mutex may be used before main() is entered. It may even |
2470 | // be used before the dynamic initialization stage. Therefore we |
2471 | // must be able to initialize a static mutex object at link time. |
2472 | // This means MutexBase has to be a POD and its member variables |
2473 | // have to be public. |
2474 | public: |
2475 | pthread_mutex_t mutex_; // The underlying pthread mutex. |
2476 | // has_owner_ indicates whether the owner_ field below contains a valid thread |
2477 | // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All |
2478 | // accesses to the owner_ field should be protected by a check of this field. |
2479 | // An alternative might be to memset() owner_ to all zeros, but there's no |
2480 | // guarantee that a zero'd pthread_t is necessarily invalid or even different |
2481 | // from pthread_self(). |
2482 | bool has_owner_; |
2483 | pthread_t owner_; // The thread holding the mutex. |
2484 | }; |
2485 | |
2486 | // Forward-declares a static mutex. |
2487 | # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ |
2488 | extern ::testing::internal::MutexBase mutex |
2489 | |
2490 | // Defines and statically (i.e. at link time) initializes a static mutex. |
2491 | // The initialization list here does not explicitly initialize each field, |
2492 | // instead relying on default initialization for the unspecified fields. In |
2493 | // particular, the owner_ field (a pthread_t) is not explicitly initialized. |
2494 | // This allows initialization to work whether pthread_t is a scalar or struct. |
2495 | // The flag -Wmissing-field-initializers must not be specified for this to work. |
2496 | # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \ |
2497 | ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false } |
2498 | |
2499 | // The Mutex class can only be used for mutexes created at runtime. It |
2500 | // shares its API with MutexBase otherwise. |
2501 | class Mutex : public MutexBase { |
2502 | public: |
2503 | Mutex() { |
2504 | GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL)); |
2505 | has_owner_ = false; |
2506 | } |
2507 | ~Mutex() { |
2508 | GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_)); |
2509 | } |
2510 | |
2511 | private: |
2512 | GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex); |
2513 | }; |
2514 | |
2515 | // We cannot name this class MutexLock as the ctor declaration would |
2516 | // conflict with a macro named MutexLock, which is defined on some |
2517 | // platforms. Hence the typedef trick below. |
2518 | class GTestMutexLock { |
2519 | public: |
2520 | explicit GTestMutexLock(MutexBase* mutex) |
2521 | : mutex_(mutex) { mutex_->Lock(); } |
2522 | |
2523 | ~GTestMutexLock() { mutex_->Unlock(); } |
2524 | |
2525 | private: |
2526 | MutexBase* const mutex_; |
2527 | |
2528 | GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock); |
2529 | }; |
2530 | |
2531 | typedef GTestMutexLock MutexLock; |
2532 | |
2533 | // Helpers for ThreadLocal. |
2534 | |
2535 | // pthread_key_create() requires DeleteThreadLocalValue() to have |
2536 | // C-linkage. Therefore it cannot be templatized to access |
2537 | // ThreadLocal<T>. Hence the need for class |
2538 | // ThreadLocalValueHolderBase. |
2539 | class ThreadLocalValueHolderBase { |
2540 | public: |
2541 | virtual ~ThreadLocalValueHolderBase() {} |
2542 | }; |
2543 | |
2544 | // Called by pthread to delete thread-local data stored by |
2545 | // pthread_setspecific(). |
2546 | extern "C" inline void DeleteThreadLocalValue(void* value_holder) { |
2547 | delete static_cast<ThreadLocalValueHolderBase*>(value_holder); |
2548 | } |
2549 | |
2550 | // Implements thread-local storage on pthreads-based systems. |
2551 | // |
2552 | // // Thread 1 |
2553 | // ThreadLocal<int> tl(100); // 100 is the default value for each thread. |
2554 | // |
2555 | // // Thread 2 |
2556 | // tl.set(150); // Changes the value for thread 2 only. |
2557 | // EXPECT_EQ(150, tl.get()); |
2558 | // |
2559 | // // Thread 1 |
2560 | // EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value. |
2561 | // tl.set(200); |
2562 | // EXPECT_EQ(200, tl.get()); |
2563 | // |
2564 | // The template type argument T must have a public copy constructor. |
2565 | // In addition, the default ThreadLocal constructor requires T to have |
2566 | // a public default constructor. |
2567 | // |
2568 | // An object managed for a thread by a ThreadLocal instance is deleted |
2569 | // when the thread exits. Or, if the ThreadLocal instance dies in |
2570 | // that thread, when the ThreadLocal dies. It's the user's |
2571 | // responsibility to ensure that all other threads using a ThreadLocal |
2572 | // have exited when it dies, or the per-thread objects for those |
2573 | // threads will not be deleted. |
2574 | // |
2575 | // Google Test only uses global ThreadLocal objects. That means they |
2576 | // will die after main() has returned. Therefore, no per-thread |
2577 | // object managed by Google Test will be leaked as long as all threads |
2578 | // using Google Test have exited when main() returns. |
2579 | template <typename T> |
2580 | class ThreadLocal { |
2581 | public: |
2582 | ThreadLocal() : key_(CreateKey()), |
2583 | default_() {} |
2584 | explicit ThreadLocal(const T& value) : key_(CreateKey()), |
2585 | default_(value) {} |
2586 | |
2587 | ~ThreadLocal() { |
2588 | // Destroys the managed object for the current thread, if any. |
2589 | DeleteThreadLocalValue(pthread_getspecific(key_)); |
2590 | |
2591 | // Releases resources associated with the key. This will *not* |
2592 | // delete managed objects for other threads. |
2593 | GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_)); |
2594 | } |
2595 | |
2596 | T* pointer() { return GetOrCreateValue(); } |
2597 | const T* pointer() const { return GetOrCreateValue(); } |
2598 | const T& get() const { return *pointer(); } |
2599 | void set(const T& value) { *pointer() = value; } |
2600 | |
2601 | private: |
2602 | // Holds a value of type T. |
2603 | class ValueHolder : public ThreadLocalValueHolderBase { |
2604 | public: |
2605 | explicit ValueHolder(const T& value) : value_(value) {} |
2606 | |
2607 | T* pointer() { return &value_; } |
2608 | |
2609 | private: |
2610 | T value_; |
2611 | GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder); |
2612 | }; |
2613 | |
2614 | static pthread_key_t CreateKey() { |
2615 | pthread_key_t key; |
2616 | // When a thread exits, DeleteThreadLocalValue() will be called on |
2617 | // the object managed for that thread. |
2618 | GTEST_CHECK_POSIX_SUCCESS_( |
2619 | pthread_key_create(&key, &DeleteThreadLocalValue)); |
2620 | return key; |
2621 | } |
2622 | |
2623 | T* GetOrCreateValue() const { |
2624 | ThreadLocalValueHolderBase* const holder = |
2625 | static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_)); |
2626 | if (holder != NULL) { |
2627 | return CheckedDowncastToActualType<ValueHolder>(holder)->pointer(); |
2628 | } |
2629 | |
2630 | ValueHolder* const new_holder = new ValueHolder(default_); |
2631 | ThreadLocalValueHolderBase* const holder_base = new_holder; |
2632 | GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base)); |
2633 | return new_holder->pointer(); |
2634 | } |
2635 | |
2636 | // A key pthreads uses for looking up per-thread values. |
2637 | const pthread_key_t key_; |
2638 | const T default_; // The default value for each thread. |
2639 | |
2640 | GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal); |
2641 | }; |
2642 | |
2643 | # define GTEST_IS_THREADSAFE 1 |
2644 | |
2645 | #else // GTEST_HAS_PTHREAD |
2646 | |
2647 | // A dummy implementation of synchronization primitives (mutex, lock, |
2648 | // and thread-local variable). Necessary for compiling Google Test where |
2649 | // mutex is not supported - using Google Test in multiple threads is not |
2650 | // supported on such platforms. |
2651 | |
2652 | class Mutex { |
2653 | public: |
2654 | Mutex() {} |
2655 | void Lock() {} |
2656 | void Unlock() {} |
2657 | void AssertHeld() const {} |
2658 | }; |
2659 | |
2660 | # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ |
2661 | extern ::testing::internal::Mutex mutex |
2662 | |
2663 | # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex |
2664 | |
2665 | class GTestMutexLock { |
2666 | public: |
2667 | explicit GTestMutexLock(Mutex*) {} // NOLINT |
2668 | }; |
2669 | |
2670 | typedef GTestMutexLock MutexLock; |
2671 | |
2672 | template <typename T> |
2673 | class ThreadLocal { |
2674 | public: |
2675 | ThreadLocal() : value_() {} |
2676 | explicit ThreadLocal(const T& value) : value_(value) {} |
2677 | T* pointer() { return &value_; } |
2678 | const T* pointer() const { return &value_; } |
2679 | const T& get() const { return value_; } |
2680 | void set(const T& value) { value_ = value; } |
2681 | private: |
2682 | T value_; |
2683 | }; |
2684 | |
2685 | // The above synchronization primitives have dummy implementations. |
2686 | // Therefore Google Test is not thread-safe. |
2687 | # define GTEST_IS_THREADSAFE 0 |
2688 | |
2689 | #endif // GTEST_HAS_PTHREAD |
2690 | |
2691 | // Returns the number of threads running in the process, or 0 to indicate that |
2692 | // we cannot detect it. |
2693 | GTEST_API_ size_t GetThreadCount(); |
2694 | |
2695 | // Passing non-POD classes through ellipsis (...) crashes the ARM |
2696 | // compiler and generates a warning in Sun Studio. The Nokia Symbian |
2697 | // and the IBM XL C/C++ compiler try to instantiate a copy constructor |
2698 | // for objects passed through ellipsis (...), failing for uncopyable |
2699 | // objects. We define this to ensure that only POD is passed through |
2700 | // ellipsis on these systems. |
2701 | #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC) |
2702 | // We lose support for NULL detection where the compiler doesn't like |
2703 | // passing non-POD classes through ellipsis (...). |
2704 | # define GTEST_ELLIPSIS_NEEDS_POD_ 1 |
2705 | #else |
2706 | # define GTEST_CAN_COMPARE_NULL 1 |
2707 | #endif |
2708 | |
2709 | // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between |
2710 | // const T& and const T* in a function template. These compilers |
2711 | // _can_ decide between class template specializations for T and T*, |
2712 | // so a tr1::type_traits-like is_pointer works. |
2713 | #if defined(__SYMBIAN32__) || defined(__IBMCPP__) |
2714 | # define GTEST_NEEDS_IS_POINTER_ 1 |
2715 | #endif |
2716 | |
2717 | template <bool bool_value> |
2718 | struct bool_constant { |
2719 | typedef bool_constant<bool_value> type; |
2720 | static const bool value = bool_value; |
2721 | }; |
2722 | template <bool bool_value> const bool bool_constant<bool_value>::value; |
2723 | |
2724 | typedef bool_constant<false> false_type; |
2725 | typedef bool_constant<true> true_type; |
2726 | |
2727 | template <typename T> |
2728 | struct is_pointer : public false_type {}; |
2729 | |
2730 | template <typename T> |
2731 | struct is_pointer<T*> : public true_type {}; |
2732 | |
2733 | template <typename Iterator> |
2734 | struct IteratorTraits { |
2735 | typedef typename Iterator::value_type value_type; |
2736 | }; |
2737 | |
2738 | template <typename T> |
2739 | struct IteratorTraits<T*> { |
2740 | typedef T value_type; |
2741 | }; |
2742 | |
2743 | template <typename T> |
2744 | struct IteratorTraits<const T*> { |
2745 | typedef T value_type; |
2746 | }; |
2747 | |
2748 | #if GTEST_OS_WINDOWS |
2749 | # define GTEST_PATH_SEP_ "\\" |
2750 | # define GTEST_HAS_ALT_PATH_SEP_ 1 |
2751 | // The biggest signed integer type the compiler supports. |
2752 | typedef __int64 BiggestInt; |
2753 | #else |
2754 | # define GTEST_PATH_SEP_ "/" |
2755 | # define GTEST_HAS_ALT_PATH_SEP_ 0 |
2756 | typedef long long BiggestInt; // NOLINT |
2757 | #endif // GTEST_OS_WINDOWS |
2758 | |
2759 | // Utilities for char. |
2760 | |
2761 | // isspace(int ch) and friends accept an unsigned char or EOF. char |
2762 | // may be signed, depending on the compiler (or compiler flags). |
2763 | // Therefore we need to cast a char to unsigned char before calling |
2764 | // isspace(), etc. |
2765 | |
2766 | inline bool IsAlpha(char ch) { |
2767 | return isalpha(static_cast<unsigned char>(ch)) != 0; |
2768 | } |
2769 | inline bool IsAlNum(char ch) { |
2770 | return isalnum(static_cast<unsigned char>(ch)) != 0; |
2771 | } |
2772 | inline bool IsDigit(char ch) { |
2773 | return isdigit(static_cast<unsigned char>(ch)) != 0; |
2774 | } |
2775 | inline bool IsLower(char ch) { |
2776 | return islower(static_cast<unsigned char>(ch)) != 0; |
2777 | } |
2778 | inline bool IsSpace(char ch) { |
2779 | return isspace(static_cast<unsigned char>(ch)) != 0; |
2780 | } |
2781 | inline bool IsUpper(char ch) { |
2782 | return isupper(static_cast<unsigned char>(ch)) != 0; |
2783 | } |
2784 | inline bool IsXDigit(char ch) { |
2785 | return isxdigit(static_cast<unsigned char>(ch)) != 0; |
2786 | } |
2787 | inline bool IsXDigit(wchar_t ch) { |
2788 | const unsigned char low_byte = static_cast<unsigned char>(ch); |
2789 | return ch == low_byte && isxdigit(low_byte) != 0; |
2790 | } |
2791 | |
2792 | inline char ToLower(char ch) { |
2793 | return static_cast<char>(tolower(static_cast<unsigned char>(ch))); |
2794 | } |
2795 | inline char ToUpper(char ch) { |
2796 | return static_cast<char>(toupper(static_cast<unsigned char>(ch))); |
2797 | } |
2798 | |
2799 | // The testing::internal::posix namespace holds wrappers for common |
2800 | // POSIX functions. These wrappers hide the differences between |
2801 | // Windows/MSVC and POSIX systems. Since some compilers define these |
2802 | // standard functions as macros, the wrapper cannot have the same name |
2803 | // as the wrapped function. |
2804 | |
2805 | namespace posix { |
2806 | |
2807 | // Functions with a different name on Windows. |
2808 | |
2809 | #if GTEST_OS_WINDOWS |
2810 | |
2811 | typedef struct _stat StatStruct; |
2812 | |
2813 | # ifdef __BORLANDC__ |
2814 | inline int IsATTY(int fd) { return isatty(fd); } |
2815 | inline int StrCaseCmp(const char* s1, const char* s2) { |
2816 | return stricmp(s1, s2); |
2817 | } |
2818 | inline char* StrDup(const char* src) { return strdup(src); } |
2819 | # else // !__BORLANDC__ |
2820 | # if GTEST_OS_WINDOWS_MOBILE |
2821 | inline int IsATTY(int /* fd */) { return 0; } |
2822 | # else |
2823 | inline int IsATTY(int fd) { return _isatty(fd); } |
2824 | # endif // GTEST_OS_WINDOWS_MOBILE |
2825 | inline int StrCaseCmp(const char* s1, const char* s2) { |
2826 | return _stricmp(s1, s2); |
2827 | } |
2828 | inline char* StrDup(const char* src) { return _strdup(src); } |
2829 | # endif // __BORLANDC__ |
2830 | |
2831 | # if GTEST_OS_WINDOWS_MOBILE |
2832 | inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); } |
2833 | // Stat(), RmDir(), and IsDir() are not needed on Windows CE at this |
2834 | // time and thus not defined there. |
2835 | # else |
2836 | inline int FileNo(FILE* file) { return _fileno(file); } |
2837 | inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); } |
2838 | inline int RmDir(const char* dir) { return _rmdir(dir); } |
2839 | inline bool IsDir(const StatStruct& st) { |
2840 | return (_S_IFDIR & st.st_mode) != 0; |
2841 | } |
2842 | # endif // GTEST_OS_WINDOWS_MOBILE |
2843 | |
2844 | #else |
2845 | |
2846 | typedef struct stat StatStruct; |
2847 | |
2848 | inline int FileNo(FILE* file) { return fileno(file); } |
2849 | inline int IsATTY(int fd) { return isatty(fd); } |
2850 | inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); } |
2851 | inline int StrCaseCmp(const char* s1, const char* s2) { |
2852 | return strcasecmp(s1, s2); |
2853 | } |
2854 | inline char* StrDup(const char* src) { return strdup(src); } |
2855 | inline int RmDir(const char* dir) { return rmdir(dir); } |
2856 | inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); } |
2857 | |
2858 | #endif // GTEST_OS_WINDOWS |
2859 | |
2860 | // Functions deprecated by MSVC 8.0. |
2861 | |
2862 | #ifdef _MSC_VER |
2863 | // Temporarily disable warning 4996 (deprecated function). |
2864 | # pragma warning(push) |
2865 | # pragma warning(disable:4996) |
2866 | #endif |
2867 | |
2868 | inline const char* StrNCpy(char* dest, const char* src, size_t n) { |
2869 | return strncpy(dest, src, n); |
2870 | } |
2871 | |
2872 | // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and |
2873 | // StrError() aren't needed on Windows CE at this time and thus not |
2874 | // defined there. |
2875 | |
2876 | #if !GTEST_OS_WINDOWS_MOBILE |
2877 | inline int ChDir(const char* dir) { return chdir(dir); } |
2878 | #endif |
2879 | inline FILE* FOpen(const char* path, const char* mode) { |
2880 | return fopen(path, mode); |
2881 | } |
2882 | #if !GTEST_OS_WINDOWS_MOBILE |
2883 | inline FILE *FReopen(const char* path, const char* mode, FILE* stream) { |
2884 | return freopen(path, mode, stream); |
2885 | } |
2886 | inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); } |
2887 | #endif |
2888 | inline int FClose(FILE* fp) { return fclose(fp); } |
2889 | #if !GTEST_OS_WINDOWS_MOBILE |
2890 | inline int Read(int fd, void* buf, unsigned int count) { |
2891 | return static_cast<int>(read(fd, buf, count)); |
2892 | } |
2893 | inline int Write(int fd, const void* buf, unsigned int count) { |
2894 | return static_cast<int>(write(fd, buf, count)); |
2895 | } |
2896 | inline int Close(int fd) { return close(fd); } |
2897 | inline const char* StrError(int errnum) { return strerror(errnum); } |
2898 | #endif |
2899 | inline const char* GetEnv(const char* name) { |
2900 | #if GTEST_OS_WINDOWS_MOBILE |
2901 | // We are on Windows CE, which has no environment variables. |
2902 | return NULL; |
2903 | #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9) |
2904 | // Environment variables which we programmatically clear will be set to the |
2905 | // empty string rather than unset (NULL). Handle that case. |
2906 | const char* const env = getenv(name); |
2907 | return (env != NULL && env[0] != '\0') ? env : NULL; |
2908 | #else |
2909 | return getenv(name); |
2910 | #endif |
2911 | } |
2912 | |
2913 | #ifdef _MSC_VER |
2914 | # pragma warning(pop) // Restores the warning state. |
2915 | #endif |
2916 | |
2917 | #if GTEST_OS_WINDOWS_MOBILE |
2918 | // Windows CE has no C library. The abort() function is used in |
2919 | // several places in Google Test. This implementation provides a reasonable |
2920 | // imitation of standard behaviour. |
2921 | void Abort(); |
2922 | #else |
2923 | inline void Abort() { abort(); } |
2924 | #endif // GTEST_OS_WINDOWS_MOBILE |
2925 | |
2926 | } // namespace posix |
2927 | |
2928 | // MSVC "deprecates" snprintf and issues warnings wherever it is used. In |
2929 | // order to avoid these warnings, we need to use _snprintf or _snprintf_s on |
2930 | // MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate |
2931 | // function in order to achieve that. We use macro definition here because |
2932 | // snprintf is a variadic function. |
2933 | #if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE |
2934 | // MSVC 2005 and above support variadic macros. |
2935 | # define GTEST_SNPRINTF_(buffer, size, format, ...) \ |
2936 | _snprintf_s(buffer, size, size, format, __VA_ARGS__) |
2937 | #elif defined(_MSC_VER) |
2938 | // Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't |
2939 | // complain about _snprintf. |
2940 | # define GTEST_SNPRINTF_ _snprintf |
2941 | #else |
2942 | # define GTEST_SNPRINTF_ snprintf |
2943 | #endif |
2944 | |
2945 | // The maximum number a BiggestInt can represent. This definition |
2946 | // works no matter BiggestInt is represented in one's complement or |
2947 | // two's complement. |
2948 | // |
2949 | // We cannot rely on numeric_limits in STL, as __int64 and long long |
2950 | // are not part of standard C++ and numeric_limits doesn't need to be |
2951 | // defined for them. |
2952 | const BiggestInt kMaxBiggestInt = |
2953 | ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1)); |
2954 | |
2955 | // This template class serves as a compile-time function from size to |
2956 | // type. It maps a size in bytes to a primitive type with that |
2957 | // size. e.g. |
2958 | // |
2959 | // TypeWithSize<4>::UInt |
2960 | // |
2961 | // is typedef-ed to be unsigned int (unsigned integer made up of 4 |
2962 | // bytes). |
2963 | // |
2964 | // Such functionality should belong to STL, but I cannot find it |
2965 | // there. |
2966 | // |
2967 | // Google Test uses this class in the implementation of floating-point |
2968 | // comparison. |
2969 | // |
2970 | // For now it only handles UInt (unsigned int) as that's all Google Test |
2971 | // needs. Other types can be easily added in the future if need |
2972 | // arises. |
2973 | template <size_t size> |
2974 | class TypeWithSize { |
2975 | public: |
2976 | // This prevents the user from using TypeWithSize<N> with incorrect |
2977 | // values of N. |
2978 | typedef void UInt; |
2979 | }; |
2980 | |
2981 | // The specialization for size 4. |
2982 | template <> |
2983 | class TypeWithSize<4> { |
2984 | public: |
2985 | // unsigned int has size 4 in both gcc and MSVC. |
2986 | // |
2987 | // As base/basictypes.h doesn't compile on Windows, we cannot use |
2988 | // uint32, uint64, and etc here. |
2989 | typedef int Int; |
2990 | typedef unsigned int UInt; |
2991 | }; |
2992 | |
2993 | // The specialization for size 8. |
2994 | template <> |
2995 | class TypeWithSize<8> { |
2996 | public: |
2997 | #if GTEST_OS_WINDOWS |
2998 | typedef __int64 Int; |
2999 | typedef unsigned __int64 UInt; |
3000 | #else |
3001 | typedef long long Int; // NOLINT |
3002 | typedef unsigned long long UInt; // NOLINT |
3003 | #endif // GTEST_OS_WINDOWS |
3004 | }; |
3005 | |
3006 | // Integer types of known sizes. |
3007 | typedef TypeWithSize<4>::Int Int32; |
3008 | typedef TypeWithSize<4>::UInt UInt32; |
3009 | typedef TypeWithSize<8>::Int Int64; |
3010 | typedef TypeWithSize<8>::UInt UInt64; |
3011 | typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds. |
3012 | |
3013 | // Utilities for command line flags and environment variables. |
3014 | |
3015 | // Macro for referencing flags. |
3016 | #define GTEST_FLAG(name) FLAGS_gtest_##name |
3017 | |
3018 | // Macros for declaring flags. |
3019 | #define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name) |
3020 | #define GTEST_DECLARE_int32_(name) \ |
3021 | GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name) |
3022 | #define GTEST_DECLARE_string_(name) \ |
3023 | GTEST_API_ extern ::std::string GTEST_FLAG(name) |
3024 | |
3025 | // Macros for defining flags. |
3026 | #define GTEST_DEFINE_bool_(name, default_val, doc) \ |
3027 | GTEST_API_ bool GTEST_FLAG(name) = (default_val) |
3028 | #define GTEST_DEFINE_int32_(name, default_val, doc) \ |
3029 | GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val) |
3030 | #define GTEST_DEFINE_string_(name, default_val, doc) \ |
3031 | GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val) |
3032 | |
3033 | // Thread annotations |
3034 | #define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks) |
3035 | #define GTEST_LOCK_EXCLUDED_(locks) |
3036 | |
3037 | // Parses 'str' for a 32-bit signed integer. If successful, writes the result |
3038 | // to *value and returns true; otherwise leaves *value unchanged and returns |
3039 | // false. |
3040 | // TODO(chandlerc): Find a better way to refactor flag and environment parsing |
3041 | // out of both gtest-port.cc and gtest.cc to avoid exporting this utility |
3042 | // function. |
3043 | bool ParseInt32(const Message& src_text, const char* str, Int32* value); |
3044 | |
3045 | // Parses a bool/Int32/string from the environment variable |
3046 | // corresponding to the given Google Test flag. |
3047 | bool BoolFromGTestEnv(const char* flag, bool default_val); |
3048 | GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val); |
3049 | const char* StringFromGTestEnv(const char* flag, const char* default_val); |
3050 | |
3051 | } // namespace internal |
3052 | } // namespace testing |
3053 | |
3054 | #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ |
3055 | |
3056 | #if GTEST_OS_LINUX |
3057 | # include <stdlib.h> |
3058 | # include <sys/types.h> |
3059 | # include <sys/wait.h> |
3060 | # include <unistd.h> |
3061 | #endif // GTEST_OS_LINUX |
3062 | |
3063 | #if GTEST_HAS_EXCEPTIONS |
3064 | # include <stdexcept> |
3065 | #endif |
3066 | |
3067 | #include <ctype.h> |
3068 | #include <float.h> |
3069 | #include <string.h> |
3070 | #include <iomanip> |
3071 | #include <limits> |
3072 | #include <set> |
3073 | |
3074 | // Copyright 2005, Google Inc. |
3075 | // All rights reserved. |
3076 | // |
3077 | // Redistribution and use in source and binary forms, with or without |
3078 | // modification, are permitted provided that the following conditions are |
3079 | // met: |
3080 | // |
3081 | // * Redistributions of source code must retain the above copyright |
3082 | // notice, this list of conditions and the following disclaimer. |
3083 | // * Redistributions in binary form must reproduce the above |
3084 | // copyright notice, this list of conditions and the following disclaimer |
3085 | // in the documentation and/or other materials provided with the |
3086 | // distribution. |
3087 | // * Neither the name of Google Inc. nor the names of its |
3088 | // contributors may be used to endorse or promote products derived from |
3089 | // this software without specific prior written permission. |
3090 | // |
3091 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
3092 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
3093 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
3094 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
3095 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
3096 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
3097 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
3098 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
3099 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
3100 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
3101 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
3102 | // |
3103 | // Author: wan@google.com (Zhanyong Wan) |
3104 | // |
3105 | // The Google C++ Testing Framework (Google Test) |
3106 | // |
3107 | // This header file defines the Message class. |
3108 | // |
3109 | // IMPORTANT NOTE: Due to limitation of the C++ language, we have to |
3110 | // leave some internal implementation details in this header file. |
3111 | // They are clearly marked by comments like this: |
3112 | // |
3113 | // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
3114 | // |
3115 | // Such code is NOT meant to be used by a user directly, and is subject |
3116 | // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user |
3117 | // program! |
3118 | |
3119 | #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ |
3120 | #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ |
3121 | |
3122 | #include <limits> |
3123 | |
3124 | |
3125 | // Ensures that there is at least one operator<< in the global namespace. |
3126 | // See Message& operator<<(...) below for why. |
3127 | void operator<<(const testing::internal::Secret&, int); |
3128 | |
3129 | namespace testing { |
3130 | |
3131 | // The Message class works like an ostream repeater. |
3132 | // |
3133 | // Typical usage: |
3134 | // |
3135 | // 1. You stream a bunch of values to a Message object. |
3136 | // It will remember the text in a stringstream. |
3137 | // 2. Then you stream the Message object to an ostream. |
3138 | // This causes the text in the Message to be streamed |
3139 | // to the ostream. |
3140 | // |
3141 | // For example; |
3142 | // |
3143 | // testing::Message foo; |
3144 | // foo << 1 << " != " << 2; |
3145 | // std::cout << foo; |
3146 | // |
3147 | // will print "1 != 2". |
3148 | // |
3149 | // Message is not intended to be inherited from. In particular, its |
3150 | // destructor is not virtual. |
3151 | // |
3152 | // Note that stringstream behaves differently in gcc and in MSVC. You |
3153 | // can stream a NULL char pointer to it in the former, but not in the |
3154 | // latter (it causes an access violation if you do). The Message |
3155 | // class hides this difference by treating a NULL char pointer as |
3156 | // "(null)". |
3157 | class GTEST_API_ Message { |
3158 | private: |
3159 | // The type of basic IO manipulators (endl, ends, and flush) for |
3160 | // narrow streams. |
3161 | typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&); |
3162 | |
3163 | public: |
3164 | // Constructs an empty Message. |
3165 | Message(); |
3166 | |
3167 | // Copy constructor. |
3168 | Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT |
3169 | *ss_ << msg.GetString(); |
3170 | } |
3171 | |
3172 | // Constructs a Message from a C-string. |
3173 | explicit Message(const char* str) : ss_(new ::std::stringstream) { |
3174 | *ss_ << str; |
3175 | } |
3176 | |
3177 | #if GTEST_OS_SYMBIAN |
3178 | // Streams a value (either a pointer or not) to this object. |
3179 | template <typename T> |
3180 | inline Message& operator <<(const T& value) { |
3181 | StreamHelper(typename internal::is_pointer<T>::type(), value); |
3182 | return *this; |
3183 | } |
3184 | #else |
3185 | // Streams a non-pointer value to this object. |
3186 | template <typename T> |
3187 | inline Message& operator <<(const T& val) { |
3188 | // Some libraries overload << for STL containers. These |
3189 | // overloads are defined in the global namespace instead of ::std. |
3190 | // |
3191 | // C++'s symbol lookup rule (i.e. Koenig lookup) says that these |
3192 | // overloads are visible in either the std namespace or the global |
3193 | // namespace, but not other namespaces, including the testing |
3194 | // namespace which Google Test's Message class is in. |
3195 | // |
3196 | // To allow STL containers (and other types that has a << operator |
3197 | // defined in the global namespace) to be used in Google Test |
3198 | // assertions, testing::Message must access the custom << operator |
3199 | // from the global namespace. With this using declaration, |
3200 | // overloads of << defined in the global namespace and those |
3201 | // visible via Koenig lookup are both exposed in this function. |
3202 | using ::operator <<; |
3203 | *ss_ << val; |
3204 | return *this; |
3205 | } |
3206 | |
3207 | // Streams a pointer value to this object. |
3208 | // |
3209 | // This function is an overload of the previous one. When you |
3210 | // stream a pointer to a Message, this definition will be used as it |
3211 | // is more specialized. (The C++ Standard, section |
3212 | // [temp.func.order].) If you stream a non-pointer, then the |
3213 | // previous definition will be used. |
3214 | // |
3215 | // The reason for this overload is that streaming a NULL pointer to |
3216 | // ostream is undefined behavior. Depending on the compiler, you |
3217 | // may get "0", "(nil)", "(null)", or an access violation. To |
3218 | // ensure consistent result across compilers, we always treat NULL |
3219 | // as "(null)". |
3220 | template <typename T> |
3221 | inline Message& operator <<(T* const& pointer) { // NOLINT |
3222 | if (pointer == NULL) { |
3223 | *ss_ << "(null)" ; |
3224 | } else { |
3225 | *ss_ << pointer; |
3226 | } |
3227 | return *this; |
3228 | } |
3229 | #endif // GTEST_OS_SYMBIAN |
3230 | |
3231 | // Since the basic IO manipulators are overloaded for both narrow |
3232 | // and wide streams, we have to provide this specialized definition |
3233 | // of operator <<, even though its body is the same as the |
3234 | // templatized version above. Without this definition, streaming |
3235 | // endl or other basic IO manipulators to Message will confuse the |
3236 | // compiler. |
3237 | Message& operator <<(BasicNarrowIoManip val) { |
3238 | *ss_ << val; |
3239 | return *this; |
3240 | } |
3241 | |
3242 | // Instead of 1/0, we want to see true/false for bool values. |
3243 | Message& operator <<(bool b) { |
3244 | return *this << (b ? "true" : "false" ); |
3245 | } |
3246 | |
3247 | // These two overloads allow streaming a wide C string to a Message |
3248 | // using the UTF-8 encoding. |
3249 | Message& operator <<(const wchar_t* wide_c_str); |
3250 | Message& operator <<(wchar_t* wide_c_str); |
3251 | |
3252 | #if GTEST_HAS_STD_WSTRING |
3253 | // Converts the given wide string to a narrow string using the UTF-8 |
3254 | // encoding, and streams the result to this Message object. |
3255 | Message& operator <<(const ::std::wstring& wstr); |
3256 | #endif // GTEST_HAS_STD_WSTRING |
3257 | |
3258 | #if GTEST_HAS_GLOBAL_WSTRING |
3259 | // Converts the given wide string to a narrow string using the UTF-8 |
3260 | // encoding, and streams the result to this Message object. |
3261 | Message& operator <<(const ::wstring& wstr); |
3262 | #endif // GTEST_HAS_GLOBAL_WSTRING |
3263 | |
3264 | // Gets the text streamed to this object so far as an std::string. |
3265 | // Each '\0' character in the buffer is replaced with "\\0". |
3266 | // |
3267 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
3268 | std::string GetString() const; |
3269 | |
3270 | private: |
3271 | |
3272 | #if GTEST_OS_SYMBIAN |
3273 | // These are needed as the Nokia Symbian Compiler cannot decide between |
3274 | // const T& and const T* in a function template. The Nokia compiler _can_ |
3275 | // decide between class template specializations for T and T*, so a |
3276 | // tr1::type_traits-like is_pointer works, and we can overload on that. |
3277 | template <typename T> |
3278 | inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) { |
3279 | if (pointer == NULL) { |
3280 | *ss_ << "(null)" ; |
3281 | } else { |
3282 | *ss_ << pointer; |
3283 | } |
3284 | } |
3285 | template <typename T> |
3286 | inline void StreamHelper(internal::false_type /*is_pointer*/, |
3287 | const T& value) { |
3288 | // See the comments in Message& operator <<(const T&) above for why |
3289 | // we need this using statement. |
3290 | using ::operator <<; |
3291 | *ss_ << value; |
3292 | } |
3293 | #endif // GTEST_OS_SYMBIAN |
3294 | |
3295 | // We'll hold the text streamed to this object here. |
3296 | const internal::scoped_ptr< ::std::stringstream> ss_; |
3297 | |
3298 | // We declare (but don't implement) this to prevent the compiler |
3299 | // from implementing the assignment operator. |
3300 | void operator=(const Message&); |
3301 | }; |
3302 | |
3303 | // Streams a Message to an ostream. |
3304 | inline std::ostream& operator <<(std::ostream& os, const Message& sb) { |
3305 | return os << sb.GetString(); |
3306 | } |
3307 | |
3308 | namespace internal { |
3309 | |
3310 | // Converts a streamable value to an std::string. A NULL pointer is |
3311 | // converted to "(null)". When the input value is a ::string, |
3312 | // ::std::string, ::wstring, or ::std::wstring object, each NUL |
3313 | // character in it is replaced with "\\0". |
3314 | template <typename T> |
3315 | std::string StreamableToString(const T& streamable) { |
3316 | return (Message() << streamable).GetString(); |
3317 | } |
3318 | |
3319 | } // namespace internal |
3320 | } // namespace testing |
3321 | |
3322 | #endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ |
3323 | // Copyright 2005, Google Inc. |
3324 | // All rights reserved. |
3325 | // |
3326 | // Redistribution and use in source and binary forms, with or without |
3327 | // modification, are permitted provided that the following conditions are |
3328 | // met: |
3329 | // |
3330 | // * Redistributions of source code must retain the above copyright |
3331 | // notice, this list of conditions and the following disclaimer. |
3332 | // * Redistributions in binary form must reproduce the above |
3333 | // copyright notice, this list of conditions and the following disclaimer |
3334 | // in the documentation and/or other materials provided with the |
3335 | // distribution. |
3336 | // * Neither the name of Google Inc. nor the names of its |
3337 | // contributors may be used to endorse or promote products derived from |
3338 | // this software without specific prior written permission. |
3339 | // |
3340 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
3341 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
3342 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
3343 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
3344 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
3345 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
3346 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
3347 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
3348 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
3349 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
3350 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
3351 | // |
3352 | // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) |
3353 | // |
3354 | // The Google C++ Testing Framework (Google Test) |
3355 | // |
3356 | // This header file declares the String class and functions used internally by |
3357 | // Google Test. They are subject to change without notice. They should not used |
3358 | // by code external to Google Test. |
3359 | // |
3360 | // This header file is #included by <gtest/internal/gtest-internal.h>. |
3361 | // It should not be #included by other files. |
3362 | |
3363 | #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ |
3364 | #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ |
3365 | |
3366 | #ifdef __BORLANDC__ |
3367 | // string.h is not guaranteed to provide strcpy on C++ Builder. |
3368 | # include <mem.h> |
3369 | #endif |
3370 | |
3371 | #include <string.h> |
3372 | #include <string> |
3373 | |
3374 | |
3375 | namespace testing { |
3376 | namespace internal { |
3377 | |
3378 | // String - an abstract class holding static string utilities. |
3379 | class GTEST_API_ String { |
3380 | public: |
3381 | // Static utility methods |
3382 | |
3383 | // Clones a 0-terminated C string, allocating memory using new. The |
3384 | // caller is responsible for deleting the return value using |
3385 | // delete[]. Returns the cloned string, or NULL if the input is |
3386 | // NULL. |
3387 | // |
3388 | // This is different from strdup() in string.h, which allocates |
3389 | // memory using malloc(). |
3390 | static const char* CloneCString(const char* c_str); |
3391 | |
3392 | #if GTEST_OS_WINDOWS_MOBILE |
3393 | // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be |
3394 | // able to pass strings to Win32 APIs on CE we need to convert them |
3395 | // to 'Unicode', UTF-16. |
3396 | |
3397 | // Creates a UTF-16 wide string from the given ANSI string, allocating |
3398 | // memory using new. The caller is responsible for deleting the return |
3399 | // value using delete[]. Returns the wide string, or NULL if the |
3400 | // input is NULL. |
3401 | // |
3402 | // The wide string is created using the ANSI codepage (CP_ACP) to |
3403 | // match the behaviour of the ANSI versions of Win32 calls and the |
3404 | // C runtime. |
3405 | static LPCWSTR AnsiToUtf16(const char* c_str); |
3406 | |
3407 | // Creates an ANSI string from the given wide string, allocating |
3408 | // memory using new. The caller is responsible for deleting the return |
3409 | // value using delete[]. Returns the ANSI string, or NULL if the |
3410 | // input is NULL. |
3411 | // |
3412 | // The returned string is created using the ANSI codepage (CP_ACP) to |
3413 | // match the behaviour of the ANSI versions of Win32 calls and the |
3414 | // C runtime. |
3415 | static const char* Utf16ToAnsi(LPCWSTR utf16_str); |
3416 | #endif |
3417 | |
3418 | // Compares two C strings. Returns true iff they have the same content. |
3419 | // |
3420 | // Unlike strcmp(), this function can handle NULL argument(s). A |
3421 | // NULL C string is considered different to any non-NULL C string, |
3422 | // including the empty string. |
3423 | static bool CStringEquals(const char* lhs, const char* rhs); |
3424 | |
3425 | // Converts a wide C string to a String using the UTF-8 encoding. |
3426 | // NULL will be converted to "(null)". If an error occurred during |
3427 | // the conversion, "(failed to convert from wide string)" is |
3428 | // returned. |
3429 | static std::string ShowWideCString(const wchar_t* wide_c_str); |
3430 | |
3431 | // Compares two wide C strings. Returns true iff they have the same |
3432 | // content. |
3433 | // |
3434 | // Unlike wcscmp(), this function can handle NULL argument(s). A |
3435 | // NULL C string is considered different to any non-NULL C string, |
3436 | // including the empty string. |
3437 | static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); |
3438 | |
3439 | // Compares two C strings, ignoring case. Returns true iff they |
3440 | // have the same content. |
3441 | // |
3442 | // Unlike strcasecmp(), this function can handle NULL argument(s). |
3443 | // A NULL C string is considered different to any non-NULL C string, |
3444 | // including the empty string. |
3445 | static bool CaseInsensitiveCStringEquals(const char* lhs, |
3446 | const char* rhs); |
3447 | |
3448 | // Compares two wide C strings, ignoring case. Returns true iff they |
3449 | // have the same content. |
3450 | // |
3451 | // Unlike wcscasecmp(), this function can handle NULL argument(s). |
3452 | // A NULL C string is considered different to any non-NULL wide C string, |
3453 | // including the empty string. |
3454 | // NB: The implementations on different platforms slightly differ. |
3455 | // On windows, this method uses _wcsicmp which compares according to LC_CTYPE |
3456 | // environment variable. On GNU platform this method uses wcscasecmp |
3457 | // which compares according to LC_CTYPE category of the current locale. |
3458 | // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the |
3459 | // current locale. |
3460 | static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, |
3461 | const wchar_t* rhs); |
3462 | |
3463 | // Returns true iff the given string ends with the given suffix, ignoring |
3464 | // case. Any string is considered to end with an empty suffix. |
3465 | static bool EndsWithCaseInsensitive( |
3466 | const std::string& str, const std::string& suffix); |
3467 | |
3468 | // Formats an int value as "%02d". |
3469 | static std::string FormatIntWidth2(int value); // "%02d" for width == 2 |
3470 | |
3471 | // Formats an int value as "%X". |
3472 | static std::string FormatHexInt(int value); |
3473 | |
3474 | // Formats a byte as "%02X". |
3475 | static std::string FormatByte(unsigned char value); |
3476 | |
3477 | private: |
3478 | String(); // Not meant to be instantiated. |
3479 | }; // class String |
3480 | |
3481 | // Gets the content of the stringstream's buffer as an std::string. Each '\0' |
3482 | // character in the buffer is replaced with "\\0". |
3483 | GTEST_API_ std::string StringStreamToString(::std::stringstream* stream); |
3484 | |
3485 | } // namespace internal |
3486 | } // namespace testing |
3487 | |
3488 | #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ |
3489 | // Copyright 2008, Google Inc. |
3490 | // All rights reserved. |
3491 | // |
3492 | // Redistribution and use in source and binary forms, with or without |
3493 | // modification, are permitted provided that the following conditions are |
3494 | // met: |
3495 | // |
3496 | // * Redistributions of source code must retain the above copyright |
3497 | // notice, this list of conditions and the following disclaimer. |
3498 | // * Redistributions in binary form must reproduce the above |
3499 | // copyright notice, this list of conditions and the following disclaimer |
3500 | // in the documentation and/or other materials provided with the |
3501 | // distribution. |
3502 | // * Neither the name of Google Inc. nor the names of its |
3503 | // contributors may be used to endorse or promote products derived from |
3504 | // this software without specific prior written permission. |
3505 | // |
3506 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
3507 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
3508 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
3509 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
3510 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
3511 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
3512 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
3513 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
3514 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
3515 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
3516 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
3517 | // |
3518 | // Author: keith.ray@gmail.com (Keith Ray) |
3519 | // |
3520 | // Google Test filepath utilities |
3521 | // |
3522 | // This header file declares classes and functions used internally by |
3523 | // Google Test. They are subject to change without notice. |
3524 | // |
3525 | // This file is #included in <gtest/internal/gtest-internal.h>. |
3526 | // Do not include this header file separately! |
3527 | |
3528 | #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ |
3529 | #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ |
3530 | |
3531 | |
3532 | namespace testing { |
3533 | namespace internal { |
3534 | |
3535 | // FilePath - a class for file and directory pathname manipulation which |
3536 | // handles platform-specific conventions (like the pathname separator). |
3537 | // Used for helper functions for naming files in a directory for xml output. |
3538 | // Except for Set methods, all methods are const or static, which provides an |
3539 | // "immutable value object" -- useful for peace of mind. |
3540 | // A FilePath with a value ending in a path separator ("like/this/") represents |
3541 | // a directory, otherwise it is assumed to represent a file. In either case, |
3542 | // it may or may not represent an actual file or directory in the file system. |
3543 | // Names are NOT checked for syntax correctness -- no checking for illegal |
3544 | // characters, malformed paths, etc. |
3545 | |
3546 | class GTEST_API_ FilePath { |
3547 | public: |
3548 | FilePath() : pathname_("" ) { } |
3549 | FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { } |
3550 | |
3551 | explicit FilePath(const std::string& pathname) : pathname_(pathname) { |
3552 | Normalize(); |
3553 | } |
3554 | |
3555 | FilePath& operator=(const FilePath& rhs) { |
3556 | Set(rhs); |
3557 | return *this; |
3558 | } |
3559 | |
3560 | void Set(const FilePath& rhs) { |
3561 | pathname_ = rhs.pathname_; |
3562 | } |
3563 | |
3564 | const std::string& string() const { return pathname_; } |
3565 | const char* c_str() const { return pathname_.c_str(); } |
3566 | |
3567 | // Returns the current working directory, or "" if unsuccessful. |
3568 | static FilePath GetCurrentDir(); |
3569 | |
3570 | // Given directory = "dir", base_name = "test", number = 0, |
3571 | // extension = "xml", returns "dir/test.xml". If number is greater |
3572 | // than zero (e.g., 12), returns "dir/test_12.xml". |
3573 | // On Windows platform, uses \ as the separator rather than /. |
3574 | static FilePath MakeFileName(const FilePath& directory, |
3575 | const FilePath& base_name, |
3576 | int number, |
3577 | const char* extension); |
3578 | |
3579 | // Given directory = "dir", relative_path = "test.xml", |
3580 | // returns "dir/test.xml". |
3581 | // On Windows, uses \ as the separator rather than /. |
3582 | static FilePath ConcatPaths(const FilePath& directory, |
3583 | const FilePath& relative_path); |
3584 | |
3585 | // Returns a pathname for a file that does not currently exist. The pathname |
3586 | // will be directory/base_name.extension or |
3587 | // directory/base_name_<number>.extension if directory/base_name.extension |
3588 | // already exists. The number will be incremented until a pathname is found |
3589 | // that does not already exist. |
3590 | // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. |
3591 | // There could be a race condition if two or more processes are calling this |
3592 | // function at the same time -- they could both pick the same filename. |
3593 | static FilePath GenerateUniqueFileName(const FilePath& directory, |
3594 | const FilePath& base_name, |
3595 | const char* extension); |
3596 | |
3597 | // Returns true iff the path is "". |
3598 | bool IsEmpty() const { return pathname_.empty(); } |
3599 | |
3600 | // If input name has a trailing separator character, removes it and returns |
3601 | // the name, otherwise return the name string unmodified. |
3602 | // On Windows platform, uses \ as the separator, other platforms use /. |
3603 | FilePath RemoveTrailingPathSeparator() const; |
3604 | |
3605 | // Returns a copy of the FilePath with the directory part removed. |
3606 | // Example: FilePath("path/to/file").RemoveDirectoryName() returns |
3607 | // FilePath("file"). If there is no directory part ("just_a_file"), it returns |
3608 | // the FilePath unmodified. If there is no file part ("just_a_dir/") it |
3609 | // returns an empty FilePath (""). |
3610 | // On Windows platform, '\' is the path separator, otherwise it is '/'. |
3611 | FilePath RemoveDirectoryName() const; |
3612 | |
3613 | // RemoveFileName returns the directory path with the filename removed. |
3614 | // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/". |
3615 | // If the FilePath is "a_file" or "/a_file", RemoveFileName returns |
3616 | // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does |
3617 | // not have a file, like "just/a/dir/", it returns the FilePath unmodified. |
3618 | // On Windows platform, '\' is the path separator, otherwise it is '/'. |
3619 | FilePath RemoveFileName() const; |
3620 | |
3621 | // Returns a copy of the FilePath with the case-insensitive extension removed. |
3622 | // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns |
3623 | // FilePath("dir/file"). If a case-insensitive extension is not |
3624 | // found, returns a copy of the original FilePath. |
3625 | FilePath RemoveExtension(const char* extension) const; |
3626 | |
3627 | // Creates directories so that path exists. Returns true if successful or if |
3628 | // the directories already exist; returns false if unable to create |
3629 | // directories for any reason. Will also return false if the FilePath does |
3630 | // not represent a directory (that is, it doesn't end with a path separator). |
3631 | bool CreateDirectoriesRecursively() const; |
3632 | |
3633 | // Create the directory so that path exists. Returns true if successful or |
3634 | // if the directory already exists; returns false if unable to create the |
3635 | // directory for any reason, including if the parent directory does not |
3636 | // exist. Not named "CreateDirectory" because that's a macro on Windows. |
3637 | bool CreateFolder() const; |
3638 | |
3639 | // Returns true if FilePath describes something in the file-system, |
3640 | // either a file, directory, or whatever, and that something exists. |
3641 | bool FileOrDirectoryExists() const; |
3642 | |
3643 | // Returns true if pathname describes a directory in the file-system |
3644 | // that exists. |
3645 | bool DirectoryExists() const; |
3646 | |
3647 | // Returns true if FilePath ends with a path separator, which indicates that |
3648 | // it is intended to represent a directory. Returns false otherwise. |
3649 | // This does NOT check that a directory (or file) actually exists. |
3650 | bool IsDirectory() const; |
3651 | |
3652 | // Returns true if pathname describes a root directory. (Windows has one |
3653 | // root directory per disk drive.) |
3654 | bool IsRootDirectory() const; |
3655 | |
3656 | // Returns true if pathname describes an absolute path. |
3657 | bool IsAbsolutePath() const; |
3658 | |
3659 | private: |
3660 | // Replaces multiple consecutive separators with a single separator. |
3661 | // For example, "bar///foo" becomes "bar/foo". Does not eliminate other |
3662 | // redundancies that might be in a pathname involving "." or "..". |
3663 | // |
3664 | // A pathname with multiple consecutive separators may occur either through |
3665 | // user error or as a result of some scripts or APIs that generate a pathname |
3666 | // with a trailing separator. On other platforms the same API or script |
3667 | // may NOT generate a pathname with a trailing "/". Then elsewhere that |
3668 | // pathname may have another "/" and pathname components added to it, |
3669 | // without checking for the separator already being there. |
3670 | // The script language and operating system may allow paths like "foo//bar" |
3671 | // but some of the functions in FilePath will not handle that correctly. In |
3672 | // particular, RemoveTrailingPathSeparator() only removes one separator, and |
3673 | // it is called in CreateDirectoriesRecursively() assuming that it will change |
3674 | // a pathname from directory syntax (trailing separator) to filename syntax. |
3675 | // |
3676 | // On Windows this method also replaces the alternate path separator '/' with |
3677 | // the primary path separator '\\', so that for example "bar\\/\\foo" becomes |
3678 | // "bar\\foo". |
3679 | |
3680 | void Normalize(); |
3681 | |
3682 | // Returns a pointer to the last occurence of a valid path separator in |
3683 | // the FilePath. On Windows, for example, both '/' and '\' are valid path |
3684 | // separators. Returns NULL if no path separator was found. |
3685 | const char* FindLastPathSeparator() const; |
3686 | |
3687 | std::string pathname_; |
3688 | }; // class FilePath |
3689 | |
3690 | } // namespace internal |
3691 | } // namespace testing |
3692 | |
3693 | #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ |
3694 | // This file was GENERATED by command: |
3695 | // pump.py gtest-type-util.h.pump |
3696 | // DO NOT EDIT BY HAND!!! |
3697 | |
3698 | // Copyright 2008 Google Inc. |
3699 | // All Rights Reserved. |
3700 | // |
3701 | // Redistribution and use in source and binary forms, with or without |
3702 | // modification, are permitted provided that the following conditions are |
3703 | // met: |
3704 | // |
3705 | // * Redistributions of source code must retain the above copyright |
3706 | // notice, this list of conditions and the following disclaimer. |
3707 | // * Redistributions in binary form must reproduce the above |
3708 | // copyright notice, this list of conditions and the following disclaimer |
3709 | // in the documentation and/or other materials provided with the |
3710 | // distribution. |
3711 | // * Neither the name of Google Inc. nor the names of its |
3712 | // contributors may be used to endorse or promote products derived from |
3713 | // this software without specific prior written permission. |
3714 | // |
3715 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
3716 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
3717 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
3718 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
3719 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
3720 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
3721 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
3722 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
3723 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
3724 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
3725 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
3726 | // |
3727 | // Author: wan@google.com (Zhanyong Wan) |
3728 | |
3729 | // Type utilities needed for implementing typed and type-parameterized |
3730 | // tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND! |
3731 | // |
3732 | // Currently we support at most 50 types in a list, and at most 50 |
3733 | // type-parameterized tests in one type-parameterized test case. |
3734 | // Please contact googletestframework@googlegroups.com if you need |
3735 | // more. |
3736 | |
3737 | #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ |
3738 | #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ |
3739 | |
3740 | |
3741 | // #ifdef __GNUC__ is too general here. It is possible to use gcc without using |
3742 | // libstdc++ (which is where cxxabi.h comes from). |
3743 | # if GTEST_HAS_CXXABI_H_ |
3744 | # include <cxxabi.h> |
3745 | # elif defined(__HP_aCC) |
3746 | # include <acxx_demangle.h> |
3747 | # endif // GTEST_HASH_CXXABI_H_ |
3748 | |
3749 | namespace testing { |
3750 | namespace internal { |
3751 | |
3752 | // GetTypeName<T>() returns a human-readable name of type T. |
3753 | // NB: This function is also used in Google Mock, so don't move it inside of |
3754 | // the typed-test-only section below. |
3755 | template <typename T> |
3756 | std::string GetTypeName() { |
3757 | # if GTEST_HAS_RTTI |
3758 | |
3759 | const char* const name = typeid(T).name(); |
3760 | # if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC) |
3761 | int status = 0; |
3762 | // gcc's implementation of typeid(T).name() mangles the type name, |
3763 | // so we have to demangle it. |
3764 | # if GTEST_HAS_CXXABI_H_ |
3765 | using abi::__cxa_demangle; |
3766 | # endif // GTEST_HAS_CXXABI_H_ |
3767 | char* const readable_name = __cxa_demangle(name, 0, 0, &status); |
3768 | const std::string name_str(status == 0 ? readable_name : name); |
3769 | free(readable_name); |
3770 | return name_str; |
3771 | # else |
3772 | return name; |
3773 | # endif // GTEST_HAS_CXXABI_H_ || __HP_aCC |
3774 | |
3775 | # else |
3776 | |
3777 | return "<type>" ; |
3778 | |
3779 | # endif // GTEST_HAS_RTTI |
3780 | } |
3781 | |
3782 | #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P |
3783 | |
3784 | // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same |
3785 | // type. This can be used as a compile-time assertion to ensure that |
3786 | // two types are equal. |
3787 | |
3788 | template <typename T1, typename T2> |
3789 | struct AssertTypeEq; |
3790 | |
3791 | template <typename T> |
3792 | struct AssertTypeEq<T, T> { |
3793 | typedef bool type; |
3794 | }; |
3795 | |
3796 | // A unique type used as the default value for the arguments of class |
3797 | // template Types. This allows us to simulate variadic templates |
3798 | // (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't |
3799 | // support directly. |
3800 | struct None {}; |
3801 | |
3802 | // The following family of struct and struct templates are used to |
3803 | // represent type lists. In particular, TypesN<T1, T2, ..., TN> |
3804 | // represents a type list with N types (T1, T2, ..., and TN) in it. |
3805 | // Except for Types0, every struct in the family has two member types: |
3806 | // Head for the first type in the list, and Tail for the rest of the |
3807 | // list. |
3808 | |
3809 | // The empty type list. |
3810 | struct Types0 {}; |
3811 | |
3812 | // Type lists of length 1, 2, 3, and so on. |
3813 | |
3814 | template <typename T1> |
3815 | struct Types1 { |
3816 | typedef T1 Head; |
3817 | typedef Types0 Tail; |
3818 | }; |
3819 | template <typename T1, typename T2> |
3820 | struct Types2 { |
3821 | typedef T1 Head; |
3822 | typedef Types1<T2> Tail; |
3823 | }; |
3824 | |
3825 | template <typename T1, typename T2, typename T3> |
3826 | struct Types3 { |
3827 | typedef T1 Head; |
3828 | typedef Types2<T2, T3> Tail; |
3829 | }; |
3830 | |
3831 | template <typename T1, typename T2, typename T3, typename T4> |
3832 | struct Types4 { |
3833 | typedef T1 Head; |
3834 | typedef Types3<T2, T3, T4> Tail; |
3835 | }; |
3836 | |
3837 | template <typename T1, typename T2, typename T3, typename T4, typename T5> |
3838 | struct Types5 { |
3839 | typedef T1 Head; |
3840 | typedef Types4<T2, T3, T4, T5> Tail; |
3841 | }; |
3842 | |
3843 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3844 | typename T6> |
3845 | struct Types6 { |
3846 | typedef T1 Head; |
3847 | typedef Types5<T2, T3, T4, T5, T6> Tail; |
3848 | }; |
3849 | |
3850 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3851 | typename T6, typename T7> |
3852 | struct Types7 { |
3853 | typedef T1 Head; |
3854 | typedef Types6<T2, T3, T4, T5, T6, T7> Tail; |
3855 | }; |
3856 | |
3857 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3858 | typename T6, typename T7, typename T8> |
3859 | struct Types8 { |
3860 | typedef T1 Head; |
3861 | typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail; |
3862 | }; |
3863 | |
3864 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3865 | typename T6, typename T7, typename T8, typename T9> |
3866 | struct Types9 { |
3867 | typedef T1 Head; |
3868 | typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail; |
3869 | }; |
3870 | |
3871 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3872 | typename T6, typename T7, typename T8, typename T9, typename T10> |
3873 | struct Types10 { |
3874 | typedef T1 Head; |
3875 | typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail; |
3876 | }; |
3877 | |
3878 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3879 | typename T6, typename T7, typename T8, typename T9, typename T10, |
3880 | typename T11> |
3881 | struct Types11 { |
3882 | typedef T1 Head; |
3883 | typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail; |
3884 | }; |
3885 | |
3886 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3887 | typename T6, typename T7, typename T8, typename T9, typename T10, |
3888 | typename T11, typename T12> |
3889 | struct Types12 { |
3890 | typedef T1 Head; |
3891 | typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail; |
3892 | }; |
3893 | |
3894 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3895 | typename T6, typename T7, typename T8, typename T9, typename T10, |
3896 | typename T11, typename T12, typename T13> |
3897 | struct Types13 { |
3898 | typedef T1 Head; |
3899 | typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail; |
3900 | }; |
3901 | |
3902 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3903 | typename T6, typename T7, typename T8, typename T9, typename T10, |
3904 | typename T11, typename T12, typename T13, typename T14> |
3905 | struct Types14 { |
3906 | typedef T1 Head; |
3907 | typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail; |
3908 | }; |
3909 | |
3910 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3911 | typename T6, typename T7, typename T8, typename T9, typename T10, |
3912 | typename T11, typename T12, typename T13, typename T14, typename T15> |
3913 | struct Types15 { |
3914 | typedef T1 Head; |
3915 | typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
3916 | T15> Tail; |
3917 | }; |
3918 | |
3919 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3920 | typename T6, typename T7, typename T8, typename T9, typename T10, |
3921 | typename T11, typename T12, typename T13, typename T14, typename T15, |
3922 | typename T16> |
3923 | struct Types16 { |
3924 | typedef T1 Head; |
3925 | typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
3926 | T16> Tail; |
3927 | }; |
3928 | |
3929 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3930 | typename T6, typename T7, typename T8, typename T9, typename T10, |
3931 | typename T11, typename T12, typename T13, typename T14, typename T15, |
3932 | typename T16, typename T17> |
3933 | struct Types17 { |
3934 | typedef T1 Head; |
3935 | typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
3936 | T16, T17> Tail; |
3937 | }; |
3938 | |
3939 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3940 | typename T6, typename T7, typename T8, typename T9, typename T10, |
3941 | typename T11, typename T12, typename T13, typename T14, typename T15, |
3942 | typename T16, typename T17, typename T18> |
3943 | struct Types18 { |
3944 | typedef T1 Head; |
3945 | typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
3946 | T16, T17, T18> Tail; |
3947 | }; |
3948 | |
3949 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3950 | typename T6, typename T7, typename T8, typename T9, typename T10, |
3951 | typename T11, typename T12, typename T13, typename T14, typename T15, |
3952 | typename T16, typename T17, typename T18, typename T19> |
3953 | struct Types19 { |
3954 | typedef T1 Head; |
3955 | typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
3956 | T16, T17, T18, T19> Tail; |
3957 | }; |
3958 | |
3959 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3960 | typename T6, typename T7, typename T8, typename T9, typename T10, |
3961 | typename T11, typename T12, typename T13, typename T14, typename T15, |
3962 | typename T16, typename T17, typename T18, typename T19, typename T20> |
3963 | struct Types20 { |
3964 | typedef T1 Head; |
3965 | typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
3966 | T16, T17, T18, T19, T20> Tail; |
3967 | }; |
3968 | |
3969 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3970 | typename T6, typename T7, typename T8, typename T9, typename T10, |
3971 | typename T11, typename T12, typename T13, typename T14, typename T15, |
3972 | typename T16, typename T17, typename T18, typename T19, typename T20, |
3973 | typename T21> |
3974 | struct Types21 { |
3975 | typedef T1 Head; |
3976 | typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
3977 | T16, T17, T18, T19, T20, T21> Tail; |
3978 | }; |
3979 | |
3980 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3981 | typename T6, typename T7, typename T8, typename T9, typename T10, |
3982 | typename T11, typename T12, typename T13, typename T14, typename T15, |
3983 | typename T16, typename T17, typename T18, typename T19, typename T20, |
3984 | typename T21, typename T22> |
3985 | struct Types22 { |
3986 | typedef T1 Head; |
3987 | typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
3988 | T16, T17, T18, T19, T20, T21, T22> Tail; |
3989 | }; |
3990 | |
3991 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
3992 | typename T6, typename T7, typename T8, typename T9, typename T10, |
3993 | typename T11, typename T12, typename T13, typename T14, typename T15, |
3994 | typename T16, typename T17, typename T18, typename T19, typename T20, |
3995 | typename T21, typename T22, typename T23> |
3996 | struct Types23 { |
3997 | typedef T1 Head; |
3998 | typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
3999 | T16, T17, T18, T19, T20, T21, T22, T23> Tail; |
4000 | }; |
4001 | |
4002 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4003 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4004 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4005 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4006 | typename T21, typename T22, typename T23, typename T24> |
4007 | struct Types24 { |
4008 | typedef T1 Head; |
4009 | typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4010 | T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail; |
4011 | }; |
4012 | |
4013 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4014 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4015 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4016 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4017 | typename T21, typename T22, typename T23, typename T24, typename T25> |
4018 | struct Types25 { |
4019 | typedef T1 Head; |
4020 | typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4021 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail; |
4022 | }; |
4023 | |
4024 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4025 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4026 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4027 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4028 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4029 | typename T26> |
4030 | struct Types26 { |
4031 | typedef T1 Head; |
4032 | typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4033 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail; |
4034 | }; |
4035 | |
4036 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4037 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4038 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4039 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4040 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4041 | typename T26, typename T27> |
4042 | struct Types27 { |
4043 | typedef T1 Head; |
4044 | typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4045 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail; |
4046 | }; |
4047 | |
4048 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4049 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4050 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4051 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4052 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4053 | typename T26, typename T27, typename T28> |
4054 | struct Types28 { |
4055 | typedef T1 Head; |
4056 | typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4057 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail; |
4058 | }; |
4059 | |
4060 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4061 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4062 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4063 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4064 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4065 | typename T26, typename T27, typename T28, typename T29> |
4066 | struct Types29 { |
4067 | typedef T1 Head; |
4068 | typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4069 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
4070 | T29> Tail; |
4071 | }; |
4072 | |
4073 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4074 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4075 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4076 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4077 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4078 | typename T26, typename T27, typename T28, typename T29, typename T30> |
4079 | struct Types30 { |
4080 | typedef T1 Head; |
4081 | typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4082 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4083 | T30> Tail; |
4084 | }; |
4085 | |
4086 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4087 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4088 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4089 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4090 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4091 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4092 | typename T31> |
4093 | struct Types31 { |
4094 | typedef T1 Head; |
4095 | typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4096 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4097 | T30, T31> Tail; |
4098 | }; |
4099 | |
4100 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4101 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4102 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4103 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4104 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4105 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4106 | typename T31, typename T32> |
4107 | struct Types32 { |
4108 | typedef T1 Head; |
4109 | typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4110 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4111 | T30, T31, T32> Tail; |
4112 | }; |
4113 | |
4114 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4115 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4116 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4117 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4118 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4119 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4120 | typename T31, typename T32, typename T33> |
4121 | struct Types33 { |
4122 | typedef T1 Head; |
4123 | typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4124 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4125 | T30, T31, T32, T33> Tail; |
4126 | }; |
4127 | |
4128 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4129 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4130 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4131 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4132 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4133 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4134 | typename T31, typename T32, typename T33, typename T34> |
4135 | struct Types34 { |
4136 | typedef T1 Head; |
4137 | typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4138 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4139 | T30, T31, T32, T33, T34> Tail; |
4140 | }; |
4141 | |
4142 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4143 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4144 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4145 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4146 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4147 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4148 | typename T31, typename T32, typename T33, typename T34, typename T35> |
4149 | struct Types35 { |
4150 | typedef T1 Head; |
4151 | typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4152 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4153 | T30, T31, T32, T33, T34, T35> Tail; |
4154 | }; |
4155 | |
4156 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4157 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4158 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4159 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4160 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4161 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4162 | typename T31, typename T32, typename T33, typename T34, typename T35, |
4163 | typename T36> |
4164 | struct Types36 { |
4165 | typedef T1 Head; |
4166 | typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4167 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4168 | T30, T31, T32, T33, T34, T35, T36> Tail; |
4169 | }; |
4170 | |
4171 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4172 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4173 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4174 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4175 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4176 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4177 | typename T31, typename T32, typename T33, typename T34, typename T35, |
4178 | typename T36, typename T37> |
4179 | struct Types37 { |
4180 | typedef T1 Head; |
4181 | typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4182 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4183 | T30, T31, T32, T33, T34, T35, T36, T37> Tail; |
4184 | }; |
4185 | |
4186 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4187 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4188 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4189 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4190 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4191 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4192 | typename T31, typename T32, typename T33, typename T34, typename T35, |
4193 | typename T36, typename T37, typename T38> |
4194 | struct Types38 { |
4195 | typedef T1 Head; |
4196 | typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4197 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4198 | T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail; |
4199 | }; |
4200 | |
4201 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4202 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4203 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4204 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4205 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4206 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4207 | typename T31, typename T32, typename T33, typename T34, typename T35, |
4208 | typename T36, typename T37, typename T38, typename T39> |
4209 | struct Types39 { |
4210 | typedef T1 Head; |
4211 | typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4212 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4213 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail; |
4214 | }; |
4215 | |
4216 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4217 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4218 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4219 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4220 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4221 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4222 | typename T31, typename T32, typename T33, typename T34, typename T35, |
4223 | typename T36, typename T37, typename T38, typename T39, typename T40> |
4224 | struct Types40 { |
4225 | typedef T1 Head; |
4226 | typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4227 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4228 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail; |
4229 | }; |
4230 | |
4231 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4232 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4233 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4234 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4235 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4236 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4237 | typename T31, typename T32, typename T33, typename T34, typename T35, |
4238 | typename T36, typename T37, typename T38, typename T39, typename T40, |
4239 | typename T41> |
4240 | struct Types41 { |
4241 | typedef T1 Head; |
4242 | typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4243 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4244 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail; |
4245 | }; |
4246 | |
4247 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4248 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4249 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4250 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4251 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4252 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4253 | typename T31, typename T32, typename T33, typename T34, typename T35, |
4254 | typename T36, typename T37, typename T38, typename T39, typename T40, |
4255 | typename T41, typename T42> |
4256 | struct Types42 { |
4257 | typedef T1 Head; |
4258 | typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4259 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4260 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail; |
4261 | }; |
4262 | |
4263 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4264 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4265 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4266 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4267 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4268 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4269 | typename T31, typename T32, typename T33, typename T34, typename T35, |
4270 | typename T36, typename T37, typename T38, typename T39, typename T40, |
4271 | typename T41, typename T42, typename T43> |
4272 | struct Types43 { |
4273 | typedef T1 Head; |
4274 | typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4275 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4276 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, |
4277 | T43> Tail; |
4278 | }; |
4279 | |
4280 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4281 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4282 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4283 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4284 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4285 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4286 | typename T31, typename T32, typename T33, typename T34, typename T35, |
4287 | typename T36, typename T37, typename T38, typename T39, typename T40, |
4288 | typename T41, typename T42, typename T43, typename T44> |
4289 | struct Types44 { |
4290 | typedef T1 Head; |
4291 | typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4292 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4293 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
4294 | T44> Tail; |
4295 | }; |
4296 | |
4297 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4298 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4299 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4300 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4301 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4302 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4303 | typename T31, typename T32, typename T33, typename T34, typename T35, |
4304 | typename T36, typename T37, typename T38, typename T39, typename T40, |
4305 | typename T41, typename T42, typename T43, typename T44, typename T45> |
4306 | struct Types45 { |
4307 | typedef T1 Head; |
4308 | typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4309 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4310 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
4311 | T44, T45> Tail; |
4312 | }; |
4313 | |
4314 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4315 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4316 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4317 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4318 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4319 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4320 | typename T31, typename T32, typename T33, typename T34, typename T35, |
4321 | typename T36, typename T37, typename T38, typename T39, typename T40, |
4322 | typename T41, typename T42, typename T43, typename T44, typename T45, |
4323 | typename T46> |
4324 | struct Types46 { |
4325 | typedef T1 Head; |
4326 | typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4327 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4328 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
4329 | T44, T45, T46> Tail; |
4330 | }; |
4331 | |
4332 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4333 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4334 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4335 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4336 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4337 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4338 | typename T31, typename T32, typename T33, typename T34, typename T35, |
4339 | typename T36, typename T37, typename T38, typename T39, typename T40, |
4340 | typename T41, typename T42, typename T43, typename T44, typename T45, |
4341 | typename T46, typename T47> |
4342 | struct Types47 { |
4343 | typedef T1 Head; |
4344 | typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4345 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4346 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
4347 | T44, T45, T46, T47> Tail; |
4348 | }; |
4349 | |
4350 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4351 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4352 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4353 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4354 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4355 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4356 | typename T31, typename T32, typename T33, typename T34, typename T35, |
4357 | typename T36, typename T37, typename T38, typename T39, typename T40, |
4358 | typename T41, typename T42, typename T43, typename T44, typename T45, |
4359 | typename T46, typename T47, typename T48> |
4360 | struct Types48 { |
4361 | typedef T1 Head; |
4362 | typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4363 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4364 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
4365 | T44, T45, T46, T47, T48> Tail; |
4366 | }; |
4367 | |
4368 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4369 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4370 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4371 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4372 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4373 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4374 | typename T31, typename T32, typename T33, typename T34, typename T35, |
4375 | typename T36, typename T37, typename T38, typename T39, typename T40, |
4376 | typename T41, typename T42, typename T43, typename T44, typename T45, |
4377 | typename T46, typename T47, typename T48, typename T49> |
4378 | struct Types49 { |
4379 | typedef T1 Head; |
4380 | typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4381 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4382 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
4383 | T44, T45, T46, T47, T48, T49> Tail; |
4384 | }; |
4385 | |
4386 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4387 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4388 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4389 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4390 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4391 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4392 | typename T31, typename T32, typename T33, typename T34, typename T35, |
4393 | typename T36, typename T37, typename T38, typename T39, typename T40, |
4394 | typename T41, typename T42, typename T43, typename T44, typename T45, |
4395 | typename T46, typename T47, typename T48, typename T49, typename T50> |
4396 | struct Types50 { |
4397 | typedef T1 Head; |
4398 | typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4399 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4400 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
4401 | T44, T45, T46, T47, T48, T49, T50> Tail; |
4402 | }; |
4403 | |
4404 | |
4405 | } // namespace internal |
4406 | |
4407 | // We don't want to require the users to write TypesN<...> directly, |
4408 | // as that would require them to count the length. Types<...> is much |
4409 | // easier to write, but generates horrible messages when there is a |
4410 | // compiler error, as gcc insists on printing out each template |
4411 | // argument, even if it has the default value (this means Types<int> |
4412 | // will appear as Types<int, None, None, ..., None> in the compiler |
4413 | // errors). |
4414 | // |
4415 | // Our solution is to combine the best part of the two approaches: a |
4416 | // user would write Types<T1, ..., TN>, and Google Test will translate |
4417 | // that to TypesN<T1, ..., TN> internally to make error messages |
4418 | // readable. The translation is done by the 'type' member of the |
4419 | // Types template. |
4420 | template <typename T1 = internal::None, typename T2 = internal::None, |
4421 | typename T3 = internal::None, typename T4 = internal::None, |
4422 | typename T5 = internal::None, typename T6 = internal::None, |
4423 | typename T7 = internal::None, typename T8 = internal::None, |
4424 | typename T9 = internal::None, typename T10 = internal::None, |
4425 | typename T11 = internal::None, typename T12 = internal::None, |
4426 | typename T13 = internal::None, typename T14 = internal::None, |
4427 | typename T15 = internal::None, typename T16 = internal::None, |
4428 | typename T17 = internal::None, typename T18 = internal::None, |
4429 | typename T19 = internal::None, typename T20 = internal::None, |
4430 | typename T21 = internal::None, typename T22 = internal::None, |
4431 | typename T23 = internal::None, typename T24 = internal::None, |
4432 | typename T25 = internal::None, typename T26 = internal::None, |
4433 | typename T27 = internal::None, typename T28 = internal::None, |
4434 | typename T29 = internal::None, typename T30 = internal::None, |
4435 | typename T31 = internal::None, typename T32 = internal::None, |
4436 | typename T33 = internal::None, typename T34 = internal::None, |
4437 | typename T35 = internal::None, typename T36 = internal::None, |
4438 | typename T37 = internal::None, typename T38 = internal::None, |
4439 | typename T39 = internal::None, typename T40 = internal::None, |
4440 | typename T41 = internal::None, typename T42 = internal::None, |
4441 | typename T43 = internal::None, typename T44 = internal::None, |
4442 | typename T45 = internal::None, typename T46 = internal::None, |
4443 | typename T47 = internal::None, typename T48 = internal::None, |
4444 | typename T49 = internal::None, typename T50 = internal::None> |
4445 | struct Types { |
4446 | typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4447 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
4448 | T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, |
4449 | T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type; |
4450 | }; |
4451 | |
4452 | template <> |
4453 | struct Types<internal::None, internal::None, internal::None, internal::None, |
4454 | internal::None, internal::None, internal::None, internal::None, |
4455 | internal::None, internal::None, internal::None, internal::None, |
4456 | internal::None, internal::None, internal::None, internal::None, |
4457 | internal::None, internal::None, internal::None, internal::None, |
4458 | internal::None, internal::None, internal::None, internal::None, |
4459 | internal::None, internal::None, internal::None, internal::None, |
4460 | internal::None, internal::None, internal::None, internal::None, |
4461 | internal::None, internal::None, internal::None, internal::None, |
4462 | internal::None, internal::None, internal::None, internal::None, |
4463 | internal::None, internal::None, internal::None, internal::None, |
4464 | internal::None, internal::None, internal::None, internal::None, |
4465 | internal::None, internal::None> { |
4466 | typedef internal::Types0 type; |
4467 | }; |
4468 | template <typename T1> |
4469 | struct Types<T1, internal::None, internal::None, internal::None, |
4470 | internal::None, internal::None, internal::None, internal::None, |
4471 | internal::None, internal::None, internal::None, internal::None, |
4472 | internal::None, internal::None, internal::None, internal::None, |
4473 | internal::None, internal::None, internal::None, internal::None, |
4474 | internal::None, internal::None, internal::None, internal::None, |
4475 | internal::None, internal::None, internal::None, internal::None, |
4476 | internal::None, internal::None, internal::None, internal::None, |
4477 | internal::None, internal::None, internal::None, internal::None, |
4478 | internal::None, internal::None, internal::None, internal::None, |
4479 | internal::None, internal::None, internal::None, internal::None, |
4480 | internal::None, internal::None, internal::None, internal::None, |
4481 | internal::None, internal::None> { |
4482 | typedef internal::Types1<T1> type; |
4483 | }; |
4484 | template <typename T1, typename T2> |
4485 | struct Types<T1, T2, internal::None, internal::None, internal::None, |
4486 | internal::None, internal::None, internal::None, internal::None, |
4487 | internal::None, internal::None, internal::None, internal::None, |
4488 | internal::None, internal::None, internal::None, internal::None, |
4489 | internal::None, internal::None, internal::None, internal::None, |
4490 | internal::None, internal::None, internal::None, internal::None, |
4491 | internal::None, internal::None, internal::None, internal::None, |
4492 | internal::None, internal::None, internal::None, internal::None, |
4493 | internal::None, internal::None, internal::None, internal::None, |
4494 | internal::None, internal::None, internal::None, internal::None, |
4495 | internal::None, internal::None, internal::None, internal::None, |
4496 | internal::None, internal::None, internal::None, internal::None, |
4497 | internal::None> { |
4498 | typedef internal::Types2<T1, T2> type; |
4499 | }; |
4500 | template <typename T1, typename T2, typename T3> |
4501 | struct Types<T1, T2, T3, internal::None, internal::None, internal::None, |
4502 | internal::None, internal::None, internal::None, internal::None, |
4503 | internal::None, internal::None, internal::None, internal::None, |
4504 | internal::None, internal::None, internal::None, internal::None, |
4505 | internal::None, internal::None, internal::None, internal::None, |
4506 | internal::None, internal::None, internal::None, internal::None, |
4507 | internal::None, internal::None, internal::None, internal::None, |
4508 | internal::None, internal::None, internal::None, internal::None, |
4509 | internal::None, internal::None, internal::None, internal::None, |
4510 | internal::None, internal::None, internal::None, internal::None, |
4511 | internal::None, internal::None, internal::None, internal::None, |
4512 | internal::None, internal::None, internal::None, internal::None> { |
4513 | typedef internal::Types3<T1, T2, T3> type; |
4514 | }; |
4515 | template <typename T1, typename T2, typename T3, typename T4> |
4516 | struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None, |
4517 | internal::None, internal::None, internal::None, internal::None, |
4518 | internal::None, internal::None, internal::None, internal::None, |
4519 | internal::None, internal::None, internal::None, internal::None, |
4520 | internal::None, internal::None, internal::None, internal::None, |
4521 | internal::None, internal::None, internal::None, internal::None, |
4522 | internal::None, internal::None, internal::None, internal::None, |
4523 | internal::None, internal::None, internal::None, internal::None, |
4524 | internal::None, internal::None, internal::None, internal::None, |
4525 | internal::None, internal::None, internal::None, internal::None, |
4526 | internal::None, internal::None, internal::None, internal::None, |
4527 | internal::None, internal::None, internal::None> { |
4528 | typedef internal::Types4<T1, T2, T3, T4> type; |
4529 | }; |
4530 | template <typename T1, typename T2, typename T3, typename T4, typename T5> |
4531 | struct Types<T1, T2, T3, T4, T5, internal::None, internal::None, |
4532 | internal::None, internal::None, internal::None, internal::None, |
4533 | internal::None, internal::None, internal::None, internal::None, |
4534 | internal::None, internal::None, internal::None, internal::None, |
4535 | internal::None, internal::None, internal::None, internal::None, |
4536 | internal::None, internal::None, internal::None, internal::None, |
4537 | internal::None, internal::None, internal::None, internal::None, |
4538 | internal::None, internal::None, internal::None, internal::None, |
4539 | internal::None, internal::None, internal::None, internal::None, |
4540 | internal::None, internal::None, internal::None, internal::None, |
4541 | internal::None, internal::None, internal::None, internal::None, |
4542 | internal::None, internal::None, internal::None> { |
4543 | typedef internal::Types5<T1, T2, T3, T4, T5> type; |
4544 | }; |
4545 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4546 | typename T6> |
4547 | struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None, |
4548 | internal::None, internal::None, internal::None, internal::None, |
4549 | internal::None, internal::None, internal::None, internal::None, |
4550 | internal::None, internal::None, internal::None, internal::None, |
4551 | internal::None, internal::None, internal::None, internal::None, |
4552 | internal::None, internal::None, internal::None, internal::None, |
4553 | internal::None, internal::None, internal::None, internal::None, |
4554 | internal::None, internal::None, internal::None, internal::None, |
4555 | internal::None, internal::None, internal::None, internal::None, |
4556 | internal::None, internal::None, internal::None, internal::None, |
4557 | internal::None, internal::None, internal::None, internal::None, |
4558 | internal::None, internal::None> { |
4559 | typedef internal::Types6<T1, T2, T3, T4, T5, T6> type; |
4560 | }; |
4561 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4562 | typename T6, typename T7> |
4563 | struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None, |
4564 | internal::None, internal::None, internal::None, internal::None, |
4565 | internal::None, internal::None, internal::None, internal::None, |
4566 | internal::None, internal::None, internal::None, internal::None, |
4567 | internal::None, internal::None, internal::None, internal::None, |
4568 | internal::None, internal::None, internal::None, internal::None, |
4569 | internal::None, internal::None, internal::None, internal::None, |
4570 | internal::None, internal::None, internal::None, internal::None, |
4571 | internal::None, internal::None, internal::None, internal::None, |
4572 | internal::None, internal::None, internal::None, internal::None, |
4573 | internal::None, internal::None, internal::None, internal::None, |
4574 | internal::None> { |
4575 | typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type; |
4576 | }; |
4577 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4578 | typename T6, typename T7, typename T8> |
4579 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None, |
4580 | internal::None, internal::None, internal::None, internal::None, |
4581 | internal::None, internal::None, internal::None, internal::None, |
4582 | internal::None, internal::None, internal::None, internal::None, |
4583 | internal::None, internal::None, internal::None, internal::None, |
4584 | internal::None, internal::None, internal::None, internal::None, |
4585 | internal::None, internal::None, internal::None, internal::None, |
4586 | internal::None, internal::None, internal::None, internal::None, |
4587 | internal::None, internal::None, internal::None, internal::None, |
4588 | internal::None, internal::None, internal::None, internal::None, |
4589 | internal::None, internal::None, internal::None, internal::None> { |
4590 | typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type; |
4591 | }; |
4592 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4593 | typename T6, typename T7, typename T8, typename T9> |
4594 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None, |
4595 | internal::None, internal::None, internal::None, internal::None, |
4596 | internal::None, internal::None, internal::None, internal::None, |
4597 | internal::None, internal::None, internal::None, internal::None, |
4598 | internal::None, internal::None, internal::None, internal::None, |
4599 | internal::None, internal::None, internal::None, internal::None, |
4600 | internal::None, internal::None, internal::None, internal::None, |
4601 | internal::None, internal::None, internal::None, internal::None, |
4602 | internal::None, internal::None, internal::None, internal::None, |
4603 | internal::None, internal::None, internal::None, internal::None, |
4604 | internal::None, internal::None, internal::None, internal::None> { |
4605 | typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type; |
4606 | }; |
4607 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4608 | typename T6, typename T7, typename T8, typename T9, typename T10> |
4609 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None, |
4610 | internal::None, internal::None, internal::None, internal::None, |
4611 | internal::None, internal::None, internal::None, internal::None, |
4612 | internal::None, internal::None, internal::None, internal::None, |
4613 | internal::None, internal::None, internal::None, internal::None, |
4614 | internal::None, internal::None, internal::None, internal::None, |
4615 | internal::None, internal::None, internal::None, internal::None, |
4616 | internal::None, internal::None, internal::None, internal::None, |
4617 | internal::None, internal::None, internal::None, internal::None, |
4618 | internal::None, internal::None, internal::None, internal::None, |
4619 | internal::None, internal::None, internal::None> { |
4620 | typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type; |
4621 | }; |
4622 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4623 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4624 | typename T11> |
4625 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None, |
4626 | internal::None, internal::None, internal::None, internal::None, |
4627 | internal::None, internal::None, internal::None, internal::None, |
4628 | internal::None, internal::None, internal::None, internal::None, |
4629 | internal::None, internal::None, internal::None, internal::None, |
4630 | internal::None, internal::None, internal::None, internal::None, |
4631 | internal::None, internal::None, internal::None, internal::None, |
4632 | internal::None, internal::None, internal::None, internal::None, |
4633 | internal::None, internal::None, internal::None, internal::None, |
4634 | internal::None, internal::None, internal::None, internal::None, |
4635 | internal::None, internal::None> { |
4636 | typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type; |
4637 | }; |
4638 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4639 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4640 | typename T11, typename T12> |
4641 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None, |
4642 | internal::None, internal::None, internal::None, internal::None, |
4643 | internal::None, internal::None, internal::None, internal::None, |
4644 | internal::None, internal::None, internal::None, internal::None, |
4645 | internal::None, internal::None, internal::None, internal::None, |
4646 | internal::None, internal::None, internal::None, internal::None, |
4647 | internal::None, internal::None, internal::None, internal::None, |
4648 | internal::None, internal::None, internal::None, internal::None, |
4649 | internal::None, internal::None, internal::None, internal::None, |
4650 | internal::None, internal::None, internal::None, internal::None, |
4651 | internal::None> { |
4652 | typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
4653 | T12> type; |
4654 | }; |
4655 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4656 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4657 | typename T11, typename T12, typename T13> |
4658 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
4659 | internal::None, internal::None, internal::None, internal::None, |
4660 | internal::None, internal::None, internal::None, internal::None, |
4661 | internal::None, internal::None, internal::None, internal::None, |
4662 | internal::None, internal::None, internal::None, internal::None, |
4663 | internal::None, internal::None, internal::None, internal::None, |
4664 | internal::None, internal::None, internal::None, internal::None, |
4665 | internal::None, internal::None, internal::None, internal::None, |
4666 | internal::None, internal::None, internal::None, internal::None, |
4667 | internal::None, internal::None, internal::None, internal::None, |
4668 | internal::None> { |
4669 | typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4670 | T13> type; |
4671 | }; |
4672 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4673 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4674 | typename T11, typename T12, typename T13, typename T14> |
4675 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
4676 | internal::None, internal::None, internal::None, internal::None, |
4677 | internal::None, internal::None, internal::None, internal::None, |
4678 | internal::None, internal::None, internal::None, internal::None, |
4679 | internal::None, internal::None, internal::None, internal::None, |
4680 | internal::None, internal::None, internal::None, internal::None, |
4681 | internal::None, internal::None, internal::None, internal::None, |
4682 | internal::None, internal::None, internal::None, internal::None, |
4683 | internal::None, internal::None, internal::None, internal::None, |
4684 | internal::None, internal::None, internal::None, internal::None> { |
4685 | typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4686 | T13, T14> type; |
4687 | }; |
4688 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4689 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4690 | typename T11, typename T12, typename T13, typename T14, typename T15> |
4691 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4692 | internal::None, internal::None, internal::None, internal::None, |
4693 | internal::None, internal::None, internal::None, internal::None, |
4694 | internal::None, internal::None, internal::None, internal::None, |
4695 | internal::None, internal::None, internal::None, internal::None, |
4696 | internal::None, internal::None, internal::None, internal::None, |
4697 | internal::None, internal::None, internal::None, internal::None, |
4698 | internal::None, internal::None, internal::None, internal::None, |
4699 | internal::None, internal::None, internal::None, internal::None, |
4700 | internal::None, internal::None, internal::None> { |
4701 | typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4702 | T13, T14, T15> type; |
4703 | }; |
4704 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4705 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4706 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4707 | typename T16> |
4708 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4709 | T16, internal::None, internal::None, internal::None, internal::None, |
4710 | internal::None, internal::None, internal::None, internal::None, |
4711 | internal::None, internal::None, internal::None, internal::None, |
4712 | internal::None, internal::None, internal::None, internal::None, |
4713 | internal::None, internal::None, internal::None, internal::None, |
4714 | internal::None, internal::None, internal::None, internal::None, |
4715 | internal::None, internal::None, internal::None, internal::None, |
4716 | internal::None, internal::None, internal::None, internal::None, |
4717 | internal::None, internal::None> { |
4718 | typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4719 | T13, T14, T15, T16> type; |
4720 | }; |
4721 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4722 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4723 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4724 | typename T16, typename T17> |
4725 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4726 | T16, T17, internal::None, internal::None, internal::None, internal::None, |
4727 | internal::None, internal::None, internal::None, internal::None, |
4728 | internal::None, internal::None, internal::None, internal::None, |
4729 | internal::None, internal::None, internal::None, internal::None, |
4730 | internal::None, internal::None, internal::None, internal::None, |
4731 | internal::None, internal::None, internal::None, internal::None, |
4732 | internal::None, internal::None, internal::None, internal::None, |
4733 | internal::None, internal::None, internal::None, internal::None, |
4734 | internal::None> { |
4735 | typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4736 | T13, T14, T15, T16, T17> type; |
4737 | }; |
4738 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4739 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4740 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4741 | typename T16, typename T17, typename T18> |
4742 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4743 | T16, T17, T18, internal::None, internal::None, internal::None, |
4744 | internal::None, internal::None, internal::None, internal::None, |
4745 | internal::None, internal::None, internal::None, internal::None, |
4746 | internal::None, internal::None, internal::None, internal::None, |
4747 | internal::None, internal::None, internal::None, internal::None, |
4748 | internal::None, internal::None, internal::None, internal::None, |
4749 | internal::None, internal::None, internal::None, internal::None, |
4750 | internal::None, internal::None, internal::None, internal::None, |
4751 | internal::None> { |
4752 | typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4753 | T13, T14, T15, T16, T17, T18> type; |
4754 | }; |
4755 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4756 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4757 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4758 | typename T16, typename T17, typename T18, typename T19> |
4759 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4760 | T16, T17, T18, T19, internal::None, internal::None, internal::None, |
4761 | internal::None, internal::None, internal::None, internal::None, |
4762 | internal::None, internal::None, internal::None, internal::None, |
4763 | internal::None, internal::None, internal::None, internal::None, |
4764 | internal::None, internal::None, internal::None, internal::None, |
4765 | internal::None, internal::None, internal::None, internal::None, |
4766 | internal::None, internal::None, internal::None, internal::None, |
4767 | internal::None, internal::None, internal::None, internal::None> { |
4768 | typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4769 | T13, T14, T15, T16, T17, T18, T19> type; |
4770 | }; |
4771 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4772 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4773 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4774 | typename T16, typename T17, typename T18, typename T19, typename T20> |
4775 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4776 | T16, T17, T18, T19, T20, internal::None, internal::None, internal::None, |
4777 | internal::None, internal::None, internal::None, internal::None, |
4778 | internal::None, internal::None, internal::None, internal::None, |
4779 | internal::None, internal::None, internal::None, internal::None, |
4780 | internal::None, internal::None, internal::None, internal::None, |
4781 | internal::None, internal::None, internal::None, internal::None, |
4782 | internal::None, internal::None, internal::None, internal::None, |
4783 | internal::None, internal::None, internal::None> { |
4784 | typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4785 | T13, T14, T15, T16, T17, T18, T19, T20> type; |
4786 | }; |
4787 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4788 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4789 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4790 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4791 | typename T21> |
4792 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4793 | T16, T17, T18, T19, T20, T21, internal::None, internal::None, |
4794 | internal::None, internal::None, internal::None, internal::None, |
4795 | internal::None, internal::None, internal::None, internal::None, |
4796 | internal::None, internal::None, internal::None, internal::None, |
4797 | internal::None, internal::None, internal::None, internal::None, |
4798 | internal::None, internal::None, internal::None, internal::None, |
4799 | internal::None, internal::None, internal::None, internal::None, |
4800 | internal::None, internal::None, internal::None> { |
4801 | typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4802 | T13, T14, T15, T16, T17, T18, T19, T20, T21> type; |
4803 | }; |
4804 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4805 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4806 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4807 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4808 | typename T21, typename T22> |
4809 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4810 | T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None, |
4811 | internal::None, internal::None, internal::None, internal::None, |
4812 | internal::None, internal::None, internal::None, internal::None, |
4813 | internal::None, internal::None, internal::None, internal::None, |
4814 | internal::None, internal::None, internal::None, internal::None, |
4815 | internal::None, internal::None, internal::None, internal::None, |
4816 | internal::None, internal::None, internal::None, internal::None, |
4817 | internal::None, internal::None> { |
4818 | typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4819 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type; |
4820 | }; |
4821 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4822 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4823 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4824 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4825 | typename T21, typename T22, typename T23> |
4826 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4827 | T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None, |
4828 | internal::None, internal::None, internal::None, internal::None, |
4829 | internal::None, internal::None, internal::None, internal::None, |
4830 | internal::None, internal::None, internal::None, internal::None, |
4831 | internal::None, internal::None, internal::None, internal::None, |
4832 | internal::None, internal::None, internal::None, internal::None, |
4833 | internal::None, internal::None, internal::None, internal::None, |
4834 | internal::None> { |
4835 | typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4836 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type; |
4837 | }; |
4838 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4839 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4840 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4841 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4842 | typename T21, typename T22, typename T23, typename T24> |
4843 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4844 | T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None, |
4845 | internal::None, internal::None, internal::None, internal::None, |
4846 | internal::None, internal::None, internal::None, internal::None, |
4847 | internal::None, internal::None, internal::None, internal::None, |
4848 | internal::None, internal::None, internal::None, internal::None, |
4849 | internal::None, internal::None, internal::None, internal::None, |
4850 | internal::None, internal::None, internal::None, internal::None, |
4851 | internal::None> { |
4852 | typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4853 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type; |
4854 | }; |
4855 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4856 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4857 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4858 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4859 | typename T21, typename T22, typename T23, typename T24, typename T25> |
4860 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4861 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None, |
4862 | internal::None, internal::None, internal::None, internal::None, |
4863 | internal::None, internal::None, internal::None, internal::None, |
4864 | internal::None, internal::None, internal::None, internal::None, |
4865 | internal::None, internal::None, internal::None, internal::None, |
4866 | internal::None, internal::None, internal::None, internal::None, |
4867 | internal::None, internal::None, internal::None, internal::None> { |
4868 | typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4869 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type; |
4870 | }; |
4871 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4872 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4873 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4874 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4875 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4876 | typename T26> |
4877 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4878 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None, |
4879 | internal::None, internal::None, internal::None, internal::None, |
4880 | internal::None, internal::None, internal::None, internal::None, |
4881 | internal::None, internal::None, internal::None, internal::None, |
4882 | internal::None, internal::None, internal::None, internal::None, |
4883 | internal::None, internal::None, internal::None, internal::None, |
4884 | internal::None, internal::None, internal::None> { |
4885 | typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4886 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
4887 | T26> type; |
4888 | }; |
4889 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4890 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4891 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4892 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4893 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4894 | typename T26, typename T27> |
4895 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4896 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None, |
4897 | internal::None, internal::None, internal::None, internal::None, |
4898 | internal::None, internal::None, internal::None, internal::None, |
4899 | internal::None, internal::None, internal::None, internal::None, |
4900 | internal::None, internal::None, internal::None, internal::None, |
4901 | internal::None, internal::None, internal::None, internal::None, |
4902 | internal::None, internal::None> { |
4903 | typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4904 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
4905 | T27> type; |
4906 | }; |
4907 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4908 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4909 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4910 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4911 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4912 | typename T26, typename T27, typename T28> |
4913 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4914 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
4915 | internal::None, internal::None, internal::None, internal::None, |
4916 | internal::None, internal::None, internal::None, internal::None, |
4917 | internal::None, internal::None, internal::None, internal::None, |
4918 | internal::None, internal::None, internal::None, internal::None, |
4919 | internal::None, internal::None, internal::None, internal::None, |
4920 | internal::None, internal::None> { |
4921 | typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4922 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
4923 | T27, T28> type; |
4924 | }; |
4925 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4926 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4927 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4928 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4929 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4930 | typename T26, typename T27, typename T28, typename T29> |
4931 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4932 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
4933 | internal::None, internal::None, internal::None, internal::None, |
4934 | internal::None, internal::None, internal::None, internal::None, |
4935 | internal::None, internal::None, internal::None, internal::None, |
4936 | internal::None, internal::None, internal::None, internal::None, |
4937 | internal::None, internal::None, internal::None, internal::None, |
4938 | internal::None> { |
4939 | typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4940 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
4941 | T27, T28, T29> type; |
4942 | }; |
4943 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4944 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4945 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4946 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4947 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4948 | typename T26, typename T27, typename T28, typename T29, typename T30> |
4949 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4950 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
4951 | internal::None, internal::None, internal::None, internal::None, |
4952 | internal::None, internal::None, internal::None, internal::None, |
4953 | internal::None, internal::None, internal::None, internal::None, |
4954 | internal::None, internal::None, internal::None, internal::None, |
4955 | internal::None, internal::None, internal::None, internal::None> { |
4956 | typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4957 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
4958 | T27, T28, T29, T30> type; |
4959 | }; |
4960 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4961 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4962 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4963 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4964 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4965 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4966 | typename T31> |
4967 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4968 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
4969 | T31, internal::None, internal::None, internal::None, internal::None, |
4970 | internal::None, internal::None, internal::None, internal::None, |
4971 | internal::None, internal::None, internal::None, internal::None, |
4972 | internal::None, internal::None, internal::None, internal::None, |
4973 | internal::None, internal::None, internal::None> { |
4974 | typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4975 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
4976 | T27, T28, T29, T30, T31> type; |
4977 | }; |
4978 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4979 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4980 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4981 | typename T16, typename T17, typename T18, typename T19, typename T20, |
4982 | typename T21, typename T22, typename T23, typename T24, typename T25, |
4983 | typename T26, typename T27, typename T28, typename T29, typename T30, |
4984 | typename T31, typename T32> |
4985 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
4986 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
4987 | T31, T32, internal::None, internal::None, internal::None, internal::None, |
4988 | internal::None, internal::None, internal::None, internal::None, |
4989 | internal::None, internal::None, internal::None, internal::None, |
4990 | internal::None, internal::None, internal::None, internal::None, |
4991 | internal::None, internal::None> { |
4992 | typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
4993 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
4994 | T27, T28, T29, T30, T31, T32> type; |
4995 | }; |
4996 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
4997 | typename T6, typename T7, typename T8, typename T9, typename T10, |
4998 | typename T11, typename T12, typename T13, typename T14, typename T15, |
4999 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5000 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5001 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5002 | typename T31, typename T32, typename T33> |
5003 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5004 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5005 | T31, T32, T33, internal::None, internal::None, internal::None, |
5006 | internal::None, internal::None, internal::None, internal::None, |
5007 | internal::None, internal::None, internal::None, internal::None, |
5008 | internal::None, internal::None, internal::None, internal::None, |
5009 | internal::None, internal::None> { |
5010 | typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5011 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5012 | T27, T28, T29, T30, T31, T32, T33> type; |
5013 | }; |
5014 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
5015 | typename T6, typename T7, typename T8, typename T9, typename T10, |
5016 | typename T11, typename T12, typename T13, typename T14, typename T15, |
5017 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5018 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5019 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5020 | typename T31, typename T32, typename T33, typename T34> |
5021 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5022 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5023 | T31, T32, T33, T34, internal::None, internal::None, internal::None, |
5024 | internal::None, internal::None, internal::None, internal::None, |
5025 | internal::None, internal::None, internal::None, internal::None, |
5026 | internal::None, internal::None, internal::None, internal::None, |
5027 | internal::None> { |
5028 | typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5029 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5030 | T27, T28, T29, T30, T31, T32, T33, T34> type; |
5031 | }; |
5032 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
5033 | typename T6, typename T7, typename T8, typename T9, typename T10, |
5034 | typename T11, typename T12, typename T13, typename T14, typename T15, |
5035 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5036 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5037 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5038 | typename T31, typename T32, typename T33, typename T34, typename T35> |
5039 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5040 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5041 | T31, T32, T33, T34, T35, internal::None, internal::None, internal::None, |
5042 | internal::None, internal::None, internal::None, internal::None, |
5043 | internal::None, internal::None, internal::None, internal::None, |
5044 | internal::None, internal::None, internal::None, internal::None> { |
5045 | typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5046 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5047 | T27, T28, T29, T30, T31, T32, T33, T34, T35> type; |
5048 | }; |
5049 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
5050 | typename T6, typename T7, typename T8, typename T9, typename T10, |
5051 | typename T11, typename T12, typename T13, typename T14, typename T15, |
5052 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5053 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5054 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5055 | typename T31, typename T32, typename T33, typename T34, typename T35, |
5056 | typename T36> |
5057 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5058 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5059 | T31, T32, T33, T34, T35, T36, internal::None, internal::None, |
5060 | internal::None, internal::None, internal::None, internal::None, |
5061 | internal::None, internal::None, internal::None, internal::None, |
5062 | internal::None, internal::None, internal::None, internal::None> { |
5063 | typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5064 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5065 | T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type; |
5066 | }; |
5067 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
5068 | typename T6, typename T7, typename T8, typename T9, typename T10, |
5069 | typename T11, typename T12, typename T13, typename T14, typename T15, |
5070 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5071 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5072 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5073 | typename T31, typename T32, typename T33, typename T34, typename T35, |
5074 | typename T36, typename T37> |
5075 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5076 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5077 | T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None, |
5078 | internal::None, internal::None, internal::None, internal::None, |
5079 | internal::None, internal::None, internal::None, internal::None, |
5080 | internal::None, internal::None, internal::None> { |
5081 | typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5082 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5083 | T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type; |
5084 | }; |
5085 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
5086 | typename T6, typename T7, typename T8, typename T9, typename T10, |
5087 | typename T11, typename T12, typename T13, typename T14, typename T15, |
5088 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5089 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5090 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5091 | typename T31, typename T32, typename T33, typename T34, typename T35, |
5092 | typename T36, typename T37, typename T38> |
5093 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5094 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5095 | T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None, |
5096 | internal::None, internal::None, internal::None, internal::None, |
5097 | internal::None, internal::None, internal::None, internal::None, |
5098 | internal::None, internal::None> { |
5099 | typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5100 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5101 | T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type; |
5102 | }; |
5103 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
5104 | typename T6, typename T7, typename T8, typename T9, typename T10, |
5105 | typename T11, typename T12, typename T13, typename T14, typename T15, |
5106 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5107 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5108 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5109 | typename T31, typename T32, typename T33, typename T34, typename T35, |
5110 | typename T36, typename T37, typename T38, typename T39> |
5111 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5112 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5113 | T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None, |
5114 | internal::None, internal::None, internal::None, internal::None, |
5115 | internal::None, internal::None, internal::None, internal::None, |
5116 | internal::None, internal::None> { |
5117 | typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5118 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5119 | T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type; |
5120 | }; |
5121 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
5122 | typename T6, typename T7, typename T8, typename T9, typename T10, |
5123 | typename T11, typename T12, typename T13, typename T14, typename T15, |
5124 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5125 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5126 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5127 | typename T31, typename T32, typename T33, typename T34, typename T35, |
5128 | typename T36, typename T37, typename T38, typename T39, typename T40> |
5129 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5130 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5131 | T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None, |
5132 | internal::None, internal::None, internal::None, internal::None, |
5133 | internal::None, internal::None, internal::None, internal::None, |
5134 | internal::None> { |
5135 | typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5136 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5137 | T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
5138 | T40> type; |
5139 | }; |
5140 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
5141 | typename T6, typename T7, typename T8, typename T9, typename T10, |
5142 | typename T11, typename T12, typename T13, typename T14, typename T15, |
5143 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5144 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5145 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5146 | typename T31, typename T32, typename T33, typename T34, typename T35, |
5147 | typename T36, typename T37, typename T38, typename T39, typename T40, |
5148 | typename T41> |
5149 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5150 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5151 | T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None, |
5152 | internal::None, internal::None, internal::None, internal::None, |
5153 | internal::None, internal::None, internal::None, internal::None> { |
5154 | typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5155 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5156 | T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, |
5157 | T41> type; |
5158 | }; |
5159 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
5160 | typename T6, typename T7, typename T8, typename T9, typename T10, |
5161 | typename T11, typename T12, typename T13, typename T14, typename T15, |
5162 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5163 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5164 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5165 | typename T31, typename T32, typename T33, typename T34, typename T35, |
5166 | typename T36, typename T37, typename T38, typename T39, typename T40, |
5167 | typename T41, typename T42> |
5168 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5169 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5170 | T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None, |
5171 | internal::None, internal::None, internal::None, internal::None, |
5172 | internal::None, internal::None, internal::None> { |
5173 | typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5174 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5175 | T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, |
5176 | T41, T42> type; |
5177 | }; |
5178 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
5179 | typename T6, typename T7, typename T8, typename T9, typename T10, |
5180 | typename T11, typename T12, typename T13, typename T14, typename T15, |
5181 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5182 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5183 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5184 | typename T31, typename T32, typename T33, typename T34, typename T35, |
5185 | typename T36, typename T37, typename T38, typename T39, typename T40, |
5186 | typename T41, typename T42, typename T43> |
5187 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5188 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5189 | T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
5190 | internal::None, internal::None, internal::None, internal::None, |
5191 | internal::None, internal::None, internal::None> { |
5192 | typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5193 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5194 | T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, |
5195 | T41, T42, T43> type; |
5196 | }; |
5197 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
5198 | typename T6, typename T7, typename T8, typename T9, typename T10, |
5199 | typename T11, typename T12, typename T13, typename T14, typename T15, |
5200 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5201 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5202 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5203 | typename T31, typename T32, typename T33, typename T34, typename T35, |
5204 | typename T36, typename T37, typename T38, typename T39, typename T40, |
5205 | typename T41, typename T42, typename T43, typename T44> |
5206 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5207 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5208 | T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, |
5209 | internal::None, internal::None, internal::None, internal::None, |
5210 | internal::None, internal::None> { |
5211 | typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5212 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5213 | T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, |
5214 | T41, T42, T43, T44> type; |
5215 | }; |
5216 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
5217 | typename T6, typename T7, typename T8, typename T9, typename T10, |
5218 | typename T11, typename T12, typename T13, typename T14, typename T15, |
5219 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5220 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5221 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5222 | typename T31, typename T32, typename T33, typename T34, typename T35, |
5223 | typename T36, typename T37, typename T38, typename T39, typename T40, |
5224 | typename T41, typename T42, typename T43, typename T44, typename T45> |
5225 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5226 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5227 | T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, |
5228 | internal::None, internal::None, internal::None, internal::None, |
5229 | internal::None> { |
5230 | typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5231 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5232 | T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, |
5233 | T41, T42, T43, T44, T45> type; |
5234 | }; |
5235 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
5236 | typename T6, typename T7, typename T8, typename T9, typename T10, |
5237 | typename T11, typename T12, typename T13, typename T14, typename T15, |
5238 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5239 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5240 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5241 | typename T31, typename T32, typename T33, typename T34, typename T35, |
5242 | typename T36, typename T37, typename T38, typename T39, typename T40, |
5243 | typename T41, typename T42, typename T43, typename T44, typename T45, |
5244 | typename T46> |
5245 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5246 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5247 | T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, |
5248 | T46, internal::None, internal::None, internal::None, internal::None> { |
5249 | typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5250 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5251 | T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, |
5252 | T41, T42, T43, T44, T45, T46> type; |
5253 | }; |
5254 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
5255 | typename T6, typename T7, typename T8, typename T9, typename T10, |
5256 | typename T11, typename T12, typename T13, typename T14, typename T15, |
5257 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5258 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5259 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5260 | typename T31, typename T32, typename T33, typename T34, typename T35, |
5261 | typename T36, typename T37, typename T38, typename T39, typename T40, |
5262 | typename T41, typename T42, typename T43, typename T44, typename T45, |
5263 | typename T46, typename T47> |
5264 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5265 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5266 | T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, |
5267 | T46, T47, internal::None, internal::None, internal::None> { |
5268 | typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5269 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5270 | T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, |
5271 | T41, T42, T43, T44, T45, T46, T47> type; |
5272 | }; |
5273 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
5274 | typename T6, typename T7, typename T8, typename T9, typename T10, |
5275 | typename T11, typename T12, typename T13, typename T14, typename T15, |
5276 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5277 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5278 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5279 | typename T31, typename T32, typename T33, typename T34, typename T35, |
5280 | typename T36, typename T37, typename T38, typename T39, typename T40, |
5281 | typename T41, typename T42, typename T43, typename T44, typename T45, |
5282 | typename T46, typename T47, typename T48> |
5283 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5284 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5285 | T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, |
5286 | T46, T47, T48, internal::None, internal::None> { |
5287 | typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5288 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5289 | T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, |
5290 | T41, T42, T43, T44, T45, T46, T47, T48> type; |
5291 | }; |
5292 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
5293 | typename T6, typename T7, typename T8, typename T9, typename T10, |
5294 | typename T11, typename T12, typename T13, typename T14, typename T15, |
5295 | typename T16, typename T17, typename T18, typename T19, typename T20, |
5296 | typename T21, typename T22, typename T23, typename T24, typename T25, |
5297 | typename T26, typename T27, typename T28, typename T29, typename T30, |
5298 | typename T31, typename T32, typename T33, typename T34, typename T35, |
5299 | typename T36, typename T37, typename T38, typename T39, typename T40, |
5300 | typename T41, typename T42, typename T43, typename T44, typename T45, |
5301 | typename T46, typename T47, typename T48, typename T49> |
5302 | struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, |
5303 | T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, |
5304 | T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, |
5305 | T46, T47, T48, T49, internal::None> { |
5306 | typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
5307 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
5308 | T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, |
5309 | T41, T42, T43, T44, T45, T46, T47, T48, T49> type; |
5310 | }; |
5311 | |
5312 | namespace internal { |
5313 | |
5314 | # define GTEST_TEMPLATE_ template <typename T> class |
5315 | |
5316 | // The template "selector" struct TemplateSel<Tmpl> is used to |
5317 | // represent Tmpl, which must be a class template with one type |
5318 | // parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined |
5319 | // as the type Tmpl<T>. This allows us to actually instantiate the |
5320 | // template "selected" by TemplateSel<Tmpl>. |
5321 | // |
5322 | // This trick is necessary for simulating typedef for class templates, |
5323 | // which C++ doesn't support directly. |
5324 | template <GTEST_TEMPLATE_ Tmpl> |
5325 | struct TemplateSel { |
5326 | template <typename T> |
5327 | struct Bind { |
5328 | typedef Tmpl<T> type; |
5329 | }; |
5330 | }; |
5331 | |
5332 | # define GTEST_BIND_(TmplSel, T) \ |
5333 | TmplSel::template Bind<T>::type |
5334 | |
5335 | // A unique struct template used as the default value for the |
5336 | // arguments of class template Templates. This allows us to simulate |
5337 | // variadic templates (e.g. Templates<int>, Templates<int, double>, |
5338 | // and etc), which C++ doesn't support directly. |
5339 | template <typename T> |
5340 | struct NoneT {}; |
5341 | |
5342 | // The following family of struct and struct templates are used to |
5343 | // represent template lists. In particular, TemplatesN<T1, T2, ..., |
5344 | // TN> represents a list of N templates (T1, T2, ..., and TN). Except |
5345 | // for Templates0, every struct in the family has two member types: |
5346 | // Head for the selector of the first template in the list, and Tail |
5347 | // for the rest of the list. |
5348 | |
5349 | // The empty template list. |
5350 | struct Templates0 {}; |
5351 | |
5352 | // Template lists of length 1, 2, 3, and so on. |
5353 | |
5354 | template <GTEST_TEMPLATE_ T1> |
5355 | struct Templates1 { |
5356 | typedef TemplateSel<T1> Head; |
5357 | typedef Templates0 Tail; |
5358 | }; |
5359 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2> |
5360 | struct Templates2 { |
5361 | typedef TemplateSel<T1> Head; |
5362 | typedef Templates1<T2> Tail; |
5363 | }; |
5364 | |
5365 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3> |
5366 | struct Templates3 { |
5367 | typedef TemplateSel<T1> Head; |
5368 | typedef Templates2<T2, T3> Tail; |
5369 | }; |
5370 | |
5371 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5372 | GTEST_TEMPLATE_ T4> |
5373 | struct Templates4 { |
5374 | typedef TemplateSel<T1> Head; |
5375 | typedef Templates3<T2, T3, T4> Tail; |
5376 | }; |
5377 | |
5378 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5379 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5> |
5380 | struct Templates5 { |
5381 | typedef TemplateSel<T1> Head; |
5382 | typedef Templates4<T2, T3, T4, T5> Tail; |
5383 | }; |
5384 | |
5385 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5386 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6> |
5387 | struct Templates6 { |
5388 | typedef TemplateSel<T1> Head; |
5389 | typedef Templates5<T2, T3, T4, T5, T6> Tail; |
5390 | }; |
5391 | |
5392 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5393 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5394 | GTEST_TEMPLATE_ T7> |
5395 | struct Templates7 { |
5396 | typedef TemplateSel<T1> Head; |
5397 | typedef Templates6<T2, T3, T4, T5, T6, T7> Tail; |
5398 | }; |
5399 | |
5400 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5401 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5402 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8> |
5403 | struct Templates8 { |
5404 | typedef TemplateSel<T1> Head; |
5405 | typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail; |
5406 | }; |
5407 | |
5408 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5409 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5410 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9> |
5411 | struct Templates9 { |
5412 | typedef TemplateSel<T1> Head; |
5413 | typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail; |
5414 | }; |
5415 | |
5416 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5417 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5418 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5419 | GTEST_TEMPLATE_ T10> |
5420 | struct Templates10 { |
5421 | typedef TemplateSel<T1> Head; |
5422 | typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail; |
5423 | }; |
5424 | |
5425 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5426 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5427 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5428 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11> |
5429 | struct Templates11 { |
5430 | typedef TemplateSel<T1> Head; |
5431 | typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail; |
5432 | }; |
5433 | |
5434 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5435 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5436 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5437 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12> |
5438 | struct Templates12 { |
5439 | typedef TemplateSel<T1> Head; |
5440 | typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail; |
5441 | }; |
5442 | |
5443 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5444 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5445 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5446 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5447 | GTEST_TEMPLATE_ T13> |
5448 | struct Templates13 { |
5449 | typedef TemplateSel<T1> Head; |
5450 | typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail; |
5451 | }; |
5452 | |
5453 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5454 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5455 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5456 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5457 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14> |
5458 | struct Templates14 { |
5459 | typedef TemplateSel<T1> Head; |
5460 | typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
5461 | T14> Tail; |
5462 | }; |
5463 | |
5464 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5465 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5466 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5467 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5468 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15> |
5469 | struct Templates15 { |
5470 | typedef TemplateSel<T1> Head; |
5471 | typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5472 | T15> Tail; |
5473 | }; |
5474 | |
5475 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5476 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5477 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5478 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5479 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5480 | GTEST_TEMPLATE_ T16> |
5481 | struct Templates16 { |
5482 | typedef TemplateSel<T1> Head; |
5483 | typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5484 | T15, T16> Tail; |
5485 | }; |
5486 | |
5487 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5488 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5489 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5490 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5491 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5492 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17> |
5493 | struct Templates17 { |
5494 | typedef TemplateSel<T1> Head; |
5495 | typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5496 | T15, T16, T17> Tail; |
5497 | }; |
5498 | |
5499 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5500 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5501 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5502 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5503 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5504 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18> |
5505 | struct Templates18 { |
5506 | typedef TemplateSel<T1> Head; |
5507 | typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5508 | T15, T16, T17, T18> Tail; |
5509 | }; |
5510 | |
5511 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5512 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5513 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5514 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5515 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5516 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5517 | GTEST_TEMPLATE_ T19> |
5518 | struct Templates19 { |
5519 | typedef TemplateSel<T1> Head; |
5520 | typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5521 | T15, T16, T17, T18, T19> Tail; |
5522 | }; |
5523 | |
5524 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5525 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5526 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5527 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5528 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5529 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5530 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20> |
5531 | struct Templates20 { |
5532 | typedef TemplateSel<T1> Head; |
5533 | typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5534 | T15, T16, T17, T18, T19, T20> Tail; |
5535 | }; |
5536 | |
5537 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5538 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5539 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5540 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5541 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5542 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5543 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21> |
5544 | struct Templates21 { |
5545 | typedef TemplateSel<T1> Head; |
5546 | typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5547 | T15, T16, T17, T18, T19, T20, T21> Tail; |
5548 | }; |
5549 | |
5550 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5551 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5552 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5553 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5554 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5555 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5556 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5557 | GTEST_TEMPLATE_ T22> |
5558 | struct Templates22 { |
5559 | typedef TemplateSel<T1> Head; |
5560 | typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5561 | T15, T16, T17, T18, T19, T20, T21, T22> Tail; |
5562 | }; |
5563 | |
5564 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5565 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5566 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5567 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5568 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5569 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5570 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5571 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23> |
5572 | struct Templates23 { |
5573 | typedef TemplateSel<T1> Head; |
5574 | typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5575 | T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail; |
5576 | }; |
5577 | |
5578 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5579 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5580 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5581 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5582 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5583 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5584 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5585 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24> |
5586 | struct Templates24 { |
5587 | typedef TemplateSel<T1> Head; |
5588 | typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5589 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail; |
5590 | }; |
5591 | |
5592 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5593 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5594 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5595 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5596 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5597 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5598 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5599 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5600 | GTEST_TEMPLATE_ T25> |
5601 | struct Templates25 { |
5602 | typedef TemplateSel<T1> Head; |
5603 | typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5604 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail; |
5605 | }; |
5606 | |
5607 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5608 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5609 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5610 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5611 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5612 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5613 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5614 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5615 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26> |
5616 | struct Templates26 { |
5617 | typedef TemplateSel<T1> Head; |
5618 | typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5619 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail; |
5620 | }; |
5621 | |
5622 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5623 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5624 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5625 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5626 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5627 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5628 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5629 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5630 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27> |
5631 | struct Templates27 { |
5632 | typedef TemplateSel<T1> Head; |
5633 | typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5634 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail; |
5635 | }; |
5636 | |
5637 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5638 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5639 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5640 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5641 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5642 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5643 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5644 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5645 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5646 | GTEST_TEMPLATE_ T28> |
5647 | struct Templates28 { |
5648 | typedef TemplateSel<T1> Head; |
5649 | typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5650 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
5651 | T28> Tail; |
5652 | }; |
5653 | |
5654 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5655 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5656 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5657 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5658 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5659 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5660 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5661 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5662 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5663 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29> |
5664 | struct Templates29 { |
5665 | typedef TemplateSel<T1> Head; |
5666 | typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5667 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5668 | T29> Tail; |
5669 | }; |
5670 | |
5671 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5672 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5673 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5674 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5675 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5676 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5677 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5678 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5679 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5680 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30> |
5681 | struct Templates30 { |
5682 | typedef TemplateSel<T1> Head; |
5683 | typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5684 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5685 | T29, T30> Tail; |
5686 | }; |
5687 | |
5688 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5689 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5690 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5691 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5692 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5693 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5694 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5695 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5696 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5697 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
5698 | GTEST_TEMPLATE_ T31> |
5699 | struct Templates31 { |
5700 | typedef TemplateSel<T1> Head; |
5701 | typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5702 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5703 | T29, T30, T31> Tail; |
5704 | }; |
5705 | |
5706 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5707 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5708 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5709 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5710 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5711 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5712 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5713 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5714 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5715 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
5716 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32> |
5717 | struct Templates32 { |
5718 | typedef TemplateSel<T1> Head; |
5719 | typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5720 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5721 | T29, T30, T31, T32> Tail; |
5722 | }; |
5723 | |
5724 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5725 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5726 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5727 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5728 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5729 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5730 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5731 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5732 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5733 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
5734 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33> |
5735 | struct Templates33 { |
5736 | typedef TemplateSel<T1> Head; |
5737 | typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5738 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5739 | T29, T30, T31, T32, T33> Tail; |
5740 | }; |
5741 | |
5742 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5743 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5744 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5745 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5746 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5747 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5748 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5749 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5750 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5751 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
5752 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
5753 | GTEST_TEMPLATE_ T34> |
5754 | struct Templates34 { |
5755 | typedef TemplateSel<T1> Head; |
5756 | typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5757 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5758 | T29, T30, T31, T32, T33, T34> Tail; |
5759 | }; |
5760 | |
5761 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5762 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5763 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5764 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5765 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5766 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5767 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5768 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5769 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5770 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
5771 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
5772 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35> |
5773 | struct Templates35 { |
5774 | typedef TemplateSel<T1> Head; |
5775 | typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5776 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5777 | T29, T30, T31, T32, T33, T34, T35> Tail; |
5778 | }; |
5779 | |
5780 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5781 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5782 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5783 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5784 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5785 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5786 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5787 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5788 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5789 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
5790 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
5791 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36> |
5792 | struct Templates36 { |
5793 | typedef TemplateSel<T1> Head; |
5794 | typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5795 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5796 | T29, T30, T31, T32, T33, T34, T35, T36> Tail; |
5797 | }; |
5798 | |
5799 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5800 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5801 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5802 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5803 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5804 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5805 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5806 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5807 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5808 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
5809 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
5810 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
5811 | GTEST_TEMPLATE_ T37> |
5812 | struct Templates37 { |
5813 | typedef TemplateSel<T1> Head; |
5814 | typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5815 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5816 | T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail; |
5817 | }; |
5818 | |
5819 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5820 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5821 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5822 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5823 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5824 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5825 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5826 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5827 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5828 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
5829 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
5830 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
5831 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38> |
5832 | struct Templates38 { |
5833 | typedef TemplateSel<T1> Head; |
5834 | typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5835 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5836 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail; |
5837 | }; |
5838 | |
5839 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5840 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5841 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5842 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5843 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5844 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5845 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5846 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5847 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5848 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
5849 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
5850 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
5851 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39> |
5852 | struct Templates39 { |
5853 | typedef TemplateSel<T1> Head; |
5854 | typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5855 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5856 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail; |
5857 | }; |
5858 | |
5859 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5860 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5861 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5862 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5863 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5864 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5865 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5866 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5867 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5868 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
5869 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
5870 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
5871 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
5872 | GTEST_TEMPLATE_ T40> |
5873 | struct Templates40 { |
5874 | typedef TemplateSel<T1> Head; |
5875 | typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5876 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5877 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail; |
5878 | }; |
5879 | |
5880 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5881 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5882 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5883 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5884 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5885 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5886 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5887 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5888 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5889 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
5890 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
5891 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
5892 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
5893 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41> |
5894 | struct Templates41 { |
5895 | typedef TemplateSel<T1> Head; |
5896 | typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5897 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5898 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail; |
5899 | }; |
5900 | |
5901 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5902 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5903 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5904 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5905 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5906 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5907 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5908 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5909 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5910 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
5911 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
5912 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
5913 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
5914 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42> |
5915 | struct Templates42 { |
5916 | typedef TemplateSel<T1> Head; |
5917 | typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5918 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5919 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, |
5920 | T42> Tail; |
5921 | }; |
5922 | |
5923 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5924 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5925 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5926 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5927 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5928 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5929 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5930 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5931 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5932 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
5933 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
5934 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
5935 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
5936 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42, |
5937 | GTEST_TEMPLATE_ T43> |
5938 | struct Templates43 { |
5939 | typedef TemplateSel<T1> Head; |
5940 | typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5941 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5942 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, |
5943 | T43> Tail; |
5944 | }; |
5945 | |
5946 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5947 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5948 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5949 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5950 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5951 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5952 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5953 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5954 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5955 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
5956 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
5957 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
5958 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
5959 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42, |
5960 | GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44> |
5961 | struct Templates44 { |
5962 | typedef TemplateSel<T1> Head; |
5963 | typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5964 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5965 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, |
5966 | T43, T44> Tail; |
5967 | }; |
5968 | |
5969 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5970 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5971 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5972 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5973 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5974 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5975 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5976 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
5977 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
5978 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
5979 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
5980 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
5981 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
5982 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42, |
5983 | GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45> |
5984 | struct Templates45 { |
5985 | typedef TemplateSel<T1> Head; |
5986 | typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
5987 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
5988 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, |
5989 | T43, T44, T45> Tail; |
5990 | }; |
5991 | |
5992 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
5993 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
5994 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
5995 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
5996 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
5997 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
5998 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
5999 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6000 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6001 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6002 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6003 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6004 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
6005 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42, |
6006 | GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45, |
6007 | GTEST_TEMPLATE_ T46> |
6008 | struct Templates46 { |
6009 | typedef TemplateSel<T1> Head; |
6010 | typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6011 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
6012 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, |
6013 | T43, T44, T45, T46> Tail; |
6014 | }; |
6015 | |
6016 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6017 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6018 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6019 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6020 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6021 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6022 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6023 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6024 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6025 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6026 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6027 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6028 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
6029 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42, |
6030 | GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45, |
6031 | GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47> |
6032 | struct Templates47 { |
6033 | typedef TemplateSel<T1> Head; |
6034 | typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6035 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
6036 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, |
6037 | T43, T44, T45, T46, T47> Tail; |
6038 | }; |
6039 | |
6040 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6041 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6042 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6043 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6044 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6045 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6046 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6047 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6048 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6049 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6050 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6051 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6052 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
6053 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42, |
6054 | GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45, |
6055 | GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48> |
6056 | struct Templates48 { |
6057 | typedef TemplateSel<T1> Head; |
6058 | typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6059 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
6060 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, |
6061 | T43, T44, T45, T46, T47, T48> Tail; |
6062 | }; |
6063 | |
6064 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6065 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6066 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6067 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6068 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6069 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6070 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6071 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6072 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6073 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6074 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6075 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6076 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
6077 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42, |
6078 | GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45, |
6079 | GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48, |
6080 | GTEST_TEMPLATE_ T49> |
6081 | struct Templates49 { |
6082 | typedef TemplateSel<T1> Head; |
6083 | typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6084 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
6085 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, |
6086 | T43, T44, T45, T46, T47, T48, T49> Tail; |
6087 | }; |
6088 | |
6089 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6090 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6091 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6092 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6093 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6094 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6095 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6096 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6097 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6098 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6099 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6100 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6101 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
6102 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42, |
6103 | GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45, |
6104 | GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48, |
6105 | GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50> |
6106 | struct Templates50 { |
6107 | typedef TemplateSel<T1> Head; |
6108 | typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6109 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
6110 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, |
6111 | T43, T44, T45, T46, T47, T48, T49, T50> Tail; |
6112 | }; |
6113 | |
6114 | |
6115 | // We don't want to require the users to write TemplatesN<...> directly, |
6116 | // as that would require them to count the length. Templates<...> is much |
6117 | // easier to write, but generates horrible messages when there is a |
6118 | // compiler error, as gcc insists on printing out each template |
6119 | // argument, even if it has the default value (this means Templates<list> |
6120 | // will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler |
6121 | // errors). |
6122 | // |
6123 | // Our solution is to combine the best part of the two approaches: a |
6124 | // user would write Templates<T1, ..., TN>, and Google Test will translate |
6125 | // that to TemplatesN<T1, ..., TN> internally to make error messages |
6126 | // readable. The translation is done by the 'type' member of the |
6127 | // Templates template. |
6128 | template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT, |
6129 | GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT, |
6130 | GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT, |
6131 | GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT, |
6132 | GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT, |
6133 | GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT, |
6134 | GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT, |
6135 | GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT, |
6136 | GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT, |
6137 | GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT, |
6138 | GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT, |
6139 | GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT, |
6140 | GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT, |
6141 | GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT, |
6142 | GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT, |
6143 | GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT, |
6144 | GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT, |
6145 | GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT, |
6146 | GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT, |
6147 | GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT, |
6148 | GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT, |
6149 | GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT, |
6150 | GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT, |
6151 | GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT, |
6152 | GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT> |
6153 | struct Templates { |
6154 | typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6155 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6156 | T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, |
6157 | T42, T43, T44, T45, T46, T47, T48, T49, T50> type; |
6158 | }; |
6159 | |
6160 | template <> |
6161 | struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6162 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6163 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6164 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6165 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6166 | NoneT> { |
6167 | typedef Templates0 type; |
6168 | }; |
6169 | template <GTEST_TEMPLATE_ T1> |
6170 | struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6171 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6172 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6173 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6174 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6175 | NoneT> { |
6176 | typedef Templates1<T1> type; |
6177 | }; |
6178 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2> |
6179 | struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6180 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6181 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6182 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6183 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6184 | NoneT> { |
6185 | typedef Templates2<T1, T2> type; |
6186 | }; |
6187 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3> |
6188 | struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6189 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6190 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6191 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6192 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6193 | typedef Templates3<T1, T2, T3> type; |
6194 | }; |
6195 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6196 | GTEST_TEMPLATE_ T4> |
6197 | struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6198 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6199 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6200 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6201 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6202 | typedef Templates4<T1, T2, T3, T4> type; |
6203 | }; |
6204 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6205 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5> |
6206 | struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6207 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6208 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6209 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6210 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6211 | typedef Templates5<T1, T2, T3, T4, T5> type; |
6212 | }; |
6213 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6214 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6> |
6215 | struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT, |
6216 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6217 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6218 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6219 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6220 | typedef Templates6<T1, T2, T3, T4, T5, T6> type; |
6221 | }; |
6222 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6223 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6224 | GTEST_TEMPLATE_ T7> |
6225 | struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT, |
6226 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6227 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6228 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6229 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6230 | typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type; |
6231 | }; |
6232 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6233 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6234 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8> |
6235 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT, |
6236 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6237 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6238 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6239 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6240 | typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type; |
6241 | }; |
6242 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6243 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6244 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9> |
6245 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT, |
6246 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6247 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6248 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6249 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6250 | typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type; |
6251 | }; |
6252 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6253 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6254 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6255 | GTEST_TEMPLATE_ T10> |
6256 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT, |
6257 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6258 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6259 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6260 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6261 | typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type; |
6262 | }; |
6263 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6264 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6265 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6266 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11> |
6267 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT, |
6268 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6269 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6270 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6271 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6272 | typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type; |
6273 | }; |
6274 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6275 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6276 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6277 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12> |
6278 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT, |
6279 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6280 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6281 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6282 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6283 | typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type; |
6284 | }; |
6285 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6286 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6287 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6288 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6289 | GTEST_TEMPLATE_ T13> |
6290 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT, |
6291 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6292 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6293 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6294 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6295 | typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
6296 | T13> type; |
6297 | }; |
6298 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6299 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6300 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6301 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6302 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14> |
6303 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6304 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6305 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6306 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6307 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6308 | typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6309 | T14> type; |
6310 | }; |
6311 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6312 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6313 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6314 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6315 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15> |
6316 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6317 | T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6318 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6319 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6320 | NoneT, NoneT, NoneT, NoneT, NoneT> { |
6321 | typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6322 | T14, T15> type; |
6323 | }; |
6324 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6325 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6326 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6327 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6328 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6329 | GTEST_TEMPLATE_ T16> |
6330 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6331 | T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6332 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6333 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6334 | NoneT, NoneT, NoneT, NoneT, NoneT> { |
6335 | typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6336 | T14, T15, T16> type; |
6337 | }; |
6338 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6339 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6340 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6341 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6342 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6343 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17> |
6344 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6345 | T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6346 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6347 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6348 | NoneT, NoneT, NoneT, NoneT, NoneT> { |
6349 | typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6350 | T14, T15, T16, T17> type; |
6351 | }; |
6352 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6353 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6354 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6355 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6356 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6357 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18> |
6358 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6359 | T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6360 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6361 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6362 | NoneT, NoneT, NoneT, NoneT> { |
6363 | typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6364 | T14, T15, T16, T17, T18> type; |
6365 | }; |
6366 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6367 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6368 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6369 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6370 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6371 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6372 | GTEST_TEMPLATE_ T19> |
6373 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6374 | T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6375 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6376 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6377 | NoneT, NoneT, NoneT, NoneT> { |
6378 | typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6379 | T14, T15, T16, T17, T18, T19> type; |
6380 | }; |
6381 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6382 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6383 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6384 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6385 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6386 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6387 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20> |
6388 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6389 | T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6390 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6391 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6392 | NoneT, NoneT, NoneT, NoneT> { |
6393 | typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6394 | T14, T15, T16, T17, T18, T19, T20> type; |
6395 | }; |
6396 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6397 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6398 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6399 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6400 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6401 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6402 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21> |
6403 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6404 | T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT, |
6405 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6406 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6407 | NoneT, NoneT, NoneT, NoneT> { |
6408 | typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6409 | T14, T15, T16, T17, T18, T19, T20, T21> type; |
6410 | }; |
6411 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6412 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6413 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6414 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6415 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6416 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6417 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6418 | GTEST_TEMPLATE_ T22> |
6419 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6420 | T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT, |
6421 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6422 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6423 | NoneT, NoneT, NoneT> { |
6424 | typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6425 | T14, T15, T16, T17, T18, T19, T20, T21, T22> type; |
6426 | }; |
6427 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6428 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6429 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6430 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6431 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6432 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6433 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6434 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23> |
6435 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6436 | T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT, |
6437 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6438 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6439 | NoneT, NoneT, NoneT> { |
6440 | typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6441 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type; |
6442 | }; |
6443 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6444 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6445 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6446 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6447 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6448 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6449 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6450 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24> |
6451 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6452 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT, |
6453 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6454 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6455 | NoneT, NoneT, NoneT> { |
6456 | typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6457 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type; |
6458 | }; |
6459 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6460 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6461 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6462 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6463 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6464 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6465 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6466 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6467 | GTEST_TEMPLATE_ T25> |
6468 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6469 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT, |
6470 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6471 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6472 | NoneT, NoneT> { |
6473 | typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6474 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type; |
6475 | }; |
6476 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6477 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6478 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6479 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6480 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6481 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6482 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6483 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6484 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26> |
6485 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6486 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT, |
6487 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6488 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6489 | NoneT, NoneT> { |
6490 | typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6491 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type; |
6492 | }; |
6493 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6494 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6495 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6496 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6497 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6498 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6499 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6500 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6501 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27> |
6502 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6503 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT, |
6504 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6505 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6506 | NoneT, NoneT> { |
6507 | typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6508 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
6509 | T27> type; |
6510 | }; |
6511 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6512 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6513 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6514 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6515 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6516 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6517 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6518 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6519 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6520 | GTEST_TEMPLATE_ T28> |
6521 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6522 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
6523 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6524 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6525 | NoneT, NoneT> { |
6526 | typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6527 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6528 | T28> type; |
6529 | }; |
6530 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6531 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6532 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6533 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6534 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6535 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6536 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6537 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6538 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6539 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29> |
6540 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6541 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6542 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6543 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6544 | NoneT> { |
6545 | typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6546 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6547 | T28, T29> type; |
6548 | }; |
6549 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6550 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6551 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6552 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6553 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6554 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6555 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6556 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6557 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6558 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30> |
6559 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6560 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6561 | T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6562 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6563 | typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6564 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6565 | T28, T29, T30> type; |
6566 | }; |
6567 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6568 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6569 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6570 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6571 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6572 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6573 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6574 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6575 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6576 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6577 | GTEST_TEMPLATE_ T31> |
6578 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6579 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6580 | T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6581 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6582 | typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6583 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6584 | T28, T29, T30, T31> type; |
6585 | }; |
6586 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6587 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6588 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6589 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6590 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6591 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6592 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6593 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6594 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6595 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6596 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32> |
6597 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6598 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6599 | T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6600 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6601 | typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6602 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6603 | T28, T29, T30, T31, T32> type; |
6604 | }; |
6605 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6606 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6607 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6608 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6609 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6610 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6611 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6612 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6613 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6614 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6615 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33> |
6616 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6617 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6618 | T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6619 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6620 | typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6621 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6622 | T28, T29, T30, T31, T32, T33> type; |
6623 | }; |
6624 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6625 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6626 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6627 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6628 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6629 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6630 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6631 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6632 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6633 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6634 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6635 | GTEST_TEMPLATE_ T34> |
6636 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6637 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6638 | T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6639 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6640 | typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6641 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6642 | T28, T29, T30, T31, T32, T33, T34> type; |
6643 | }; |
6644 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6645 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6646 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6647 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6648 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6649 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6650 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6651 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6652 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6653 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6654 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6655 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35> |
6656 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6657 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6658 | T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, |
6659 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6660 | typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6661 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6662 | T28, T29, T30, T31, T32, T33, T34, T35> type; |
6663 | }; |
6664 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6665 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6666 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6667 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6668 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6669 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6670 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6671 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6672 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6673 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6674 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6675 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36> |
6676 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6677 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6678 | T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT, |
6679 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6680 | typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6681 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6682 | T28, T29, T30, T31, T32, T33, T34, T35, T36> type; |
6683 | }; |
6684 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6685 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6686 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6687 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6688 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6689 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6690 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6691 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6692 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6693 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6694 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6695 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6696 | GTEST_TEMPLATE_ T37> |
6697 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6698 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6699 | T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT, |
6700 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6701 | typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6702 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6703 | T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type; |
6704 | }; |
6705 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6706 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6707 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6708 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6709 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6710 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6711 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6712 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6713 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6714 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6715 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6716 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6717 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38> |
6718 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6719 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6720 | T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT, |
6721 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6722 | typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6723 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6724 | T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type; |
6725 | }; |
6726 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6727 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6728 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6729 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6730 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6731 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6732 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6733 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6734 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6735 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6736 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6737 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6738 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39> |
6739 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6740 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6741 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT, |
6742 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6743 | typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6744 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6745 | T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type; |
6746 | }; |
6747 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6748 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6749 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6750 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6751 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6752 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6753 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6754 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6755 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6756 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6757 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6758 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6759 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
6760 | GTEST_TEMPLATE_ T40> |
6761 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6762 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6763 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT, |
6764 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6765 | typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6766 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6767 | T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type; |
6768 | }; |
6769 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6770 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6771 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6772 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6773 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6774 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6775 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6776 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6777 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6778 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6779 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6780 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6781 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
6782 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41> |
6783 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6784 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6785 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT, |
6786 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6787 | typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6788 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6789 | T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, |
6790 | T41> type; |
6791 | }; |
6792 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6793 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6794 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6795 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6796 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6797 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6798 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6799 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6800 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6801 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6802 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6803 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6804 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
6805 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42> |
6806 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6807 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6808 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT, |
6809 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6810 | typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6811 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6812 | T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, |
6813 | T42> type; |
6814 | }; |
6815 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6816 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6817 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6818 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6819 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6820 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6821 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6822 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6823 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6824 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6825 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6826 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6827 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
6828 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42, |
6829 | GTEST_TEMPLATE_ T43> |
6830 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6831 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6832 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
6833 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6834 | typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6835 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6836 | T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, |
6837 | T42, T43> type; |
6838 | }; |
6839 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6840 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6841 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6842 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6843 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6844 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6845 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6846 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6847 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6848 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6849 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6850 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6851 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
6852 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42, |
6853 | GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44> |
6854 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6855 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6856 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, |
6857 | NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6858 | typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6859 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6860 | T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, |
6861 | T42, T43, T44> type; |
6862 | }; |
6863 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6864 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6865 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6866 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6867 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6868 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6869 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6870 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6871 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6872 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6873 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6874 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6875 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
6876 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42, |
6877 | GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45> |
6878 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6879 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6880 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, |
6881 | T45, NoneT, NoneT, NoneT, NoneT, NoneT> { |
6882 | typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6883 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6884 | T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, |
6885 | T42, T43, T44, T45> type; |
6886 | }; |
6887 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6888 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6889 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6890 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6891 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6892 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6893 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6894 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6895 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6896 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6897 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6898 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6899 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
6900 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42, |
6901 | GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45, |
6902 | GTEST_TEMPLATE_ T46> |
6903 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6904 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6905 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, |
6906 | T45, T46, NoneT, NoneT, NoneT, NoneT> { |
6907 | typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6908 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6909 | T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, |
6910 | T42, T43, T44, T45, T46> type; |
6911 | }; |
6912 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6913 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6914 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6915 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6916 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6917 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6918 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6919 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6920 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6921 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6922 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6923 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6924 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
6925 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42, |
6926 | GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45, |
6927 | GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47> |
6928 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6929 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6930 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, |
6931 | T45, T46, T47, NoneT, NoneT, NoneT> { |
6932 | typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6933 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6934 | T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, |
6935 | T42, T43, T44, T45, T46, T47> type; |
6936 | }; |
6937 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6938 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6939 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6940 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6941 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6942 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6943 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6944 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6945 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6946 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6947 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6948 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6949 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
6950 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42, |
6951 | GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45, |
6952 | GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48> |
6953 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6954 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6955 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, |
6956 | T45, T46, T47, T48, NoneT, NoneT> { |
6957 | typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6958 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6959 | T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, |
6960 | T42, T43, T44, T45, T46, T47, T48> type; |
6961 | }; |
6962 | template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3, |
6963 | GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6, |
6964 | GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9, |
6965 | GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12, |
6966 | GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15, |
6967 | GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18, |
6968 | GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21, |
6969 | GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24, |
6970 | GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27, |
6971 | GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30, |
6972 | GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33, |
6973 | GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36, |
6974 | GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39, |
6975 | GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42, |
6976 | GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45, |
6977 | GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48, |
6978 | GTEST_TEMPLATE_ T49> |
6979 | struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, |
6980 | T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, |
6981 | T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, |
6982 | T45, T46, T47, T48, T49, NoneT> { |
6983 | typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
6984 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
6985 | T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, |
6986 | T42, T43, T44, T45, T46, T47, T48, T49> type; |
6987 | }; |
6988 | |
6989 | // The TypeList template makes it possible to use either a single type |
6990 | // or a Types<...> list in TYPED_TEST_CASE() and |
6991 | // INSTANTIATE_TYPED_TEST_CASE_P(). |
6992 | |
6993 | template <typename T> |
6994 | struct TypeList { |
6995 | typedef Types1<T> type; |
6996 | }; |
6997 | |
6998 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
6999 | typename T6, typename T7, typename T8, typename T9, typename T10, |
7000 | typename T11, typename T12, typename T13, typename T14, typename T15, |
7001 | typename T16, typename T17, typename T18, typename T19, typename T20, |
7002 | typename T21, typename T22, typename T23, typename T24, typename T25, |
7003 | typename T26, typename T27, typename T28, typename T29, typename T30, |
7004 | typename T31, typename T32, typename T33, typename T34, typename T35, |
7005 | typename T36, typename T37, typename T38, typename T39, typename T40, |
7006 | typename T41, typename T42, typename T43, typename T44, typename T45, |
7007 | typename T46, typename T47, typename T48, typename T49, typename T50> |
7008 | struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
7009 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
7010 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
7011 | T44, T45, T46, T47, T48, T49, T50> > { |
7012 | typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
7013 | T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
7014 | T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, |
7015 | T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type; |
7016 | }; |
7017 | |
7018 | #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P |
7019 | |
7020 | } // namespace internal |
7021 | } // namespace testing |
7022 | |
7023 | #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ |
7024 | |
7025 | // Due to C++ preprocessor weirdness, we need double indirection to |
7026 | // concatenate two tokens when one of them is __LINE__. Writing |
7027 | // |
7028 | // foo ## __LINE__ |
7029 | // |
7030 | // will result in the token foo__LINE__, instead of foo followed by |
7031 | // the current line number. For more details, see |
7032 | // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6 |
7033 | #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar) |
7034 | #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar |
7035 | |
7036 | class ProtocolMessage; |
7037 | namespace proto2 { class Message; } |
7038 | |
7039 | namespace testing { |
7040 | |
7041 | // Forward declarations. |
7042 | |
7043 | class AssertionResult; // Result of an assertion. |
7044 | class Message; // Represents a failure message. |
7045 | class Test; // Represents a test. |
7046 | class TestInfo; // Information about a test. |
7047 | class TestPartResult; // Result of a test part. |
7048 | class UnitTest; // A collection of test cases. |
7049 | |
7050 | template <typename T> |
7051 | ::std::string PrintToString(const T& value); |
7052 | |
7053 | namespace internal { |
7054 | |
7055 | struct TraceInfo; // Information about a trace point. |
7056 | class ScopedTrace; // Implements scoped trace. |
7057 | class TestInfoImpl; // Opaque implementation of TestInfo |
7058 | class UnitTestImpl; // Opaque implementation of UnitTest |
7059 | |
7060 | // How many times InitGoogleTest() has been called. |
7061 | GTEST_API_ extern int g_init_gtest_count; |
7062 | |
7063 | // The text used in failure messages to indicate the start of the |
7064 | // stack trace. |
7065 | GTEST_API_ extern const char kStackTraceMarker[]; |
7066 | |
7067 | // Two overloaded helpers for checking at compile time whether an |
7068 | // expression is a null pointer literal (i.e. NULL or any 0-valued |
7069 | // compile-time integral constant). Their return values have |
7070 | // different sizes, so we can use sizeof() to test which version is |
7071 | // picked by the compiler. These helpers have no implementations, as |
7072 | // we only need their signatures. |
7073 | // |
7074 | // Given IsNullLiteralHelper(x), the compiler will pick the first |
7075 | // version if x can be implicitly converted to Secret*, and pick the |
7076 | // second version otherwise. Since Secret is a secret and incomplete |
7077 | // type, the only expression a user can write that has type Secret* is |
7078 | // a null pointer literal. Therefore, we know that x is a null |
7079 | // pointer literal if and only if the first version is picked by the |
7080 | // compiler. |
7081 | char IsNullLiteralHelper(Secret* p); |
7082 | char (&IsNullLiteralHelper(...))[2]; // NOLINT |
7083 | |
7084 | // A compile-time bool constant that is true if and only if x is a |
7085 | // null pointer literal (i.e. NULL or any 0-valued compile-time |
7086 | // integral constant). |
7087 | #ifdef GTEST_ELLIPSIS_NEEDS_POD_ |
7088 | // We lose support for NULL detection where the compiler doesn't like |
7089 | // passing non-POD classes through ellipsis (...). |
7090 | # define GTEST_IS_NULL_LITERAL_(x) false |
7091 | #else |
7092 | # define GTEST_IS_NULL_LITERAL_(x) \ |
7093 | (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1) |
7094 | #endif // GTEST_ELLIPSIS_NEEDS_POD_ |
7095 | |
7096 | // Appends the user-supplied message to the Google-Test-generated message. |
7097 | GTEST_API_ std::string AppendUserMessage( |
7098 | const std::string& gtest_msg, const Message& user_msg); |
7099 | |
7100 | #if GTEST_HAS_EXCEPTIONS |
7101 | |
7102 | // This exception is thrown by (and only by) a failed Google Test |
7103 | // assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions |
7104 | // are enabled). We derive it from std::runtime_error, which is for |
7105 | // errors presumably detectable only at run time. Since |
7106 | // std::runtime_error inherits from std::exception, many testing |
7107 | // frameworks know how to extract and print the message inside it. |
7108 | class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error { |
7109 | public: |
7110 | explicit GoogleTestFailureException(const TestPartResult& failure); |
7111 | }; |
7112 | |
7113 | #endif // GTEST_HAS_EXCEPTIONS |
7114 | |
7115 | // A helper class for creating scoped traces in user programs. |
7116 | class GTEST_API_ ScopedTrace { |
7117 | public: |
7118 | // The c'tor pushes the given source file location and message onto |
7119 | // a trace stack maintained by Google Test. |
7120 | ScopedTrace(const char* file, int line, const Message& message); |
7121 | |
7122 | // The d'tor pops the info pushed by the c'tor. |
7123 | // |
7124 | // Note that the d'tor is not virtual in order to be efficient. |
7125 | // Don't inherit from ScopedTrace! |
7126 | ~ScopedTrace(); |
7127 | |
7128 | private: |
7129 | GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace); |
7130 | } GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its |
7131 | // c'tor and d'tor. Therefore it doesn't |
7132 | // need to be used otherwise. |
7133 | |
7134 | // Constructs and returns the message for an equality assertion |
7135 | // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure. |
7136 | // |
7137 | // The first four parameters are the expressions used in the assertion |
7138 | // and their values, as strings. For example, for ASSERT_EQ(foo, bar) |
7139 | // where foo is 5 and bar is 6, we have: |
7140 | // |
7141 | // expected_expression: "foo" |
7142 | // actual_expression: "bar" |
7143 | // expected_value: "5" |
7144 | // actual_value: "6" |
7145 | // |
7146 | // The ignoring_case parameter is true iff the assertion is a |
7147 | // *_STRCASEEQ*. When it's true, the string " (ignoring case)" will |
7148 | // be inserted into the message. |
7149 | GTEST_API_ AssertionResult EqFailure(const char* expected_expression, |
7150 | const char* actual_expression, |
7151 | const std::string& expected_value, |
7152 | const std::string& actual_value, |
7153 | bool ignoring_case); |
7154 | |
7155 | // Constructs a failure message for Boolean assertions such as EXPECT_TRUE. |
7156 | GTEST_API_ std::string GetBoolAssertionFailureMessage( |
7157 | const AssertionResult& assertion_result, |
7158 | const char* expression_text, |
7159 | const char* actual_predicate_value, |
7160 | const char* expected_predicate_value); |
7161 | |
7162 | // This template class represents an IEEE floating-point number |
7163 | // (either single-precision or double-precision, depending on the |
7164 | // template parameters). |
7165 | // |
7166 | // The purpose of this class is to do more sophisticated number |
7167 | // comparison. (Due to round-off error, etc, it's very unlikely that |
7168 | // two floating-points will be equal exactly. Hence a naive |
7169 | // comparison by the == operation often doesn't work.) |
7170 | // |
7171 | // Format of IEEE floating-point: |
7172 | // |
7173 | // The most-significant bit being the leftmost, an IEEE |
7174 | // floating-point looks like |
7175 | // |
7176 | // sign_bit exponent_bits fraction_bits |
7177 | // |
7178 | // Here, sign_bit is a single bit that designates the sign of the |
7179 | // number. |
7180 | // |
7181 | // For float, there are 8 exponent bits and 23 fraction bits. |
7182 | // |
7183 | // For double, there are 11 exponent bits and 52 fraction bits. |
7184 | // |
7185 | // More details can be found at |
7186 | // http://en.wikipedia.org/wiki/IEEE_floating-point_standard. |
7187 | // |
7188 | // Template parameter: |
7189 | // |
7190 | // RawType: the raw floating-point type (either float or double) |
7191 | template <typename RawType> |
7192 | class FloatingPoint { |
7193 | public: |
7194 | // Defines the unsigned integer type that has the same size as the |
7195 | // floating point number. |
7196 | typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits; |
7197 | |
7198 | // Constants. |
7199 | |
7200 | // # of bits in a number. |
7201 | static const size_t kBitCount = 8*sizeof(RawType); |
7202 | |
7203 | // # of fraction bits in a number. |
7204 | static const size_t kFractionBitCount = |
7205 | std::numeric_limits<RawType>::digits - 1; |
7206 | |
7207 | // # of exponent bits in a number. |
7208 | static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount; |
7209 | |
7210 | // The mask for the sign bit. |
7211 | static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1); |
7212 | |
7213 | // The mask for the fraction bits. |
7214 | static const Bits kFractionBitMask = |
7215 | ~static_cast<Bits>(0) >> (kExponentBitCount + 1); |
7216 | |
7217 | // The mask for the exponent bits. |
7218 | static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask); |
7219 | |
7220 | // How many ULP's (Units in the Last Place) we want to tolerate when |
7221 | // comparing two numbers. The larger the value, the more error we |
7222 | // allow. A 0 value means that two numbers must be exactly the same |
7223 | // to be considered equal. |
7224 | // |
7225 | // The maximum error of a single floating-point operation is 0.5 |
7226 | // units in the last place. On Intel CPU's, all floating-point |
7227 | // calculations are done with 80-bit precision, while double has 64 |
7228 | // bits. Therefore, 4 should be enough for ordinary use. |
7229 | // |
7230 | // See the following article for more details on ULP: |
7231 | // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ |
7232 | static const size_t kMaxUlps = 4; |
7233 | |
7234 | // Constructs a FloatingPoint from a raw floating-point number. |
7235 | // |
7236 | // On an Intel CPU, passing a non-normalized NAN (Not a Number) |
7237 | // around may change its bits, although the new value is guaranteed |
7238 | // to be also a NAN. Therefore, don't expect this constructor to |
7239 | // preserve the bits in x when x is a NAN. |
7240 | explicit FloatingPoint(const RawType& x) { u_.value_ = x; } |
7241 | |
7242 | // Static methods |
7243 | |
7244 | // Reinterprets a bit pattern as a floating-point number. |
7245 | // |
7246 | // This function is needed to test the AlmostEquals() method. |
7247 | static RawType ReinterpretBits(const Bits bits) { |
7248 | FloatingPoint fp(0); |
7249 | fp.u_.bits_ = bits; |
7250 | return fp.u_.value_; |
7251 | } |
7252 | |
7253 | // Returns the floating-point number that represent positive infinity. |
7254 | static RawType Infinity() { |
7255 | return ReinterpretBits(kExponentBitMask); |
7256 | } |
7257 | |
7258 | // Returns the maximum representable finite floating-point number. |
7259 | static RawType Max(); |
7260 | |
7261 | // Non-static methods |
7262 | |
7263 | // Returns the bits that represents this number. |
7264 | const Bits &bits() const { return u_.bits_; } |
7265 | |
7266 | // Returns the exponent bits of this number. |
7267 | Bits exponent_bits() const { return kExponentBitMask & u_.bits_; } |
7268 | |
7269 | // Returns the fraction bits of this number. |
7270 | Bits fraction_bits() const { return kFractionBitMask & u_.bits_; } |
7271 | |
7272 | // Returns the sign bit of this number. |
7273 | Bits sign_bit() const { return kSignBitMask & u_.bits_; } |
7274 | |
7275 | // Returns true iff this is NAN (not a number). |
7276 | bool is_nan() const { |
7277 | // It's a NAN if the exponent bits are all ones and the fraction |
7278 | // bits are not entirely zeros. |
7279 | return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0); |
7280 | } |
7281 | |
7282 | // Returns true iff this number is at most kMaxUlps ULP's away from |
7283 | // rhs. In particular, this function: |
7284 | // |
7285 | // - returns false if either number is (or both are) NAN. |
7286 | // - treats really large numbers as almost equal to infinity. |
7287 | // - thinks +0.0 and -0.0 are 0 DLP's apart. |
7288 | bool AlmostEquals(const FloatingPoint& rhs) const { |
7289 | // The IEEE standard says that any comparison operation involving |
7290 | // a NAN must return false. |
7291 | if (is_nan() || rhs.is_nan()) return false; |
7292 | |
7293 | return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_) |
7294 | <= kMaxUlps; |
7295 | } |
7296 | |
7297 | private: |
7298 | // The data type used to store the actual floating-point number. |
7299 | union FloatingPointUnion { |
7300 | RawType value_; // The raw floating-point number. |
7301 | Bits bits_; // The bits that represent the number. |
7302 | }; |
7303 | |
7304 | // Converts an integer from the sign-and-magnitude representation to |
7305 | // the biased representation. More precisely, let N be 2 to the |
7306 | // power of (kBitCount - 1), an integer x is represented by the |
7307 | // unsigned number x + N. |
7308 | // |
7309 | // For instance, |
7310 | // |
7311 | // -N + 1 (the most negative number representable using |
7312 | // sign-and-magnitude) is represented by 1; |
7313 | // 0 is represented by N; and |
7314 | // N - 1 (the biggest number representable using |
7315 | // sign-and-magnitude) is represented by 2N - 1. |
7316 | // |
7317 | // Read http://en.wikipedia.org/wiki/Signed_number_representations |
7318 | // for more details on signed number representations. |
7319 | static Bits SignAndMagnitudeToBiased(const Bits &sam) { |
7320 | if (kSignBitMask & sam) { |
7321 | // sam represents a negative number. |
7322 | return ~sam + 1; |
7323 | } else { |
7324 | // sam represents a positive number. |
7325 | return kSignBitMask | sam; |
7326 | } |
7327 | } |
7328 | |
7329 | // Given two numbers in the sign-and-magnitude representation, |
7330 | // returns the distance between them as an unsigned number. |
7331 | static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1, |
7332 | const Bits &sam2) { |
7333 | const Bits biased1 = SignAndMagnitudeToBiased(sam1); |
7334 | const Bits biased2 = SignAndMagnitudeToBiased(sam2); |
7335 | return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1); |
7336 | } |
7337 | |
7338 | FloatingPointUnion u_; |
7339 | }; |
7340 | |
7341 | // We cannot use std::numeric_limits<T>::max() as it clashes with the max() |
7342 | // macro defined by <windows.h>. |
7343 | template <> |
7344 | inline float FloatingPoint<float>::Max() { return FLT_MAX; } |
7345 | template <> |
7346 | inline double FloatingPoint<double>::Max() { return DBL_MAX; } |
7347 | |
7348 | // Typedefs the instances of the FloatingPoint template class that we |
7349 | // care to use. |
7350 | typedef FloatingPoint<float> Float; |
7351 | typedef FloatingPoint<double> Double; |
7352 | |
7353 | // In order to catch the mistake of putting tests that use different |
7354 | // test fixture classes in the same test case, we need to assign |
7355 | // unique IDs to fixture classes and compare them. The TypeId type is |
7356 | // used to hold such IDs. The user should treat TypeId as an opaque |
7357 | // type: the only operation allowed on TypeId values is to compare |
7358 | // them for equality using the == operator. |
7359 | typedef const void* TypeId; |
7360 | |
7361 | template <typename T> |
7362 | class TypeIdHelper { |
7363 | public: |
7364 | // dummy_ must not have a const type. Otherwise an overly eager |
7365 | // compiler (e.g. MSVC 7.1 & 8.0) may try to merge |
7366 | // TypeIdHelper<T>::dummy_ for different Ts as an "optimization". |
7367 | static bool dummy_; |
7368 | }; |
7369 | |
7370 | template <typename T> |
7371 | bool TypeIdHelper<T>::dummy_ = false; |
7372 | |
7373 | // GetTypeId<T>() returns the ID of type T. Different values will be |
7374 | // returned for different types. Calling the function twice with the |
7375 | // same type argument is guaranteed to return the same ID. |
7376 | template <typename T> |
7377 | TypeId GetTypeId() { |
7378 | // The compiler is required to allocate a different |
7379 | // TypeIdHelper<T>::dummy_ variable for each T used to instantiate |
7380 | // the template. Therefore, the address of dummy_ is guaranteed to |
7381 | // be unique. |
7382 | return &(TypeIdHelper<T>::dummy_); |
7383 | } |
7384 | |
7385 | // Returns the type ID of ::testing::Test. Always call this instead |
7386 | // of GetTypeId< ::testing::Test>() to get the type ID of |
7387 | // ::testing::Test, as the latter may give the wrong result due to a |
7388 | // suspected linker bug when compiling Google Test as a Mac OS X |
7389 | // framework. |
7390 | GTEST_API_ TypeId GetTestTypeId(); |
7391 | |
7392 | // Defines the abstract factory interface that creates instances |
7393 | // of a Test object. |
7394 | class TestFactoryBase { |
7395 | public: |
7396 | virtual ~TestFactoryBase() {} |
7397 | |
7398 | // Creates a test instance to run. The instance is both created and destroyed |
7399 | // within TestInfoImpl::Run() |
7400 | virtual Test* CreateTest() = 0; |
7401 | |
7402 | protected: |
7403 | TestFactoryBase() {} |
7404 | |
7405 | private: |
7406 | GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase); |
7407 | }; |
7408 | |
7409 | // This class provides implementation of TeastFactoryBase interface. |
7410 | // It is used in TEST and TEST_F macros. |
7411 | template <class TestClass> |
7412 | class TestFactoryImpl : public TestFactoryBase { |
7413 | public: |
7414 | virtual Test* CreateTest() { return new TestClass; } |
7415 | }; |
7416 | |
7417 | #if GTEST_OS_WINDOWS |
7418 | |
7419 | // Predicate-formatters for implementing the HRESULT checking macros |
7420 | // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED} |
7421 | // We pass a long instead of HRESULT to avoid causing an |
7422 | // include dependency for the HRESULT type. |
7423 | GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr, |
7424 | long hr); // NOLINT |
7425 | GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr, |
7426 | long hr); // NOLINT |
7427 | |
7428 | #endif // GTEST_OS_WINDOWS |
7429 | |
7430 | // Types of SetUpTestCase() and TearDownTestCase() functions. |
7431 | typedef void (*SetUpTestCaseFunc)(); |
7432 | typedef void (*TearDownTestCaseFunc)(); |
7433 | |
7434 | // Creates a new TestInfo object and registers it with Google Test; |
7435 | // returns the created object. |
7436 | // |
7437 | // Arguments: |
7438 | // |
7439 | // test_case_name: name of the test case |
7440 | // name: name of the test |
7441 | // type_param the name of the test's type parameter, or NULL if |
7442 | // this is not a typed or a type-parameterized test. |
7443 | // value_param text representation of the test's value parameter, |
7444 | // or NULL if this is not a type-parameterized test. |
7445 | // fixture_class_id: ID of the test fixture class |
7446 | // set_up_tc: pointer to the function that sets up the test case |
7447 | // tear_down_tc: pointer to the function that tears down the test case |
7448 | // factory: pointer to the factory that creates a test object. |
7449 | // The newly created TestInfo instance will assume |
7450 | // ownership of the factory object. |
7451 | GTEST_API_ TestInfo* MakeAndRegisterTestInfo( |
7452 | const char* test_case_name, |
7453 | const char* name, |
7454 | const char* type_param, |
7455 | const char* value_param, |
7456 | TypeId fixture_class_id, |
7457 | SetUpTestCaseFunc set_up_tc, |
7458 | TearDownTestCaseFunc tear_down_tc, |
7459 | TestFactoryBase* factory); |
7460 | |
7461 | // If *pstr starts with the given prefix, modifies *pstr to be right |
7462 | // past the prefix and returns true; otherwise leaves *pstr unchanged |
7463 | // and returns false. None of pstr, *pstr, and prefix can be NULL. |
7464 | GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr); |
7465 | |
7466 | #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P |
7467 | |
7468 | // State of the definition of a type-parameterized test case. |
7469 | class GTEST_API_ TypedTestCasePState { |
7470 | public: |
7471 | TypedTestCasePState() : registered_(false) {} |
7472 | |
7473 | // Adds the given test name to defined_test_names_ and return true |
7474 | // if the test case hasn't been registered; otherwise aborts the |
7475 | // program. |
7476 | bool AddTestName(const char* file, int line, const char* case_name, |
7477 | const char* test_name) { |
7478 | if (registered_) { |
7479 | fprintf(stderr, "%s Test %s must be defined before " |
7480 | "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n" , |
7481 | FormatFileLocation(file, line).c_str(), test_name, case_name); |
7482 | fflush(stderr); |
7483 | posix::Abort(); |
7484 | } |
7485 | defined_test_names_.insert(test_name); |
7486 | return true; |
7487 | } |
7488 | |
7489 | // Verifies that registered_tests match the test names in |
7490 | // defined_test_names_; returns registered_tests if successful, or |
7491 | // aborts the program otherwise. |
7492 | const char* VerifyRegisteredTestNames( |
7493 | const char* file, int line, const char* registered_tests); |
7494 | |
7495 | private: |
7496 | bool registered_; |
7497 | ::std::set<const char*> defined_test_names_; |
7498 | }; |
7499 | |
7500 | // Skips to the first non-space char after the first comma in 'str'; |
7501 | // returns NULL if no comma is found in 'str'. |
7502 | inline const char* SkipComma(const char* str) { |
7503 | const char* comma = strchr(str, ','); |
7504 | if (comma == NULL) { |
7505 | return NULL; |
7506 | } |
7507 | while (IsSpace(*(++comma))) {} |
7508 | return comma; |
7509 | } |
7510 | |
7511 | // Returns the prefix of 'str' before the first comma in it; returns |
7512 | // the entire string if it contains no comma. |
7513 | inline std::string GetPrefixUntilComma(const char* str) { |
7514 | const char* comma = strchr(str, ','); |
7515 | return comma == NULL ? str : std::string(str, comma); |
7516 | } |
7517 | |
7518 | // TypeParameterizedTest<Fixture, TestSel, Types>::Register() |
7519 | // registers a list of type-parameterized tests with Google Test. The |
7520 | // return value is insignificant - we just need to return something |
7521 | // such that we can call this function in a namespace scope. |
7522 | // |
7523 | // Implementation note: The GTEST_TEMPLATE_ macro declares a template |
7524 | // template parameter. It's defined in gtest-type-util.h. |
7525 | template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types> |
7526 | class TypeParameterizedTest { |
7527 | public: |
7528 | // 'index' is the index of the test in the type list 'Types' |
7529 | // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase, |
7530 | // Types). Valid values for 'index' are [0, N - 1] where N is the |
7531 | // length of Types. |
7532 | static bool Register(const char* prefix, const char* case_name, |
7533 | const char* test_names, int index) { |
7534 | typedef typename Types::Head Type; |
7535 | typedef Fixture<Type> FixtureClass; |
7536 | typedef typename GTEST_BIND_(TestSel, Type) TestClass; |
7537 | |
7538 | // First, registers the first type-parameterized test in the type |
7539 | // list. |
7540 | MakeAndRegisterTestInfo( |
7541 | (std::string(prefix) + (prefix[0] == '\0' ? "" : "/" ) + case_name + "/" |
7542 | + StreamableToString(index)).c_str(), |
7543 | GetPrefixUntilComma(test_names).c_str(), |
7544 | GetTypeName<Type>().c_str(), |
7545 | NULL, // No value parameter. |
7546 | GetTypeId<FixtureClass>(), |
7547 | TestClass::SetUpTestCase, |
7548 | TestClass::TearDownTestCase, |
7549 | new TestFactoryImpl<TestClass>); |
7550 | |
7551 | // Next, recurses (at compile time) with the tail of the type list. |
7552 | return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail> |
7553 | ::Register(prefix, case_name, test_names, index + 1); |
7554 | } |
7555 | }; |
7556 | |
7557 | // The base case for the compile time recursion. |
7558 | template <GTEST_TEMPLATE_ Fixture, class TestSel> |
7559 | class TypeParameterizedTest<Fixture, TestSel, Types0> { |
7560 | public: |
7561 | static bool Register(const char* /*prefix*/, const char* /*case_name*/, |
7562 | const char* /*test_names*/, int /*index*/) { |
7563 | return true; |
7564 | } |
7565 | }; |
7566 | |
7567 | // TypeParameterizedTestCase<Fixture, Tests, Types>::Register() |
7568 | // registers *all combinations* of 'Tests' and 'Types' with Google |
7569 | // Test. The return value is insignificant - we just need to return |
7570 | // something such that we can call this function in a namespace scope. |
7571 | template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types> |
7572 | class TypeParameterizedTestCase { |
7573 | public: |
7574 | static bool Register(const char* prefix, const char* case_name, |
7575 | const char* test_names) { |
7576 | typedef typename Tests::Head Head; |
7577 | |
7578 | // First, register the first test in 'Test' for each type in 'Types'. |
7579 | TypeParameterizedTest<Fixture, Head, Types>::Register( |
7580 | prefix, case_name, test_names, 0); |
7581 | |
7582 | // Next, recurses (at compile time) with the tail of the test list. |
7583 | return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types> |
7584 | ::Register(prefix, case_name, SkipComma(test_names)); |
7585 | } |
7586 | }; |
7587 | |
7588 | // The base case for the compile time recursion. |
7589 | template <GTEST_TEMPLATE_ Fixture, typename Types> |
7590 | class TypeParameterizedTestCase<Fixture, Templates0, Types> { |
7591 | public: |
7592 | static bool Register(const char* /*prefix*/, const char* /*case_name*/, |
7593 | const char* /*test_names*/) { |
7594 | return true; |
7595 | } |
7596 | }; |
7597 | |
7598 | #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P |
7599 | |
7600 | // Returns the current OS stack trace as an std::string. |
7601 | // |
7602 | // The maximum number of stack frames to be included is specified by |
7603 | // the gtest_stack_trace_depth flag. The skip_count parameter |
7604 | // specifies the number of top frames to be skipped, which doesn't |
7605 | // count against the number of frames to be included. |
7606 | // |
7607 | // For example, if Foo() calls Bar(), which in turn calls |
7608 | // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in |
7609 | // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't. |
7610 | GTEST_API_ std::string GetCurrentOsStackTraceExceptTop( |
7611 | UnitTest* unit_test, int skip_count); |
7612 | |
7613 | // Helpers for suppressing warnings on unreachable code or constant |
7614 | // condition. |
7615 | |
7616 | // Always returns true. |
7617 | GTEST_API_ bool AlwaysTrue(); |
7618 | |
7619 | // Always returns false. |
7620 | inline bool AlwaysFalse() { return !AlwaysTrue(); } |
7621 | |
7622 | // Helper for suppressing false warning from Clang on a const char* |
7623 | // variable declared in a conditional expression always being NULL in |
7624 | // the else branch. |
7625 | struct GTEST_API_ ConstCharPtr { |
7626 | ConstCharPtr(const char* str) : value(str) {} |
7627 | operator bool() const { return true; } |
7628 | const char* value; |
7629 | }; |
7630 | |
7631 | // A simple Linear Congruential Generator for generating random |
7632 | // numbers with a uniform distribution. Unlike rand() and srand(), it |
7633 | // doesn't use global state (and therefore can't interfere with user |
7634 | // code). Unlike rand_r(), it's portable. An LCG isn't very random, |
7635 | // but it's good enough for our purposes. |
7636 | class GTEST_API_ Random { |
7637 | public: |
7638 | static const UInt32 kMaxRange = 1u << 31; |
7639 | |
7640 | explicit Random(UInt32 seed) : state_(seed) {} |
7641 | |
7642 | void Reseed(UInt32 seed) { state_ = seed; } |
7643 | |
7644 | // Generates a random number from [0, range). Crashes if 'range' is |
7645 | // 0 or greater than kMaxRange. |
7646 | UInt32 Generate(UInt32 range); |
7647 | |
7648 | private: |
7649 | UInt32 state_; |
7650 | GTEST_DISALLOW_COPY_AND_ASSIGN_(Random); |
7651 | }; |
7652 | |
7653 | // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a |
7654 | // compiler error iff T1 and T2 are different types. |
7655 | template <typename T1, typename T2> |
7656 | struct CompileAssertTypesEqual; |
7657 | |
7658 | template <typename T> |
7659 | struct CompileAssertTypesEqual<T, T> { |
7660 | }; |
7661 | |
7662 | // Removes the reference from a type if it is a reference type, |
7663 | // otherwise leaves it unchanged. This is the same as |
7664 | // tr1::remove_reference, which is not widely available yet. |
7665 | template <typename T> |
7666 | struct RemoveReference { typedef T type; }; // NOLINT |
7667 | template <typename T> |
7668 | struct RemoveReference<T&> { typedef T type; }; // NOLINT |
7669 | |
7670 | // A handy wrapper around RemoveReference that works when the argument |
7671 | // T depends on template parameters. |
7672 | #define GTEST_REMOVE_REFERENCE_(T) \ |
7673 | typename ::testing::internal::RemoveReference<T>::type |
7674 | |
7675 | // Removes const from a type if it is a const type, otherwise leaves |
7676 | // it unchanged. This is the same as tr1::remove_const, which is not |
7677 | // widely available yet. |
7678 | template <typename T> |
7679 | struct RemoveConst { typedef T type; }; // NOLINT |
7680 | template <typename T> |
7681 | struct RemoveConst<const T> { typedef T type; }; // NOLINT |
7682 | |
7683 | // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above |
7684 | // definition to fail to remove the const in 'const int[3]' and 'const |
7685 | // char[3][4]'. The following specialization works around the bug. |
7686 | template <typename T, size_t N> |
7687 | struct RemoveConst<const T[N]> { |
7688 | typedef typename RemoveConst<T>::type type[N]; |
7689 | }; |
7690 | |
7691 | #if defined(_MSC_VER) && _MSC_VER < 1400 |
7692 | // This is the only specialization that allows VC++ 7.1 to remove const in |
7693 | // 'const int[3] and 'const int[3][4]'. However, it causes trouble with GCC |
7694 | // and thus needs to be conditionally compiled. |
7695 | template <typename T, size_t N> |
7696 | struct RemoveConst<T[N]> { |
7697 | typedef typename RemoveConst<T>::type type[N]; |
7698 | }; |
7699 | #endif |
7700 | |
7701 | // A handy wrapper around RemoveConst that works when the argument |
7702 | // T depends on template parameters. |
7703 | #define GTEST_REMOVE_CONST_(T) \ |
7704 | typename ::testing::internal::RemoveConst<T>::type |
7705 | |
7706 | // Turns const U&, U&, const U, and U all into U. |
7707 | #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \ |
7708 | GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T)) |
7709 | |
7710 | // Adds reference to a type if it is not a reference type, |
7711 | // otherwise leaves it unchanged. This is the same as |
7712 | // tr1::add_reference, which is not widely available yet. |
7713 | template <typename T> |
7714 | struct AddReference { typedef T& type; }; // NOLINT |
7715 | template <typename T> |
7716 | struct AddReference<T&> { typedef T& type; }; // NOLINT |
7717 | |
7718 | // A handy wrapper around AddReference that works when the argument T |
7719 | // depends on template parameters. |
7720 | #define GTEST_ADD_REFERENCE_(T) \ |
7721 | typename ::testing::internal::AddReference<T>::type |
7722 | |
7723 | // Adds a reference to const on top of T as necessary. For example, |
7724 | // it transforms |
7725 | // |
7726 | // char ==> const char& |
7727 | // const char ==> const char& |
7728 | // char& ==> const char& |
7729 | // const char& ==> const char& |
7730 | // |
7731 | // The argument T must depend on some template parameters. |
7732 | #define GTEST_REFERENCE_TO_CONST_(T) \ |
7733 | GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T)) |
7734 | |
7735 | // ImplicitlyConvertible<From, To>::value is a compile-time bool |
7736 | // constant that's true iff type From can be implicitly converted to |
7737 | // type To. |
7738 | template <typename From, typename To> |
7739 | class ImplicitlyConvertible { |
7740 | private: |
7741 | // We need the following helper functions only for their types. |
7742 | // They have no implementations. |
7743 | |
7744 | // MakeFrom() is an expression whose type is From. We cannot simply |
7745 | // use From(), as the type From may not have a public default |
7746 | // constructor. |
7747 | static From MakeFrom(); |
7748 | |
7749 | // These two functions are overloaded. Given an expression |
7750 | // Helper(x), the compiler will pick the first version if x can be |
7751 | // implicitly converted to type To; otherwise it will pick the |
7752 | // second version. |
7753 | // |
7754 | // The first version returns a value of size 1, and the second |
7755 | // version returns a value of size 2. Therefore, by checking the |
7756 | // size of Helper(x), which can be done at compile time, we can tell |
7757 | // which version of Helper() is used, and hence whether x can be |
7758 | // implicitly converted to type To. |
7759 | static char Helper(To); |
7760 | static char (&Helper(...))[2]; // NOLINT |
7761 | |
7762 | // We have to put the 'public' section after the 'private' section, |
7763 | // or MSVC refuses to compile the code. |
7764 | public: |
7765 | // MSVC warns about implicitly converting from double to int for |
7766 | // possible loss of data, so we need to temporarily disable the |
7767 | // warning. |
7768 | #ifdef _MSC_VER |
7769 | # pragma warning(push) // Saves the current warning state. |
7770 | # pragma warning(disable:4244) // Temporarily disables warning 4244. |
7771 | |
7772 | static const bool value = |
7773 | sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1; |
7774 | # pragma warning(pop) // Restores the warning state. |
7775 | #elif defined(__BORLANDC__) |
7776 | // C++Builder cannot use member overload resolution during template |
7777 | // instantiation. The simplest workaround is to use its C++0x type traits |
7778 | // functions (C++Builder 2009 and above only). |
7779 | static const bool value = __is_convertible(From, To); |
7780 | #else |
7781 | static const bool value = |
7782 | sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1; |
7783 | #endif // _MSV_VER |
7784 | }; |
7785 | template <typename From, typename To> |
7786 | const bool ImplicitlyConvertible<From, To>::value; |
7787 | |
7788 | // IsAProtocolMessage<T>::value is a compile-time bool constant that's |
7789 | // true iff T is type ProtocolMessage, proto2::Message, or a subclass |
7790 | // of those. |
7791 | template <typename T> |
7792 | struct IsAProtocolMessage |
7793 | : public bool_constant< |
7794 | ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value || |
7795 | ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> { |
7796 | }; |
7797 | |
7798 | // When the compiler sees expression IsContainerTest<C>(0), if C is an |
7799 | // STL-style container class, the first overload of IsContainerTest |
7800 | // will be viable (since both C::iterator* and C::const_iterator* are |
7801 | // valid types and NULL can be implicitly converted to them). It will |
7802 | // be picked over the second overload as 'int' is a perfect match for |
7803 | // the type of argument 0. If C::iterator or C::const_iterator is not |
7804 | // a valid type, the first overload is not viable, and the second |
7805 | // overload will be picked. Therefore, we can determine whether C is |
7806 | // a container class by checking the type of IsContainerTest<C>(0). |
7807 | // The value of the expression is insignificant. |
7808 | // |
7809 | // Note that we look for both C::iterator and C::const_iterator. The |
7810 | // reason is that C++ injects the name of a class as a member of the |
7811 | // class itself (e.g. you can refer to class iterator as either |
7812 | // 'iterator' or 'iterator::iterator'). If we look for C::iterator |
7813 | // only, for example, we would mistakenly think that a class named |
7814 | // iterator is an STL container. |
7815 | // |
7816 | // Also note that the simpler approach of overloading |
7817 | // IsContainerTest(typename C::const_iterator*) and |
7818 | // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++. |
7819 | typedef int IsContainer; |
7820 | template <class C> |
7821 | IsContainer IsContainerTest(int /* dummy */, |
7822 | typename C::iterator* /* it */ = NULL, |
7823 | typename C::const_iterator* /* const_it */ = NULL) { |
7824 | return 0; |
7825 | } |
7826 | |
7827 | typedef char IsNotContainer; |
7828 | template <class C> |
7829 | IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; } |
7830 | |
7831 | // EnableIf<condition>::type is void when 'Cond' is true, and |
7832 | // undefined when 'Cond' is false. To use SFINAE to make a function |
7833 | // overload only apply when a particular expression is true, add |
7834 | // "typename EnableIf<expression>::type* = 0" as the last parameter. |
7835 | template<bool> struct EnableIf; |
7836 | template<> struct EnableIf<true> { typedef void type; }; // NOLINT |
7837 | |
7838 | // Utilities for native arrays. |
7839 | |
7840 | // ArrayEq() compares two k-dimensional native arrays using the |
7841 | // elements' operator==, where k can be any integer >= 0. When k is |
7842 | // 0, ArrayEq() degenerates into comparing a single pair of values. |
7843 | |
7844 | template <typename T, typename U> |
7845 | bool ArrayEq(const T* lhs, size_t size, const U* rhs); |
7846 | |
7847 | // This generic version is used when k is 0. |
7848 | template <typename T, typename U> |
7849 | inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; } |
7850 | |
7851 | // This overload is used when k >= 1. |
7852 | template <typename T, typename U, size_t N> |
7853 | inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) { |
7854 | return internal::ArrayEq(lhs, N, rhs); |
7855 | } |
7856 | |
7857 | // This helper reduces code bloat. If we instead put its logic inside |
7858 | // the previous ArrayEq() function, arrays with different sizes would |
7859 | // lead to different copies of the template code. |
7860 | template <typename T, typename U> |
7861 | bool ArrayEq(const T* lhs, size_t size, const U* rhs) { |
7862 | for (size_t i = 0; i != size; i++) { |
7863 | if (!internal::ArrayEq(lhs[i], rhs[i])) |
7864 | return false; |
7865 | } |
7866 | return true; |
7867 | } |
7868 | |
7869 | // Finds the first element in the iterator range [begin, end) that |
7870 | // equals elem. Element may be a native array type itself. |
7871 | template <typename Iter, typename Element> |
7872 | Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) { |
7873 | for (Iter it = begin; it != end; ++it) { |
7874 | if (internal::ArrayEq(*it, elem)) |
7875 | return it; |
7876 | } |
7877 | return end; |
7878 | } |
7879 | |
7880 | // CopyArray() copies a k-dimensional native array using the elements' |
7881 | // operator=, where k can be any integer >= 0. When k is 0, |
7882 | // CopyArray() degenerates into copying a single value. |
7883 | |
7884 | template <typename T, typename U> |
7885 | void CopyArray(const T* from, size_t size, U* to); |
7886 | |
7887 | // This generic version is used when k is 0. |
7888 | template <typename T, typename U> |
7889 | inline void CopyArray(const T& from, U* to) { *to = from; } |
7890 | |
7891 | // This overload is used when k >= 1. |
7892 | template <typename T, typename U, size_t N> |
7893 | inline void CopyArray(const T(&from)[N], U(*to)[N]) { |
7894 | internal::CopyArray(from, N, *to); |
7895 | } |
7896 | |
7897 | // This helper reduces code bloat. If we instead put its logic inside |
7898 | // the previous CopyArray() function, arrays with different sizes |
7899 | // would lead to different copies of the template code. |
7900 | template <typename T, typename U> |
7901 | void CopyArray(const T* from, size_t size, U* to) { |
7902 | for (size_t i = 0; i != size; i++) { |
7903 | internal::CopyArray(from[i], to + i); |
7904 | } |
7905 | } |
7906 | |
7907 | // The relation between an NativeArray object (see below) and the |
7908 | // native array it represents. |
7909 | enum RelationToSource { |
7910 | kReference, // The NativeArray references the native array. |
7911 | kCopy // The NativeArray makes a copy of the native array and |
7912 | // owns the copy. |
7913 | }; |
7914 | |
7915 | // Adapts a native array to a read-only STL-style container. Instead |
7916 | // of the complete STL container concept, this adaptor only implements |
7917 | // members useful for Google Mock's container matchers. New members |
7918 | // should be added as needed. To simplify the implementation, we only |
7919 | // support Element being a raw type (i.e. having no top-level const or |
7920 | // reference modifier). It's the client's responsibility to satisfy |
7921 | // this requirement. Element can be an array type itself (hence |
7922 | // multi-dimensional arrays are supported). |
7923 | template <typename Element> |
7924 | class NativeArray { |
7925 | public: |
7926 | // STL-style container typedefs. |
7927 | typedef Element value_type; |
7928 | typedef Element* iterator; |
7929 | typedef const Element* const_iterator; |
7930 | |
7931 | // Constructs from a native array. |
7932 | NativeArray(const Element* array, size_t count, RelationToSource relation) { |
7933 | Init(array, count, relation); |
7934 | } |
7935 | |
7936 | // Copy constructor. |
7937 | NativeArray(const NativeArray& rhs) { |
7938 | Init(rhs.array_, rhs.size_, rhs.relation_to_source_); |
7939 | } |
7940 | |
7941 | ~NativeArray() { |
7942 | // Ensures that the user doesn't instantiate NativeArray with a |
7943 | // const or reference type. |
7944 | static_cast<void>(StaticAssertTypeEqHelper<Element, |
7945 | GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>()); |
7946 | if (relation_to_source_ == kCopy) |
7947 | delete[] array_; |
7948 | } |
7949 | |
7950 | // STL-style container methods. |
7951 | size_t size() const { return size_; } |
7952 | const_iterator begin() const { return array_; } |
7953 | const_iterator end() const { return array_ + size_; } |
7954 | bool operator==(const NativeArray& rhs) const { |
7955 | return size() == rhs.size() && |
7956 | ArrayEq(begin(), size(), rhs.begin()); |
7957 | } |
7958 | |
7959 | private: |
7960 | // Initializes this object; makes a copy of the input array if |
7961 | // 'relation' is kCopy. |
7962 | void Init(const Element* array, size_t a_size, RelationToSource relation) { |
7963 | if (relation == kReference) { |
7964 | array_ = array; |
7965 | } else { |
7966 | Element* const copy = new Element[a_size]; |
7967 | CopyArray(array, a_size, copy); |
7968 | array_ = copy; |
7969 | } |
7970 | size_ = a_size; |
7971 | relation_to_source_ = relation; |
7972 | } |
7973 | |
7974 | const Element* array_; |
7975 | size_t size_; |
7976 | RelationToSource relation_to_source_; |
7977 | |
7978 | GTEST_DISALLOW_ASSIGN_(NativeArray); |
7979 | }; |
7980 | |
7981 | } // namespace internal |
7982 | } // namespace testing |
7983 | |
7984 | #define GTEST_MESSAGE_AT_(file, line, message, result_type) \ |
7985 | ::testing::internal::AssertHelper(result_type, file, line, message) \ |
7986 | = ::testing::Message() |
7987 | |
7988 | #define GTEST_MESSAGE_(message, result_type) \ |
7989 | GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type) |
7990 | |
7991 | #define GTEST_FATAL_FAILURE_(message) \ |
7992 | return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure) |
7993 | |
7994 | #define GTEST_NONFATAL_FAILURE_(message) \ |
7995 | GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure) |
7996 | |
7997 | #define GTEST_SUCCESS_(message) \ |
7998 | GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess) |
7999 | |
8000 | // Suppresses MSVC warnings 4072 (unreachable code) for the code following |
8001 | // statement if it returns or throws (or doesn't return or throw in some |
8002 | // situations). |
8003 | #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \ |
8004 | if (::testing::internal::AlwaysTrue()) { statement; } |
8005 | |
8006 | #define GTEST_TEST_THROW_(statement, expected_exception, fail) \ |
8007 | GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ |
8008 | if (::testing::internal::ConstCharPtr gtest_msg = "") { \ |
8009 | bool gtest_caught_expected = false; \ |
8010 | try { \ |
8011 | GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ |
8012 | } \ |
8013 | catch (expected_exception const&) { \ |
8014 | gtest_caught_expected = true; \ |
8015 | } \ |
8016 | catch (...) { \ |
8017 | gtest_msg.value = \ |
8018 | "Expected: " #statement " throws an exception of type " \ |
8019 | #expected_exception ".\n Actual: it throws a different type."; \ |
8020 | goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \ |
8021 | } \ |
8022 | if (!gtest_caught_expected) { \ |
8023 | gtest_msg.value = \ |
8024 | "Expected: " #statement " throws an exception of type " \ |
8025 | #expected_exception ".\n Actual: it throws nothing."; \ |
8026 | goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \ |
8027 | } \ |
8028 | } else \ |
8029 | GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \ |
8030 | fail(gtest_msg.value) |
8031 | |
8032 | #define GTEST_TEST_NO_THROW_(statement, fail) \ |
8033 | GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ |
8034 | if (::testing::internal::AlwaysTrue()) { \ |
8035 | try { \ |
8036 | GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ |
8037 | } \ |
8038 | catch (...) { \ |
8039 | goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \ |
8040 | } \ |
8041 | } else \ |
8042 | GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \ |
8043 | fail("Expected: " #statement " doesn't throw an exception.\n" \ |
8044 | " Actual: it throws.") |
8045 | |
8046 | #define GTEST_TEST_ANY_THROW_(statement, fail) \ |
8047 | GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ |
8048 | if (::testing::internal::AlwaysTrue()) { \ |
8049 | bool gtest_caught_any = false; \ |
8050 | try { \ |
8051 | GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ |
8052 | } \ |
8053 | catch (...) { \ |
8054 | gtest_caught_any = true; \ |
8055 | } \ |
8056 | if (!gtest_caught_any) { \ |
8057 | goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \ |
8058 | } \ |
8059 | } else \ |
8060 | GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \ |
8061 | fail("Expected: " #statement " throws an exception.\n" \ |
8062 | " Actual: it doesn't.") |
8063 | |
8064 | |
8065 | // Implements Boolean test assertions such as EXPECT_TRUE. expression can be |
8066 | // either a boolean expression or an AssertionResult. text is a textual |
8067 | // represenation of expression as it was passed into the EXPECT_TRUE. |
8068 | #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \ |
8069 | GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ |
8070 | if (const ::testing::AssertionResult gtest_ar_ = \ |
8071 | ::testing::AssertionResult(expression)) \ |
8072 | ; \ |
8073 | else \ |
8074 | fail(::testing::internal::GetBoolAssertionFailureMessage(\ |
8075 | gtest_ar_, text, #actual, #expected).c_str()) |
8076 | |
8077 | #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \ |
8078 | GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ |
8079 | if (::testing::internal::AlwaysTrue()) { \ |
8080 | ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \ |
8081 | GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ |
8082 | if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \ |
8083 | goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \ |
8084 | } \ |
8085 | } else \ |
8086 | GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \ |
8087 | fail("Expected: " #statement " doesn't generate new fatal " \ |
8088 | "failures in the current thread.\n" \ |
8089 | " Actual: it does.") |
8090 | |
8091 | // Expands to the name of the class that implements the given test. |
8092 | #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ |
8093 | test_case_name##_##test_name##_Test |
8094 | |
8095 | // Helper macro for defining tests. |
8096 | #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\ |
8097 | class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\ |
8098 | public:\ |
8099 | GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\ |
8100 | private:\ |
8101 | virtual void TestBody();\ |
8102 | static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\ |
8103 | GTEST_DISALLOW_COPY_AND_ASSIGN_(\ |
8104 | GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\ |
8105 | };\ |
8106 | \ |
8107 | ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\ |
8108 | ::test_info_ =\ |
8109 | ::testing::internal::MakeAndRegisterTestInfo(\ |
8110 | #test_case_name, #test_name, NULL, NULL, \ |
8111 | (parent_id), \ |
8112 | parent_class::SetUpTestCase, \ |
8113 | parent_class::TearDownTestCase, \ |
8114 | new ::testing::internal::TestFactoryImpl<\ |
8115 | GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\ |
8116 | void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() |
8117 | |
8118 | #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ |
8119 | // Copyright 2005, Google Inc. |
8120 | // All rights reserved. |
8121 | // |
8122 | // Redistribution and use in source and binary forms, with or without |
8123 | // modification, are permitted provided that the following conditions are |
8124 | // met: |
8125 | // |
8126 | // * Redistributions of source code must retain the above copyright |
8127 | // notice, this list of conditions and the following disclaimer. |
8128 | // * Redistributions in binary form must reproduce the above |
8129 | // copyright notice, this list of conditions and the following disclaimer |
8130 | // in the documentation and/or other materials provided with the |
8131 | // distribution. |
8132 | // * Neither the name of Google Inc. nor the names of its |
8133 | // contributors may be used to endorse or promote products derived from |
8134 | // this software without specific prior written permission. |
8135 | // |
8136 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
8137 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
8138 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
8139 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
8140 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
8141 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
8142 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
8143 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
8144 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
8145 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
8146 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
8147 | // |
8148 | // Author: wan@google.com (Zhanyong Wan) |
8149 | // |
8150 | // The Google C++ Testing Framework (Google Test) |
8151 | // |
8152 | // This header file defines the public API for death tests. It is |
8153 | // #included by gtest.h so a user doesn't need to include this |
8154 | // directly. |
8155 | |
8156 | #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ |
8157 | #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ |
8158 | |
8159 | // Copyright 2005, Google Inc. |
8160 | // All rights reserved. |
8161 | // |
8162 | // Redistribution and use in source and binary forms, with or without |
8163 | // modification, are permitted provided that the following conditions are |
8164 | // met: |
8165 | // |
8166 | // * Redistributions of source code must retain the above copyright |
8167 | // notice, this list of conditions and the following disclaimer. |
8168 | // * Redistributions in binary form must reproduce the above |
8169 | // copyright notice, this list of conditions and the following disclaimer |
8170 | // in the documentation and/or other materials provided with the |
8171 | // distribution. |
8172 | // * Neither the name of Google Inc. nor the names of its |
8173 | // contributors may be used to endorse or promote products derived from |
8174 | // this software without specific prior written permission. |
8175 | // |
8176 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
8177 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
8178 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
8179 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
8180 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
8181 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
8182 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
8183 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
8184 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
8185 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
8186 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
8187 | // |
8188 | // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) |
8189 | // |
8190 | // The Google C++ Testing Framework (Google Test) |
8191 | // |
8192 | // This header file defines internal utilities needed for implementing |
8193 | // death tests. They are subject to change without notice. |
8194 | |
8195 | #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ |
8196 | #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ |
8197 | |
8198 | |
8199 | #include <stdio.h> |
8200 | |
8201 | namespace testing { |
8202 | namespace internal { |
8203 | |
8204 | GTEST_DECLARE_string_(internal_run_death_test); |
8205 | |
8206 | // Names of the flags (needed for parsing Google Test flags). |
8207 | const char kDeathTestStyleFlag[] = "death_test_style" ; |
8208 | const char kDeathTestUseFork[] = "death_test_use_fork" ; |
8209 | const char kInternalRunDeathTestFlag[] = "internal_run_death_test" ; |
8210 | |
8211 | #if GTEST_HAS_DEATH_TEST |
8212 | |
8213 | // DeathTest is a class that hides much of the complexity of the |
8214 | // GTEST_DEATH_TEST_ macro. It is abstract; its static Create method |
8215 | // returns a concrete class that depends on the prevailing death test |
8216 | // style, as defined by the --gtest_death_test_style and/or |
8217 | // --gtest_internal_run_death_test flags. |
8218 | |
8219 | // In describing the results of death tests, these terms are used with |
8220 | // the corresponding definitions: |
8221 | // |
8222 | // exit status: The integer exit information in the format specified |
8223 | // by wait(2) |
8224 | // exit code: The integer code passed to exit(3), _exit(2), or |
8225 | // returned from main() |
8226 | class GTEST_API_ DeathTest { |
8227 | public: |
8228 | // Create returns false if there was an error determining the |
8229 | // appropriate action to take for the current death test; for example, |
8230 | // if the gtest_death_test_style flag is set to an invalid value. |
8231 | // The LastMessage method will return a more detailed message in that |
8232 | // case. Otherwise, the DeathTest pointer pointed to by the "test" |
8233 | // argument is set. If the death test should be skipped, the pointer |
8234 | // is set to NULL; otherwise, it is set to the address of a new concrete |
8235 | // DeathTest object that controls the execution of the current test. |
8236 | static bool Create(const char* statement, const RE* regex, |
8237 | const char* file, int line, DeathTest** test); |
8238 | DeathTest(); |
8239 | virtual ~DeathTest() { } |
8240 | |
8241 | // A helper class that aborts a death test when it's deleted. |
8242 | class ReturnSentinel { |
8243 | public: |
8244 | explicit ReturnSentinel(DeathTest* test) : test_(test) { } |
8245 | ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); } |
8246 | private: |
8247 | DeathTest* const test_; |
8248 | GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel); |
8249 | } GTEST_ATTRIBUTE_UNUSED_; |
8250 | |
8251 | // An enumeration of possible roles that may be taken when a death |
8252 | // test is encountered. EXECUTE means that the death test logic should |
8253 | // be executed immediately. OVERSEE means that the program should prepare |
8254 | // the appropriate environment for a child process to execute the death |
8255 | // test, then wait for it to complete. |
8256 | enum TestRole { OVERSEE_TEST, EXECUTE_TEST }; |
8257 | |
8258 | // An enumeration of the three reasons that a test might be aborted. |
8259 | enum AbortReason { |
8260 | TEST_ENCOUNTERED_RETURN_STATEMENT, |
8261 | TEST_THREW_EXCEPTION, |
8262 | TEST_DID_NOT_DIE |
8263 | }; |
8264 | |
8265 | // Assumes one of the above roles. |
8266 | virtual TestRole AssumeRole() = 0; |
8267 | |
8268 | // Waits for the death test to finish and returns its status. |
8269 | virtual int Wait() = 0; |
8270 | |
8271 | // Returns true if the death test passed; that is, the test process |
8272 | // exited during the test, its exit status matches a user-supplied |
8273 | // predicate, and its stderr output matches a user-supplied regular |
8274 | // expression. |
8275 | // The user-supplied predicate may be a macro expression rather |
8276 | // than a function pointer or functor, or else Wait and Passed could |
8277 | // be combined. |
8278 | virtual bool Passed(bool exit_status_ok) = 0; |
8279 | |
8280 | // Signals that the death test did not die as expected. |
8281 | virtual void Abort(AbortReason reason) = 0; |
8282 | |
8283 | // Returns a human-readable outcome message regarding the outcome of |
8284 | // the last death test. |
8285 | static const char* LastMessage(); |
8286 | |
8287 | static void set_last_death_test_message(const std::string& message); |
8288 | |
8289 | private: |
8290 | // A string containing a description of the outcome of the last death test. |
8291 | static std::string last_death_test_message_; |
8292 | |
8293 | GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest); |
8294 | }; |
8295 | |
8296 | // Factory interface for death tests. May be mocked out for testing. |
8297 | class DeathTestFactory { |
8298 | public: |
8299 | virtual ~DeathTestFactory() { } |
8300 | virtual bool Create(const char* statement, const RE* regex, |
8301 | const char* file, int line, DeathTest** test) = 0; |
8302 | }; |
8303 | |
8304 | // A concrete DeathTestFactory implementation for normal use. |
8305 | class DefaultDeathTestFactory : public DeathTestFactory { |
8306 | public: |
8307 | virtual bool Create(const char* statement, const RE* regex, |
8308 | const char* file, int line, DeathTest** test); |
8309 | }; |
8310 | |
8311 | // Returns true if exit_status describes a process that was terminated |
8312 | // by a signal, or exited normally with a nonzero exit code. |
8313 | GTEST_API_ bool ExitedUnsuccessfully(int exit_status); |
8314 | |
8315 | // Traps C++ exceptions escaping statement and reports them as test |
8316 | // failures. Note that trapping SEH exceptions is not implemented here. |
8317 | # if GTEST_HAS_EXCEPTIONS |
8318 | # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \ |
8319 | try { \ |
8320 | GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ |
8321 | } catch (const ::std::exception& gtest_exception) { \ |
8322 | fprintf(\ |
8323 | stderr, \ |
8324 | "\n%s: Caught std::exception-derived exception escaping the " \ |
8325 | "death test statement. Exception message: %s\n", \ |
8326 | ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \ |
8327 | gtest_exception.what()); \ |
8328 | fflush(stderr); \ |
8329 | death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \ |
8330 | } catch (...) { \ |
8331 | death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \ |
8332 | } |
8333 | |
8334 | # else |
8335 | # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \ |
8336 | GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) |
8337 | |
8338 | # endif |
8339 | |
8340 | // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*, |
8341 | // ASSERT_EXIT*, and EXPECT_EXIT*. |
8342 | # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \ |
8343 | GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ |
8344 | if (::testing::internal::AlwaysTrue()) { \ |
8345 | const ::testing::internal::RE& gtest_regex = (regex); \ |
8346 | ::testing::internal::DeathTest* gtest_dt; \ |
8347 | if (!::testing::internal::DeathTest::Create(#statement, >est_regex, \ |
8348 | __FILE__, __LINE__, >est_dt)) { \ |
8349 | goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \ |
8350 | } \ |
8351 | if (gtest_dt != NULL) { \ |
8352 | ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \ |
8353 | gtest_dt_ptr(gtest_dt); \ |
8354 | switch (gtest_dt->AssumeRole()) { \ |
8355 | case ::testing::internal::DeathTest::OVERSEE_TEST: \ |
8356 | if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \ |
8357 | goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \ |
8358 | } \ |
8359 | break; \ |
8360 | case ::testing::internal::DeathTest::EXECUTE_TEST: { \ |
8361 | ::testing::internal::DeathTest::ReturnSentinel \ |
8362 | gtest_sentinel(gtest_dt); \ |
8363 | GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \ |
8364 | gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \ |
8365 | break; \ |
8366 | } \ |
8367 | default: \ |
8368 | break; \ |
8369 | } \ |
8370 | } \ |
8371 | } else \ |
8372 | GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \ |
8373 | fail(::testing::internal::DeathTest::LastMessage()) |
8374 | // The symbol "fail" here expands to something into which a message |
8375 | // can be streamed. |
8376 | |
8377 | // This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in |
8378 | // NDEBUG mode. In this case we need the statements to be executed, the regex is |
8379 | // ignored, and the macro must accept a streamed message even though the message |
8380 | // is never printed. |
8381 | # define GTEST_EXECUTE_STATEMENT_(statement, regex) \ |
8382 | GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ |
8383 | if (::testing::internal::AlwaysTrue()) { \ |
8384 | GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ |
8385 | } else \ |
8386 | ::testing::Message() |
8387 | |
8388 | // A class representing the parsed contents of the |
8389 | // --gtest_internal_run_death_test flag, as it existed when |
8390 | // RUN_ALL_TESTS was called. |
8391 | class InternalRunDeathTestFlag { |
8392 | public: |
8393 | InternalRunDeathTestFlag(const std::string& a_file, |
8394 | int a_line, |
8395 | int an_index, |
8396 | int a_write_fd) |
8397 | : file_(a_file), line_(a_line), index_(an_index), |
8398 | write_fd_(a_write_fd) {} |
8399 | |
8400 | ~InternalRunDeathTestFlag() { |
8401 | if (write_fd_ >= 0) |
8402 | posix::Close(write_fd_); |
8403 | } |
8404 | |
8405 | const std::string& file() const { return file_; } |
8406 | int line() const { return line_; } |
8407 | int index() const { return index_; } |
8408 | int write_fd() const { return write_fd_; } |
8409 | |
8410 | private: |
8411 | std::string file_; |
8412 | int line_; |
8413 | int index_; |
8414 | int write_fd_; |
8415 | |
8416 | GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag); |
8417 | }; |
8418 | |
8419 | // Returns a newly created InternalRunDeathTestFlag object with fields |
8420 | // initialized from the GTEST_FLAG(internal_run_death_test) flag if |
8421 | // the flag is specified; otherwise returns NULL. |
8422 | InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag(); |
8423 | |
8424 | #else // GTEST_HAS_DEATH_TEST |
8425 | |
8426 | // This macro is used for implementing macros such as |
8427 | // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where |
8428 | // death tests are not supported. Those macros must compile on such systems |
8429 | // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on |
8430 | // systems that support death tests. This allows one to write such a macro |
8431 | // on a system that does not support death tests and be sure that it will |
8432 | // compile on a death-test supporting system. |
8433 | // |
8434 | // Parameters: |
8435 | // statement - A statement that a macro such as EXPECT_DEATH would test |
8436 | // for program termination. This macro has to make sure this |
8437 | // statement is compiled but not executed, to ensure that |
8438 | // EXPECT_DEATH_IF_SUPPORTED compiles with a certain |
8439 | // parameter iff EXPECT_DEATH compiles with it. |
8440 | // regex - A regex that a macro such as EXPECT_DEATH would use to test |
8441 | // the output of statement. This parameter has to be |
8442 | // compiled but not evaluated by this macro, to ensure that |
8443 | // this macro only accepts expressions that a macro such as |
8444 | // EXPECT_DEATH would accept. |
8445 | // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED |
8446 | // and a return statement for ASSERT_DEATH_IF_SUPPORTED. |
8447 | // This ensures that ASSERT_DEATH_IF_SUPPORTED will not |
8448 | // compile inside functions where ASSERT_DEATH doesn't |
8449 | // compile. |
8450 | // |
8451 | // The branch that has an always false condition is used to ensure that |
8452 | // statement and regex are compiled (and thus syntactically correct) but |
8453 | // never executed. The unreachable code macro protects the terminator |
8454 | // statement from generating an 'unreachable code' warning in case |
8455 | // statement unconditionally returns or throws. The Message constructor at |
8456 | // the end allows the syntax of streaming additional messages into the |
8457 | // macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH. |
8458 | # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \ |
8459 | GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ |
8460 | if (::testing::internal::AlwaysTrue()) { \ |
8461 | GTEST_LOG_(WARNING) \ |
8462 | << "Death tests are not supported on this platform.\n" \ |
8463 | << "Statement '" #statement "' cannot be verified."; \ |
8464 | } else if (::testing::internal::AlwaysFalse()) { \ |
8465 | ::testing::internal::RE::PartialMatch(".*", (regex)); \ |
8466 | GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ |
8467 | terminator; \ |
8468 | } else \ |
8469 | ::testing::Message() |
8470 | |
8471 | #endif // GTEST_HAS_DEATH_TEST |
8472 | |
8473 | } // namespace internal |
8474 | } // namespace testing |
8475 | |
8476 | #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ |
8477 | |
8478 | namespace testing { |
8479 | |
8480 | // This flag controls the style of death tests. Valid values are "threadsafe", |
8481 | // meaning that the death test child process will re-execute the test binary |
8482 | // from the start, running only a single death test, or "fast", |
8483 | // meaning that the child process will execute the test logic immediately |
8484 | // after forking. |
8485 | GTEST_DECLARE_string_(death_test_style); |
8486 | |
8487 | #if GTEST_HAS_DEATH_TEST |
8488 | |
8489 | namespace internal { |
8490 | |
8491 | // Returns a Boolean value indicating whether the caller is currently |
8492 | // executing in the context of the death test child process. Tools such as |
8493 | // Valgrind heap checkers may need this to modify their behavior in death |
8494 | // tests. IMPORTANT: This is an internal utility. Using it may break the |
8495 | // implementation of death tests. User code MUST NOT use it. |
8496 | GTEST_API_ bool InDeathTestChild(); |
8497 | |
8498 | } // namespace internal |
8499 | |
8500 | // The following macros are useful for writing death tests. |
8501 | |
8502 | // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is |
8503 | // executed: |
8504 | // |
8505 | // 1. It generates a warning if there is more than one active |
8506 | // thread. This is because it's safe to fork() or clone() only |
8507 | // when there is a single thread. |
8508 | // |
8509 | // 2. The parent process clone()s a sub-process and runs the death |
8510 | // test in it; the sub-process exits with code 0 at the end of the |
8511 | // death test, if it hasn't exited already. |
8512 | // |
8513 | // 3. The parent process waits for the sub-process to terminate. |
8514 | // |
8515 | // 4. The parent process checks the exit code and error message of |
8516 | // the sub-process. |
8517 | // |
8518 | // Examples: |
8519 | // |
8520 | // ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number"); |
8521 | // for (int i = 0; i < 5; i++) { |
8522 | // EXPECT_DEATH(server.ProcessRequest(i), |
8523 | // "Invalid request .* in ProcessRequest()") |
8524 | // << "Failed to die on request " << i; |
8525 | // } |
8526 | // |
8527 | // ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting"); |
8528 | // |
8529 | // bool KilledBySIGHUP(int exit_code) { |
8530 | // return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP; |
8531 | // } |
8532 | // |
8533 | // ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!"); |
8534 | // |
8535 | // On the regular expressions used in death tests: |
8536 | // |
8537 | // On POSIX-compliant systems (*nix), we use the <regex.h> library, |
8538 | // which uses the POSIX extended regex syntax. |
8539 | // |
8540 | // On other platforms (e.g. Windows), we only support a simple regex |
8541 | // syntax implemented as part of Google Test. This limited |
8542 | // implementation should be enough most of the time when writing |
8543 | // death tests; though it lacks many features you can find in PCRE |
8544 | // or POSIX extended regex syntax. For example, we don't support |
8545 | // union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and |
8546 | // repetition count ("x{5,7}"), among others. |
8547 | // |
8548 | // Below is the syntax that we do support. We chose it to be a |
8549 | // subset of both PCRE and POSIX extended regex, so it's easy to |
8550 | // learn wherever you come from. In the following: 'A' denotes a |
8551 | // literal character, period (.), or a single \\ escape sequence; |
8552 | // 'x' and 'y' denote regular expressions; 'm' and 'n' are for |
8553 | // natural numbers. |
8554 | // |
8555 | // c matches any literal character c |
8556 | // \\d matches any decimal digit |
8557 | // \\D matches any character that's not a decimal digit |
8558 | // \\f matches \f |
8559 | // \\n matches \n |
8560 | // \\r matches \r |
8561 | // \\s matches any ASCII whitespace, including \n |
8562 | // \\S matches any character that's not a whitespace |
8563 | // \\t matches \t |
8564 | // \\v matches \v |
8565 | // \\w matches any letter, _, or decimal digit |
8566 | // \\W matches any character that \\w doesn't match |
8567 | // \\c matches any literal character c, which must be a punctuation |
8568 | // . matches any single character except \n |
8569 | // A? matches 0 or 1 occurrences of A |
8570 | // A* matches 0 or many occurrences of A |
8571 | // A+ matches 1 or many occurrences of A |
8572 | // ^ matches the beginning of a string (not that of each line) |
8573 | // $ matches the end of a string (not that of each line) |
8574 | // xy matches x followed by y |
8575 | // |
8576 | // If you accidentally use PCRE or POSIX extended regex features |
8577 | // not implemented by us, you will get a run-time failure. In that |
8578 | // case, please try to rewrite your regular expression within the |
8579 | // above syntax. |
8580 | // |
8581 | // This implementation is *not* meant to be as highly tuned or robust |
8582 | // as a compiled regex library, but should perform well enough for a |
8583 | // death test, which already incurs significant overhead by launching |
8584 | // a child process. |
8585 | // |
8586 | // Known caveats: |
8587 | // |
8588 | // A "threadsafe" style death test obtains the path to the test |
8589 | // program from argv[0] and re-executes it in the sub-process. For |
8590 | // simplicity, the current implementation doesn't search the PATH |
8591 | // when launching the sub-process. This means that the user must |
8592 | // invoke the test program via a path that contains at least one |
8593 | // path separator (e.g. path/to/foo_test and |
8594 | // /absolute/path/to/bar_test are fine, but foo_test is not). This |
8595 | // is rarely a problem as people usually don't put the test binary |
8596 | // directory in PATH. |
8597 | // |
8598 | // TODO(wan@google.com): make thread-safe death tests search the PATH. |
8599 | |
8600 | // Asserts that a given statement causes the program to exit, with an |
8601 | // integer exit status that satisfies predicate, and emitting error output |
8602 | // that matches regex. |
8603 | # define ASSERT_EXIT(statement, predicate, regex) \ |
8604 | GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) |
8605 | |
8606 | // Like ASSERT_EXIT, but continues on to successive tests in the |
8607 | // test case, if any: |
8608 | # define EXPECT_EXIT(statement, predicate, regex) \ |
8609 | GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) |
8610 | |
8611 | // Asserts that a given statement causes the program to exit, either by |
8612 | // explicitly exiting with a nonzero exit code or being killed by a |
8613 | // signal, and emitting error output that matches regex. |
8614 | # define ASSERT_DEATH(statement, regex) \ |
8615 | ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) |
8616 | |
8617 | // Like ASSERT_DEATH, but continues on to successive tests in the |
8618 | // test case, if any: |
8619 | # define EXPECT_DEATH(statement, regex) \ |
8620 | EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) |
8621 | |
8622 | // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: |
8623 | |
8624 | // Tests that an exit code describes a normal exit with a given exit code. |
8625 | class GTEST_API_ ExitedWithCode { |
8626 | public: |
8627 | explicit ExitedWithCode(int exit_code); |
8628 | bool operator()(int exit_status) const; |
8629 | private: |
8630 | // No implementation - assignment is unsupported. |
8631 | void operator=(const ExitedWithCode& other); |
8632 | |
8633 | const int exit_code_; |
8634 | }; |
8635 | |
8636 | # if !GTEST_OS_WINDOWS |
8637 | // Tests that an exit code describes an exit due to termination by a |
8638 | // given signal. |
8639 | class GTEST_API_ KilledBySignal { |
8640 | public: |
8641 | explicit KilledBySignal(int signum); |
8642 | bool operator()(int exit_status) const; |
8643 | private: |
8644 | const int signum_; |
8645 | }; |
8646 | # endif // !GTEST_OS_WINDOWS |
8647 | |
8648 | // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode. |
8649 | // The death testing framework causes this to have interesting semantics, |
8650 | // since the sideeffects of the call are only visible in opt mode, and not |
8651 | // in debug mode. |
8652 | // |
8653 | // In practice, this can be used to test functions that utilize the |
8654 | // LOG(DFATAL) macro using the following style: |
8655 | // |
8656 | // int DieInDebugOr12(int* sideeffect) { |
8657 | // if (sideeffect) { |
8658 | // *sideeffect = 12; |
8659 | // } |
8660 | // LOG(DFATAL) << "death"; |
8661 | // return 12; |
8662 | // } |
8663 | // |
8664 | // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) { |
8665 | // int sideeffect = 0; |
8666 | // // Only asserts in dbg. |
8667 | // EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death"); |
8668 | // |
8669 | // #ifdef NDEBUG |
8670 | // // opt-mode has sideeffect visible. |
8671 | // EXPECT_EQ(12, sideeffect); |
8672 | // #else |
8673 | // // dbg-mode no visible sideeffect. |
8674 | // EXPECT_EQ(0, sideeffect); |
8675 | // #endif |
8676 | // } |
8677 | // |
8678 | // This will assert that DieInDebugReturn12InOpt() crashes in debug |
8679 | // mode, usually due to a DCHECK or LOG(DFATAL), but returns the |
8680 | // appropriate fallback value (12 in this case) in opt mode. If you |
8681 | // need to test that a function has appropriate side-effects in opt |
8682 | // mode, include assertions against the side-effects. A general |
8683 | // pattern for this is: |
8684 | // |
8685 | // EXPECT_DEBUG_DEATH({ |
8686 | // // Side-effects here will have an effect after this statement in |
8687 | // // opt mode, but none in debug mode. |
8688 | // EXPECT_EQ(12, DieInDebugOr12(&sideeffect)); |
8689 | // }, "death"); |
8690 | // |
8691 | # ifdef NDEBUG |
8692 | |
8693 | # define EXPECT_DEBUG_DEATH(statement, regex) \ |
8694 | GTEST_EXECUTE_STATEMENT_(statement, regex) |
8695 | |
8696 | # define ASSERT_DEBUG_DEATH(statement, regex) \ |
8697 | GTEST_EXECUTE_STATEMENT_(statement, regex) |
8698 | |
8699 | # else |
8700 | |
8701 | # define EXPECT_DEBUG_DEATH(statement, regex) \ |
8702 | EXPECT_DEATH(statement, regex) |
8703 | |
8704 | # define ASSERT_DEBUG_DEATH(statement, regex) \ |
8705 | ASSERT_DEATH(statement, regex) |
8706 | |
8707 | # endif // NDEBUG for EXPECT_DEBUG_DEATH |
8708 | #endif // GTEST_HAS_DEATH_TEST |
8709 | |
8710 | // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and |
8711 | // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if |
8712 | // death tests are supported; otherwise they just issue a warning. This is |
8713 | // useful when you are combining death test assertions with normal test |
8714 | // assertions in one test. |
8715 | #if GTEST_HAS_DEATH_TEST |
8716 | # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ |
8717 | EXPECT_DEATH(statement, regex) |
8718 | # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ |
8719 | ASSERT_DEATH(statement, regex) |
8720 | #else |
8721 | # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ |
8722 | GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, ) |
8723 | # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ |
8724 | GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return) |
8725 | #endif |
8726 | |
8727 | } // namespace testing |
8728 | |
8729 | #endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ |
8730 | // This file was GENERATED by command: |
8731 | // pump.py gtest-param-test.h.pump |
8732 | // DO NOT EDIT BY HAND!!! |
8733 | |
8734 | // Copyright 2008, Google Inc. |
8735 | // All rights reserved. |
8736 | // |
8737 | // Redistribution and use in source and binary forms, with or without |
8738 | // modification, are permitted provided that the following conditions are |
8739 | // met: |
8740 | // |
8741 | // * Redistributions of source code must retain the above copyright |
8742 | // notice, this list of conditions and the following disclaimer. |
8743 | // * Redistributions in binary form must reproduce the above |
8744 | // copyright notice, this list of conditions and the following disclaimer |
8745 | // in the documentation and/or other materials provided with the |
8746 | // distribution. |
8747 | // * Neither the name of Google Inc. nor the names of its |
8748 | // contributors may be used to endorse or promote products derived from |
8749 | // this software without specific prior written permission. |
8750 | // |
8751 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
8752 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
8753 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
8754 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
8755 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
8756 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
8757 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
8758 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
8759 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
8760 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
8761 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
8762 | // |
8763 | // Authors: vladl@google.com (Vlad Losev) |
8764 | // |
8765 | // Macros and functions for implementing parameterized tests |
8766 | // in Google C++ Testing Framework (Google Test) |
8767 | // |
8768 | // This file is generated by a SCRIPT. DO NOT EDIT BY HAND! |
8769 | // |
8770 | #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ |
8771 | #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ |
8772 | |
8773 | |
8774 | // Value-parameterized tests allow you to test your code with different |
8775 | // parameters without writing multiple copies of the same test. |
8776 | // |
8777 | // Here is how you use value-parameterized tests: |
8778 | |
8779 | #if 0 |
8780 | |
8781 | // To write value-parameterized tests, first you should define a fixture |
8782 | // class. It is usually derived from testing::TestWithParam<T> (see below for |
8783 | // another inheritance scheme that's sometimes useful in more complicated |
8784 | // class hierarchies), where the type of your parameter values. |
8785 | // TestWithParam<T> is itself derived from testing::Test. T can be any |
8786 | // copyable type. If it's a raw pointer, you are responsible for managing the |
8787 | // lifespan of the pointed values. |
8788 | |
8789 | class FooTest : public ::testing::TestWithParam<const char*> { |
8790 | // You can implement all the usual class fixture members here. |
8791 | }; |
8792 | |
8793 | // Then, use the TEST_P macro to define as many parameterized tests |
8794 | // for this fixture as you want. The _P suffix is for "parameterized" |
8795 | // or "pattern", whichever you prefer to think. |
8796 | |
8797 | TEST_P(FooTest, DoesBlah) { |
8798 | // Inside a test, access the test parameter with the GetParam() method |
8799 | // of the TestWithParam<T> class: |
8800 | EXPECT_TRUE(foo.Blah(GetParam())); |
8801 | ... |
8802 | } |
8803 | |
8804 | TEST_P(FooTest, HasBlahBlah) { |
8805 | ... |
8806 | } |
8807 | |
8808 | // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test |
8809 | // case with any set of parameters you want. Google Test defines a number |
8810 | // of functions for generating test parameters. They return what we call |
8811 | // (surprise!) parameter generators. Here is a summary of them, which |
8812 | // are all in the testing namespace: |
8813 | // |
8814 | // |
8815 | // Range(begin, end [, step]) - Yields values {begin, begin+step, |
8816 | // begin+step+step, ...}. The values do not |
8817 | // include end. step defaults to 1. |
8818 | // Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}. |
8819 | // ValuesIn(container) - Yields values from a C-style array, an STL |
8820 | // ValuesIn(begin,end) container, or an iterator range [begin, end). |
8821 | // Bool() - Yields sequence {false, true}. |
8822 | // Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product |
8823 | // for the math savvy) of the values generated |
8824 | // by the N generators. |
8825 | // |
8826 | // For more details, see comments at the definitions of these functions below |
8827 | // in this file. |
8828 | // |
8829 | // The following statement will instantiate tests from the FooTest test case |
8830 | // each with parameter values "meeny", "miny", and "moe". |
8831 | |
8832 | INSTANTIATE_TEST_CASE_P(InstantiationName, |
8833 | FooTest, |
8834 | Values("meeny" , "miny" , "moe" )); |
8835 | |
8836 | // To distinguish different instances of the pattern, (yes, you |
8837 | // can instantiate it more then once) the first argument to the |
8838 | // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the |
8839 | // actual test case name. Remember to pick unique prefixes for different |
8840 | // instantiations. The tests from the instantiation above will have |
8841 | // these names: |
8842 | // |
8843 | // * InstantiationName/FooTest.DoesBlah/0 for "meeny" |
8844 | // * InstantiationName/FooTest.DoesBlah/1 for "miny" |
8845 | // * InstantiationName/FooTest.DoesBlah/2 for "moe" |
8846 | // * InstantiationName/FooTest.HasBlahBlah/0 for "meeny" |
8847 | // * InstantiationName/FooTest.HasBlahBlah/1 for "miny" |
8848 | // * InstantiationName/FooTest.HasBlahBlah/2 for "moe" |
8849 | // |
8850 | // You can use these names in --gtest_filter. |
8851 | // |
8852 | // This statement will instantiate all tests from FooTest again, each |
8853 | // with parameter values "cat" and "dog": |
8854 | |
8855 | const char* pets[] = {"cat" , "dog" }; |
8856 | INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets)); |
8857 | |
8858 | // The tests from the instantiation above will have these names: |
8859 | // |
8860 | // * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat" |
8861 | // * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog" |
8862 | // * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat" |
8863 | // * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog" |
8864 | // |
8865 | // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests |
8866 | // in the given test case, whether their definitions come before or |
8867 | // AFTER the INSTANTIATE_TEST_CASE_P statement. |
8868 | // |
8869 | // Please also note that generator expressions (including parameters to the |
8870 | // generators) are evaluated in InitGoogleTest(), after main() has started. |
8871 | // This allows the user on one hand, to adjust generator parameters in order |
8872 | // to dynamically determine a set of tests to run and on the other hand, |
8873 | // give the user a chance to inspect the generated tests with Google Test |
8874 | // reflection API before RUN_ALL_TESTS() is executed. |
8875 | // |
8876 | // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc |
8877 | // for more examples. |
8878 | // |
8879 | // In the future, we plan to publish the API for defining new parameter |
8880 | // generators. But for now this interface remains part of the internal |
8881 | // implementation and is subject to change. |
8882 | // |
8883 | // |
8884 | // A parameterized test fixture must be derived from testing::Test and from |
8885 | // testing::WithParamInterface<T>, where T is the type of the parameter |
8886 | // values. Inheriting from TestWithParam<T> satisfies that requirement because |
8887 | // TestWithParam<T> inherits from both Test and WithParamInterface. In more |
8888 | // complicated hierarchies, however, it is occasionally useful to inherit |
8889 | // separately from Test and WithParamInterface. For example: |
8890 | |
8891 | class BaseTest : public ::testing::Test { |
8892 | // You can inherit all the usual members for a non-parameterized test |
8893 | // fixture here. |
8894 | }; |
8895 | |
8896 | class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> { |
8897 | // The usual test fixture members go here too. |
8898 | }; |
8899 | |
8900 | TEST_F(BaseTest, HasFoo) { |
8901 | // This is an ordinary non-parameterized test. |
8902 | } |
8903 | |
8904 | TEST_P(DerivedTest, DoesBlah) { |
8905 | // GetParam works just the same here as if you inherit from TestWithParam. |
8906 | EXPECT_TRUE(foo.Blah(GetParam())); |
8907 | } |
8908 | |
8909 | #endif // 0 |
8910 | |
8911 | |
8912 | #if !GTEST_OS_SYMBIAN |
8913 | # include <utility> |
8914 | #endif |
8915 | |
8916 | // scripts/fuse_gtest.py depends on gtest's own header being #included |
8917 | // *unconditionally*. Therefore these #includes cannot be moved |
8918 | // inside #if GTEST_HAS_PARAM_TEST. |
8919 | // Copyright 2008 Google Inc. |
8920 | // All Rights Reserved. |
8921 | // |
8922 | // Redistribution and use in source and binary forms, with or without |
8923 | // modification, are permitted provided that the following conditions are |
8924 | // met: |
8925 | // |
8926 | // * Redistributions of source code must retain the above copyright |
8927 | // notice, this list of conditions and the following disclaimer. |
8928 | // * Redistributions in binary form must reproduce the above |
8929 | // copyright notice, this list of conditions and the following disclaimer |
8930 | // in the documentation and/or other materials provided with the |
8931 | // distribution. |
8932 | // * Neither the name of Google Inc. nor the names of its |
8933 | // contributors may be used to endorse or promote products derived from |
8934 | // this software without specific prior written permission. |
8935 | // |
8936 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
8937 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
8938 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
8939 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
8940 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
8941 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
8942 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
8943 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
8944 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
8945 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
8946 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
8947 | // |
8948 | // Author: vladl@google.com (Vlad Losev) |
8949 | |
8950 | // Type and function utilities for implementing parameterized tests. |
8951 | |
8952 | #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ |
8953 | #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ |
8954 | |
8955 | #include <iterator> |
8956 | #include <utility> |
8957 | #include <vector> |
8958 | |
8959 | // scripts/fuse_gtest.py depends on gtest's own header being #included |
8960 | // *unconditionally*. Therefore these #includes cannot be moved |
8961 | // inside #if GTEST_HAS_PARAM_TEST. |
8962 | // Copyright 2003 Google Inc. |
8963 | // All rights reserved. |
8964 | // |
8965 | // Redistribution and use in source and binary forms, with or without |
8966 | // modification, are permitted provided that the following conditions are |
8967 | // met: |
8968 | // |
8969 | // * Redistributions of source code must retain the above copyright |
8970 | // notice, this list of conditions and the following disclaimer. |
8971 | // * Redistributions in binary form must reproduce the above |
8972 | // copyright notice, this list of conditions and the following disclaimer |
8973 | // in the documentation and/or other materials provided with the |
8974 | // distribution. |
8975 | // * Neither the name of Google Inc. nor the names of its |
8976 | // contributors may be used to endorse or promote products derived from |
8977 | // this software without specific prior written permission. |
8978 | // |
8979 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
8980 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
8981 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
8982 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
8983 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
8984 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
8985 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
8986 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
8987 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
8988 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
8989 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
8990 | // |
8991 | // Authors: Dan Egnor (egnor@google.com) |
8992 | // |
8993 | // A "smart" pointer type with reference tracking. Every pointer to a |
8994 | // particular object is kept on a circular linked list. When the last pointer |
8995 | // to an object is destroyed or reassigned, the object is deleted. |
8996 | // |
8997 | // Used properly, this deletes the object when the last reference goes away. |
8998 | // There are several caveats: |
8999 | // - Like all reference counting schemes, cycles lead to leaks. |
9000 | // - Each smart pointer is actually two pointers (8 bytes instead of 4). |
9001 | // - Every time a pointer is assigned, the entire list of pointers to that |
9002 | // object is traversed. This class is therefore NOT SUITABLE when there |
9003 | // will often be more than two or three pointers to a particular object. |
9004 | // - References are only tracked as long as linked_ptr<> objects are copied. |
9005 | // If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS |
9006 | // will happen (double deletion). |
9007 | // |
9008 | // A good use of this class is storing object references in STL containers. |
9009 | // You can safely put linked_ptr<> in a vector<>. |
9010 | // Other uses may not be as good. |
9011 | // |
9012 | // Note: If you use an incomplete type with linked_ptr<>, the class |
9013 | // *containing* linked_ptr<> must have a constructor and destructor (even |
9014 | // if they do nothing!). |
9015 | // |
9016 | // Bill Gibbons suggested we use something like this. |
9017 | // |
9018 | // Thread Safety: |
9019 | // Unlike other linked_ptr implementations, in this implementation |
9020 | // a linked_ptr object is thread-safe in the sense that: |
9021 | // - it's safe to copy linked_ptr objects concurrently, |
9022 | // - it's safe to copy *from* a linked_ptr and read its underlying |
9023 | // raw pointer (e.g. via get()) concurrently, and |
9024 | // - it's safe to write to two linked_ptrs that point to the same |
9025 | // shared object concurrently. |
9026 | // TODO(wan@google.com): rename this to safe_linked_ptr to avoid |
9027 | // confusion with normal linked_ptr. |
9028 | |
9029 | #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ |
9030 | #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ |
9031 | |
9032 | #include <stdlib.h> |
9033 | #include <assert.h> |
9034 | |
9035 | |
9036 | namespace testing { |
9037 | namespace internal { |
9038 | |
9039 | // Protects copying of all linked_ptr objects. |
9040 | GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex); |
9041 | |
9042 | // This is used internally by all instances of linked_ptr<>. It needs to be |
9043 | // a non-template class because different types of linked_ptr<> can refer to |
9044 | // the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)). |
9045 | // So, it needs to be possible for different types of linked_ptr to participate |
9046 | // in the same circular linked list, so we need a single class type here. |
9047 | // |
9048 | // DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr<T>. |
9049 | class linked_ptr_internal { |
9050 | public: |
9051 | // Create a new circle that includes only this instance. |
9052 | void join_new() { |
9053 | next_ = this; |
9054 | } |
9055 | |
9056 | // Many linked_ptr operations may change p.link_ for some linked_ptr |
9057 | // variable p in the same circle as this object. Therefore we need |
9058 | // to prevent two such operations from occurring concurrently. |
9059 | // |
9060 | // Note that different types of linked_ptr objects can coexist in a |
9061 | // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and |
9062 | // linked_ptr<Derived2>). Therefore we must use a single mutex to |
9063 | // protect all linked_ptr objects. This can create serious |
9064 | // contention in production code, but is acceptable in a testing |
9065 | // framework. |
9066 | |
9067 | // Join an existing circle. |
9068 | void join(linked_ptr_internal const* ptr) |
9069 | GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) { |
9070 | MutexLock lock(&g_linked_ptr_mutex); |
9071 | |
9072 | linked_ptr_internal const* p = ptr; |
9073 | while (p->next_ != ptr) p = p->next_; |
9074 | p->next_ = this; |
9075 | next_ = ptr; |
9076 | } |
9077 | |
9078 | // Leave whatever circle we're part of. Returns true if we were the |
9079 | // last member of the circle. Once this is done, you can join() another. |
9080 | bool depart() |
9081 | GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) { |
9082 | MutexLock lock(&g_linked_ptr_mutex); |
9083 | |
9084 | if (next_ == this) return true; |
9085 | linked_ptr_internal const* p = next_; |
9086 | while (p->next_ != this) p = p->next_; |
9087 | p->next_ = next_; |
9088 | return false; |
9089 | } |
9090 | |
9091 | private: |
9092 | mutable linked_ptr_internal const* next_; |
9093 | }; |
9094 | |
9095 | template <typename T> |
9096 | class linked_ptr { |
9097 | public: |
9098 | typedef T element_type; |
9099 | |
9100 | // Take over ownership of a raw pointer. This should happen as soon as |
9101 | // possible after the object is created. |
9102 | explicit linked_ptr(T* ptr = NULL) { capture(ptr); } |
9103 | ~linked_ptr() { depart(); } |
9104 | |
9105 | // Copy an existing linked_ptr<>, adding ourselves to the list of references. |
9106 | template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); } |
9107 | linked_ptr(linked_ptr const& ptr) { // NOLINT |
9108 | assert(&ptr != this); |
9109 | copy(&ptr); |
9110 | } |
9111 | |
9112 | // Assignment releases the old value and acquires the new. |
9113 | template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) { |
9114 | depart(); |
9115 | copy(&ptr); |
9116 | return *this; |
9117 | } |
9118 | |
9119 | linked_ptr& operator=(linked_ptr const& ptr) { |
9120 | if (&ptr != this) { |
9121 | depart(); |
9122 | copy(&ptr); |
9123 | } |
9124 | return *this; |
9125 | } |
9126 | |
9127 | // Smart pointer members. |
9128 | void reset(T* ptr = NULL) { |
9129 | depart(); |
9130 | capture(ptr); |
9131 | } |
9132 | T* get() const { return value_; } |
9133 | T* operator->() const { return value_; } |
9134 | T& operator*() const { return *value_; } |
9135 | |
9136 | bool operator==(T* p) const { return value_ == p; } |
9137 | bool operator!=(T* p) const { return value_ != p; } |
9138 | template <typename U> |
9139 | bool operator==(linked_ptr<U> const& ptr) const { |
9140 | return value_ == ptr.get(); |
9141 | } |
9142 | template <typename U> |
9143 | bool operator!=(linked_ptr<U> const& ptr) const { |
9144 | return value_ != ptr.get(); |
9145 | } |
9146 | |
9147 | private: |
9148 | template <typename U> |
9149 | friend class linked_ptr; |
9150 | |
9151 | T* value_; |
9152 | linked_ptr_internal link_; |
9153 | |
9154 | void depart() { |
9155 | if (link_.depart()) delete value_; |
9156 | } |
9157 | |
9158 | void capture(T* ptr) { |
9159 | value_ = ptr; |
9160 | link_.join_new(); |
9161 | } |
9162 | |
9163 | template <typename U> void copy(linked_ptr<U> const* ptr) { |
9164 | value_ = ptr->get(); |
9165 | if (value_) |
9166 | link_.join(&ptr->link_); |
9167 | else |
9168 | link_.join_new(); |
9169 | } |
9170 | }; |
9171 | |
9172 | template<typename T> inline |
9173 | bool operator==(T* ptr, const linked_ptr<T>& x) { |
9174 | return ptr == x.get(); |
9175 | } |
9176 | |
9177 | template<typename T> inline |
9178 | bool operator!=(T* ptr, const linked_ptr<T>& x) { |
9179 | return ptr != x.get(); |
9180 | } |
9181 | |
9182 | // A function to convert T* into linked_ptr<T> |
9183 | // Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation |
9184 | // for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg)) |
9185 | template <typename T> |
9186 | linked_ptr<T> make_linked_ptr(T* ptr) { |
9187 | return linked_ptr<T>(ptr); |
9188 | } |
9189 | |
9190 | } // namespace internal |
9191 | } // namespace testing |
9192 | |
9193 | #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ |
9194 | // Copyright 2007, Google Inc. |
9195 | // All rights reserved. |
9196 | // |
9197 | // Redistribution and use in source and binary forms, with or without |
9198 | // modification, are permitted provided that the following conditions are |
9199 | // met: |
9200 | // |
9201 | // * Redistributions of source code must retain the above copyright |
9202 | // notice, this list of conditions and the following disclaimer. |
9203 | // * Redistributions in binary form must reproduce the above |
9204 | // copyright notice, this list of conditions and the following disclaimer |
9205 | // in the documentation and/or other materials provided with the |
9206 | // distribution. |
9207 | // * Neither the name of Google Inc. nor the names of its |
9208 | // contributors may be used to endorse or promote products derived from |
9209 | // this software without specific prior written permission. |
9210 | // |
9211 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
9212 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
9213 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
9214 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
9215 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
9216 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
9217 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
9218 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
9219 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
9220 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
9221 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
9222 | // |
9223 | // Author: wan@google.com (Zhanyong Wan) |
9224 | |
9225 | // Google Test - The Google C++ Testing Framework |
9226 | // |
9227 | // This file implements a universal value printer that can print a |
9228 | // value of any type T: |
9229 | // |
9230 | // void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr); |
9231 | // |
9232 | // A user can teach this function how to print a class type T by |
9233 | // defining either operator<<() or PrintTo() in the namespace that |
9234 | // defines T. More specifically, the FIRST defined function in the |
9235 | // following list will be used (assuming T is defined in namespace |
9236 | // foo): |
9237 | // |
9238 | // 1. foo::PrintTo(const T&, ostream*) |
9239 | // 2. operator<<(ostream&, const T&) defined in either foo or the |
9240 | // global namespace. |
9241 | // |
9242 | // If none of the above is defined, it will print the debug string of |
9243 | // the value if it is a protocol buffer, or print the raw bytes in the |
9244 | // value otherwise. |
9245 | // |
9246 | // To aid debugging: when T is a reference type, the address of the |
9247 | // value is also printed; when T is a (const) char pointer, both the |
9248 | // pointer value and the NUL-terminated string it points to are |
9249 | // printed. |
9250 | // |
9251 | // We also provide some convenient wrappers: |
9252 | // |
9253 | // // Prints a value to a string. For a (const or not) char |
9254 | // // pointer, the NUL-terminated string (but not the pointer) is |
9255 | // // printed. |
9256 | // std::string ::testing::PrintToString(const T& value); |
9257 | // |
9258 | // // Prints a value tersely: for a reference type, the referenced |
9259 | // // value (but not the address) is printed; for a (const or not) char |
9260 | // // pointer, the NUL-terminated string (but not the pointer) is |
9261 | // // printed. |
9262 | // void ::testing::internal::UniversalTersePrint(const T& value, ostream*); |
9263 | // |
9264 | // // Prints value using the type inferred by the compiler. The difference |
9265 | // // from UniversalTersePrint() is that this function prints both the |
9266 | // // pointer and the NUL-terminated string for a (const or not) char pointer. |
9267 | // void ::testing::internal::UniversalPrint(const T& value, ostream*); |
9268 | // |
9269 | // // Prints the fields of a tuple tersely to a string vector, one |
9270 | // // element for each field. Tuple support must be enabled in |
9271 | // // gtest-port.h. |
9272 | // std::vector<string> UniversalTersePrintTupleFieldsToStrings( |
9273 | // const Tuple& value); |
9274 | // |
9275 | // Known limitation: |
9276 | // |
9277 | // The print primitives print the elements of an STL-style container |
9278 | // using the compiler-inferred type of *iter where iter is a |
9279 | // const_iterator of the container. When const_iterator is an input |
9280 | // iterator but not a forward iterator, this inferred type may not |
9281 | // match value_type, and the print output may be incorrect. In |
9282 | // practice, this is rarely a problem as for most containers |
9283 | // const_iterator is a forward iterator. We'll fix this if there's an |
9284 | // actual need for it. Note that this fix cannot rely on value_type |
9285 | // being defined as many user-defined container types don't have |
9286 | // value_type. |
9287 | |
9288 | #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ |
9289 | #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ |
9290 | |
9291 | #include <ostream> // NOLINT |
9292 | #include <sstream> |
9293 | #include <string> |
9294 | #include <utility> |
9295 | #include <vector> |
9296 | |
9297 | namespace testing { |
9298 | |
9299 | // Definitions in the 'internal' and 'internal2' name spaces are |
9300 | // subject to change without notice. DO NOT USE THEM IN USER CODE! |
9301 | namespace internal2 { |
9302 | |
9303 | // Prints the given number of bytes in the given object to the given |
9304 | // ostream. |
9305 | GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes, |
9306 | size_t count, |
9307 | ::std::ostream* os); |
9308 | |
9309 | // For selecting which printer to use when a given type has neither << |
9310 | // nor PrintTo(). |
9311 | enum TypeKind { |
9312 | kProtobuf, // a protobuf type |
9313 | kConvertibleToInteger, // a type implicitly convertible to BiggestInt |
9314 | // (e.g. a named or unnamed enum type) |
9315 | kOtherType // anything else |
9316 | }; |
9317 | |
9318 | // TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called |
9319 | // by the universal printer to print a value of type T when neither |
9320 | // operator<< nor PrintTo() is defined for T, where kTypeKind is the |
9321 | // "kind" of T as defined by enum TypeKind. |
9322 | template <typename T, TypeKind kTypeKind> |
9323 | class TypeWithoutFormatter { |
9324 | public: |
9325 | // This default version is called when kTypeKind is kOtherType. |
9326 | static void PrintValue(const T& value, ::std::ostream* os) { |
9327 | PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value), |
9328 | sizeof(value), os); |
9329 | } |
9330 | }; |
9331 | |
9332 | // We print a protobuf using its ShortDebugString() when the string |
9333 | // doesn't exceed this many characters; otherwise we print it using |
9334 | // DebugString() for better readability. |
9335 | const size_t kProtobufOneLinerMaxLength = 50; |
9336 | |
9337 | template <typename T> |
9338 | class TypeWithoutFormatter<T, kProtobuf> { |
9339 | public: |
9340 | static void PrintValue(const T& value, ::std::ostream* os) { |
9341 | const ::testing::internal::string short_str = value.ShortDebugString(); |
9342 | const ::testing::internal::string pretty_str = |
9343 | short_str.length() <= kProtobufOneLinerMaxLength ? |
9344 | short_str : ("\n" + value.DebugString()); |
9345 | *os << ("<" + pretty_str + ">" ); |
9346 | } |
9347 | }; |
9348 | |
9349 | template <typename T> |
9350 | class TypeWithoutFormatter<T, kConvertibleToInteger> { |
9351 | public: |
9352 | // Since T has no << operator or PrintTo() but can be implicitly |
9353 | // converted to BiggestInt, we print it as a BiggestInt. |
9354 | // |
9355 | // Most likely T is an enum type (either named or unnamed), in which |
9356 | // case printing it as an integer is the desired behavior. In case |
9357 | // T is not an enum, printing it as an integer is the best we can do |
9358 | // given that it has no user-defined printer. |
9359 | static void PrintValue(const T& value, ::std::ostream* os) { |
9360 | const internal::BiggestInt kBigInt = value; |
9361 | *os << kBigInt; |
9362 | } |
9363 | }; |
9364 | |
9365 | // Prints the given value to the given ostream. If the value is a |
9366 | // protocol message, its debug string is printed; if it's an enum or |
9367 | // of a type implicitly convertible to BiggestInt, it's printed as an |
9368 | // integer; otherwise the bytes in the value are printed. This is |
9369 | // what UniversalPrinter<T>::Print() does when it knows nothing about |
9370 | // type T and T has neither << operator nor PrintTo(). |
9371 | // |
9372 | // A user can override this behavior for a class type Foo by defining |
9373 | // a << operator in the namespace where Foo is defined. |
9374 | // |
9375 | // We put this operator in namespace 'internal2' instead of 'internal' |
9376 | // to simplify the implementation, as much code in 'internal' needs to |
9377 | // use << in STL, which would conflict with our own << were it defined |
9378 | // in 'internal'. |
9379 | // |
9380 | // Note that this operator<< takes a generic std::basic_ostream<Char, |
9381 | // CharTraits> type instead of the more restricted std::ostream. If |
9382 | // we define it to take an std::ostream instead, we'll get an |
9383 | // "ambiguous overloads" compiler error when trying to print a type |
9384 | // Foo that supports streaming to std::basic_ostream<Char, |
9385 | // CharTraits>, as the compiler cannot tell whether |
9386 | // operator<<(std::ostream&, const T&) or |
9387 | // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more |
9388 | // specific. |
9389 | template <typename Char, typename CharTraits, typename T> |
9390 | ::std::basic_ostream<Char, CharTraits>& operator<<( |
9391 | ::std::basic_ostream<Char, CharTraits>& os, const T& x) { |
9392 | TypeWithoutFormatter<T, |
9393 | (internal::IsAProtocolMessage<T>::value ? kProtobuf : |
9394 | internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ? |
9395 | kConvertibleToInteger : kOtherType)>::PrintValue(x, &os); |
9396 | return os; |
9397 | } |
9398 | |
9399 | } // namespace internal2 |
9400 | } // namespace testing |
9401 | |
9402 | // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up |
9403 | // magic needed for implementing UniversalPrinter won't work. |
9404 | namespace testing_internal { |
9405 | |
9406 | // Used to print a value that is not an STL-style container when the |
9407 | // user doesn't define PrintTo() for it. |
9408 | template <typename T> |
9409 | void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) { |
9410 | // With the following statement, during unqualified name lookup, |
9411 | // testing::internal2::operator<< appears as if it was declared in |
9412 | // the nearest enclosing namespace that contains both |
9413 | // ::testing_internal and ::testing::internal2, i.e. the global |
9414 | // namespace. For more details, refer to the C++ Standard section |
9415 | // 7.3.4-1 [namespace.udir]. This allows us to fall back onto |
9416 | // testing::internal2::operator<< in case T doesn't come with a << |
9417 | // operator. |
9418 | // |
9419 | // We cannot write 'using ::testing::internal2::operator<<;', which |
9420 | // gcc 3.3 fails to compile due to a compiler bug. |
9421 | using namespace ::testing::internal2; // NOLINT |
9422 | |
9423 | // Assuming T is defined in namespace foo, in the next statement, |
9424 | // the compiler will consider all of: |
9425 | // |
9426 | // 1. foo::operator<< (thanks to Koenig look-up), |
9427 | // 2. ::operator<< (as the current namespace is enclosed in ::), |
9428 | // 3. testing::internal2::operator<< (thanks to the using statement above). |
9429 | // |
9430 | // The operator<< whose type matches T best will be picked. |
9431 | // |
9432 | // We deliberately allow #2 to be a candidate, as sometimes it's |
9433 | // impossible to define #1 (e.g. when foo is ::std, defining |
9434 | // anything in it is undefined behavior unless you are a compiler |
9435 | // vendor.). |
9436 | *os << value; |
9437 | } |
9438 | |
9439 | } // namespace testing_internal |
9440 | |
9441 | namespace testing { |
9442 | namespace internal { |
9443 | |
9444 | // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given |
9445 | // value to the given ostream. The caller must ensure that |
9446 | // 'ostream_ptr' is not NULL, or the behavior is undefined. |
9447 | // |
9448 | // We define UniversalPrinter as a class template (as opposed to a |
9449 | // function template), as we need to partially specialize it for |
9450 | // reference types, which cannot be done with function templates. |
9451 | template <typename T> |
9452 | class UniversalPrinter; |
9453 | |
9454 | template <typename T> |
9455 | void UniversalPrint(const T& value, ::std::ostream* os); |
9456 | |
9457 | // Used to print an STL-style container when the user doesn't define |
9458 | // a PrintTo() for it. |
9459 | template <typename C> |
9460 | void DefaultPrintTo(IsContainer /* dummy */, |
9461 | false_type /* is not a pointer */, |
9462 | const C& container, ::std::ostream* os) { |
9463 | const size_t kMaxCount = 32; // The maximum number of elements to print. |
9464 | *os << '{'; |
9465 | size_t count = 0; |
9466 | for (typename C::const_iterator it = container.begin(); |
9467 | it != container.end(); ++it, ++count) { |
9468 | if (count > 0) { |
9469 | *os << ','; |
9470 | if (count == kMaxCount) { // Enough has been printed. |
9471 | *os << " ..." ; |
9472 | break; |
9473 | } |
9474 | } |
9475 | *os << ' '; |
9476 | // We cannot call PrintTo(*it, os) here as PrintTo() doesn't |
9477 | // handle *it being a native array. |
9478 | internal::UniversalPrint(*it, os); |
9479 | } |
9480 | |
9481 | if (count > 0) { |
9482 | *os << ' '; |
9483 | } |
9484 | *os << '}'; |
9485 | } |
9486 | |
9487 | // Used to print a pointer that is neither a char pointer nor a member |
9488 | // pointer, when the user doesn't define PrintTo() for it. (A member |
9489 | // variable pointer or member function pointer doesn't really point to |
9490 | // a location in the address space. Their representation is |
9491 | // implementation-defined. Therefore they will be printed as raw |
9492 | // bytes.) |
9493 | template <typename T> |
9494 | void DefaultPrintTo(IsNotContainer /* dummy */, |
9495 | true_type /* is a pointer */, |
9496 | T* p, ::std::ostream* os) { |
9497 | if (p == NULL) { |
9498 | *os << "NULL" ; |
9499 | } else { |
9500 | // C++ doesn't allow casting from a function pointer to any object |
9501 | // pointer. |
9502 | // |
9503 | // IsTrue() silences warnings: "Condition is always true", |
9504 | // "unreachable code". |
9505 | if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) { |
9506 | // T is not a function type. We just call << to print p, |
9507 | // relying on ADL to pick up user-defined << for their pointer |
9508 | // types, if any. |
9509 | *os << p; |
9510 | } else { |
9511 | // T is a function type, so '*os << p' doesn't do what we want |
9512 | // (it just prints p as bool). We want to print p as a const |
9513 | // void*. However, we cannot cast it to const void* directly, |
9514 | // even using reinterpret_cast, as earlier versions of gcc |
9515 | // (e.g. 3.4.5) cannot compile the cast when p is a function |
9516 | // pointer. Casting to UInt64 first solves the problem. |
9517 | *os << reinterpret_cast<const void*>( |
9518 | reinterpret_cast<internal::UInt64>(p)); |
9519 | } |
9520 | } |
9521 | } |
9522 | |
9523 | // Used to print a non-container, non-pointer value when the user |
9524 | // doesn't define PrintTo() for it. |
9525 | template <typename T> |
9526 | void DefaultPrintTo(IsNotContainer /* dummy */, |
9527 | false_type /* is not a pointer */, |
9528 | const T& value, ::std::ostream* os) { |
9529 | ::testing_internal::DefaultPrintNonContainerTo(value, os); |
9530 | } |
9531 | |
9532 | // Prints the given value using the << operator if it has one; |
9533 | // otherwise prints the bytes in it. This is what |
9534 | // UniversalPrinter<T>::Print() does when PrintTo() is not specialized |
9535 | // or overloaded for type T. |
9536 | // |
9537 | // A user can override this behavior for a class type Foo by defining |
9538 | // an overload of PrintTo() in the namespace where Foo is defined. We |
9539 | // give the user this option as sometimes defining a << operator for |
9540 | // Foo is not desirable (e.g. the coding style may prevent doing it, |
9541 | // or there is already a << operator but it doesn't do what the user |
9542 | // wants). |
9543 | template <typename T> |
9544 | void PrintTo(const T& value, ::std::ostream* os) { |
9545 | // DefaultPrintTo() is overloaded. The type of its first two |
9546 | // arguments determine which version will be picked. If T is an |
9547 | // STL-style container, the version for container will be called; if |
9548 | // T is a pointer, the pointer version will be called; otherwise the |
9549 | // generic version will be called. |
9550 | // |
9551 | // Note that we check for container types here, prior to we check |
9552 | // for protocol message types in our operator<<. The rationale is: |
9553 | // |
9554 | // For protocol messages, we want to give people a chance to |
9555 | // override Google Mock's format by defining a PrintTo() or |
9556 | // operator<<. For STL containers, other formats can be |
9557 | // incompatible with Google Mock's format for the container |
9558 | // elements; therefore we check for container types here to ensure |
9559 | // that our format is used. |
9560 | // |
9561 | // The second argument of DefaultPrintTo() is needed to bypass a bug |
9562 | // in Symbian's C++ compiler that prevents it from picking the right |
9563 | // overload between: |
9564 | // |
9565 | // PrintTo(const T& x, ...); |
9566 | // PrintTo(T* x, ...); |
9567 | DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os); |
9568 | } |
9569 | |
9570 | // The following list of PrintTo() overloads tells |
9571 | // UniversalPrinter<T>::Print() how to print standard types (built-in |
9572 | // types, strings, plain arrays, and pointers). |
9573 | |
9574 | // Overloads for various char types. |
9575 | GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os); |
9576 | GTEST_API_ void PrintTo(signed char c, ::std::ostream* os); |
9577 | inline void PrintTo(char c, ::std::ostream* os) { |
9578 | // When printing a plain char, we always treat it as unsigned. This |
9579 | // way, the output won't be affected by whether the compiler thinks |
9580 | // char is signed or not. |
9581 | PrintTo(static_cast<unsigned char>(c), os); |
9582 | } |
9583 | |
9584 | // Overloads for other simple built-in types. |
9585 | inline void PrintTo(bool x, ::std::ostream* os) { |
9586 | *os << (x ? "true" : "false" ); |
9587 | } |
9588 | |
9589 | // Overload for wchar_t type. |
9590 | // Prints a wchar_t as a symbol if it is printable or as its internal |
9591 | // code otherwise and also as its decimal code (except for L'\0'). |
9592 | // The L'\0' char is printed as "L'\\0'". The decimal code is printed |
9593 | // as signed integer when wchar_t is implemented by the compiler |
9594 | // as a signed type and is printed as an unsigned integer when wchar_t |
9595 | // is implemented as an unsigned type. |
9596 | GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); |
9597 | |
9598 | // Overloads for C strings. |
9599 | GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); |
9600 | inline void PrintTo(char* s, ::std::ostream* os) { |
9601 | PrintTo(ImplicitCast_<const char*>(s), os); |
9602 | } |
9603 | |
9604 | // signed/unsigned char is often used for representing binary data, so |
9605 | // we print pointers to it as void* to be safe. |
9606 | inline void PrintTo(const signed char* s, ::std::ostream* os) { |
9607 | PrintTo(ImplicitCast_<const void*>(s), os); |
9608 | } |
9609 | inline void PrintTo(signed char* s, ::std::ostream* os) { |
9610 | PrintTo(ImplicitCast_<const void*>(s), os); |
9611 | } |
9612 | inline void PrintTo(const unsigned char* s, ::std::ostream* os) { |
9613 | PrintTo(ImplicitCast_<const void*>(s), os); |
9614 | } |
9615 | inline void PrintTo(unsigned char* s, ::std::ostream* os) { |
9616 | PrintTo(ImplicitCast_<const void*>(s), os); |
9617 | } |
9618 | |
9619 | // MSVC can be configured to define wchar_t as a typedef of unsigned |
9620 | // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native |
9621 | // type. When wchar_t is a typedef, defining an overload for const |
9622 | // wchar_t* would cause unsigned short* be printed as a wide string, |
9623 | // possibly causing invalid memory accesses. |
9624 | #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) |
9625 | // Overloads for wide C strings |
9626 | GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os); |
9627 | inline void PrintTo(wchar_t* s, ::std::ostream* os) { |
9628 | PrintTo(ImplicitCast_<const wchar_t*>(s), os); |
9629 | } |
9630 | #endif |
9631 | |
9632 | // Overload for C arrays. Multi-dimensional arrays are printed |
9633 | // properly. |
9634 | |
9635 | // Prints the given number of elements in an array, without printing |
9636 | // the curly braces. |
9637 | template <typename T> |
9638 | void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) { |
9639 | UniversalPrint(a[0], os); |
9640 | for (size_t i = 1; i != count; i++) { |
9641 | *os << ", " ; |
9642 | UniversalPrint(a[i], os); |
9643 | } |
9644 | } |
9645 | |
9646 | // Overloads for ::string and ::std::string. |
9647 | #if GTEST_HAS_GLOBAL_STRING |
9648 | GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os); |
9649 | inline void PrintTo(const ::string& s, ::std::ostream* os) { |
9650 | PrintStringTo(s, os); |
9651 | } |
9652 | #endif // GTEST_HAS_GLOBAL_STRING |
9653 | |
9654 | GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os); |
9655 | inline void PrintTo(const ::std::string& s, ::std::ostream* os) { |
9656 | PrintStringTo(s, os); |
9657 | } |
9658 | |
9659 | // Overloads for ::wstring and ::std::wstring. |
9660 | #if GTEST_HAS_GLOBAL_WSTRING |
9661 | GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os); |
9662 | inline void PrintTo(const ::wstring& s, ::std::ostream* os) { |
9663 | PrintWideStringTo(s, os); |
9664 | } |
9665 | #endif // GTEST_HAS_GLOBAL_WSTRING |
9666 | |
9667 | #if GTEST_HAS_STD_WSTRING |
9668 | GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os); |
9669 | inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) { |
9670 | PrintWideStringTo(s, os); |
9671 | } |
9672 | #endif // GTEST_HAS_STD_WSTRING |
9673 | |
9674 | #if GTEST_HAS_TR1_TUPLE |
9675 | // Overload for ::std::tr1::tuple. Needed for printing function arguments, |
9676 | // which are packed as tuples. |
9677 | |
9678 | // Helper function for printing a tuple. T must be instantiated with |
9679 | // a tuple type. |
9680 | template <typename T> |
9681 | void PrintTupleTo(const T& t, ::std::ostream* os); |
9682 | |
9683 | // Overloaded PrintTo() for tuples of various arities. We support |
9684 | // tuples of up-to 10 fields. The following implementation works |
9685 | // regardless of whether tr1::tuple is implemented using the |
9686 | // non-standard variadic template feature or not. |
9687 | |
9688 | inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) { |
9689 | PrintTupleTo(t, os); |
9690 | } |
9691 | |
9692 | template <typename T1> |
9693 | void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) { |
9694 | PrintTupleTo(t, os); |
9695 | } |
9696 | |
9697 | template <typename T1, typename T2> |
9698 | void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) { |
9699 | PrintTupleTo(t, os); |
9700 | } |
9701 | |
9702 | template <typename T1, typename T2, typename T3> |
9703 | void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) { |
9704 | PrintTupleTo(t, os); |
9705 | } |
9706 | |
9707 | template <typename T1, typename T2, typename T3, typename T4> |
9708 | void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) { |
9709 | PrintTupleTo(t, os); |
9710 | } |
9711 | |
9712 | template <typename T1, typename T2, typename T3, typename T4, typename T5> |
9713 | void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t, |
9714 | ::std::ostream* os) { |
9715 | PrintTupleTo(t, os); |
9716 | } |
9717 | |
9718 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
9719 | typename T6> |
9720 | void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t, |
9721 | ::std::ostream* os) { |
9722 | PrintTupleTo(t, os); |
9723 | } |
9724 | |
9725 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
9726 | typename T6, typename T7> |
9727 | void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t, |
9728 | ::std::ostream* os) { |
9729 | PrintTupleTo(t, os); |
9730 | } |
9731 | |
9732 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
9733 | typename T6, typename T7, typename T8> |
9734 | void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t, |
9735 | ::std::ostream* os) { |
9736 | PrintTupleTo(t, os); |
9737 | } |
9738 | |
9739 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
9740 | typename T6, typename T7, typename T8, typename T9> |
9741 | void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t, |
9742 | ::std::ostream* os) { |
9743 | PrintTupleTo(t, os); |
9744 | } |
9745 | |
9746 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
9747 | typename T6, typename T7, typename T8, typename T9, typename T10> |
9748 | void PrintTo( |
9749 | const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t, |
9750 | ::std::ostream* os) { |
9751 | PrintTupleTo(t, os); |
9752 | } |
9753 | #endif // GTEST_HAS_TR1_TUPLE |
9754 | |
9755 | // Overload for std::pair. |
9756 | template <typename T1, typename T2> |
9757 | void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) { |
9758 | *os << '('; |
9759 | // We cannot use UniversalPrint(value.first, os) here, as T1 may be |
9760 | // a reference type. The same for printing value.second. |
9761 | UniversalPrinter<T1>::Print(value.first, os); |
9762 | *os << ", " ; |
9763 | UniversalPrinter<T2>::Print(value.second, os); |
9764 | *os << ')'; |
9765 | } |
9766 | |
9767 | // Implements printing a non-reference type T by letting the compiler |
9768 | // pick the right overload of PrintTo() for T. |
9769 | template <typename T> |
9770 | class UniversalPrinter { |
9771 | public: |
9772 | // MSVC warns about adding const to a function type, so we want to |
9773 | // disable the warning. |
9774 | #ifdef _MSC_VER |
9775 | # pragma warning(push) // Saves the current warning state. |
9776 | # pragma warning(disable:4180) // Temporarily disables warning 4180. |
9777 | #endif // _MSC_VER |
9778 | |
9779 | // Note: we deliberately don't call this PrintTo(), as that name |
9780 | // conflicts with ::testing::internal::PrintTo in the body of the |
9781 | // function. |
9782 | static void Print(const T& value, ::std::ostream* os) { |
9783 | // By default, ::testing::internal::PrintTo() is used for printing |
9784 | // the value. |
9785 | // |
9786 | // Thanks to Koenig look-up, if T is a class and has its own |
9787 | // PrintTo() function defined in its namespace, that function will |
9788 | // be visible here. Since it is more specific than the generic ones |
9789 | // in ::testing::internal, it will be picked by the compiler in the |
9790 | // following statement - exactly what we want. |
9791 | PrintTo(value, os); |
9792 | } |
9793 | |
9794 | #ifdef _MSC_VER |
9795 | # pragma warning(pop) // Restores the warning state. |
9796 | #endif // _MSC_VER |
9797 | }; |
9798 | |
9799 | // UniversalPrintArray(begin, len, os) prints an array of 'len' |
9800 | // elements, starting at address 'begin'. |
9801 | template <typename T> |
9802 | void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) { |
9803 | if (len == 0) { |
9804 | *os << "{}" ; |
9805 | } else { |
9806 | *os << "{ " ; |
9807 | const size_t kThreshold = 18; |
9808 | const size_t kChunkSize = 8; |
9809 | // If the array has more than kThreshold elements, we'll have to |
9810 | // omit some details by printing only the first and the last |
9811 | // kChunkSize elements. |
9812 | // TODO(wan@google.com): let the user control the threshold using a flag. |
9813 | if (len <= kThreshold) { |
9814 | PrintRawArrayTo(begin, len, os); |
9815 | } else { |
9816 | PrintRawArrayTo(begin, kChunkSize, os); |
9817 | *os << ", ..., " ; |
9818 | PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); |
9819 | } |
9820 | *os << " }" ; |
9821 | } |
9822 | } |
9823 | // This overload prints a (const) char array compactly. |
9824 | GTEST_API_ void UniversalPrintArray( |
9825 | const char* begin, size_t len, ::std::ostream* os); |
9826 | |
9827 | // This overload prints a (const) wchar_t array compactly. |
9828 | GTEST_API_ void UniversalPrintArray( |
9829 | const wchar_t* begin, size_t len, ::std::ostream* os); |
9830 | |
9831 | // Implements printing an array type T[N]. |
9832 | template <typename T, size_t N> |
9833 | class UniversalPrinter<T[N]> { |
9834 | public: |
9835 | // Prints the given array, omitting some elements when there are too |
9836 | // many. |
9837 | static void Print(const T (&a)[N], ::std::ostream* os) { |
9838 | UniversalPrintArray(a, N, os); |
9839 | } |
9840 | }; |
9841 | |
9842 | // Implements printing a reference type T&. |
9843 | template <typename T> |
9844 | class UniversalPrinter<T&> { |
9845 | public: |
9846 | // MSVC warns about adding const to a function type, so we want to |
9847 | // disable the warning. |
9848 | #ifdef _MSC_VER |
9849 | # pragma warning(push) // Saves the current warning state. |
9850 | # pragma warning(disable:4180) // Temporarily disables warning 4180. |
9851 | #endif // _MSC_VER |
9852 | |
9853 | static void Print(const T& value, ::std::ostream* os) { |
9854 | // Prints the address of the value. We use reinterpret_cast here |
9855 | // as static_cast doesn't compile when T is a function type. |
9856 | *os << "@" << reinterpret_cast<const void*>(&value) << " " ; |
9857 | |
9858 | // Then prints the value itself. |
9859 | UniversalPrint(value, os); |
9860 | } |
9861 | |
9862 | #ifdef _MSC_VER |
9863 | # pragma warning(pop) // Restores the warning state. |
9864 | #endif // _MSC_VER |
9865 | }; |
9866 | |
9867 | // Prints a value tersely: for a reference type, the referenced value |
9868 | // (but not the address) is printed; for a (const) char pointer, the |
9869 | // NUL-terminated string (but not the pointer) is printed. |
9870 | |
9871 | template <typename T> |
9872 | class UniversalTersePrinter { |
9873 | public: |
9874 | static void Print(const T& value, ::std::ostream* os) { |
9875 | UniversalPrint(value, os); |
9876 | } |
9877 | }; |
9878 | template <typename T> |
9879 | class UniversalTersePrinter<T&> { |
9880 | public: |
9881 | static void Print(const T& value, ::std::ostream* os) { |
9882 | UniversalPrint(value, os); |
9883 | } |
9884 | }; |
9885 | template <typename T, size_t N> |
9886 | class UniversalTersePrinter<T[N]> { |
9887 | public: |
9888 | static void Print(const T (&value)[N], ::std::ostream* os) { |
9889 | UniversalPrinter<T[N]>::Print(value, os); |
9890 | } |
9891 | }; |
9892 | template <> |
9893 | class UniversalTersePrinter<const char*> { |
9894 | public: |
9895 | static void Print(const char* str, ::std::ostream* os) { |
9896 | if (str == NULL) { |
9897 | *os << "NULL" ; |
9898 | } else { |
9899 | UniversalPrint(string(str), os); |
9900 | } |
9901 | } |
9902 | }; |
9903 | template <> |
9904 | class UniversalTersePrinter<char*> { |
9905 | public: |
9906 | static void Print(char* str, ::std::ostream* os) { |
9907 | UniversalTersePrinter<const char*>::Print(str, os); |
9908 | } |
9909 | }; |
9910 | |
9911 | #if GTEST_HAS_STD_WSTRING |
9912 | template <> |
9913 | class UniversalTersePrinter<const wchar_t*> { |
9914 | public: |
9915 | static void Print(const wchar_t* str, ::std::ostream* os) { |
9916 | if (str == NULL) { |
9917 | *os << "NULL" ; |
9918 | } else { |
9919 | UniversalPrint(::std::wstring(str), os); |
9920 | } |
9921 | } |
9922 | }; |
9923 | #endif |
9924 | |
9925 | template <> |
9926 | class UniversalTersePrinter<wchar_t*> { |
9927 | public: |
9928 | static void Print(wchar_t* str, ::std::ostream* os) { |
9929 | UniversalTersePrinter<const wchar_t*>::Print(str, os); |
9930 | } |
9931 | }; |
9932 | |
9933 | template <typename T> |
9934 | void UniversalTersePrint(const T& value, ::std::ostream* os) { |
9935 | UniversalTersePrinter<T>::Print(value, os); |
9936 | } |
9937 | |
9938 | // Prints a value using the type inferred by the compiler. The |
9939 | // difference between this and UniversalTersePrint() is that for a |
9940 | // (const) char pointer, this prints both the pointer and the |
9941 | // NUL-terminated string. |
9942 | template <typename T> |
9943 | void UniversalPrint(const T& value, ::std::ostream* os) { |
9944 | // A workarond for the bug in VC++ 7.1 that prevents us from instantiating |
9945 | // UniversalPrinter with T directly. |
9946 | typedef T T1; |
9947 | UniversalPrinter<T1>::Print(value, os); |
9948 | } |
9949 | |
9950 | #if GTEST_HAS_TR1_TUPLE |
9951 | typedef ::std::vector<string> Strings; |
9952 | |
9953 | // This helper template allows PrintTo() for tuples and |
9954 | // UniversalTersePrintTupleFieldsToStrings() to be defined by |
9955 | // induction on the number of tuple fields. The idea is that |
9956 | // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N |
9957 | // fields in tuple t, and can be defined in terms of |
9958 | // TuplePrefixPrinter<N - 1>. |
9959 | |
9960 | // The inductive case. |
9961 | template <size_t N> |
9962 | struct TuplePrefixPrinter { |
9963 | // Prints the first N fields of a tuple. |
9964 | template <typename Tuple> |
9965 | static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) { |
9966 | TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os); |
9967 | *os << ", " ; |
9968 | UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type> |
9969 | ::Print(::std::tr1::get<N - 1>(t), os); |
9970 | } |
9971 | |
9972 | // Tersely prints the first N fields of a tuple to a string vector, |
9973 | // one element for each field. |
9974 | template <typename Tuple> |
9975 | static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) { |
9976 | TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings); |
9977 | ::std::stringstream ss; |
9978 | UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss); |
9979 | strings->push_back(ss.str()); |
9980 | } |
9981 | }; |
9982 | |
9983 | // Base cases. |
9984 | template <> |
9985 | struct TuplePrefixPrinter<0> { |
9986 | template <typename Tuple> |
9987 | static void PrintPrefixTo(const Tuple&, ::std::ostream*) {} |
9988 | |
9989 | template <typename Tuple> |
9990 | static void TersePrintPrefixToStrings(const Tuple&, Strings*) {} |
9991 | }; |
9992 | // We have to specialize the entire TuplePrefixPrinter<> class |
9993 | // template here, even though the definition of |
9994 | // TersePrintPrefixToStrings() is the same as the generic version, as |
9995 | // Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't |
9996 | // support specializing a method template of a class template. |
9997 | template <> |
9998 | struct TuplePrefixPrinter<1> { |
9999 | template <typename Tuple> |
10000 | static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) { |
10001 | UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>:: |
10002 | Print(::std::tr1::get<0>(t), os); |
10003 | } |
10004 | |
10005 | template <typename Tuple> |
10006 | static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) { |
10007 | ::std::stringstream ss; |
10008 | UniversalTersePrint(::std::tr1::get<0>(t), &ss); |
10009 | strings->push_back(ss.str()); |
10010 | } |
10011 | }; |
10012 | |
10013 | // Helper function for printing a tuple. T must be instantiated with |
10014 | // a tuple type. |
10015 | template <typename T> |
10016 | void PrintTupleTo(const T& t, ::std::ostream* os) { |
10017 | *os << "(" ; |
10018 | TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>:: |
10019 | PrintPrefixTo(t, os); |
10020 | *os << ")" ; |
10021 | } |
10022 | |
10023 | // Prints the fields of a tuple tersely to a string vector, one |
10024 | // element for each field. See the comment before |
10025 | // UniversalTersePrint() for how we define "tersely". |
10026 | template <typename Tuple> |
10027 | Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) { |
10028 | Strings result; |
10029 | TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>:: |
10030 | TersePrintPrefixToStrings(value, &result); |
10031 | return result; |
10032 | } |
10033 | #endif // GTEST_HAS_TR1_TUPLE |
10034 | |
10035 | } // namespace internal |
10036 | |
10037 | template <typename T> |
10038 | ::std::string PrintToString(const T& value) { |
10039 | ::std::stringstream ss; |
10040 | internal::UniversalTersePrinter<T>::Print(value, &ss); |
10041 | return ss.str(); |
10042 | } |
10043 | |
10044 | } // namespace testing |
10045 | |
10046 | #endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ |
10047 | |
10048 | #if GTEST_HAS_PARAM_TEST |
10049 | |
10050 | namespace testing { |
10051 | namespace internal { |
10052 | |
10053 | // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. |
10054 | // |
10055 | // Outputs a message explaining invalid registration of different |
10056 | // fixture class for the same test case. This may happen when |
10057 | // TEST_P macro is used to define two tests with the same name |
10058 | // but in different namespaces. |
10059 | GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, |
10060 | const char* file, int line); |
10061 | |
10062 | template <typename> class ParamGeneratorInterface; |
10063 | template <typename> class ParamGenerator; |
10064 | |
10065 | // Interface for iterating over elements provided by an implementation |
10066 | // of ParamGeneratorInterface<T>. |
10067 | template <typename T> |
10068 | class ParamIteratorInterface { |
10069 | public: |
10070 | virtual ~ParamIteratorInterface() {} |
10071 | // A pointer to the base generator instance. |
10072 | // Used only for the purposes of iterator comparison |
10073 | // to make sure that two iterators belong to the same generator. |
10074 | virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0; |
10075 | // Advances iterator to point to the next element |
10076 | // provided by the generator. The caller is responsible |
10077 | // for not calling Advance() on an iterator equal to |
10078 | // BaseGenerator()->End(). |
10079 | virtual void Advance() = 0; |
10080 | // Clones the iterator object. Used for implementing copy semantics |
10081 | // of ParamIterator<T>. |
10082 | virtual ParamIteratorInterface* Clone() const = 0; |
10083 | // Dereferences the current iterator and provides (read-only) access |
10084 | // to the pointed value. It is the caller's responsibility not to call |
10085 | // Current() on an iterator equal to BaseGenerator()->End(). |
10086 | // Used for implementing ParamGenerator<T>::operator*(). |
10087 | virtual const T* Current() const = 0; |
10088 | // Determines whether the given iterator and other point to the same |
10089 | // element in the sequence generated by the generator. |
10090 | // Used for implementing ParamGenerator<T>::operator==(). |
10091 | virtual bool Equals(const ParamIteratorInterface& other) const = 0; |
10092 | }; |
10093 | |
10094 | // Class iterating over elements provided by an implementation of |
10095 | // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T> |
10096 | // and implements the const forward iterator concept. |
10097 | template <typename T> |
10098 | class ParamIterator { |
10099 | public: |
10100 | typedef T value_type; |
10101 | typedef const T& reference; |
10102 | typedef ptrdiff_t difference_type; |
10103 | |
10104 | // ParamIterator assumes ownership of the impl_ pointer. |
10105 | ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {} |
10106 | ParamIterator& operator=(const ParamIterator& other) { |
10107 | if (this != &other) |
10108 | impl_.reset(other.impl_->Clone()); |
10109 | return *this; |
10110 | } |
10111 | |
10112 | const T& operator*() const { return *impl_->Current(); } |
10113 | const T* operator->() const { return impl_->Current(); } |
10114 | // Prefix version of operator++. |
10115 | ParamIterator& operator++() { |
10116 | impl_->Advance(); |
10117 | return *this; |
10118 | } |
10119 | // Postfix version of operator++. |
10120 | ParamIterator operator++(int /*unused*/) { |
10121 | ParamIteratorInterface<T>* clone = impl_->Clone(); |
10122 | impl_->Advance(); |
10123 | return ParamIterator(clone); |
10124 | } |
10125 | bool operator==(const ParamIterator& other) const { |
10126 | return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_); |
10127 | } |
10128 | bool operator!=(const ParamIterator& other) const { |
10129 | return !(*this == other); |
10130 | } |
10131 | |
10132 | private: |
10133 | friend class ParamGenerator<T>; |
10134 | explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {} |
10135 | scoped_ptr<ParamIteratorInterface<T> > impl_; |
10136 | }; |
10137 | |
10138 | // ParamGeneratorInterface<T> is the binary interface to access generators |
10139 | // defined in other translation units. |
10140 | template <typename T> |
10141 | class ParamGeneratorInterface { |
10142 | public: |
10143 | typedef T ParamType; |
10144 | |
10145 | virtual ~ParamGeneratorInterface() {} |
10146 | |
10147 | // Generator interface definition |
10148 | virtual ParamIteratorInterface<T>* Begin() const = 0; |
10149 | virtual ParamIteratorInterface<T>* End() const = 0; |
10150 | }; |
10151 | |
10152 | // Wraps ParamGeneratorInterface<T> and provides general generator syntax |
10153 | // compatible with the STL Container concept. |
10154 | // This class implements copy initialization semantics and the contained |
10155 | // ParamGeneratorInterface<T> instance is shared among all copies |
10156 | // of the original object. This is possible because that instance is immutable. |
10157 | template<typename T> |
10158 | class ParamGenerator { |
10159 | public: |
10160 | typedef ParamIterator<T> iterator; |
10161 | |
10162 | explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {} |
10163 | ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {} |
10164 | |
10165 | ParamGenerator& operator=(const ParamGenerator& other) { |
10166 | impl_ = other.impl_; |
10167 | return *this; |
10168 | } |
10169 | |
10170 | iterator begin() const { return iterator(impl_->Begin()); } |
10171 | iterator end() const { return iterator(impl_->End()); } |
10172 | |
10173 | private: |
10174 | linked_ptr<const ParamGeneratorInterface<T> > impl_; |
10175 | }; |
10176 | |
10177 | // Generates values from a range of two comparable values. Can be used to |
10178 | // generate sequences of user-defined types that implement operator+() and |
10179 | // operator<(). |
10180 | // This class is used in the Range() function. |
10181 | template <typename T, typename IncrementT> |
10182 | class RangeGenerator : public ParamGeneratorInterface<T> { |
10183 | public: |
10184 | RangeGenerator(T begin, T end, IncrementT step) |
10185 | : begin_(begin), end_(end), |
10186 | step_(step), end_index_(CalculateEndIndex(begin, end, step)) {} |
10187 | virtual ~RangeGenerator() {} |
10188 | |
10189 | virtual ParamIteratorInterface<T>* Begin() const { |
10190 | return new Iterator(this, begin_, 0, step_); |
10191 | } |
10192 | virtual ParamIteratorInterface<T>* End() const { |
10193 | return new Iterator(this, end_, end_index_, step_); |
10194 | } |
10195 | |
10196 | private: |
10197 | class Iterator : public ParamIteratorInterface<T> { |
10198 | public: |
10199 | Iterator(const ParamGeneratorInterface<T>* base, T value, int index, |
10200 | IncrementT step) |
10201 | : base_(base), value_(value), index_(index), step_(step) {} |
10202 | virtual ~Iterator() {} |
10203 | |
10204 | virtual const ParamGeneratorInterface<T>* BaseGenerator() const { |
10205 | return base_; |
10206 | } |
10207 | virtual void Advance() { |
10208 | value_ = value_ + step_; |
10209 | index_++; |
10210 | } |
10211 | virtual ParamIteratorInterface<T>* Clone() const { |
10212 | return new Iterator(*this); |
10213 | } |
10214 | virtual const T* Current() const { return &value_; } |
10215 | virtual bool Equals(const ParamIteratorInterface<T>& other) const { |
10216 | // Having the same base generator guarantees that the other |
10217 | // iterator is of the same type and we can downcast. |
10218 | GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) |
10219 | << "The program attempted to compare iterators " |
10220 | << "from different generators." << std::endl; |
10221 | const int other_index = |
10222 | CheckedDowncastToActualType<const Iterator>(&other)->index_; |
10223 | return index_ == other_index; |
10224 | } |
10225 | |
10226 | private: |
10227 | Iterator(const Iterator& other) |
10228 | : ParamIteratorInterface<T>(), |
10229 | base_(other.base_), value_(other.value_), index_(other.index_), |
10230 | step_(other.step_) {} |
10231 | |
10232 | // No implementation - assignment is unsupported. |
10233 | void operator=(const Iterator& other); |
10234 | |
10235 | const ParamGeneratorInterface<T>* const base_; |
10236 | T value_; |
10237 | int index_; |
10238 | const IncrementT step_; |
10239 | }; // class RangeGenerator::Iterator |
10240 | |
10241 | static int CalculateEndIndex(const T& begin, |
10242 | const T& end, |
10243 | const IncrementT& step) { |
10244 | int end_index = 0; |
10245 | for (T i = begin; i < end; i = i + step) |
10246 | end_index++; |
10247 | return end_index; |
10248 | } |
10249 | |
10250 | // No implementation - assignment is unsupported. |
10251 | void operator=(const RangeGenerator& other); |
10252 | |
10253 | const T begin_; |
10254 | const T end_; |
10255 | const IncrementT step_; |
10256 | // The index for the end() iterator. All the elements in the generated |
10257 | // sequence are indexed (0-based) to aid iterator comparison. |
10258 | const int end_index_; |
10259 | }; // class RangeGenerator |
10260 | |
10261 | |
10262 | // Generates values from a pair of STL-style iterators. Used in the |
10263 | // ValuesIn() function. The elements are copied from the source range |
10264 | // since the source can be located on the stack, and the generator |
10265 | // is likely to persist beyond that stack frame. |
10266 | template <typename T> |
10267 | class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> { |
10268 | public: |
10269 | template <typename ForwardIterator> |
10270 | ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end) |
10271 | : container_(begin, end) {} |
10272 | virtual ~ValuesInIteratorRangeGenerator() {} |
10273 | |
10274 | virtual ParamIteratorInterface<T>* Begin() const { |
10275 | return new Iterator(this, container_.begin()); |
10276 | } |
10277 | virtual ParamIteratorInterface<T>* End() const { |
10278 | return new Iterator(this, container_.end()); |
10279 | } |
10280 | |
10281 | private: |
10282 | typedef typename ::std::vector<T> ContainerType; |
10283 | |
10284 | class Iterator : public ParamIteratorInterface<T> { |
10285 | public: |
10286 | Iterator(const ParamGeneratorInterface<T>* base, |
10287 | typename ContainerType::const_iterator iterator) |
10288 | : base_(base), iterator_(iterator) {} |
10289 | virtual ~Iterator() {} |
10290 | |
10291 | virtual const ParamGeneratorInterface<T>* BaseGenerator() const { |
10292 | return base_; |
10293 | } |
10294 | virtual void Advance() { |
10295 | ++iterator_; |
10296 | value_.reset(); |
10297 | } |
10298 | virtual ParamIteratorInterface<T>* Clone() const { |
10299 | return new Iterator(*this); |
10300 | } |
10301 | // We need to use cached value referenced by iterator_ because *iterator_ |
10302 | // can return a temporary object (and of type other then T), so just |
10303 | // having "return &*iterator_;" doesn't work. |
10304 | // value_ is updated here and not in Advance() because Advance() |
10305 | // can advance iterator_ beyond the end of the range, and we cannot |
10306 | // detect that fact. The client code, on the other hand, is |
10307 | // responsible for not calling Current() on an out-of-range iterator. |
10308 | virtual const T* Current() const { |
10309 | if (value_.get() == NULL) |
10310 | value_.reset(new T(*iterator_)); |
10311 | return value_.get(); |
10312 | } |
10313 | virtual bool Equals(const ParamIteratorInterface<T>& other) const { |
10314 | // Having the same base generator guarantees that the other |
10315 | // iterator is of the same type and we can downcast. |
10316 | GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) |
10317 | << "The program attempted to compare iterators " |
10318 | << "from different generators." << std::endl; |
10319 | return iterator_ == |
10320 | CheckedDowncastToActualType<const Iterator>(&other)->iterator_; |
10321 | } |
10322 | |
10323 | private: |
10324 | Iterator(const Iterator& other) |
10325 | // The explicit constructor call suppresses a false warning |
10326 | // emitted by gcc when supplied with the -Wextra option. |
10327 | : ParamIteratorInterface<T>(), |
10328 | base_(other.base_), |
10329 | iterator_(other.iterator_) {} |
10330 | |
10331 | const ParamGeneratorInterface<T>* const base_; |
10332 | typename ContainerType::const_iterator iterator_; |
10333 | // A cached value of *iterator_. We keep it here to allow access by |
10334 | // pointer in the wrapping iterator's operator->(). |
10335 | // value_ needs to be mutable to be accessed in Current(). |
10336 | // Use of scoped_ptr helps manage cached value's lifetime, |
10337 | // which is bound by the lifespan of the iterator itself. |
10338 | mutable scoped_ptr<const T> value_; |
10339 | }; // class ValuesInIteratorRangeGenerator::Iterator |
10340 | |
10341 | // No implementation - assignment is unsupported. |
10342 | void operator=(const ValuesInIteratorRangeGenerator& other); |
10343 | |
10344 | const ContainerType container_; |
10345 | }; // class ValuesInIteratorRangeGenerator |
10346 | |
10347 | // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. |
10348 | // |
10349 | // Stores a parameter value and later creates tests parameterized with that |
10350 | // value. |
10351 | template <class TestClass> |
10352 | class ParameterizedTestFactory : public TestFactoryBase { |
10353 | public: |
10354 | typedef typename TestClass::ParamType ParamType; |
10355 | explicit ParameterizedTestFactory(ParamType parameter) : |
10356 | parameter_(parameter) {} |
10357 | virtual Test* CreateTest() { |
10358 | TestClass::SetParam(¶meter_); |
10359 | return new TestClass(); |
10360 | } |
10361 | |
10362 | private: |
10363 | const ParamType parameter_; |
10364 | |
10365 | GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory); |
10366 | }; |
10367 | |
10368 | // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. |
10369 | // |
10370 | // TestMetaFactoryBase is a base class for meta-factories that create |
10371 | // test factories for passing into MakeAndRegisterTestInfo function. |
10372 | template <class ParamType> |
10373 | class TestMetaFactoryBase { |
10374 | public: |
10375 | virtual ~TestMetaFactoryBase() {} |
10376 | |
10377 | virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0; |
10378 | }; |
10379 | |
10380 | // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. |
10381 | // |
10382 | // TestMetaFactory creates test factories for passing into |
10383 | // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives |
10384 | // ownership of test factory pointer, same factory object cannot be passed |
10385 | // into that method twice. But ParameterizedTestCaseInfo is going to call |
10386 | // it for each Test/Parameter value combination. Thus it needs meta factory |
10387 | // creator class. |
10388 | template <class TestCase> |
10389 | class TestMetaFactory |
10390 | : public TestMetaFactoryBase<typename TestCase::ParamType> { |
10391 | public: |
10392 | typedef typename TestCase::ParamType ParamType; |
10393 | |
10394 | TestMetaFactory() {} |
10395 | |
10396 | virtual TestFactoryBase* CreateTestFactory(ParamType parameter) { |
10397 | return new ParameterizedTestFactory<TestCase>(parameter); |
10398 | } |
10399 | |
10400 | private: |
10401 | GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory); |
10402 | }; |
10403 | |
10404 | // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. |
10405 | // |
10406 | // ParameterizedTestCaseInfoBase is a generic interface |
10407 | // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase |
10408 | // accumulates test information provided by TEST_P macro invocations |
10409 | // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations |
10410 | // and uses that information to register all resulting test instances |
10411 | // in RegisterTests method. The ParameterizeTestCaseRegistry class holds |
10412 | // a collection of pointers to the ParameterizedTestCaseInfo objects |
10413 | // and calls RegisterTests() on each of them when asked. |
10414 | class ParameterizedTestCaseInfoBase { |
10415 | public: |
10416 | virtual ~ParameterizedTestCaseInfoBase() {} |
10417 | |
10418 | // Base part of test case name for display purposes. |
10419 | virtual const string& GetTestCaseName() const = 0; |
10420 | // Test case id to verify identity. |
10421 | virtual TypeId GetTestCaseTypeId() const = 0; |
10422 | // UnitTest class invokes this method to register tests in this |
10423 | // test case right before running them in RUN_ALL_TESTS macro. |
10424 | // This method should not be called more then once on any single |
10425 | // instance of a ParameterizedTestCaseInfoBase derived class. |
10426 | virtual void RegisterTests() = 0; |
10427 | |
10428 | protected: |
10429 | ParameterizedTestCaseInfoBase() {} |
10430 | |
10431 | private: |
10432 | GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase); |
10433 | }; |
10434 | |
10435 | // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. |
10436 | // |
10437 | // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P |
10438 | // macro invocations for a particular test case and generators |
10439 | // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that |
10440 | // test case. It registers tests with all values generated by all |
10441 | // generators when asked. |
10442 | template <class TestCase> |
10443 | class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase { |
10444 | public: |
10445 | // ParamType and GeneratorCreationFunc are private types but are required |
10446 | // for declarations of public methods AddTestPattern() and |
10447 | // AddTestCaseInstantiation(). |
10448 | typedef typename TestCase::ParamType ParamType; |
10449 | // A function that returns an instance of appropriate generator type. |
10450 | typedef ParamGenerator<ParamType>(GeneratorCreationFunc)(); |
10451 | |
10452 | explicit ParameterizedTestCaseInfo(const char* name) |
10453 | : test_case_name_(name) {} |
10454 | |
10455 | // Test case base name for display purposes. |
10456 | virtual const string& GetTestCaseName() const { return test_case_name_; } |
10457 | // Test case id to verify identity. |
10458 | virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); } |
10459 | // TEST_P macro uses AddTestPattern() to record information |
10460 | // about a single test in a LocalTestInfo structure. |
10461 | // test_case_name is the base name of the test case (without invocation |
10462 | // prefix). test_base_name is the name of an individual test without |
10463 | // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is |
10464 | // test case base name and DoBar is test base name. |
10465 | void AddTestPattern(const char* test_case_name, |
10466 | const char* test_base_name, |
10467 | TestMetaFactoryBase<ParamType>* meta_factory) { |
10468 | tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name, |
10469 | test_base_name, |
10470 | meta_factory))); |
10471 | } |
10472 | // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information |
10473 | // about a generator. |
10474 | int AddTestCaseInstantiation(const string& instantiation_name, |
10475 | GeneratorCreationFunc* func, |
10476 | const char* /* file */, |
10477 | int /* line */) { |
10478 | instantiations_.push_back(::std::make_pair(instantiation_name, func)); |
10479 | return 0; // Return value used only to run this method in namespace scope. |
10480 | } |
10481 | // UnitTest class invokes this method to register tests in this test case |
10482 | // test cases right before running tests in RUN_ALL_TESTS macro. |
10483 | // This method should not be called more then once on any single |
10484 | // instance of a ParameterizedTestCaseInfoBase derived class. |
10485 | // UnitTest has a guard to prevent from calling this method more then once. |
10486 | virtual void RegisterTests() { |
10487 | for (typename TestInfoContainer::iterator test_it = tests_.begin(); |
10488 | test_it != tests_.end(); ++test_it) { |
10489 | linked_ptr<TestInfo> test_info = *test_it; |
10490 | for (typename InstantiationContainer::iterator gen_it = |
10491 | instantiations_.begin(); gen_it != instantiations_.end(); |
10492 | ++gen_it) { |
10493 | const string& instantiation_name = gen_it->first; |
10494 | ParamGenerator<ParamType> generator((*gen_it->second)()); |
10495 | |
10496 | string test_case_name; |
10497 | if ( !instantiation_name.empty() ) |
10498 | test_case_name = instantiation_name + "/" ; |
10499 | test_case_name += test_info->test_case_base_name; |
10500 | |
10501 | int i = 0; |
10502 | for (typename ParamGenerator<ParamType>::iterator param_it = |
10503 | generator.begin(); |
10504 | param_it != generator.end(); ++param_it, ++i) { |
10505 | Message test_name_stream; |
10506 | test_name_stream << test_info->test_base_name << "/" << i; |
10507 | MakeAndRegisterTestInfo( |
10508 | test_case_name.c_str(), |
10509 | test_name_stream.GetString().c_str(), |
10510 | NULL, // No type parameter. |
10511 | PrintToString(*param_it).c_str(), |
10512 | GetTestCaseTypeId(), |
10513 | TestCase::SetUpTestCase, |
10514 | TestCase::TearDownTestCase, |
10515 | test_info->test_meta_factory->CreateTestFactory(*param_it)); |
10516 | } // for param_it |
10517 | } // for gen_it |
10518 | } // for test_it |
10519 | } // RegisterTests |
10520 | |
10521 | private: |
10522 | // LocalTestInfo structure keeps information about a single test registered |
10523 | // with TEST_P macro. |
10524 | struct TestInfo { |
10525 | TestInfo(const char* a_test_case_base_name, |
10526 | const char* a_test_base_name, |
10527 | TestMetaFactoryBase<ParamType>* a_test_meta_factory) : |
10528 | test_case_base_name(a_test_case_base_name), |
10529 | test_base_name(a_test_base_name), |
10530 | test_meta_factory(a_test_meta_factory) {} |
10531 | |
10532 | const string test_case_base_name; |
10533 | const string test_base_name; |
10534 | const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory; |
10535 | }; |
10536 | typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer; |
10537 | // Keeps pairs of <Instantiation name, Sequence generator creation function> |
10538 | // received from INSTANTIATE_TEST_CASE_P macros. |
10539 | typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> > |
10540 | InstantiationContainer; |
10541 | |
10542 | const string test_case_name_; |
10543 | TestInfoContainer tests_; |
10544 | InstantiationContainer instantiations_; |
10545 | |
10546 | GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo); |
10547 | }; // class ParameterizedTestCaseInfo |
10548 | |
10549 | // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. |
10550 | // |
10551 | // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase |
10552 | // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P |
10553 | // macros use it to locate their corresponding ParameterizedTestCaseInfo |
10554 | // descriptors. |
10555 | class ParameterizedTestCaseRegistry { |
10556 | public: |
10557 | ParameterizedTestCaseRegistry() {} |
10558 | ~ParameterizedTestCaseRegistry() { |
10559 | for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); |
10560 | it != test_case_infos_.end(); ++it) { |
10561 | delete *it; |
10562 | } |
10563 | } |
10564 | |
10565 | // Looks up or creates and returns a structure containing information about |
10566 | // tests and instantiations of a particular test case. |
10567 | template <class TestCase> |
10568 | ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder( |
10569 | const char* test_case_name, |
10570 | const char* file, |
10571 | int line) { |
10572 | ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL; |
10573 | for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); |
10574 | it != test_case_infos_.end(); ++it) { |
10575 | if ((*it)->GetTestCaseName() == test_case_name) { |
10576 | if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) { |
10577 | // Complain about incorrect usage of Google Test facilities |
10578 | // and terminate the program since we cannot guaranty correct |
10579 | // test case setup and tear-down in this case. |
10580 | ReportInvalidTestCaseType(test_case_name, file, line); |
10581 | posix::Abort(); |
10582 | } else { |
10583 | // At this point we are sure that the object we found is of the same |
10584 | // type we are looking for, so we downcast it to that type |
10585 | // without further checks. |
10586 | typed_test_info = CheckedDowncastToActualType< |
10587 | ParameterizedTestCaseInfo<TestCase> >(*it); |
10588 | } |
10589 | break; |
10590 | } |
10591 | } |
10592 | if (typed_test_info == NULL) { |
10593 | typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name); |
10594 | test_case_infos_.push_back(typed_test_info); |
10595 | } |
10596 | return typed_test_info; |
10597 | } |
10598 | void RegisterTests() { |
10599 | for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); |
10600 | it != test_case_infos_.end(); ++it) { |
10601 | (*it)->RegisterTests(); |
10602 | } |
10603 | } |
10604 | |
10605 | private: |
10606 | typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer; |
10607 | |
10608 | TestCaseInfoContainer test_case_infos_; |
10609 | |
10610 | GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry); |
10611 | }; |
10612 | |
10613 | } // namespace internal |
10614 | } // namespace testing |
10615 | |
10616 | #endif // GTEST_HAS_PARAM_TEST |
10617 | |
10618 | #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ |
10619 | // This file was GENERATED by command: |
10620 | // pump.py gtest-param-util-generated.h.pump |
10621 | // DO NOT EDIT BY HAND!!! |
10622 | |
10623 | // Copyright 2008 Google Inc. |
10624 | // All Rights Reserved. |
10625 | // |
10626 | // Redistribution and use in source and binary forms, with or without |
10627 | // modification, are permitted provided that the following conditions are |
10628 | // met: |
10629 | // |
10630 | // * Redistributions of source code must retain the above copyright |
10631 | // notice, this list of conditions and the following disclaimer. |
10632 | // * Redistributions in binary form must reproduce the above |
10633 | // copyright notice, this list of conditions and the following disclaimer |
10634 | // in the documentation and/or other materials provided with the |
10635 | // distribution. |
10636 | // * Neither the name of Google Inc. nor the names of its |
10637 | // contributors may be used to endorse or promote products derived from |
10638 | // this software without specific prior written permission. |
10639 | // |
10640 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
10641 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
10642 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
10643 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
10644 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
10645 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
10646 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
10647 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
10648 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
10649 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
10650 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
10651 | // |
10652 | // Author: vladl@google.com (Vlad Losev) |
10653 | |
10654 | // Type and function utilities for implementing parameterized tests. |
10655 | // This file is generated by a SCRIPT. DO NOT EDIT BY HAND! |
10656 | // |
10657 | // Currently Google Test supports at most 50 arguments in Values, |
10658 | // and at most 10 arguments in Combine. Please contact |
10659 | // googletestframework@googlegroups.com if you need more. |
10660 | // Please note that the number of arguments to Combine is limited |
10661 | // by the maximum arity of the implementation of tr1::tuple which is |
10662 | // currently set at 10. |
10663 | |
10664 | #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ |
10665 | #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ |
10666 | |
10667 | // scripts/fuse_gtest.py depends on gtest's own header being #included |
10668 | // *unconditionally*. Therefore these #includes cannot be moved |
10669 | // inside #if GTEST_HAS_PARAM_TEST. |
10670 | |
10671 | #if GTEST_HAS_PARAM_TEST |
10672 | |
10673 | namespace testing { |
10674 | |
10675 | // Forward declarations of ValuesIn(), which is implemented in |
10676 | // include/gtest/gtest-param-test.h. |
10677 | template <typename ForwardIterator> |
10678 | internal::ParamGenerator< |
10679 | typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type> |
10680 | ValuesIn(ForwardIterator begin, ForwardIterator end); |
10681 | |
10682 | template <typename T, size_t N> |
10683 | internal::ParamGenerator<T> ValuesIn(const T (&array)[N]); |
10684 | |
10685 | template <class Container> |
10686 | internal::ParamGenerator<typename Container::value_type> ValuesIn( |
10687 | const Container& container); |
10688 | |
10689 | namespace internal { |
10690 | |
10691 | // Used in the Values() function to provide polymorphic capabilities. |
10692 | template <typename T1> |
10693 | class ValueArray1 { |
10694 | public: |
10695 | explicit ValueArray1(T1 v1) : v1_(v1) {} |
10696 | |
10697 | template <typename T> |
10698 | operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); } |
10699 | |
10700 | private: |
10701 | // No implementation - assignment is unsupported. |
10702 | void operator=(const ValueArray1& other); |
10703 | |
10704 | const T1 v1_; |
10705 | }; |
10706 | |
10707 | template <typename T1, typename T2> |
10708 | class ValueArray2 { |
10709 | public: |
10710 | ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {} |
10711 | |
10712 | template <typename T> |
10713 | operator ParamGenerator<T>() const { |
10714 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)}; |
10715 | return ValuesIn(array); |
10716 | } |
10717 | |
10718 | private: |
10719 | // No implementation - assignment is unsupported. |
10720 | void operator=(const ValueArray2& other); |
10721 | |
10722 | const T1 v1_; |
10723 | const T2 v2_; |
10724 | }; |
10725 | |
10726 | template <typename T1, typename T2, typename T3> |
10727 | class ValueArray3 { |
10728 | public: |
10729 | ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {} |
10730 | |
10731 | template <typename T> |
10732 | operator ParamGenerator<T>() const { |
10733 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
10734 | static_cast<T>(v3_)}; |
10735 | return ValuesIn(array); |
10736 | } |
10737 | |
10738 | private: |
10739 | // No implementation - assignment is unsupported. |
10740 | void operator=(const ValueArray3& other); |
10741 | |
10742 | const T1 v1_; |
10743 | const T2 v2_; |
10744 | const T3 v3_; |
10745 | }; |
10746 | |
10747 | template <typename T1, typename T2, typename T3, typename T4> |
10748 | class ValueArray4 { |
10749 | public: |
10750 | ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3), |
10751 | v4_(v4) {} |
10752 | |
10753 | template <typename T> |
10754 | operator ParamGenerator<T>() const { |
10755 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
10756 | static_cast<T>(v3_), static_cast<T>(v4_)}; |
10757 | return ValuesIn(array); |
10758 | } |
10759 | |
10760 | private: |
10761 | // No implementation - assignment is unsupported. |
10762 | void operator=(const ValueArray4& other); |
10763 | |
10764 | const T1 v1_; |
10765 | const T2 v2_; |
10766 | const T3 v3_; |
10767 | const T4 v4_; |
10768 | }; |
10769 | |
10770 | template <typename T1, typename T2, typename T3, typename T4, typename T5> |
10771 | class ValueArray5 { |
10772 | public: |
10773 | ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3), |
10774 | v4_(v4), v5_(v5) {} |
10775 | |
10776 | template <typename T> |
10777 | operator ParamGenerator<T>() const { |
10778 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
10779 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)}; |
10780 | return ValuesIn(array); |
10781 | } |
10782 | |
10783 | private: |
10784 | // No implementation - assignment is unsupported. |
10785 | void operator=(const ValueArray5& other); |
10786 | |
10787 | const T1 v1_; |
10788 | const T2 v2_; |
10789 | const T3 v3_; |
10790 | const T4 v4_; |
10791 | const T5 v5_; |
10792 | }; |
10793 | |
10794 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
10795 | typename T6> |
10796 | class ValueArray6 { |
10797 | public: |
10798 | ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2), |
10799 | v3_(v3), v4_(v4), v5_(v5), v6_(v6) {} |
10800 | |
10801 | template <typename T> |
10802 | operator ParamGenerator<T>() const { |
10803 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
10804 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
10805 | static_cast<T>(v6_)}; |
10806 | return ValuesIn(array); |
10807 | } |
10808 | |
10809 | private: |
10810 | // No implementation - assignment is unsupported. |
10811 | void operator=(const ValueArray6& other); |
10812 | |
10813 | const T1 v1_; |
10814 | const T2 v2_; |
10815 | const T3 v3_; |
10816 | const T4 v4_; |
10817 | const T5 v5_; |
10818 | const T6 v6_; |
10819 | }; |
10820 | |
10821 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
10822 | typename T6, typename T7> |
10823 | class ValueArray7 { |
10824 | public: |
10825 | ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1), |
10826 | v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {} |
10827 | |
10828 | template <typename T> |
10829 | operator ParamGenerator<T>() const { |
10830 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
10831 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
10832 | static_cast<T>(v6_), static_cast<T>(v7_)}; |
10833 | return ValuesIn(array); |
10834 | } |
10835 | |
10836 | private: |
10837 | // No implementation - assignment is unsupported. |
10838 | void operator=(const ValueArray7& other); |
10839 | |
10840 | const T1 v1_; |
10841 | const T2 v2_; |
10842 | const T3 v3_; |
10843 | const T4 v4_; |
10844 | const T5 v5_; |
10845 | const T6 v6_; |
10846 | const T7 v7_; |
10847 | }; |
10848 | |
10849 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
10850 | typename T6, typename T7, typename T8> |
10851 | class ValueArray8 { |
10852 | public: |
10853 | ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, |
10854 | T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), |
10855 | v8_(v8) {} |
10856 | |
10857 | template <typename T> |
10858 | operator ParamGenerator<T>() const { |
10859 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
10860 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
10861 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)}; |
10862 | return ValuesIn(array); |
10863 | } |
10864 | |
10865 | private: |
10866 | // No implementation - assignment is unsupported. |
10867 | void operator=(const ValueArray8& other); |
10868 | |
10869 | const T1 v1_; |
10870 | const T2 v2_; |
10871 | const T3 v3_; |
10872 | const T4 v4_; |
10873 | const T5 v5_; |
10874 | const T6 v6_; |
10875 | const T7 v7_; |
10876 | const T8 v8_; |
10877 | }; |
10878 | |
10879 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
10880 | typename T6, typename T7, typename T8, typename T9> |
10881 | class ValueArray9 { |
10882 | public: |
10883 | ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, |
10884 | T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), |
10885 | v8_(v8), v9_(v9) {} |
10886 | |
10887 | template <typename T> |
10888 | operator ParamGenerator<T>() const { |
10889 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
10890 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
10891 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
10892 | static_cast<T>(v9_)}; |
10893 | return ValuesIn(array); |
10894 | } |
10895 | |
10896 | private: |
10897 | // No implementation - assignment is unsupported. |
10898 | void operator=(const ValueArray9& other); |
10899 | |
10900 | const T1 v1_; |
10901 | const T2 v2_; |
10902 | const T3 v3_; |
10903 | const T4 v4_; |
10904 | const T5 v5_; |
10905 | const T6 v6_; |
10906 | const T7 v7_; |
10907 | const T8 v8_; |
10908 | const T9 v9_; |
10909 | }; |
10910 | |
10911 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
10912 | typename T6, typename T7, typename T8, typename T9, typename T10> |
10913 | class ValueArray10 { |
10914 | public: |
10915 | ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
10916 | T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), |
10917 | v8_(v8), v9_(v9), v10_(v10) {} |
10918 | |
10919 | template <typename T> |
10920 | operator ParamGenerator<T>() const { |
10921 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
10922 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
10923 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
10924 | static_cast<T>(v9_), static_cast<T>(v10_)}; |
10925 | return ValuesIn(array); |
10926 | } |
10927 | |
10928 | private: |
10929 | // No implementation - assignment is unsupported. |
10930 | void operator=(const ValueArray10& other); |
10931 | |
10932 | const T1 v1_; |
10933 | const T2 v2_; |
10934 | const T3 v3_; |
10935 | const T4 v4_; |
10936 | const T5 v5_; |
10937 | const T6 v6_; |
10938 | const T7 v7_; |
10939 | const T8 v8_; |
10940 | const T9 v9_; |
10941 | const T10 v10_; |
10942 | }; |
10943 | |
10944 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
10945 | typename T6, typename T7, typename T8, typename T9, typename T10, |
10946 | typename T11> |
10947 | class ValueArray11 { |
10948 | public: |
10949 | ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
10950 | T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), |
10951 | v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {} |
10952 | |
10953 | template <typename T> |
10954 | operator ParamGenerator<T>() const { |
10955 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
10956 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
10957 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
10958 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)}; |
10959 | return ValuesIn(array); |
10960 | } |
10961 | |
10962 | private: |
10963 | // No implementation - assignment is unsupported. |
10964 | void operator=(const ValueArray11& other); |
10965 | |
10966 | const T1 v1_; |
10967 | const T2 v2_; |
10968 | const T3 v3_; |
10969 | const T4 v4_; |
10970 | const T5 v5_; |
10971 | const T6 v6_; |
10972 | const T7 v7_; |
10973 | const T8 v8_; |
10974 | const T9 v9_; |
10975 | const T10 v10_; |
10976 | const T11 v11_; |
10977 | }; |
10978 | |
10979 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
10980 | typename T6, typename T7, typename T8, typename T9, typename T10, |
10981 | typename T11, typename T12> |
10982 | class ValueArray12 { |
10983 | public: |
10984 | ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
10985 | T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), |
10986 | v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {} |
10987 | |
10988 | template <typename T> |
10989 | operator ParamGenerator<T>() const { |
10990 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
10991 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
10992 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
10993 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
10994 | static_cast<T>(v12_)}; |
10995 | return ValuesIn(array); |
10996 | } |
10997 | |
10998 | private: |
10999 | // No implementation - assignment is unsupported. |
11000 | void operator=(const ValueArray12& other); |
11001 | |
11002 | const T1 v1_; |
11003 | const T2 v2_; |
11004 | const T3 v3_; |
11005 | const T4 v4_; |
11006 | const T5 v5_; |
11007 | const T6 v6_; |
11008 | const T7 v7_; |
11009 | const T8 v8_; |
11010 | const T9 v9_; |
11011 | const T10 v10_; |
11012 | const T11 v11_; |
11013 | const T12 v12_; |
11014 | }; |
11015 | |
11016 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11017 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11018 | typename T11, typename T12, typename T13> |
11019 | class ValueArray13 { |
11020 | public: |
11021 | ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11022 | T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), |
11023 | v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), |
11024 | v12_(v12), v13_(v13) {} |
11025 | |
11026 | template <typename T> |
11027 | operator ParamGenerator<T>() const { |
11028 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11029 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11030 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11031 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11032 | static_cast<T>(v12_), static_cast<T>(v13_)}; |
11033 | return ValuesIn(array); |
11034 | } |
11035 | |
11036 | private: |
11037 | // No implementation - assignment is unsupported. |
11038 | void operator=(const ValueArray13& other); |
11039 | |
11040 | const T1 v1_; |
11041 | const T2 v2_; |
11042 | const T3 v3_; |
11043 | const T4 v4_; |
11044 | const T5 v5_; |
11045 | const T6 v6_; |
11046 | const T7 v7_; |
11047 | const T8 v8_; |
11048 | const T9 v9_; |
11049 | const T10 v10_; |
11050 | const T11 v11_; |
11051 | const T12 v12_; |
11052 | const T13 v13_; |
11053 | }; |
11054 | |
11055 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11056 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11057 | typename T11, typename T12, typename T13, typename T14> |
11058 | class ValueArray14 { |
11059 | public: |
11060 | ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11061 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3), |
11062 | v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), |
11063 | v11_(v11), v12_(v12), v13_(v13), v14_(v14) {} |
11064 | |
11065 | template <typename T> |
11066 | operator ParamGenerator<T>() const { |
11067 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11068 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11069 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11070 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11071 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)}; |
11072 | return ValuesIn(array); |
11073 | } |
11074 | |
11075 | private: |
11076 | // No implementation - assignment is unsupported. |
11077 | void operator=(const ValueArray14& other); |
11078 | |
11079 | const T1 v1_; |
11080 | const T2 v2_; |
11081 | const T3 v3_; |
11082 | const T4 v4_; |
11083 | const T5 v5_; |
11084 | const T6 v6_; |
11085 | const T7 v7_; |
11086 | const T8 v8_; |
11087 | const T9 v9_; |
11088 | const T10 v10_; |
11089 | const T11 v11_; |
11090 | const T12 v12_; |
11091 | const T13 v13_; |
11092 | const T14 v14_; |
11093 | }; |
11094 | |
11095 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11096 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11097 | typename T11, typename T12, typename T13, typename T14, typename T15> |
11098 | class ValueArray15 { |
11099 | public: |
11100 | ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11101 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2), |
11102 | v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), |
11103 | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {} |
11104 | |
11105 | template <typename T> |
11106 | operator ParamGenerator<T>() const { |
11107 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11108 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11109 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11110 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11111 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
11112 | static_cast<T>(v15_)}; |
11113 | return ValuesIn(array); |
11114 | } |
11115 | |
11116 | private: |
11117 | // No implementation - assignment is unsupported. |
11118 | void operator=(const ValueArray15& other); |
11119 | |
11120 | const T1 v1_; |
11121 | const T2 v2_; |
11122 | const T3 v3_; |
11123 | const T4 v4_; |
11124 | const T5 v5_; |
11125 | const T6 v6_; |
11126 | const T7 v7_; |
11127 | const T8 v8_; |
11128 | const T9 v9_; |
11129 | const T10 v10_; |
11130 | const T11 v11_; |
11131 | const T12 v12_; |
11132 | const T13 v13_; |
11133 | const T14 v14_; |
11134 | const T15 v15_; |
11135 | }; |
11136 | |
11137 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11138 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11139 | typename T11, typename T12, typename T13, typename T14, typename T15, |
11140 | typename T16> |
11141 | class ValueArray16 { |
11142 | public: |
11143 | ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11144 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1), |
11145 | v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), |
11146 | v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), |
11147 | v16_(v16) {} |
11148 | |
11149 | template <typename T> |
11150 | operator ParamGenerator<T>() const { |
11151 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11152 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11153 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11154 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11155 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
11156 | static_cast<T>(v15_), static_cast<T>(v16_)}; |
11157 | return ValuesIn(array); |
11158 | } |
11159 | |
11160 | private: |
11161 | // No implementation - assignment is unsupported. |
11162 | void operator=(const ValueArray16& other); |
11163 | |
11164 | const T1 v1_; |
11165 | const T2 v2_; |
11166 | const T3 v3_; |
11167 | const T4 v4_; |
11168 | const T5 v5_; |
11169 | const T6 v6_; |
11170 | const T7 v7_; |
11171 | const T8 v8_; |
11172 | const T9 v9_; |
11173 | const T10 v10_; |
11174 | const T11 v11_; |
11175 | const T12 v12_; |
11176 | const T13 v13_; |
11177 | const T14 v14_; |
11178 | const T15 v15_; |
11179 | const T16 v16_; |
11180 | }; |
11181 | |
11182 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11183 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11184 | typename T11, typename T12, typename T13, typename T14, typename T15, |
11185 | typename T16, typename T17> |
11186 | class ValueArray17 { |
11187 | public: |
11188 | ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11189 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, |
11190 | T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), |
11191 | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), |
11192 | v15_(v15), v16_(v16), v17_(v17) {} |
11193 | |
11194 | template <typename T> |
11195 | operator ParamGenerator<T>() const { |
11196 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11197 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11198 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11199 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11200 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
11201 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)}; |
11202 | return ValuesIn(array); |
11203 | } |
11204 | |
11205 | private: |
11206 | // No implementation - assignment is unsupported. |
11207 | void operator=(const ValueArray17& other); |
11208 | |
11209 | const T1 v1_; |
11210 | const T2 v2_; |
11211 | const T3 v3_; |
11212 | const T4 v4_; |
11213 | const T5 v5_; |
11214 | const T6 v6_; |
11215 | const T7 v7_; |
11216 | const T8 v8_; |
11217 | const T9 v9_; |
11218 | const T10 v10_; |
11219 | const T11 v11_; |
11220 | const T12 v12_; |
11221 | const T13 v13_; |
11222 | const T14 v14_; |
11223 | const T15 v15_; |
11224 | const T16 v16_; |
11225 | const T17 v17_; |
11226 | }; |
11227 | |
11228 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11229 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11230 | typename T11, typename T12, typename T13, typename T14, typename T15, |
11231 | typename T16, typename T17, typename T18> |
11232 | class ValueArray18 { |
11233 | public: |
11234 | ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11235 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
11236 | T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), |
11237 | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), |
11238 | v15_(v15), v16_(v16), v17_(v17), v18_(v18) {} |
11239 | |
11240 | template <typename T> |
11241 | operator ParamGenerator<T>() const { |
11242 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11243 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11244 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11245 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11246 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
11247 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
11248 | static_cast<T>(v18_)}; |
11249 | return ValuesIn(array); |
11250 | } |
11251 | |
11252 | private: |
11253 | // No implementation - assignment is unsupported. |
11254 | void operator=(const ValueArray18& other); |
11255 | |
11256 | const T1 v1_; |
11257 | const T2 v2_; |
11258 | const T3 v3_; |
11259 | const T4 v4_; |
11260 | const T5 v5_; |
11261 | const T6 v6_; |
11262 | const T7 v7_; |
11263 | const T8 v8_; |
11264 | const T9 v9_; |
11265 | const T10 v10_; |
11266 | const T11 v11_; |
11267 | const T12 v12_; |
11268 | const T13 v13_; |
11269 | const T14 v14_; |
11270 | const T15 v15_; |
11271 | const T16 v16_; |
11272 | const T17 v17_; |
11273 | const T18 v18_; |
11274 | }; |
11275 | |
11276 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11277 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11278 | typename T11, typename T12, typename T13, typename T14, typename T15, |
11279 | typename T16, typename T17, typename T18, typename T19> |
11280 | class ValueArray19 { |
11281 | public: |
11282 | ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11283 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
11284 | T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), |
11285 | v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), |
11286 | v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {} |
11287 | |
11288 | template <typename T> |
11289 | operator ParamGenerator<T>() const { |
11290 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11291 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11292 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11293 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11294 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
11295 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
11296 | static_cast<T>(v18_), static_cast<T>(v19_)}; |
11297 | return ValuesIn(array); |
11298 | } |
11299 | |
11300 | private: |
11301 | // No implementation - assignment is unsupported. |
11302 | void operator=(const ValueArray19& other); |
11303 | |
11304 | const T1 v1_; |
11305 | const T2 v2_; |
11306 | const T3 v3_; |
11307 | const T4 v4_; |
11308 | const T5 v5_; |
11309 | const T6 v6_; |
11310 | const T7 v7_; |
11311 | const T8 v8_; |
11312 | const T9 v9_; |
11313 | const T10 v10_; |
11314 | const T11 v11_; |
11315 | const T12 v12_; |
11316 | const T13 v13_; |
11317 | const T14 v14_; |
11318 | const T15 v15_; |
11319 | const T16 v16_; |
11320 | const T17 v17_; |
11321 | const T18 v18_; |
11322 | const T19 v19_; |
11323 | }; |
11324 | |
11325 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11326 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11327 | typename T11, typename T12, typename T13, typename T14, typename T15, |
11328 | typename T16, typename T17, typename T18, typename T19, typename T20> |
11329 | class ValueArray20 { |
11330 | public: |
11331 | ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11332 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
11333 | T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), |
11334 | v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), |
11335 | v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), |
11336 | v19_(v19), v20_(v20) {} |
11337 | |
11338 | template <typename T> |
11339 | operator ParamGenerator<T>() const { |
11340 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11341 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11342 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11343 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11344 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
11345 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
11346 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)}; |
11347 | return ValuesIn(array); |
11348 | } |
11349 | |
11350 | private: |
11351 | // No implementation - assignment is unsupported. |
11352 | void operator=(const ValueArray20& other); |
11353 | |
11354 | const T1 v1_; |
11355 | const T2 v2_; |
11356 | const T3 v3_; |
11357 | const T4 v4_; |
11358 | const T5 v5_; |
11359 | const T6 v6_; |
11360 | const T7 v7_; |
11361 | const T8 v8_; |
11362 | const T9 v9_; |
11363 | const T10 v10_; |
11364 | const T11 v11_; |
11365 | const T12 v12_; |
11366 | const T13 v13_; |
11367 | const T14 v14_; |
11368 | const T15 v15_; |
11369 | const T16 v16_; |
11370 | const T17 v17_; |
11371 | const T18 v18_; |
11372 | const T19 v19_; |
11373 | const T20 v20_; |
11374 | }; |
11375 | |
11376 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11377 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11378 | typename T11, typename T12, typename T13, typename T14, typename T15, |
11379 | typename T16, typename T17, typename T18, typename T19, typename T20, |
11380 | typename T21> |
11381 | class ValueArray21 { |
11382 | public: |
11383 | ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11384 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
11385 | T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), |
11386 | v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), |
11387 | v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), |
11388 | v18_(v18), v19_(v19), v20_(v20), v21_(v21) {} |
11389 | |
11390 | template <typename T> |
11391 | operator ParamGenerator<T>() const { |
11392 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11393 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11394 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11395 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11396 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
11397 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
11398 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
11399 | static_cast<T>(v21_)}; |
11400 | return ValuesIn(array); |
11401 | } |
11402 | |
11403 | private: |
11404 | // No implementation - assignment is unsupported. |
11405 | void operator=(const ValueArray21& other); |
11406 | |
11407 | const T1 v1_; |
11408 | const T2 v2_; |
11409 | const T3 v3_; |
11410 | const T4 v4_; |
11411 | const T5 v5_; |
11412 | const T6 v6_; |
11413 | const T7 v7_; |
11414 | const T8 v8_; |
11415 | const T9 v9_; |
11416 | const T10 v10_; |
11417 | const T11 v11_; |
11418 | const T12 v12_; |
11419 | const T13 v13_; |
11420 | const T14 v14_; |
11421 | const T15 v15_; |
11422 | const T16 v16_; |
11423 | const T17 v17_; |
11424 | const T18 v18_; |
11425 | const T19 v19_; |
11426 | const T20 v20_; |
11427 | const T21 v21_; |
11428 | }; |
11429 | |
11430 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11431 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11432 | typename T11, typename T12, typename T13, typename T14, typename T15, |
11433 | typename T16, typename T17, typename T18, typename T19, typename T20, |
11434 | typename T21, typename T22> |
11435 | class ValueArray22 { |
11436 | public: |
11437 | ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11438 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
11439 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3), |
11440 | v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), |
11441 | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), |
11442 | v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {} |
11443 | |
11444 | template <typename T> |
11445 | operator ParamGenerator<T>() const { |
11446 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11447 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11448 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11449 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11450 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
11451 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
11452 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
11453 | static_cast<T>(v21_), static_cast<T>(v22_)}; |
11454 | return ValuesIn(array); |
11455 | } |
11456 | |
11457 | private: |
11458 | // No implementation - assignment is unsupported. |
11459 | void operator=(const ValueArray22& other); |
11460 | |
11461 | const T1 v1_; |
11462 | const T2 v2_; |
11463 | const T3 v3_; |
11464 | const T4 v4_; |
11465 | const T5 v5_; |
11466 | const T6 v6_; |
11467 | const T7 v7_; |
11468 | const T8 v8_; |
11469 | const T9 v9_; |
11470 | const T10 v10_; |
11471 | const T11 v11_; |
11472 | const T12 v12_; |
11473 | const T13 v13_; |
11474 | const T14 v14_; |
11475 | const T15 v15_; |
11476 | const T16 v16_; |
11477 | const T17 v17_; |
11478 | const T18 v18_; |
11479 | const T19 v19_; |
11480 | const T20 v20_; |
11481 | const T21 v21_; |
11482 | const T22 v22_; |
11483 | }; |
11484 | |
11485 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11486 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11487 | typename T11, typename T12, typename T13, typename T14, typename T15, |
11488 | typename T16, typename T17, typename T18, typename T19, typename T20, |
11489 | typename T21, typename T22, typename T23> |
11490 | class ValueArray23 { |
11491 | public: |
11492 | ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11493 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
11494 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2), |
11495 | v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), |
11496 | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), |
11497 | v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), |
11498 | v23_(v23) {} |
11499 | |
11500 | template <typename T> |
11501 | operator ParamGenerator<T>() const { |
11502 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11503 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11504 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11505 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11506 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
11507 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
11508 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
11509 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)}; |
11510 | return ValuesIn(array); |
11511 | } |
11512 | |
11513 | private: |
11514 | // No implementation - assignment is unsupported. |
11515 | void operator=(const ValueArray23& other); |
11516 | |
11517 | const T1 v1_; |
11518 | const T2 v2_; |
11519 | const T3 v3_; |
11520 | const T4 v4_; |
11521 | const T5 v5_; |
11522 | const T6 v6_; |
11523 | const T7 v7_; |
11524 | const T8 v8_; |
11525 | const T9 v9_; |
11526 | const T10 v10_; |
11527 | const T11 v11_; |
11528 | const T12 v12_; |
11529 | const T13 v13_; |
11530 | const T14 v14_; |
11531 | const T15 v15_; |
11532 | const T16 v16_; |
11533 | const T17 v17_; |
11534 | const T18 v18_; |
11535 | const T19 v19_; |
11536 | const T20 v20_; |
11537 | const T21 v21_; |
11538 | const T22 v22_; |
11539 | const T23 v23_; |
11540 | }; |
11541 | |
11542 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11543 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11544 | typename T11, typename T12, typename T13, typename T14, typename T15, |
11545 | typename T16, typename T17, typename T18, typename T19, typename T20, |
11546 | typename T21, typename T22, typename T23, typename T24> |
11547 | class ValueArray24 { |
11548 | public: |
11549 | ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11550 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
11551 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1), |
11552 | v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), |
11553 | v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), |
11554 | v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), |
11555 | v22_(v22), v23_(v23), v24_(v24) {} |
11556 | |
11557 | template <typename T> |
11558 | operator ParamGenerator<T>() const { |
11559 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11560 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11561 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11562 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11563 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
11564 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
11565 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
11566 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
11567 | static_cast<T>(v24_)}; |
11568 | return ValuesIn(array); |
11569 | } |
11570 | |
11571 | private: |
11572 | // No implementation - assignment is unsupported. |
11573 | void operator=(const ValueArray24& other); |
11574 | |
11575 | const T1 v1_; |
11576 | const T2 v2_; |
11577 | const T3 v3_; |
11578 | const T4 v4_; |
11579 | const T5 v5_; |
11580 | const T6 v6_; |
11581 | const T7 v7_; |
11582 | const T8 v8_; |
11583 | const T9 v9_; |
11584 | const T10 v10_; |
11585 | const T11 v11_; |
11586 | const T12 v12_; |
11587 | const T13 v13_; |
11588 | const T14 v14_; |
11589 | const T15 v15_; |
11590 | const T16 v16_; |
11591 | const T17 v17_; |
11592 | const T18 v18_; |
11593 | const T19 v19_; |
11594 | const T20 v20_; |
11595 | const T21 v21_; |
11596 | const T22 v22_; |
11597 | const T23 v23_; |
11598 | const T24 v24_; |
11599 | }; |
11600 | |
11601 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11602 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11603 | typename T11, typename T12, typename T13, typename T14, typename T15, |
11604 | typename T16, typename T17, typename T18, typename T19, typename T20, |
11605 | typename T21, typename T22, typename T23, typename T24, typename T25> |
11606 | class ValueArray25 { |
11607 | public: |
11608 | ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11609 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
11610 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, |
11611 | T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), |
11612 | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), |
11613 | v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), |
11614 | v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {} |
11615 | |
11616 | template <typename T> |
11617 | operator ParamGenerator<T>() const { |
11618 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11619 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11620 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11621 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11622 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
11623 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
11624 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
11625 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
11626 | static_cast<T>(v24_), static_cast<T>(v25_)}; |
11627 | return ValuesIn(array); |
11628 | } |
11629 | |
11630 | private: |
11631 | // No implementation - assignment is unsupported. |
11632 | void operator=(const ValueArray25& other); |
11633 | |
11634 | const T1 v1_; |
11635 | const T2 v2_; |
11636 | const T3 v3_; |
11637 | const T4 v4_; |
11638 | const T5 v5_; |
11639 | const T6 v6_; |
11640 | const T7 v7_; |
11641 | const T8 v8_; |
11642 | const T9 v9_; |
11643 | const T10 v10_; |
11644 | const T11 v11_; |
11645 | const T12 v12_; |
11646 | const T13 v13_; |
11647 | const T14 v14_; |
11648 | const T15 v15_; |
11649 | const T16 v16_; |
11650 | const T17 v17_; |
11651 | const T18 v18_; |
11652 | const T19 v19_; |
11653 | const T20 v20_; |
11654 | const T21 v21_; |
11655 | const T22 v22_; |
11656 | const T23 v23_; |
11657 | const T24 v24_; |
11658 | const T25 v25_; |
11659 | }; |
11660 | |
11661 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11662 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11663 | typename T11, typename T12, typename T13, typename T14, typename T15, |
11664 | typename T16, typename T17, typename T18, typename T19, typename T20, |
11665 | typename T21, typename T22, typename T23, typename T24, typename T25, |
11666 | typename T26> |
11667 | class ValueArray26 { |
11668 | public: |
11669 | ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11670 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
11671 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
11672 | T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), |
11673 | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), |
11674 | v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), |
11675 | v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {} |
11676 | |
11677 | template <typename T> |
11678 | operator ParamGenerator<T>() const { |
11679 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11680 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11681 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11682 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11683 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
11684 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
11685 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
11686 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
11687 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)}; |
11688 | return ValuesIn(array); |
11689 | } |
11690 | |
11691 | private: |
11692 | // No implementation - assignment is unsupported. |
11693 | void operator=(const ValueArray26& other); |
11694 | |
11695 | const T1 v1_; |
11696 | const T2 v2_; |
11697 | const T3 v3_; |
11698 | const T4 v4_; |
11699 | const T5 v5_; |
11700 | const T6 v6_; |
11701 | const T7 v7_; |
11702 | const T8 v8_; |
11703 | const T9 v9_; |
11704 | const T10 v10_; |
11705 | const T11 v11_; |
11706 | const T12 v12_; |
11707 | const T13 v13_; |
11708 | const T14 v14_; |
11709 | const T15 v15_; |
11710 | const T16 v16_; |
11711 | const T17 v17_; |
11712 | const T18 v18_; |
11713 | const T19 v19_; |
11714 | const T20 v20_; |
11715 | const T21 v21_; |
11716 | const T22 v22_; |
11717 | const T23 v23_; |
11718 | const T24 v24_; |
11719 | const T25 v25_; |
11720 | const T26 v26_; |
11721 | }; |
11722 | |
11723 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11724 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11725 | typename T11, typename T12, typename T13, typename T14, typename T15, |
11726 | typename T16, typename T17, typename T18, typename T19, typename T20, |
11727 | typename T21, typename T22, typename T23, typename T24, typename T25, |
11728 | typename T26, typename T27> |
11729 | class ValueArray27 { |
11730 | public: |
11731 | ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11732 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
11733 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
11734 | T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), |
11735 | v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), |
11736 | v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), |
11737 | v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), |
11738 | v26_(v26), v27_(v27) {} |
11739 | |
11740 | template <typename T> |
11741 | operator ParamGenerator<T>() const { |
11742 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11743 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11744 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11745 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11746 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
11747 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
11748 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
11749 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
11750 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
11751 | static_cast<T>(v27_)}; |
11752 | return ValuesIn(array); |
11753 | } |
11754 | |
11755 | private: |
11756 | // No implementation - assignment is unsupported. |
11757 | void operator=(const ValueArray27& other); |
11758 | |
11759 | const T1 v1_; |
11760 | const T2 v2_; |
11761 | const T3 v3_; |
11762 | const T4 v4_; |
11763 | const T5 v5_; |
11764 | const T6 v6_; |
11765 | const T7 v7_; |
11766 | const T8 v8_; |
11767 | const T9 v9_; |
11768 | const T10 v10_; |
11769 | const T11 v11_; |
11770 | const T12 v12_; |
11771 | const T13 v13_; |
11772 | const T14 v14_; |
11773 | const T15 v15_; |
11774 | const T16 v16_; |
11775 | const T17 v17_; |
11776 | const T18 v18_; |
11777 | const T19 v19_; |
11778 | const T20 v20_; |
11779 | const T21 v21_; |
11780 | const T22 v22_; |
11781 | const T23 v23_; |
11782 | const T24 v24_; |
11783 | const T25 v25_; |
11784 | const T26 v26_; |
11785 | const T27 v27_; |
11786 | }; |
11787 | |
11788 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11789 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11790 | typename T11, typename T12, typename T13, typename T14, typename T15, |
11791 | typename T16, typename T17, typename T18, typename T19, typename T20, |
11792 | typename T21, typename T22, typename T23, typename T24, typename T25, |
11793 | typename T26, typename T27, typename T28> |
11794 | class ValueArray28 { |
11795 | public: |
11796 | ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11797 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
11798 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
11799 | T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), |
11800 | v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), |
11801 | v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), |
11802 | v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), |
11803 | v25_(v25), v26_(v26), v27_(v27), v28_(v28) {} |
11804 | |
11805 | template <typename T> |
11806 | operator ParamGenerator<T>() const { |
11807 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11808 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11809 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11810 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11811 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
11812 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
11813 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
11814 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
11815 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
11816 | static_cast<T>(v27_), static_cast<T>(v28_)}; |
11817 | return ValuesIn(array); |
11818 | } |
11819 | |
11820 | private: |
11821 | // No implementation - assignment is unsupported. |
11822 | void operator=(const ValueArray28& other); |
11823 | |
11824 | const T1 v1_; |
11825 | const T2 v2_; |
11826 | const T3 v3_; |
11827 | const T4 v4_; |
11828 | const T5 v5_; |
11829 | const T6 v6_; |
11830 | const T7 v7_; |
11831 | const T8 v8_; |
11832 | const T9 v9_; |
11833 | const T10 v10_; |
11834 | const T11 v11_; |
11835 | const T12 v12_; |
11836 | const T13 v13_; |
11837 | const T14 v14_; |
11838 | const T15 v15_; |
11839 | const T16 v16_; |
11840 | const T17 v17_; |
11841 | const T18 v18_; |
11842 | const T19 v19_; |
11843 | const T20 v20_; |
11844 | const T21 v21_; |
11845 | const T22 v22_; |
11846 | const T23 v23_; |
11847 | const T24 v24_; |
11848 | const T25 v25_; |
11849 | const T26 v26_; |
11850 | const T27 v27_; |
11851 | const T28 v28_; |
11852 | }; |
11853 | |
11854 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11855 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11856 | typename T11, typename T12, typename T13, typename T14, typename T15, |
11857 | typename T16, typename T17, typename T18, typename T19, typename T20, |
11858 | typename T21, typename T22, typename T23, typename T24, typename T25, |
11859 | typename T26, typename T27, typename T28, typename T29> |
11860 | class ValueArray29 { |
11861 | public: |
11862 | ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11863 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
11864 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
11865 | T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), |
11866 | v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), |
11867 | v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), |
11868 | v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), |
11869 | v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {} |
11870 | |
11871 | template <typename T> |
11872 | operator ParamGenerator<T>() const { |
11873 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11874 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11875 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11876 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11877 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
11878 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
11879 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
11880 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
11881 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
11882 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)}; |
11883 | return ValuesIn(array); |
11884 | } |
11885 | |
11886 | private: |
11887 | // No implementation - assignment is unsupported. |
11888 | void operator=(const ValueArray29& other); |
11889 | |
11890 | const T1 v1_; |
11891 | const T2 v2_; |
11892 | const T3 v3_; |
11893 | const T4 v4_; |
11894 | const T5 v5_; |
11895 | const T6 v6_; |
11896 | const T7 v7_; |
11897 | const T8 v8_; |
11898 | const T9 v9_; |
11899 | const T10 v10_; |
11900 | const T11 v11_; |
11901 | const T12 v12_; |
11902 | const T13 v13_; |
11903 | const T14 v14_; |
11904 | const T15 v15_; |
11905 | const T16 v16_; |
11906 | const T17 v17_; |
11907 | const T18 v18_; |
11908 | const T19 v19_; |
11909 | const T20 v20_; |
11910 | const T21 v21_; |
11911 | const T22 v22_; |
11912 | const T23 v23_; |
11913 | const T24 v24_; |
11914 | const T25 v25_; |
11915 | const T26 v26_; |
11916 | const T27 v27_; |
11917 | const T28 v28_; |
11918 | const T29 v29_; |
11919 | }; |
11920 | |
11921 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11922 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11923 | typename T11, typename T12, typename T13, typename T14, typename T15, |
11924 | typename T16, typename T17, typename T18, typename T19, typename T20, |
11925 | typename T21, typename T22, typename T23, typename T24, typename T25, |
11926 | typename T26, typename T27, typename T28, typename T29, typename T30> |
11927 | class ValueArray30 { |
11928 | public: |
11929 | ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
11930 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
11931 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
11932 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3), |
11933 | v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), |
11934 | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), |
11935 | v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), |
11936 | v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), |
11937 | v29_(v29), v30_(v30) {} |
11938 | |
11939 | template <typename T> |
11940 | operator ParamGenerator<T>() const { |
11941 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
11942 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
11943 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
11944 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
11945 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
11946 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
11947 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
11948 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
11949 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
11950 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
11951 | static_cast<T>(v30_)}; |
11952 | return ValuesIn(array); |
11953 | } |
11954 | |
11955 | private: |
11956 | // No implementation - assignment is unsupported. |
11957 | void operator=(const ValueArray30& other); |
11958 | |
11959 | const T1 v1_; |
11960 | const T2 v2_; |
11961 | const T3 v3_; |
11962 | const T4 v4_; |
11963 | const T5 v5_; |
11964 | const T6 v6_; |
11965 | const T7 v7_; |
11966 | const T8 v8_; |
11967 | const T9 v9_; |
11968 | const T10 v10_; |
11969 | const T11 v11_; |
11970 | const T12 v12_; |
11971 | const T13 v13_; |
11972 | const T14 v14_; |
11973 | const T15 v15_; |
11974 | const T16 v16_; |
11975 | const T17 v17_; |
11976 | const T18 v18_; |
11977 | const T19 v19_; |
11978 | const T20 v20_; |
11979 | const T21 v21_; |
11980 | const T22 v22_; |
11981 | const T23 v23_; |
11982 | const T24 v24_; |
11983 | const T25 v25_; |
11984 | const T26 v26_; |
11985 | const T27 v27_; |
11986 | const T28 v28_; |
11987 | const T29 v29_; |
11988 | const T30 v30_; |
11989 | }; |
11990 | |
11991 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
11992 | typename T6, typename T7, typename T8, typename T9, typename T10, |
11993 | typename T11, typename T12, typename T13, typename T14, typename T15, |
11994 | typename T16, typename T17, typename T18, typename T19, typename T20, |
11995 | typename T21, typename T22, typename T23, typename T24, typename T25, |
11996 | typename T26, typename T27, typename T28, typename T29, typename T30, |
11997 | typename T31> |
11998 | class ValueArray31 { |
11999 | public: |
12000 | ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
12001 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
12002 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
12003 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2), |
12004 | v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), |
12005 | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), |
12006 | v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), |
12007 | v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), |
12008 | v29_(v29), v30_(v30), v31_(v31) {} |
12009 | |
12010 | template <typename T> |
12011 | operator ParamGenerator<T>() const { |
12012 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
12013 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
12014 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
12015 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
12016 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
12017 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
12018 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
12019 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
12020 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
12021 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
12022 | static_cast<T>(v30_), static_cast<T>(v31_)}; |
12023 | return ValuesIn(array); |
12024 | } |
12025 | |
12026 | private: |
12027 | // No implementation - assignment is unsupported. |
12028 | void operator=(const ValueArray31& other); |
12029 | |
12030 | const T1 v1_; |
12031 | const T2 v2_; |
12032 | const T3 v3_; |
12033 | const T4 v4_; |
12034 | const T5 v5_; |
12035 | const T6 v6_; |
12036 | const T7 v7_; |
12037 | const T8 v8_; |
12038 | const T9 v9_; |
12039 | const T10 v10_; |
12040 | const T11 v11_; |
12041 | const T12 v12_; |
12042 | const T13 v13_; |
12043 | const T14 v14_; |
12044 | const T15 v15_; |
12045 | const T16 v16_; |
12046 | const T17 v17_; |
12047 | const T18 v18_; |
12048 | const T19 v19_; |
12049 | const T20 v20_; |
12050 | const T21 v21_; |
12051 | const T22 v22_; |
12052 | const T23 v23_; |
12053 | const T24 v24_; |
12054 | const T25 v25_; |
12055 | const T26 v26_; |
12056 | const T27 v27_; |
12057 | const T28 v28_; |
12058 | const T29 v29_; |
12059 | const T30 v30_; |
12060 | const T31 v31_; |
12061 | }; |
12062 | |
12063 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
12064 | typename T6, typename T7, typename T8, typename T9, typename T10, |
12065 | typename T11, typename T12, typename T13, typename T14, typename T15, |
12066 | typename T16, typename T17, typename T18, typename T19, typename T20, |
12067 | typename T21, typename T22, typename T23, typename T24, typename T25, |
12068 | typename T26, typename T27, typename T28, typename T29, typename T30, |
12069 | typename T31, typename T32> |
12070 | class ValueArray32 { |
12071 | public: |
12072 | ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
12073 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
12074 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
12075 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1), |
12076 | v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), |
12077 | v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), |
12078 | v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), |
12079 | v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), |
12080 | v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {} |
12081 | |
12082 | template <typename T> |
12083 | operator ParamGenerator<T>() const { |
12084 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
12085 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
12086 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
12087 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
12088 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
12089 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
12090 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
12091 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
12092 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
12093 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
12094 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)}; |
12095 | return ValuesIn(array); |
12096 | } |
12097 | |
12098 | private: |
12099 | // No implementation - assignment is unsupported. |
12100 | void operator=(const ValueArray32& other); |
12101 | |
12102 | const T1 v1_; |
12103 | const T2 v2_; |
12104 | const T3 v3_; |
12105 | const T4 v4_; |
12106 | const T5 v5_; |
12107 | const T6 v6_; |
12108 | const T7 v7_; |
12109 | const T8 v8_; |
12110 | const T9 v9_; |
12111 | const T10 v10_; |
12112 | const T11 v11_; |
12113 | const T12 v12_; |
12114 | const T13 v13_; |
12115 | const T14 v14_; |
12116 | const T15 v15_; |
12117 | const T16 v16_; |
12118 | const T17 v17_; |
12119 | const T18 v18_; |
12120 | const T19 v19_; |
12121 | const T20 v20_; |
12122 | const T21 v21_; |
12123 | const T22 v22_; |
12124 | const T23 v23_; |
12125 | const T24 v24_; |
12126 | const T25 v25_; |
12127 | const T26 v26_; |
12128 | const T27 v27_; |
12129 | const T28 v28_; |
12130 | const T29 v29_; |
12131 | const T30 v30_; |
12132 | const T31 v31_; |
12133 | const T32 v32_; |
12134 | }; |
12135 | |
12136 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
12137 | typename T6, typename T7, typename T8, typename T9, typename T10, |
12138 | typename T11, typename T12, typename T13, typename T14, typename T15, |
12139 | typename T16, typename T17, typename T18, typename T19, typename T20, |
12140 | typename T21, typename T22, typename T23, typename T24, typename T25, |
12141 | typename T26, typename T27, typename T28, typename T29, typename T30, |
12142 | typename T31, typename T32, typename T33> |
12143 | class ValueArray33 { |
12144 | public: |
12145 | ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
12146 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
12147 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
12148 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, |
12149 | T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), |
12150 | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), |
12151 | v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), |
12152 | v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), |
12153 | v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), |
12154 | v33_(v33) {} |
12155 | |
12156 | template <typename T> |
12157 | operator ParamGenerator<T>() const { |
12158 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
12159 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
12160 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
12161 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
12162 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
12163 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
12164 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
12165 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
12166 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
12167 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
12168 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
12169 | static_cast<T>(v33_)}; |
12170 | return ValuesIn(array); |
12171 | } |
12172 | |
12173 | private: |
12174 | // No implementation - assignment is unsupported. |
12175 | void operator=(const ValueArray33& other); |
12176 | |
12177 | const T1 v1_; |
12178 | const T2 v2_; |
12179 | const T3 v3_; |
12180 | const T4 v4_; |
12181 | const T5 v5_; |
12182 | const T6 v6_; |
12183 | const T7 v7_; |
12184 | const T8 v8_; |
12185 | const T9 v9_; |
12186 | const T10 v10_; |
12187 | const T11 v11_; |
12188 | const T12 v12_; |
12189 | const T13 v13_; |
12190 | const T14 v14_; |
12191 | const T15 v15_; |
12192 | const T16 v16_; |
12193 | const T17 v17_; |
12194 | const T18 v18_; |
12195 | const T19 v19_; |
12196 | const T20 v20_; |
12197 | const T21 v21_; |
12198 | const T22 v22_; |
12199 | const T23 v23_; |
12200 | const T24 v24_; |
12201 | const T25 v25_; |
12202 | const T26 v26_; |
12203 | const T27 v27_; |
12204 | const T28 v28_; |
12205 | const T29 v29_; |
12206 | const T30 v30_; |
12207 | const T31 v31_; |
12208 | const T32 v32_; |
12209 | const T33 v33_; |
12210 | }; |
12211 | |
12212 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
12213 | typename T6, typename T7, typename T8, typename T9, typename T10, |
12214 | typename T11, typename T12, typename T13, typename T14, typename T15, |
12215 | typename T16, typename T17, typename T18, typename T19, typename T20, |
12216 | typename T21, typename T22, typename T23, typename T24, typename T25, |
12217 | typename T26, typename T27, typename T28, typename T29, typename T30, |
12218 | typename T31, typename T32, typename T33, typename T34> |
12219 | class ValueArray34 { |
12220 | public: |
12221 | ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
12222 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
12223 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
12224 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
12225 | T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), |
12226 | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), |
12227 | v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), |
12228 | v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), |
12229 | v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), |
12230 | v33_(v33), v34_(v34) {} |
12231 | |
12232 | template <typename T> |
12233 | operator ParamGenerator<T>() const { |
12234 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
12235 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
12236 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
12237 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
12238 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
12239 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
12240 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
12241 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
12242 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
12243 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
12244 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
12245 | static_cast<T>(v33_), static_cast<T>(v34_)}; |
12246 | return ValuesIn(array); |
12247 | } |
12248 | |
12249 | private: |
12250 | // No implementation - assignment is unsupported. |
12251 | void operator=(const ValueArray34& other); |
12252 | |
12253 | const T1 v1_; |
12254 | const T2 v2_; |
12255 | const T3 v3_; |
12256 | const T4 v4_; |
12257 | const T5 v5_; |
12258 | const T6 v6_; |
12259 | const T7 v7_; |
12260 | const T8 v8_; |
12261 | const T9 v9_; |
12262 | const T10 v10_; |
12263 | const T11 v11_; |
12264 | const T12 v12_; |
12265 | const T13 v13_; |
12266 | const T14 v14_; |
12267 | const T15 v15_; |
12268 | const T16 v16_; |
12269 | const T17 v17_; |
12270 | const T18 v18_; |
12271 | const T19 v19_; |
12272 | const T20 v20_; |
12273 | const T21 v21_; |
12274 | const T22 v22_; |
12275 | const T23 v23_; |
12276 | const T24 v24_; |
12277 | const T25 v25_; |
12278 | const T26 v26_; |
12279 | const T27 v27_; |
12280 | const T28 v28_; |
12281 | const T29 v29_; |
12282 | const T30 v30_; |
12283 | const T31 v31_; |
12284 | const T32 v32_; |
12285 | const T33 v33_; |
12286 | const T34 v34_; |
12287 | }; |
12288 | |
12289 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
12290 | typename T6, typename T7, typename T8, typename T9, typename T10, |
12291 | typename T11, typename T12, typename T13, typename T14, typename T15, |
12292 | typename T16, typename T17, typename T18, typename T19, typename T20, |
12293 | typename T21, typename T22, typename T23, typename T24, typename T25, |
12294 | typename T26, typename T27, typename T28, typename T29, typename T30, |
12295 | typename T31, typename T32, typename T33, typename T34, typename T35> |
12296 | class ValueArray35 { |
12297 | public: |
12298 | ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
12299 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
12300 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
12301 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
12302 | T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), |
12303 | v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), |
12304 | v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), |
12305 | v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), |
12306 | v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), |
12307 | v32_(v32), v33_(v33), v34_(v34), v35_(v35) {} |
12308 | |
12309 | template <typename T> |
12310 | operator ParamGenerator<T>() const { |
12311 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
12312 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
12313 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
12314 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
12315 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
12316 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
12317 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
12318 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
12319 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
12320 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
12321 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
12322 | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)}; |
12323 | return ValuesIn(array); |
12324 | } |
12325 | |
12326 | private: |
12327 | // No implementation - assignment is unsupported. |
12328 | void operator=(const ValueArray35& other); |
12329 | |
12330 | const T1 v1_; |
12331 | const T2 v2_; |
12332 | const T3 v3_; |
12333 | const T4 v4_; |
12334 | const T5 v5_; |
12335 | const T6 v6_; |
12336 | const T7 v7_; |
12337 | const T8 v8_; |
12338 | const T9 v9_; |
12339 | const T10 v10_; |
12340 | const T11 v11_; |
12341 | const T12 v12_; |
12342 | const T13 v13_; |
12343 | const T14 v14_; |
12344 | const T15 v15_; |
12345 | const T16 v16_; |
12346 | const T17 v17_; |
12347 | const T18 v18_; |
12348 | const T19 v19_; |
12349 | const T20 v20_; |
12350 | const T21 v21_; |
12351 | const T22 v22_; |
12352 | const T23 v23_; |
12353 | const T24 v24_; |
12354 | const T25 v25_; |
12355 | const T26 v26_; |
12356 | const T27 v27_; |
12357 | const T28 v28_; |
12358 | const T29 v29_; |
12359 | const T30 v30_; |
12360 | const T31 v31_; |
12361 | const T32 v32_; |
12362 | const T33 v33_; |
12363 | const T34 v34_; |
12364 | const T35 v35_; |
12365 | }; |
12366 | |
12367 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
12368 | typename T6, typename T7, typename T8, typename T9, typename T10, |
12369 | typename T11, typename T12, typename T13, typename T14, typename T15, |
12370 | typename T16, typename T17, typename T18, typename T19, typename T20, |
12371 | typename T21, typename T22, typename T23, typename T24, typename T25, |
12372 | typename T26, typename T27, typename T28, typename T29, typename T30, |
12373 | typename T31, typename T32, typename T33, typename T34, typename T35, |
12374 | typename T36> |
12375 | class ValueArray36 { |
12376 | public: |
12377 | ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
12378 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
12379 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
12380 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
12381 | T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), |
12382 | v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), |
12383 | v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), |
12384 | v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), |
12385 | v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), |
12386 | v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {} |
12387 | |
12388 | template <typename T> |
12389 | operator ParamGenerator<T>() const { |
12390 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
12391 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
12392 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
12393 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
12394 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
12395 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
12396 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
12397 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
12398 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
12399 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
12400 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
12401 | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), |
12402 | static_cast<T>(v36_)}; |
12403 | return ValuesIn(array); |
12404 | } |
12405 | |
12406 | private: |
12407 | // No implementation - assignment is unsupported. |
12408 | void operator=(const ValueArray36& other); |
12409 | |
12410 | const T1 v1_; |
12411 | const T2 v2_; |
12412 | const T3 v3_; |
12413 | const T4 v4_; |
12414 | const T5 v5_; |
12415 | const T6 v6_; |
12416 | const T7 v7_; |
12417 | const T8 v8_; |
12418 | const T9 v9_; |
12419 | const T10 v10_; |
12420 | const T11 v11_; |
12421 | const T12 v12_; |
12422 | const T13 v13_; |
12423 | const T14 v14_; |
12424 | const T15 v15_; |
12425 | const T16 v16_; |
12426 | const T17 v17_; |
12427 | const T18 v18_; |
12428 | const T19 v19_; |
12429 | const T20 v20_; |
12430 | const T21 v21_; |
12431 | const T22 v22_; |
12432 | const T23 v23_; |
12433 | const T24 v24_; |
12434 | const T25 v25_; |
12435 | const T26 v26_; |
12436 | const T27 v27_; |
12437 | const T28 v28_; |
12438 | const T29 v29_; |
12439 | const T30 v30_; |
12440 | const T31 v31_; |
12441 | const T32 v32_; |
12442 | const T33 v33_; |
12443 | const T34 v34_; |
12444 | const T35 v35_; |
12445 | const T36 v36_; |
12446 | }; |
12447 | |
12448 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
12449 | typename T6, typename T7, typename T8, typename T9, typename T10, |
12450 | typename T11, typename T12, typename T13, typename T14, typename T15, |
12451 | typename T16, typename T17, typename T18, typename T19, typename T20, |
12452 | typename T21, typename T22, typename T23, typename T24, typename T25, |
12453 | typename T26, typename T27, typename T28, typename T29, typename T30, |
12454 | typename T31, typename T32, typename T33, typename T34, typename T35, |
12455 | typename T36, typename T37> |
12456 | class ValueArray37 { |
12457 | public: |
12458 | ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
12459 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
12460 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
12461 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
12462 | T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), |
12463 | v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), |
12464 | v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), |
12465 | v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), |
12466 | v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), |
12467 | v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), |
12468 | v36_(v36), v37_(v37) {} |
12469 | |
12470 | template <typename T> |
12471 | operator ParamGenerator<T>() const { |
12472 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
12473 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
12474 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
12475 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
12476 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
12477 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
12478 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
12479 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
12480 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
12481 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
12482 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
12483 | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), |
12484 | static_cast<T>(v36_), static_cast<T>(v37_)}; |
12485 | return ValuesIn(array); |
12486 | } |
12487 | |
12488 | private: |
12489 | // No implementation - assignment is unsupported. |
12490 | void operator=(const ValueArray37& other); |
12491 | |
12492 | const T1 v1_; |
12493 | const T2 v2_; |
12494 | const T3 v3_; |
12495 | const T4 v4_; |
12496 | const T5 v5_; |
12497 | const T6 v6_; |
12498 | const T7 v7_; |
12499 | const T8 v8_; |
12500 | const T9 v9_; |
12501 | const T10 v10_; |
12502 | const T11 v11_; |
12503 | const T12 v12_; |
12504 | const T13 v13_; |
12505 | const T14 v14_; |
12506 | const T15 v15_; |
12507 | const T16 v16_; |
12508 | const T17 v17_; |
12509 | const T18 v18_; |
12510 | const T19 v19_; |
12511 | const T20 v20_; |
12512 | const T21 v21_; |
12513 | const T22 v22_; |
12514 | const T23 v23_; |
12515 | const T24 v24_; |
12516 | const T25 v25_; |
12517 | const T26 v26_; |
12518 | const T27 v27_; |
12519 | const T28 v28_; |
12520 | const T29 v29_; |
12521 | const T30 v30_; |
12522 | const T31 v31_; |
12523 | const T32 v32_; |
12524 | const T33 v33_; |
12525 | const T34 v34_; |
12526 | const T35 v35_; |
12527 | const T36 v36_; |
12528 | const T37 v37_; |
12529 | }; |
12530 | |
12531 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
12532 | typename T6, typename T7, typename T8, typename T9, typename T10, |
12533 | typename T11, typename T12, typename T13, typename T14, typename T15, |
12534 | typename T16, typename T17, typename T18, typename T19, typename T20, |
12535 | typename T21, typename T22, typename T23, typename T24, typename T25, |
12536 | typename T26, typename T27, typename T28, typename T29, typename T30, |
12537 | typename T31, typename T32, typename T33, typename T34, typename T35, |
12538 | typename T36, typename T37, typename T38> |
12539 | class ValueArray38 { |
12540 | public: |
12541 | ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
12542 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
12543 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
12544 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
12545 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3), |
12546 | v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), |
12547 | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), |
12548 | v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), |
12549 | v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), |
12550 | v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), |
12551 | v35_(v35), v36_(v36), v37_(v37), v38_(v38) {} |
12552 | |
12553 | template <typename T> |
12554 | operator ParamGenerator<T>() const { |
12555 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
12556 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
12557 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
12558 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
12559 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
12560 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
12561 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
12562 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
12563 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
12564 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
12565 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
12566 | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), |
12567 | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)}; |
12568 | return ValuesIn(array); |
12569 | } |
12570 | |
12571 | private: |
12572 | // No implementation - assignment is unsupported. |
12573 | void operator=(const ValueArray38& other); |
12574 | |
12575 | const T1 v1_; |
12576 | const T2 v2_; |
12577 | const T3 v3_; |
12578 | const T4 v4_; |
12579 | const T5 v5_; |
12580 | const T6 v6_; |
12581 | const T7 v7_; |
12582 | const T8 v8_; |
12583 | const T9 v9_; |
12584 | const T10 v10_; |
12585 | const T11 v11_; |
12586 | const T12 v12_; |
12587 | const T13 v13_; |
12588 | const T14 v14_; |
12589 | const T15 v15_; |
12590 | const T16 v16_; |
12591 | const T17 v17_; |
12592 | const T18 v18_; |
12593 | const T19 v19_; |
12594 | const T20 v20_; |
12595 | const T21 v21_; |
12596 | const T22 v22_; |
12597 | const T23 v23_; |
12598 | const T24 v24_; |
12599 | const T25 v25_; |
12600 | const T26 v26_; |
12601 | const T27 v27_; |
12602 | const T28 v28_; |
12603 | const T29 v29_; |
12604 | const T30 v30_; |
12605 | const T31 v31_; |
12606 | const T32 v32_; |
12607 | const T33 v33_; |
12608 | const T34 v34_; |
12609 | const T35 v35_; |
12610 | const T36 v36_; |
12611 | const T37 v37_; |
12612 | const T38 v38_; |
12613 | }; |
12614 | |
12615 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
12616 | typename T6, typename T7, typename T8, typename T9, typename T10, |
12617 | typename T11, typename T12, typename T13, typename T14, typename T15, |
12618 | typename T16, typename T17, typename T18, typename T19, typename T20, |
12619 | typename T21, typename T22, typename T23, typename T24, typename T25, |
12620 | typename T26, typename T27, typename T28, typename T29, typename T30, |
12621 | typename T31, typename T32, typename T33, typename T34, typename T35, |
12622 | typename T36, typename T37, typename T38, typename T39> |
12623 | class ValueArray39 { |
12624 | public: |
12625 | ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
12626 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
12627 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
12628 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
12629 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2), |
12630 | v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), |
12631 | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), |
12632 | v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), |
12633 | v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), |
12634 | v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), |
12635 | v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {} |
12636 | |
12637 | template <typename T> |
12638 | operator ParamGenerator<T>() const { |
12639 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
12640 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
12641 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
12642 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
12643 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
12644 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
12645 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
12646 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
12647 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
12648 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
12649 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
12650 | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), |
12651 | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), |
12652 | static_cast<T>(v39_)}; |
12653 | return ValuesIn(array); |
12654 | } |
12655 | |
12656 | private: |
12657 | // No implementation - assignment is unsupported. |
12658 | void operator=(const ValueArray39& other); |
12659 | |
12660 | const T1 v1_; |
12661 | const T2 v2_; |
12662 | const T3 v3_; |
12663 | const T4 v4_; |
12664 | const T5 v5_; |
12665 | const T6 v6_; |
12666 | const T7 v7_; |
12667 | const T8 v8_; |
12668 | const T9 v9_; |
12669 | const T10 v10_; |
12670 | const T11 v11_; |
12671 | const T12 v12_; |
12672 | const T13 v13_; |
12673 | const T14 v14_; |
12674 | const T15 v15_; |
12675 | const T16 v16_; |
12676 | const T17 v17_; |
12677 | const T18 v18_; |
12678 | const T19 v19_; |
12679 | const T20 v20_; |
12680 | const T21 v21_; |
12681 | const T22 v22_; |
12682 | const T23 v23_; |
12683 | const T24 v24_; |
12684 | const T25 v25_; |
12685 | const T26 v26_; |
12686 | const T27 v27_; |
12687 | const T28 v28_; |
12688 | const T29 v29_; |
12689 | const T30 v30_; |
12690 | const T31 v31_; |
12691 | const T32 v32_; |
12692 | const T33 v33_; |
12693 | const T34 v34_; |
12694 | const T35 v35_; |
12695 | const T36 v36_; |
12696 | const T37 v37_; |
12697 | const T38 v38_; |
12698 | const T39 v39_; |
12699 | }; |
12700 | |
12701 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
12702 | typename T6, typename T7, typename T8, typename T9, typename T10, |
12703 | typename T11, typename T12, typename T13, typename T14, typename T15, |
12704 | typename T16, typename T17, typename T18, typename T19, typename T20, |
12705 | typename T21, typename T22, typename T23, typename T24, typename T25, |
12706 | typename T26, typename T27, typename T28, typename T29, typename T30, |
12707 | typename T31, typename T32, typename T33, typename T34, typename T35, |
12708 | typename T36, typename T37, typename T38, typename T39, typename T40> |
12709 | class ValueArray40 { |
12710 | public: |
12711 | ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
12712 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
12713 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
12714 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
12715 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1), |
12716 | v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), |
12717 | v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), |
12718 | v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), |
12719 | v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), |
12720 | v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), |
12721 | v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), |
12722 | v40_(v40) {} |
12723 | |
12724 | template <typename T> |
12725 | operator ParamGenerator<T>() const { |
12726 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
12727 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
12728 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
12729 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
12730 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
12731 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
12732 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
12733 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
12734 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
12735 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
12736 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
12737 | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), |
12738 | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), |
12739 | static_cast<T>(v39_), static_cast<T>(v40_)}; |
12740 | return ValuesIn(array); |
12741 | } |
12742 | |
12743 | private: |
12744 | // No implementation - assignment is unsupported. |
12745 | void operator=(const ValueArray40& other); |
12746 | |
12747 | const T1 v1_; |
12748 | const T2 v2_; |
12749 | const T3 v3_; |
12750 | const T4 v4_; |
12751 | const T5 v5_; |
12752 | const T6 v6_; |
12753 | const T7 v7_; |
12754 | const T8 v8_; |
12755 | const T9 v9_; |
12756 | const T10 v10_; |
12757 | const T11 v11_; |
12758 | const T12 v12_; |
12759 | const T13 v13_; |
12760 | const T14 v14_; |
12761 | const T15 v15_; |
12762 | const T16 v16_; |
12763 | const T17 v17_; |
12764 | const T18 v18_; |
12765 | const T19 v19_; |
12766 | const T20 v20_; |
12767 | const T21 v21_; |
12768 | const T22 v22_; |
12769 | const T23 v23_; |
12770 | const T24 v24_; |
12771 | const T25 v25_; |
12772 | const T26 v26_; |
12773 | const T27 v27_; |
12774 | const T28 v28_; |
12775 | const T29 v29_; |
12776 | const T30 v30_; |
12777 | const T31 v31_; |
12778 | const T32 v32_; |
12779 | const T33 v33_; |
12780 | const T34 v34_; |
12781 | const T35 v35_; |
12782 | const T36 v36_; |
12783 | const T37 v37_; |
12784 | const T38 v38_; |
12785 | const T39 v39_; |
12786 | const T40 v40_; |
12787 | }; |
12788 | |
12789 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
12790 | typename T6, typename T7, typename T8, typename T9, typename T10, |
12791 | typename T11, typename T12, typename T13, typename T14, typename T15, |
12792 | typename T16, typename T17, typename T18, typename T19, typename T20, |
12793 | typename T21, typename T22, typename T23, typename T24, typename T25, |
12794 | typename T26, typename T27, typename T28, typename T29, typename T30, |
12795 | typename T31, typename T32, typename T33, typename T34, typename T35, |
12796 | typename T36, typename T37, typename T38, typename T39, typename T40, |
12797 | typename T41> |
12798 | class ValueArray41 { |
12799 | public: |
12800 | ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
12801 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
12802 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
12803 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
12804 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, |
12805 | T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), |
12806 | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), |
12807 | v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), |
12808 | v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), |
12809 | v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), |
12810 | v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), |
12811 | v39_(v39), v40_(v40), v41_(v41) {} |
12812 | |
12813 | template <typename T> |
12814 | operator ParamGenerator<T>() const { |
12815 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
12816 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
12817 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
12818 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
12819 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
12820 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
12821 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
12822 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
12823 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
12824 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
12825 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
12826 | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), |
12827 | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), |
12828 | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)}; |
12829 | return ValuesIn(array); |
12830 | } |
12831 | |
12832 | private: |
12833 | // No implementation - assignment is unsupported. |
12834 | void operator=(const ValueArray41& other); |
12835 | |
12836 | const T1 v1_; |
12837 | const T2 v2_; |
12838 | const T3 v3_; |
12839 | const T4 v4_; |
12840 | const T5 v5_; |
12841 | const T6 v6_; |
12842 | const T7 v7_; |
12843 | const T8 v8_; |
12844 | const T9 v9_; |
12845 | const T10 v10_; |
12846 | const T11 v11_; |
12847 | const T12 v12_; |
12848 | const T13 v13_; |
12849 | const T14 v14_; |
12850 | const T15 v15_; |
12851 | const T16 v16_; |
12852 | const T17 v17_; |
12853 | const T18 v18_; |
12854 | const T19 v19_; |
12855 | const T20 v20_; |
12856 | const T21 v21_; |
12857 | const T22 v22_; |
12858 | const T23 v23_; |
12859 | const T24 v24_; |
12860 | const T25 v25_; |
12861 | const T26 v26_; |
12862 | const T27 v27_; |
12863 | const T28 v28_; |
12864 | const T29 v29_; |
12865 | const T30 v30_; |
12866 | const T31 v31_; |
12867 | const T32 v32_; |
12868 | const T33 v33_; |
12869 | const T34 v34_; |
12870 | const T35 v35_; |
12871 | const T36 v36_; |
12872 | const T37 v37_; |
12873 | const T38 v38_; |
12874 | const T39 v39_; |
12875 | const T40 v40_; |
12876 | const T41 v41_; |
12877 | }; |
12878 | |
12879 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
12880 | typename T6, typename T7, typename T8, typename T9, typename T10, |
12881 | typename T11, typename T12, typename T13, typename T14, typename T15, |
12882 | typename T16, typename T17, typename T18, typename T19, typename T20, |
12883 | typename T21, typename T22, typename T23, typename T24, typename T25, |
12884 | typename T26, typename T27, typename T28, typename T29, typename T30, |
12885 | typename T31, typename T32, typename T33, typename T34, typename T35, |
12886 | typename T36, typename T37, typename T38, typename T39, typename T40, |
12887 | typename T41, typename T42> |
12888 | class ValueArray42 { |
12889 | public: |
12890 | ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
12891 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
12892 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
12893 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
12894 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, |
12895 | T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), |
12896 | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), |
12897 | v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), |
12898 | v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), |
12899 | v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), |
12900 | v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), |
12901 | v39_(v39), v40_(v40), v41_(v41), v42_(v42) {} |
12902 | |
12903 | template <typename T> |
12904 | operator ParamGenerator<T>() const { |
12905 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
12906 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
12907 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
12908 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
12909 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
12910 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
12911 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
12912 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
12913 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
12914 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
12915 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
12916 | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), |
12917 | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), |
12918 | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), |
12919 | static_cast<T>(v42_)}; |
12920 | return ValuesIn(array); |
12921 | } |
12922 | |
12923 | private: |
12924 | // No implementation - assignment is unsupported. |
12925 | void operator=(const ValueArray42& other); |
12926 | |
12927 | const T1 v1_; |
12928 | const T2 v2_; |
12929 | const T3 v3_; |
12930 | const T4 v4_; |
12931 | const T5 v5_; |
12932 | const T6 v6_; |
12933 | const T7 v7_; |
12934 | const T8 v8_; |
12935 | const T9 v9_; |
12936 | const T10 v10_; |
12937 | const T11 v11_; |
12938 | const T12 v12_; |
12939 | const T13 v13_; |
12940 | const T14 v14_; |
12941 | const T15 v15_; |
12942 | const T16 v16_; |
12943 | const T17 v17_; |
12944 | const T18 v18_; |
12945 | const T19 v19_; |
12946 | const T20 v20_; |
12947 | const T21 v21_; |
12948 | const T22 v22_; |
12949 | const T23 v23_; |
12950 | const T24 v24_; |
12951 | const T25 v25_; |
12952 | const T26 v26_; |
12953 | const T27 v27_; |
12954 | const T28 v28_; |
12955 | const T29 v29_; |
12956 | const T30 v30_; |
12957 | const T31 v31_; |
12958 | const T32 v32_; |
12959 | const T33 v33_; |
12960 | const T34 v34_; |
12961 | const T35 v35_; |
12962 | const T36 v36_; |
12963 | const T37 v37_; |
12964 | const T38 v38_; |
12965 | const T39 v39_; |
12966 | const T40 v40_; |
12967 | const T41 v41_; |
12968 | const T42 v42_; |
12969 | }; |
12970 | |
12971 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
12972 | typename T6, typename T7, typename T8, typename T9, typename T10, |
12973 | typename T11, typename T12, typename T13, typename T14, typename T15, |
12974 | typename T16, typename T17, typename T18, typename T19, typename T20, |
12975 | typename T21, typename T22, typename T23, typename T24, typename T25, |
12976 | typename T26, typename T27, typename T28, typename T29, typename T30, |
12977 | typename T31, typename T32, typename T33, typename T34, typename T35, |
12978 | typename T36, typename T37, typename T38, typename T39, typename T40, |
12979 | typename T41, typename T42, typename T43> |
12980 | class ValueArray43 { |
12981 | public: |
12982 | ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
12983 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
12984 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
12985 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
12986 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, |
12987 | T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), |
12988 | v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), |
12989 | v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), |
12990 | v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), |
12991 | v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), |
12992 | v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), |
12993 | v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {} |
12994 | |
12995 | template <typename T> |
12996 | operator ParamGenerator<T>() const { |
12997 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
12998 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
12999 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
13000 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
13001 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
13002 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
13003 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
13004 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
13005 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
13006 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
13007 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
13008 | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), |
13009 | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), |
13010 | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), |
13011 | static_cast<T>(v42_), static_cast<T>(v43_)}; |
13012 | return ValuesIn(array); |
13013 | } |
13014 | |
13015 | private: |
13016 | // No implementation - assignment is unsupported. |
13017 | void operator=(const ValueArray43& other); |
13018 | |
13019 | const T1 v1_; |
13020 | const T2 v2_; |
13021 | const T3 v3_; |
13022 | const T4 v4_; |
13023 | const T5 v5_; |
13024 | const T6 v6_; |
13025 | const T7 v7_; |
13026 | const T8 v8_; |
13027 | const T9 v9_; |
13028 | const T10 v10_; |
13029 | const T11 v11_; |
13030 | const T12 v12_; |
13031 | const T13 v13_; |
13032 | const T14 v14_; |
13033 | const T15 v15_; |
13034 | const T16 v16_; |
13035 | const T17 v17_; |
13036 | const T18 v18_; |
13037 | const T19 v19_; |
13038 | const T20 v20_; |
13039 | const T21 v21_; |
13040 | const T22 v22_; |
13041 | const T23 v23_; |
13042 | const T24 v24_; |
13043 | const T25 v25_; |
13044 | const T26 v26_; |
13045 | const T27 v27_; |
13046 | const T28 v28_; |
13047 | const T29 v29_; |
13048 | const T30 v30_; |
13049 | const T31 v31_; |
13050 | const T32 v32_; |
13051 | const T33 v33_; |
13052 | const T34 v34_; |
13053 | const T35 v35_; |
13054 | const T36 v36_; |
13055 | const T37 v37_; |
13056 | const T38 v38_; |
13057 | const T39 v39_; |
13058 | const T40 v40_; |
13059 | const T41 v41_; |
13060 | const T42 v42_; |
13061 | const T43 v43_; |
13062 | }; |
13063 | |
13064 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
13065 | typename T6, typename T7, typename T8, typename T9, typename T10, |
13066 | typename T11, typename T12, typename T13, typename T14, typename T15, |
13067 | typename T16, typename T17, typename T18, typename T19, typename T20, |
13068 | typename T21, typename T22, typename T23, typename T24, typename T25, |
13069 | typename T26, typename T27, typename T28, typename T29, typename T30, |
13070 | typename T31, typename T32, typename T33, typename T34, typename T35, |
13071 | typename T36, typename T37, typename T38, typename T39, typename T40, |
13072 | typename T41, typename T42, typename T43, typename T44> |
13073 | class ValueArray44 { |
13074 | public: |
13075 | ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
13076 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
13077 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
13078 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
13079 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, |
13080 | T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), |
13081 | v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), |
13082 | v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), |
13083 | v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), |
13084 | v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), |
13085 | v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), |
13086 | v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), |
13087 | v43_(v43), v44_(v44) {} |
13088 | |
13089 | template <typename T> |
13090 | operator ParamGenerator<T>() const { |
13091 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
13092 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
13093 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
13094 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
13095 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
13096 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
13097 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
13098 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
13099 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
13100 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
13101 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
13102 | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), |
13103 | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), |
13104 | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), |
13105 | static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)}; |
13106 | return ValuesIn(array); |
13107 | } |
13108 | |
13109 | private: |
13110 | // No implementation - assignment is unsupported. |
13111 | void operator=(const ValueArray44& other); |
13112 | |
13113 | const T1 v1_; |
13114 | const T2 v2_; |
13115 | const T3 v3_; |
13116 | const T4 v4_; |
13117 | const T5 v5_; |
13118 | const T6 v6_; |
13119 | const T7 v7_; |
13120 | const T8 v8_; |
13121 | const T9 v9_; |
13122 | const T10 v10_; |
13123 | const T11 v11_; |
13124 | const T12 v12_; |
13125 | const T13 v13_; |
13126 | const T14 v14_; |
13127 | const T15 v15_; |
13128 | const T16 v16_; |
13129 | const T17 v17_; |
13130 | const T18 v18_; |
13131 | const T19 v19_; |
13132 | const T20 v20_; |
13133 | const T21 v21_; |
13134 | const T22 v22_; |
13135 | const T23 v23_; |
13136 | const T24 v24_; |
13137 | const T25 v25_; |
13138 | const T26 v26_; |
13139 | const T27 v27_; |
13140 | const T28 v28_; |
13141 | const T29 v29_; |
13142 | const T30 v30_; |
13143 | const T31 v31_; |
13144 | const T32 v32_; |
13145 | const T33 v33_; |
13146 | const T34 v34_; |
13147 | const T35 v35_; |
13148 | const T36 v36_; |
13149 | const T37 v37_; |
13150 | const T38 v38_; |
13151 | const T39 v39_; |
13152 | const T40 v40_; |
13153 | const T41 v41_; |
13154 | const T42 v42_; |
13155 | const T43 v43_; |
13156 | const T44 v44_; |
13157 | }; |
13158 | |
13159 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
13160 | typename T6, typename T7, typename T8, typename T9, typename T10, |
13161 | typename T11, typename T12, typename T13, typename T14, typename T15, |
13162 | typename T16, typename T17, typename T18, typename T19, typename T20, |
13163 | typename T21, typename T22, typename T23, typename T24, typename T25, |
13164 | typename T26, typename T27, typename T28, typename T29, typename T30, |
13165 | typename T31, typename T32, typename T33, typename T34, typename T35, |
13166 | typename T36, typename T37, typename T38, typename T39, typename T40, |
13167 | typename T41, typename T42, typename T43, typename T44, typename T45> |
13168 | class ValueArray45 { |
13169 | public: |
13170 | ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
13171 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
13172 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
13173 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
13174 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, |
13175 | T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), |
13176 | v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), |
13177 | v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), |
13178 | v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), |
13179 | v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), |
13180 | v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), |
13181 | v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), |
13182 | v42_(v42), v43_(v43), v44_(v44), v45_(v45) {} |
13183 | |
13184 | template <typename T> |
13185 | operator ParamGenerator<T>() const { |
13186 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
13187 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
13188 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
13189 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
13190 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
13191 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
13192 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
13193 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
13194 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
13195 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
13196 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
13197 | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), |
13198 | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), |
13199 | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), |
13200 | static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_), |
13201 | static_cast<T>(v45_)}; |
13202 | return ValuesIn(array); |
13203 | } |
13204 | |
13205 | private: |
13206 | // No implementation - assignment is unsupported. |
13207 | void operator=(const ValueArray45& other); |
13208 | |
13209 | const T1 v1_; |
13210 | const T2 v2_; |
13211 | const T3 v3_; |
13212 | const T4 v4_; |
13213 | const T5 v5_; |
13214 | const T6 v6_; |
13215 | const T7 v7_; |
13216 | const T8 v8_; |
13217 | const T9 v9_; |
13218 | const T10 v10_; |
13219 | const T11 v11_; |
13220 | const T12 v12_; |
13221 | const T13 v13_; |
13222 | const T14 v14_; |
13223 | const T15 v15_; |
13224 | const T16 v16_; |
13225 | const T17 v17_; |
13226 | const T18 v18_; |
13227 | const T19 v19_; |
13228 | const T20 v20_; |
13229 | const T21 v21_; |
13230 | const T22 v22_; |
13231 | const T23 v23_; |
13232 | const T24 v24_; |
13233 | const T25 v25_; |
13234 | const T26 v26_; |
13235 | const T27 v27_; |
13236 | const T28 v28_; |
13237 | const T29 v29_; |
13238 | const T30 v30_; |
13239 | const T31 v31_; |
13240 | const T32 v32_; |
13241 | const T33 v33_; |
13242 | const T34 v34_; |
13243 | const T35 v35_; |
13244 | const T36 v36_; |
13245 | const T37 v37_; |
13246 | const T38 v38_; |
13247 | const T39 v39_; |
13248 | const T40 v40_; |
13249 | const T41 v41_; |
13250 | const T42 v42_; |
13251 | const T43 v43_; |
13252 | const T44 v44_; |
13253 | const T45 v45_; |
13254 | }; |
13255 | |
13256 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
13257 | typename T6, typename T7, typename T8, typename T9, typename T10, |
13258 | typename T11, typename T12, typename T13, typename T14, typename T15, |
13259 | typename T16, typename T17, typename T18, typename T19, typename T20, |
13260 | typename T21, typename T22, typename T23, typename T24, typename T25, |
13261 | typename T26, typename T27, typename T28, typename T29, typename T30, |
13262 | typename T31, typename T32, typename T33, typename T34, typename T35, |
13263 | typename T36, typename T37, typename T38, typename T39, typename T40, |
13264 | typename T41, typename T42, typename T43, typename T44, typename T45, |
13265 | typename T46> |
13266 | class ValueArray46 { |
13267 | public: |
13268 | ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
13269 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
13270 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
13271 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
13272 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, |
13273 | T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3), |
13274 | v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), |
13275 | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), |
13276 | v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), |
13277 | v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), |
13278 | v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), |
13279 | v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), |
13280 | v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {} |
13281 | |
13282 | template <typename T> |
13283 | operator ParamGenerator<T>() const { |
13284 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
13285 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
13286 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
13287 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
13288 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
13289 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
13290 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
13291 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
13292 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
13293 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
13294 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
13295 | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), |
13296 | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), |
13297 | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), |
13298 | static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_), |
13299 | static_cast<T>(v45_), static_cast<T>(v46_)}; |
13300 | return ValuesIn(array); |
13301 | } |
13302 | |
13303 | private: |
13304 | // No implementation - assignment is unsupported. |
13305 | void operator=(const ValueArray46& other); |
13306 | |
13307 | const T1 v1_; |
13308 | const T2 v2_; |
13309 | const T3 v3_; |
13310 | const T4 v4_; |
13311 | const T5 v5_; |
13312 | const T6 v6_; |
13313 | const T7 v7_; |
13314 | const T8 v8_; |
13315 | const T9 v9_; |
13316 | const T10 v10_; |
13317 | const T11 v11_; |
13318 | const T12 v12_; |
13319 | const T13 v13_; |
13320 | const T14 v14_; |
13321 | const T15 v15_; |
13322 | const T16 v16_; |
13323 | const T17 v17_; |
13324 | const T18 v18_; |
13325 | const T19 v19_; |
13326 | const T20 v20_; |
13327 | const T21 v21_; |
13328 | const T22 v22_; |
13329 | const T23 v23_; |
13330 | const T24 v24_; |
13331 | const T25 v25_; |
13332 | const T26 v26_; |
13333 | const T27 v27_; |
13334 | const T28 v28_; |
13335 | const T29 v29_; |
13336 | const T30 v30_; |
13337 | const T31 v31_; |
13338 | const T32 v32_; |
13339 | const T33 v33_; |
13340 | const T34 v34_; |
13341 | const T35 v35_; |
13342 | const T36 v36_; |
13343 | const T37 v37_; |
13344 | const T38 v38_; |
13345 | const T39 v39_; |
13346 | const T40 v40_; |
13347 | const T41 v41_; |
13348 | const T42 v42_; |
13349 | const T43 v43_; |
13350 | const T44 v44_; |
13351 | const T45 v45_; |
13352 | const T46 v46_; |
13353 | }; |
13354 | |
13355 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
13356 | typename T6, typename T7, typename T8, typename T9, typename T10, |
13357 | typename T11, typename T12, typename T13, typename T14, typename T15, |
13358 | typename T16, typename T17, typename T18, typename T19, typename T20, |
13359 | typename T21, typename T22, typename T23, typename T24, typename T25, |
13360 | typename T26, typename T27, typename T28, typename T29, typename T30, |
13361 | typename T31, typename T32, typename T33, typename T34, typename T35, |
13362 | typename T36, typename T37, typename T38, typename T39, typename T40, |
13363 | typename T41, typename T42, typename T43, typename T44, typename T45, |
13364 | typename T46, typename T47> |
13365 | class ValueArray47 { |
13366 | public: |
13367 | ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
13368 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
13369 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
13370 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
13371 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, |
13372 | T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2), |
13373 | v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), |
13374 | v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), |
13375 | v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), |
13376 | v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), |
13377 | v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), |
13378 | v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), |
13379 | v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46), |
13380 | v47_(v47) {} |
13381 | |
13382 | template <typename T> |
13383 | operator ParamGenerator<T>() const { |
13384 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
13385 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
13386 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
13387 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
13388 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
13389 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
13390 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
13391 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
13392 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
13393 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
13394 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
13395 | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), |
13396 | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), |
13397 | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), |
13398 | static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_), |
13399 | static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)}; |
13400 | return ValuesIn(array); |
13401 | } |
13402 | |
13403 | private: |
13404 | // No implementation - assignment is unsupported. |
13405 | void operator=(const ValueArray47& other); |
13406 | |
13407 | const T1 v1_; |
13408 | const T2 v2_; |
13409 | const T3 v3_; |
13410 | const T4 v4_; |
13411 | const T5 v5_; |
13412 | const T6 v6_; |
13413 | const T7 v7_; |
13414 | const T8 v8_; |
13415 | const T9 v9_; |
13416 | const T10 v10_; |
13417 | const T11 v11_; |
13418 | const T12 v12_; |
13419 | const T13 v13_; |
13420 | const T14 v14_; |
13421 | const T15 v15_; |
13422 | const T16 v16_; |
13423 | const T17 v17_; |
13424 | const T18 v18_; |
13425 | const T19 v19_; |
13426 | const T20 v20_; |
13427 | const T21 v21_; |
13428 | const T22 v22_; |
13429 | const T23 v23_; |
13430 | const T24 v24_; |
13431 | const T25 v25_; |
13432 | const T26 v26_; |
13433 | const T27 v27_; |
13434 | const T28 v28_; |
13435 | const T29 v29_; |
13436 | const T30 v30_; |
13437 | const T31 v31_; |
13438 | const T32 v32_; |
13439 | const T33 v33_; |
13440 | const T34 v34_; |
13441 | const T35 v35_; |
13442 | const T36 v36_; |
13443 | const T37 v37_; |
13444 | const T38 v38_; |
13445 | const T39 v39_; |
13446 | const T40 v40_; |
13447 | const T41 v41_; |
13448 | const T42 v42_; |
13449 | const T43 v43_; |
13450 | const T44 v44_; |
13451 | const T45 v45_; |
13452 | const T46 v46_; |
13453 | const T47 v47_; |
13454 | }; |
13455 | |
13456 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
13457 | typename T6, typename T7, typename T8, typename T9, typename T10, |
13458 | typename T11, typename T12, typename T13, typename T14, typename T15, |
13459 | typename T16, typename T17, typename T18, typename T19, typename T20, |
13460 | typename T21, typename T22, typename T23, typename T24, typename T25, |
13461 | typename T26, typename T27, typename T28, typename T29, typename T30, |
13462 | typename T31, typename T32, typename T33, typename T34, typename T35, |
13463 | typename T36, typename T37, typename T38, typename T39, typename T40, |
13464 | typename T41, typename T42, typename T43, typename T44, typename T45, |
13465 | typename T46, typename T47, typename T48> |
13466 | class ValueArray48 { |
13467 | public: |
13468 | ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
13469 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
13470 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
13471 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
13472 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, |
13473 | T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1), |
13474 | v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), |
13475 | v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), |
13476 | v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), |
13477 | v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), |
13478 | v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), |
13479 | v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), |
13480 | v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), |
13481 | v46_(v46), v47_(v47), v48_(v48) {} |
13482 | |
13483 | template <typename T> |
13484 | operator ParamGenerator<T>() const { |
13485 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
13486 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
13487 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
13488 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
13489 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
13490 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
13491 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
13492 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
13493 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
13494 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
13495 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
13496 | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), |
13497 | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), |
13498 | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), |
13499 | static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_), |
13500 | static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_), |
13501 | static_cast<T>(v48_)}; |
13502 | return ValuesIn(array); |
13503 | } |
13504 | |
13505 | private: |
13506 | // No implementation - assignment is unsupported. |
13507 | void operator=(const ValueArray48& other); |
13508 | |
13509 | const T1 v1_; |
13510 | const T2 v2_; |
13511 | const T3 v3_; |
13512 | const T4 v4_; |
13513 | const T5 v5_; |
13514 | const T6 v6_; |
13515 | const T7 v7_; |
13516 | const T8 v8_; |
13517 | const T9 v9_; |
13518 | const T10 v10_; |
13519 | const T11 v11_; |
13520 | const T12 v12_; |
13521 | const T13 v13_; |
13522 | const T14 v14_; |
13523 | const T15 v15_; |
13524 | const T16 v16_; |
13525 | const T17 v17_; |
13526 | const T18 v18_; |
13527 | const T19 v19_; |
13528 | const T20 v20_; |
13529 | const T21 v21_; |
13530 | const T22 v22_; |
13531 | const T23 v23_; |
13532 | const T24 v24_; |
13533 | const T25 v25_; |
13534 | const T26 v26_; |
13535 | const T27 v27_; |
13536 | const T28 v28_; |
13537 | const T29 v29_; |
13538 | const T30 v30_; |
13539 | const T31 v31_; |
13540 | const T32 v32_; |
13541 | const T33 v33_; |
13542 | const T34 v34_; |
13543 | const T35 v35_; |
13544 | const T36 v36_; |
13545 | const T37 v37_; |
13546 | const T38 v38_; |
13547 | const T39 v39_; |
13548 | const T40 v40_; |
13549 | const T41 v41_; |
13550 | const T42 v42_; |
13551 | const T43 v43_; |
13552 | const T44 v44_; |
13553 | const T45 v45_; |
13554 | const T46 v46_; |
13555 | const T47 v47_; |
13556 | const T48 v48_; |
13557 | }; |
13558 | |
13559 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
13560 | typename T6, typename T7, typename T8, typename T9, typename T10, |
13561 | typename T11, typename T12, typename T13, typename T14, typename T15, |
13562 | typename T16, typename T17, typename T18, typename T19, typename T20, |
13563 | typename T21, typename T22, typename T23, typename T24, typename T25, |
13564 | typename T26, typename T27, typename T28, typename T29, typename T30, |
13565 | typename T31, typename T32, typename T33, typename T34, typename T35, |
13566 | typename T36, typename T37, typename T38, typename T39, typename T40, |
13567 | typename T41, typename T42, typename T43, typename T44, typename T45, |
13568 | typename T46, typename T47, typename T48, typename T49> |
13569 | class ValueArray49 { |
13570 | public: |
13571 | ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
13572 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
13573 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
13574 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
13575 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, |
13576 | T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, |
13577 | T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), |
13578 | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), |
13579 | v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), |
13580 | v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), |
13581 | v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), |
13582 | v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), |
13583 | v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), |
13584 | v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {} |
13585 | |
13586 | template <typename T> |
13587 | operator ParamGenerator<T>() const { |
13588 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
13589 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
13590 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
13591 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
13592 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
13593 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
13594 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
13595 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
13596 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
13597 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
13598 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
13599 | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), |
13600 | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), |
13601 | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), |
13602 | static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_), |
13603 | static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_), |
13604 | static_cast<T>(v48_), static_cast<T>(v49_)}; |
13605 | return ValuesIn(array); |
13606 | } |
13607 | |
13608 | private: |
13609 | // No implementation - assignment is unsupported. |
13610 | void operator=(const ValueArray49& other); |
13611 | |
13612 | const T1 v1_; |
13613 | const T2 v2_; |
13614 | const T3 v3_; |
13615 | const T4 v4_; |
13616 | const T5 v5_; |
13617 | const T6 v6_; |
13618 | const T7 v7_; |
13619 | const T8 v8_; |
13620 | const T9 v9_; |
13621 | const T10 v10_; |
13622 | const T11 v11_; |
13623 | const T12 v12_; |
13624 | const T13 v13_; |
13625 | const T14 v14_; |
13626 | const T15 v15_; |
13627 | const T16 v16_; |
13628 | const T17 v17_; |
13629 | const T18 v18_; |
13630 | const T19 v19_; |
13631 | const T20 v20_; |
13632 | const T21 v21_; |
13633 | const T22 v22_; |
13634 | const T23 v23_; |
13635 | const T24 v24_; |
13636 | const T25 v25_; |
13637 | const T26 v26_; |
13638 | const T27 v27_; |
13639 | const T28 v28_; |
13640 | const T29 v29_; |
13641 | const T30 v30_; |
13642 | const T31 v31_; |
13643 | const T32 v32_; |
13644 | const T33 v33_; |
13645 | const T34 v34_; |
13646 | const T35 v35_; |
13647 | const T36 v36_; |
13648 | const T37 v37_; |
13649 | const T38 v38_; |
13650 | const T39 v39_; |
13651 | const T40 v40_; |
13652 | const T41 v41_; |
13653 | const T42 v42_; |
13654 | const T43 v43_; |
13655 | const T44 v44_; |
13656 | const T45 v45_; |
13657 | const T46 v46_; |
13658 | const T47 v47_; |
13659 | const T48 v48_; |
13660 | const T49 v49_; |
13661 | }; |
13662 | |
13663 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
13664 | typename T6, typename T7, typename T8, typename T9, typename T10, |
13665 | typename T11, typename T12, typename T13, typename T14, typename T15, |
13666 | typename T16, typename T17, typename T18, typename T19, typename T20, |
13667 | typename T21, typename T22, typename T23, typename T24, typename T25, |
13668 | typename T26, typename T27, typename T28, typename T29, typename T30, |
13669 | typename T31, typename T32, typename T33, typename T34, typename T35, |
13670 | typename T36, typename T37, typename T38, typename T39, typename T40, |
13671 | typename T41, typename T42, typename T43, typename T44, typename T45, |
13672 | typename T46, typename T47, typename T48, typename T49, typename T50> |
13673 | class ValueArray50 { |
13674 | public: |
13675 | ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
13676 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
13677 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
13678 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
13679 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, |
13680 | T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49, |
13681 | T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), |
13682 | v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), |
13683 | v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), |
13684 | v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), |
13685 | v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), |
13686 | v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), |
13687 | v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), |
13688 | v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {} |
13689 | |
13690 | template <typename T> |
13691 | operator ParamGenerator<T>() const { |
13692 | const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_), |
13693 | static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_), |
13694 | static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_), |
13695 | static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_), |
13696 | static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_), |
13697 | static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_), |
13698 | static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_), |
13699 | static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_), |
13700 | static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_), |
13701 | static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_), |
13702 | static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_), |
13703 | static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_), |
13704 | static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_), |
13705 | static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_), |
13706 | static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_), |
13707 | static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_), |
13708 | static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)}; |
13709 | return ValuesIn(array); |
13710 | } |
13711 | |
13712 | private: |
13713 | // No implementation - assignment is unsupported. |
13714 | void operator=(const ValueArray50& other); |
13715 | |
13716 | const T1 v1_; |
13717 | const T2 v2_; |
13718 | const T3 v3_; |
13719 | const T4 v4_; |
13720 | const T5 v5_; |
13721 | const T6 v6_; |
13722 | const T7 v7_; |
13723 | const T8 v8_; |
13724 | const T9 v9_; |
13725 | const T10 v10_; |
13726 | const T11 v11_; |
13727 | const T12 v12_; |
13728 | const T13 v13_; |
13729 | const T14 v14_; |
13730 | const T15 v15_; |
13731 | const T16 v16_; |
13732 | const T17 v17_; |
13733 | const T18 v18_; |
13734 | const T19 v19_; |
13735 | const T20 v20_; |
13736 | const T21 v21_; |
13737 | const T22 v22_; |
13738 | const T23 v23_; |
13739 | const T24 v24_; |
13740 | const T25 v25_; |
13741 | const T26 v26_; |
13742 | const T27 v27_; |
13743 | const T28 v28_; |
13744 | const T29 v29_; |
13745 | const T30 v30_; |
13746 | const T31 v31_; |
13747 | const T32 v32_; |
13748 | const T33 v33_; |
13749 | const T34 v34_; |
13750 | const T35 v35_; |
13751 | const T36 v36_; |
13752 | const T37 v37_; |
13753 | const T38 v38_; |
13754 | const T39 v39_; |
13755 | const T40 v40_; |
13756 | const T41 v41_; |
13757 | const T42 v42_; |
13758 | const T43 v43_; |
13759 | const T44 v44_; |
13760 | const T45 v45_; |
13761 | const T46 v46_; |
13762 | const T47 v47_; |
13763 | const T48 v48_; |
13764 | const T49 v49_; |
13765 | const T50 v50_; |
13766 | }; |
13767 | |
13768 | # if GTEST_HAS_COMBINE |
13769 | // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. |
13770 | // |
13771 | // Generates values from the Cartesian product of values produced |
13772 | // by the argument generators. |
13773 | // |
13774 | template <typename T1, typename T2> |
13775 | class CartesianProductGenerator2 |
13776 | : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > { |
13777 | public: |
13778 | typedef ::std::tr1::tuple<T1, T2> ParamType; |
13779 | |
13780 | CartesianProductGenerator2(const ParamGenerator<T1>& g1, |
13781 | const ParamGenerator<T2>& g2) |
13782 | : g1_(g1), g2_(g2) {} |
13783 | virtual ~CartesianProductGenerator2() {} |
13784 | |
13785 | virtual ParamIteratorInterface<ParamType>* Begin() const { |
13786 | return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin()); |
13787 | } |
13788 | virtual ParamIteratorInterface<ParamType>* End() const { |
13789 | return new Iterator(this, g1_, g1_.end(), g2_, g2_.end()); |
13790 | } |
13791 | |
13792 | private: |
13793 | class Iterator : public ParamIteratorInterface<ParamType> { |
13794 | public: |
13795 | Iterator(const ParamGeneratorInterface<ParamType>* base, |
13796 | const ParamGenerator<T1>& g1, |
13797 | const typename ParamGenerator<T1>::iterator& current1, |
13798 | const ParamGenerator<T2>& g2, |
13799 | const typename ParamGenerator<T2>::iterator& current2) |
13800 | : base_(base), |
13801 | begin1_(g1.begin()), end1_(g1.end()), current1_(current1), |
13802 | begin2_(g2.begin()), end2_(g2.end()), current2_(current2) { |
13803 | ComputeCurrentValue(); |
13804 | } |
13805 | virtual ~Iterator() {} |
13806 | |
13807 | virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { |
13808 | return base_; |
13809 | } |
13810 | // Advance should not be called on beyond-of-range iterators |
13811 | // so no component iterators must be beyond end of range, either. |
13812 | virtual void Advance() { |
13813 | assert(!AtEnd()); |
13814 | ++current2_; |
13815 | if (current2_ == end2_) { |
13816 | current2_ = begin2_; |
13817 | ++current1_; |
13818 | } |
13819 | ComputeCurrentValue(); |
13820 | } |
13821 | virtual ParamIteratorInterface<ParamType>* Clone() const { |
13822 | return new Iterator(*this); |
13823 | } |
13824 | virtual const ParamType* Current() const { return ¤t_value_; } |
13825 | virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { |
13826 | // Having the same base generator guarantees that the other |
13827 | // iterator is of the same type and we can downcast. |
13828 | GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) |
13829 | << "The program attempted to compare iterators " |
13830 | << "from different generators." << std::endl; |
13831 | const Iterator* typed_other = |
13832 | CheckedDowncastToActualType<const Iterator>(&other); |
13833 | // We must report iterators equal if they both point beyond their |
13834 | // respective ranges. That can happen in a variety of fashions, |
13835 | // so we have to consult AtEnd(). |
13836 | return (AtEnd() && typed_other->AtEnd()) || |
13837 | ( |
13838 | current1_ == typed_other->current1_ && |
13839 | current2_ == typed_other->current2_); |
13840 | } |
13841 | |
13842 | private: |
13843 | Iterator(const Iterator& other) |
13844 | : base_(other.base_), |
13845 | begin1_(other.begin1_), |
13846 | end1_(other.end1_), |
13847 | current1_(other.current1_), |
13848 | begin2_(other.begin2_), |
13849 | end2_(other.end2_), |
13850 | current2_(other.current2_) { |
13851 | ComputeCurrentValue(); |
13852 | } |
13853 | |
13854 | void ComputeCurrentValue() { |
13855 | if (!AtEnd()) |
13856 | current_value_ = ParamType(*current1_, *current2_); |
13857 | } |
13858 | bool AtEnd() const { |
13859 | // We must report iterator past the end of the range when either of the |
13860 | // component iterators has reached the end of its range. |
13861 | return |
13862 | current1_ == end1_ || |
13863 | current2_ == end2_; |
13864 | } |
13865 | |
13866 | // No implementation - assignment is unsupported. |
13867 | void operator=(const Iterator& other); |
13868 | |
13869 | const ParamGeneratorInterface<ParamType>* const base_; |
13870 | // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. |
13871 | // current[i]_ is the actual traversing iterator. |
13872 | const typename ParamGenerator<T1>::iterator begin1_; |
13873 | const typename ParamGenerator<T1>::iterator end1_; |
13874 | typename ParamGenerator<T1>::iterator current1_; |
13875 | const typename ParamGenerator<T2>::iterator begin2_; |
13876 | const typename ParamGenerator<T2>::iterator end2_; |
13877 | typename ParamGenerator<T2>::iterator current2_; |
13878 | ParamType current_value_; |
13879 | }; // class CartesianProductGenerator2::Iterator |
13880 | |
13881 | // No implementation - assignment is unsupported. |
13882 | void operator=(const CartesianProductGenerator2& other); |
13883 | |
13884 | const ParamGenerator<T1> g1_; |
13885 | const ParamGenerator<T2> g2_; |
13886 | }; // class CartesianProductGenerator2 |
13887 | |
13888 | |
13889 | template <typename T1, typename T2, typename T3> |
13890 | class CartesianProductGenerator3 |
13891 | : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > { |
13892 | public: |
13893 | typedef ::std::tr1::tuple<T1, T2, T3> ParamType; |
13894 | |
13895 | CartesianProductGenerator3(const ParamGenerator<T1>& g1, |
13896 | const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3) |
13897 | : g1_(g1), g2_(g2), g3_(g3) {} |
13898 | virtual ~CartesianProductGenerator3() {} |
13899 | |
13900 | virtual ParamIteratorInterface<ParamType>* Begin() const { |
13901 | return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, |
13902 | g3_.begin()); |
13903 | } |
13904 | virtual ParamIteratorInterface<ParamType>* End() const { |
13905 | return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end()); |
13906 | } |
13907 | |
13908 | private: |
13909 | class Iterator : public ParamIteratorInterface<ParamType> { |
13910 | public: |
13911 | Iterator(const ParamGeneratorInterface<ParamType>* base, |
13912 | const ParamGenerator<T1>& g1, |
13913 | const typename ParamGenerator<T1>::iterator& current1, |
13914 | const ParamGenerator<T2>& g2, |
13915 | const typename ParamGenerator<T2>::iterator& current2, |
13916 | const ParamGenerator<T3>& g3, |
13917 | const typename ParamGenerator<T3>::iterator& current3) |
13918 | : base_(base), |
13919 | begin1_(g1.begin()), end1_(g1.end()), current1_(current1), |
13920 | begin2_(g2.begin()), end2_(g2.end()), current2_(current2), |
13921 | begin3_(g3.begin()), end3_(g3.end()), current3_(current3) { |
13922 | ComputeCurrentValue(); |
13923 | } |
13924 | virtual ~Iterator() {} |
13925 | |
13926 | virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { |
13927 | return base_; |
13928 | } |
13929 | // Advance should not be called on beyond-of-range iterators |
13930 | // so no component iterators must be beyond end of range, either. |
13931 | virtual void Advance() { |
13932 | assert(!AtEnd()); |
13933 | ++current3_; |
13934 | if (current3_ == end3_) { |
13935 | current3_ = begin3_; |
13936 | ++current2_; |
13937 | } |
13938 | if (current2_ == end2_) { |
13939 | current2_ = begin2_; |
13940 | ++current1_; |
13941 | } |
13942 | ComputeCurrentValue(); |
13943 | } |
13944 | virtual ParamIteratorInterface<ParamType>* Clone() const { |
13945 | return new Iterator(*this); |
13946 | } |
13947 | virtual const ParamType* Current() const { return ¤t_value_; } |
13948 | virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { |
13949 | // Having the same base generator guarantees that the other |
13950 | // iterator is of the same type and we can downcast. |
13951 | GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) |
13952 | << "The program attempted to compare iterators " |
13953 | << "from different generators." << std::endl; |
13954 | const Iterator* typed_other = |
13955 | CheckedDowncastToActualType<const Iterator>(&other); |
13956 | // We must report iterators equal if they both point beyond their |
13957 | // respective ranges. That can happen in a variety of fashions, |
13958 | // so we have to consult AtEnd(). |
13959 | return (AtEnd() && typed_other->AtEnd()) || |
13960 | ( |
13961 | current1_ == typed_other->current1_ && |
13962 | current2_ == typed_other->current2_ && |
13963 | current3_ == typed_other->current3_); |
13964 | } |
13965 | |
13966 | private: |
13967 | Iterator(const Iterator& other) |
13968 | : base_(other.base_), |
13969 | begin1_(other.begin1_), |
13970 | end1_(other.end1_), |
13971 | current1_(other.current1_), |
13972 | begin2_(other.begin2_), |
13973 | end2_(other.end2_), |
13974 | current2_(other.current2_), |
13975 | begin3_(other.begin3_), |
13976 | end3_(other.end3_), |
13977 | current3_(other.current3_) { |
13978 | ComputeCurrentValue(); |
13979 | } |
13980 | |
13981 | void ComputeCurrentValue() { |
13982 | if (!AtEnd()) |
13983 | current_value_ = ParamType(*current1_, *current2_, *current3_); |
13984 | } |
13985 | bool AtEnd() const { |
13986 | // We must report iterator past the end of the range when either of the |
13987 | // component iterators has reached the end of its range. |
13988 | return |
13989 | current1_ == end1_ || |
13990 | current2_ == end2_ || |
13991 | current3_ == end3_; |
13992 | } |
13993 | |
13994 | // No implementation - assignment is unsupported. |
13995 | void operator=(const Iterator& other); |
13996 | |
13997 | const ParamGeneratorInterface<ParamType>* const base_; |
13998 | // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. |
13999 | // current[i]_ is the actual traversing iterator. |
14000 | const typename ParamGenerator<T1>::iterator begin1_; |
14001 | const typename ParamGenerator<T1>::iterator end1_; |
14002 | typename ParamGenerator<T1>::iterator current1_; |
14003 | const typename ParamGenerator<T2>::iterator begin2_; |
14004 | const typename ParamGenerator<T2>::iterator end2_; |
14005 | typename ParamGenerator<T2>::iterator current2_; |
14006 | const typename ParamGenerator<T3>::iterator begin3_; |
14007 | const typename ParamGenerator<T3>::iterator end3_; |
14008 | typename ParamGenerator<T3>::iterator current3_; |
14009 | ParamType current_value_; |
14010 | }; // class CartesianProductGenerator3::Iterator |
14011 | |
14012 | // No implementation - assignment is unsupported. |
14013 | void operator=(const CartesianProductGenerator3& other); |
14014 | |
14015 | const ParamGenerator<T1> g1_; |
14016 | const ParamGenerator<T2> g2_; |
14017 | const ParamGenerator<T3> g3_; |
14018 | }; // class CartesianProductGenerator3 |
14019 | |
14020 | |
14021 | template <typename T1, typename T2, typename T3, typename T4> |
14022 | class CartesianProductGenerator4 |
14023 | : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > { |
14024 | public: |
14025 | typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType; |
14026 | |
14027 | CartesianProductGenerator4(const ParamGenerator<T1>& g1, |
14028 | const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3, |
14029 | const ParamGenerator<T4>& g4) |
14030 | : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {} |
14031 | virtual ~CartesianProductGenerator4() {} |
14032 | |
14033 | virtual ParamIteratorInterface<ParamType>* Begin() const { |
14034 | return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, |
14035 | g3_.begin(), g4_, g4_.begin()); |
14036 | } |
14037 | virtual ParamIteratorInterface<ParamType>* End() const { |
14038 | return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), |
14039 | g4_, g4_.end()); |
14040 | } |
14041 | |
14042 | private: |
14043 | class Iterator : public ParamIteratorInterface<ParamType> { |
14044 | public: |
14045 | Iterator(const ParamGeneratorInterface<ParamType>* base, |
14046 | const ParamGenerator<T1>& g1, |
14047 | const typename ParamGenerator<T1>::iterator& current1, |
14048 | const ParamGenerator<T2>& g2, |
14049 | const typename ParamGenerator<T2>::iterator& current2, |
14050 | const ParamGenerator<T3>& g3, |
14051 | const typename ParamGenerator<T3>::iterator& current3, |
14052 | const ParamGenerator<T4>& g4, |
14053 | const typename ParamGenerator<T4>::iterator& current4) |
14054 | : base_(base), |
14055 | begin1_(g1.begin()), end1_(g1.end()), current1_(current1), |
14056 | begin2_(g2.begin()), end2_(g2.end()), current2_(current2), |
14057 | begin3_(g3.begin()), end3_(g3.end()), current3_(current3), |
14058 | begin4_(g4.begin()), end4_(g4.end()), current4_(current4) { |
14059 | ComputeCurrentValue(); |
14060 | } |
14061 | virtual ~Iterator() {} |
14062 | |
14063 | virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { |
14064 | return base_; |
14065 | } |
14066 | // Advance should not be called on beyond-of-range iterators |
14067 | // so no component iterators must be beyond end of range, either. |
14068 | virtual void Advance() { |
14069 | assert(!AtEnd()); |
14070 | ++current4_; |
14071 | if (current4_ == end4_) { |
14072 | current4_ = begin4_; |
14073 | ++current3_; |
14074 | } |
14075 | if (current3_ == end3_) { |
14076 | current3_ = begin3_; |
14077 | ++current2_; |
14078 | } |
14079 | if (current2_ == end2_) { |
14080 | current2_ = begin2_; |
14081 | ++current1_; |
14082 | } |
14083 | ComputeCurrentValue(); |
14084 | } |
14085 | virtual ParamIteratorInterface<ParamType>* Clone() const { |
14086 | return new Iterator(*this); |
14087 | } |
14088 | virtual const ParamType* Current() const { return ¤t_value_; } |
14089 | virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { |
14090 | // Having the same base generator guarantees that the other |
14091 | // iterator is of the same type and we can downcast. |
14092 | GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) |
14093 | << "The program attempted to compare iterators " |
14094 | << "from different generators." << std::endl; |
14095 | const Iterator* typed_other = |
14096 | CheckedDowncastToActualType<const Iterator>(&other); |
14097 | // We must report iterators equal if they both point beyond their |
14098 | // respective ranges. That can happen in a variety of fashions, |
14099 | // so we have to consult AtEnd(). |
14100 | return (AtEnd() && typed_other->AtEnd()) || |
14101 | ( |
14102 | current1_ == typed_other->current1_ && |
14103 | current2_ == typed_other->current2_ && |
14104 | current3_ == typed_other->current3_ && |
14105 | current4_ == typed_other->current4_); |
14106 | } |
14107 | |
14108 | private: |
14109 | Iterator(const Iterator& other) |
14110 | : base_(other.base_), |
14111 | begin1_(other.begin1_), |
14112 | end1_(other.end1_), |
14113 | current1_(other.current1_), |
14114 | begin2_(other.begin2_), |
14115 | end2_(other.end2_), |
14116 | current2_(other.current2_), |
14117 | begin3_(other.begin3_), |
14118 | end3_(other.end3_), |
14119 | current3_(other.current3_), |
14120 | begin4_(other.begin4_), |
14121 | end4_(other.end4_), |
14122 | current4_(other.current4_) { |
14123 | ComputeCurrentValue(); |
14124 | } |
14125 | |
14126 | void ComputeCurrentValue() { |
14127 | if (!AtEnd()) |
14128 | current_value_ = ParamType(*current1_, *current2_, *current3_, |
14129 | *current4_); |
14130 | } |
14131 | bool AtEnd() const { |
14132 | // We must report iterator past the end of the range when either of the |
14133 | // component iterators has reached the end of its range. |
14134 | return |
14135 | current1_ == end1_ || |
14136 | current2_ == end2_ || |
14137 | current3_ == end3_ || |
14138 | current4_ == end4_; |
14139 | } |
14140 | |
14141 | // No implementation - assignment is unsupported. |
14142 | void operator=(const Iterator& other); |
14143 | |
14144 | const ParamGeneratorInterface<ParamType>* const base_; |
14145 | // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. |
14146 | // current[i]_ is the actual traversing iterator. |
14147 | const typename ParamGenerator<T1>::iterator begin1_; |
14148 | const typename ParamGenerator<T1>::iterator end1_; |
14149 | typename ParamGenerator<T1>::iterator current1_; |
14150 | const typename ParamGenerator<T2>::iterator begin2_; |
14151 | const typename ParamGenerator<T2>::iterator end2_; |
14152 | typename ParamGenerator<T2>::iterator current2_; |
14153 | const typename ParamGenerator<T3>::iterator begin3_; |
14154 | const typename ParamGenerator<T3>::iterator end3_; |
14155 | typename ParamGenerator<T3>::iterator current3_; |
14156 | const typename ParamGenerator<T4>::iterator begin4_; |
14157 | const typename ParamGenerator<T4>::iterator end4_; |
14158 | typename ParamGenerator<T4>::iterator current4_; |
14159 | ParamType current_value_; |
14160 | }; // class CartesianProductGenerator4::Iterator |
14161 | |
14162 | // No implementation - assignment is unsupported. |
14163 | void operator=(const CartesianProductGenerator4& other); |
14164 | |
14165 | const ParamGenerator<T1> g1_; |
14166 | const ParamGenerator<T2> g2_; |
14167 | const ParamGenerator<T3> g3_; |
14168 | const ParamGenerator<T4> g4_; |
14169 | }; // class CartesianProductGenerator4 |
14170 | |
14171 | |
14172 | template <typename T1, typename T2, typename T3, typename T4, typename T5> |
14173 | class CartesianProductGenerator5 |
14174 | : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > { |
14175 | public: |
14176 | typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType; |
14177 | |
14178 | CartesianProductGenerator5(const ParamGenerator<T1>& g1, |
14179 | const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3, |
14180 | const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5) |
14181 | : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {} |
14182 | virtual ~CartesianProductGenerator5() {} |
14183 | |
14184 | virtual ParamIteratorInterface<ParamType>* Begin() const { |
14185 | return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, |
14186 | g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin()); |
14187 | } |
14188 | virtual ParamIteratorInterface<ParamType>* End() const { |
14189 | return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), |
14190 | g4_, g4_.end(), g5_, g5_.end()); |
14191 | } |
14192 | |
14193 | private: |
14194 | class Iterator : public ParamIteratorInterface<ParamType> { |
14195 | public: |
14196 | Iterator(const ParamGeneratorInterface<ParamType>* base, |
14197 | const ParamGenerator<T1>& g1, |
14198 | const typename ParamGenerator<T1>::iterator& current1, |
14199 | const ParamGenerator<T2>& g2, |
14200 | const typename ParamGenerator<T2>::iterator& current2, |
14201 | const ParamGenerator<T3>& g3, |
14202 | const typename ParamGenerator<T3>::iterator& current3, |
14203 | const ParamGenerator<T4>& g4, |
14204 | const typename ParamGenerator<T4>::iterator& current4, |
14205 | const ParamGenerator<T5>& g5, |
14206 | const typename ParamGenerator<T5>::iterator& current5) |
14207 | : base_(base), |
14208 | begin1_(g1.begin()), end1_(g1.end()), current1_(current1), |
14209 | begin2_(g2.begin()), end2_(g2.end()), current2_(current2), |
14210 | begin3_(g3.begin()), end3_(g3.end()), current3_(current3), |
14211 | begin4_(g4.begin()), end4_(g4.end()), current4_(current4), |
14212 | begin5_(g5.begin()), end5_(g5.end()), current5_(current5) { |
14213 | ComputeCurrentValue(); |
14214 | } |
14215 | virtual ~Iterator() {} |
14216 | |
14217 | virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { |
14218 | return base_; |
14219 | } |
14220 | // Advance should not be called on beyond-of-range iterators |
14221 | // so no component iterators must be beyond end of range, either. |
14222 | virtual void Advance() { |
14223 | assert(!AtEnd()); |
14224 | ++current5_; |
14225 | if (current5_ == end5_) { |
14226 | current5_ = begin5_; |
14227 | ++current4_; |
14228 | } |
14229 | if (current4_ == end4_) { |
14230 | current4_ = begin4_; |
14231 | ++current3_; |
14232 | } |
14233 | if (current3_ == end3_) { |
14234 | current3_ = begin3_; |
14235 | ++current2_; |
14236 | } |
14237 | if (current2_ == end2_) { |
14238 | current2_ = begin2_; |
14239 | ++current1_; |
14240 | } |
14241 | ComputeCurrentValue(); |
14242 | } |
14243 | virtual ParamIteratorInterface<ParamType>* Clone() const { |
14244 | return new Iterator(*this); |
14245 | } |
14246 | virtual const ParamType* Current() const { return ¤t_value_; } |
14247 | virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { |
14248 | // Having the same base generator guarantees that the other |
14249 | // iterator is of the same type and we can downcast. |
14250 | GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) |
14251 | << "The program attempted to compare iterators " |
14252 | << "from different generators." << std::endl; |
14253 | const Iterator* typed_other = |
14254 | CheckedDowncastToActualType<const Iterator>(&other); |
14255 | // We must report iterators equal if they both point beyond their |
14256 | // respective ranges. That can happen in a variety of fashions, |
14257 | // so we have to consult AtEnd(). |
14258 | return (AtEnd() && typed_other->AtEnd()) || |
14259 | ( |
14260 | current1_ == typed_other->current1_ && |
14261 | current2_ == typed_other->current2_ && |
14262 | current3_ == typed_other->current3_ && |
14263 | current4_ == typed_other->current4_ && |
14264 | current5_ == typed_other->current5_); |
14265 | } |
14266 | |
14267 | private: |
14268 | Iterator(const Iterator& other) |
14269 | : base_(other.base_), |
14270 | begin1_(other.begin1_), |
14271 | end1_(other.end1_), |
14272 | current1_(other.current1_), |
14273 | begin2_(other.begin2_), |
14274 | end2_(other.end2_), |
14275 | current2_(other.current2_), |
14276 | begin3_(other.begin3_), |
14277 | end3_(other.end3_), |
14278 | current3_(other.current3_), |
14279 | begin4_(other.begin4_), |
14280 | end4_(other.end4_), |
14281 | current4_(other.current4_), |
14282 | begin5_(other.begin5_), |
14283 | end5_(other.end5_), |
14284 | current5_(other.current5_) { |
14285 | ComputeCurrentValue(); |
14286 | } |
14287 | |
14288 | void ComputeCurrentValue() { |
14289 | if (!AtEnd()) |
14290 | current_value_ = ParamType(*current1_, *current2_, *current3_, |
14291 | *current4_, *current5_); |
14292 | } |
14293 | bool AtEnd() const { |
14294 | // We must report iterator past the end of the range when either of the |
14295 | // component iterators has reached the end of its range. |
14296 | return |
14297 | current1_ == end1_ || |
14298 | current2_ == end2_ || |
14299 | current3_ == end3_ || |
14300 | current4_ == end4_ || |
14301 | current5_ == end5_; |
14302 | } |
14303 | |
14304 | // No implementation - assignment is unsupported. |
14305 | void operator=(const Iterator& other); |
14306 | |
14307 | const ParamGeneratorInterface<ParamType>* const base_; |
14308 | // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. |
14309 | // current[i]_ is the actual traversing iterator. |
14310 | const typename ParamGenerator<T1>::iterator begin1_; |
14311 | const typename ParamGenerator<T1>::iterator end1_; |
14312 | typename ParamGenerator<T1>::iterator current1_; |
14313 | const typename ParamGenerator<T2>::iterator begin2_; |
14314 | const typename ParamGenerator<T2>::iterator end2_; |
14315 | typename ParamGenerator<T2>::iterator current2_; |
14316 | const typename ParamGenerator<T3>::iterator begin3_; |
14317 | const typename ParamGenerator<T3>::iterator end3_; |
14318 | typename ParamGenerator<T3>::iterator current3_; |
14319 | const typename ParamGenerator<T4>::iterator begin4_; |
14320 | const typename ParamGenerator<T4>::iterator end4_; |
14321 | typename ParamGenerator<T4>::iterator current4_; |
14322 | const typename ParamGenerator<T5>::iterator begin5_; |
14323 | const typename ParamGenerator<T5>::iterator end5_; |
14324 | typename ParamGenerator<T5>::iterator current5_; |
14325 | ParamType current_value_; |
14326 | }; // class CartesianProductGenerator5::Iterator |
14327 | |
14328 | // No implementation - assignment is unsupported. |
14329 | void operator=(const CartesianProductGenerator5& other); |
14330 | |
14331 | const ParamGenerator<T1> g1_; |
14332 | const ParamGenerator<T2> g2_; |
14333 | const ParamGenerator<T3> g3_; |
14334 | const ParamGenerator<T4> g4_; |
14335 | const ParamGenerator<T5> g5_; |
14336 | }; // class CartesianProductGenerator5 |
14337 | |
14338 | |
14339 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
14340 | typename T6> |
14341 | class CartesianProductGenerator6 |
14342 | : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, |
14343 | T6> > { |
14344 | public: |
14345 | typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType; |
14346 | |
14347 | CartesianProductGenerator6(const ParamGenerator<T1>& g1, |
14348 | const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3, |
14349 | const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5, |
14350 | const ParamGenerator<T6>& g6) |
14351 | : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {} |
14352 | virtual ~CartesianProductGenerator6() {} |
14353 | |
14354 | virtual ParamIteratorInterface<ParamType>* Begin() const { |
14355 | return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, |
14356 | g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin()); |
14357 | } |
14358 | virtual ParamIteratorInterface<ParamType>* End() const { |
14359 | return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), |
14360 | g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end()); |
14361 | } |
14362 | |
14363 | private: |
14364 | class Iterator : public ParamIteratorInterface<ParamType> { |
14365 | public: |
14366 | Iterator(const ParamGeneratorInterface<ParamType>* base, |
14367 | const ParamGenerator<T1>& g1, |
14368 | const typename ParamGenerator<T1>::iterator& current1, |
14369 | const ParamGenerator<T2>& g2, |
14370 | const typename ParamGenerator<T2>::iterator& current2, |
14371 | const ParamGenerator<T3>& g3, |
14372 | const typename ParamGenerator<T3>::iterator& current3, |
14373 | const ParamGenerator<T4>& g4, |
14374 | const typename ParamGenerator<T4>::iterator& current4, |
14375 | const ParamGenerator<T5>& g5, |
14376 | const typename ParamGenerator<T5>::iterator& current5, |
14377 | const ParamGenerator<T6>& g6, |
14378 | const typename ParamGenerator<T6>::iterator& current6) |
14379 | : base_(base), |
14380 | begin1_(g1.begin()), end1_(g1.end()), current1_(current1), |
14381 | begin2_(g2.begin()), end2_(g2.end()), current2_(current2), |
14382 | begin3_(g3.begin()), end3_(g3.end()), current3_(current3), |
14383 | begin4_(g4.begin()), end4_(g4.end()), current4_(current4), |
14384 | begin5_(g5.begin()), end5_(g5.end()), current5_(current5), |
14385 | begin6_(g6.begin()), end6_(g6.end()), current6_(current6) { |
14386 | ComputeCurrentValue(); |
14387 | } |
14388 | virtual ~Iterator() {} |
14389 | |
14390 | virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { |
14391 | return base_; |
14392 | } |
14393 | // Advance should not be called on beyond-of-range iterators |
14394 | // so no component iterators must be beyond end of range, either. |
14395 | virtual void Advance() { |
14396 | assert(!AtEnd()); |
14397 | ++current6_; |
14398 | if (current6_ == end6_) { |
14399 | current6_ = begin6_; |
14400 | ++current5_; |
14401 | } |
14402 | if (current5_ == end5_) { |
14403 | current5_ = begin5_; |
14404 | ++current4_; |
14405 | } |
14406 | if (current4_ == end4_) { |
14407 | current4_ = begin4_; |
14408 | ++current3_; |
14409 | } |
14410 | if (current3_ == end3_) { |
14411 | current3_ = begin3_; |
14412 | ++current2_; |
14413 | } |
14414 | if (current2_ == end2_) { |
14415 | current2_ = begin2_; |
14416 | ++current1_; |
14417 | } |
14418 | ComputeCurrentValue(); |
14419 | } |
14420 | virtual ParamIteratorInterface<ParamType>* Clone() const { |
14421 | return new Iterator(*this); |
14422 | } |
14423 | virtual const ParamType* Current() const { return ¤t_value_; } |
14424 | virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { |
14425 | // Having the same base generator guarantees that the other |
14426 | // iterator is of the same type and we can downcast. |
14427 | GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) |
14428 | << "The program attempted to compare iterators " |
14429 | << "from different generators." << std::endl; |
14430 | const Iterator* typed_other = |
14431 | CheckedDowncastToActualType<const Iterator>(&other); |
14432 | // We must report iterators equal if they both point beyond their |
14433 | // respective ranges. That can happen in a variety of fashions, |
14434 | // so we have to consult AtEnd(). |
14435 | return (AtEnd() && typed_other->AtEnd()) || |
14436 | ( |
14437 | current1_ == typed_other->current1_ && |
14438 | current2_ == typed_other->current2_ && |
14439 | current3_ == typed_other->current3_ && |
14440 | current4_ == typed_other->current4_ && |
14441 | current5_ == typed_other->current5_ && |
14442 | current6_ == typed_other->current6_); |
14443 | } |
14444 | |
14445 | private: |
14446 | Iterator(const Iterator& other) |
14447 | : base_(other.base_), |
14448 | begin1_(other.begin1_), |
14449 | end1_(other.end1_), |
14450 | current1_(other.current1_), |
14451 | begin2_(other.begin2_), |
14452 | end2_(other.end2_), |
14453 | current2_(other.current2_), |
14454 | begin3_(other.begin3_), |
14455 | end3_(other.end3_), |
14456 | current3_(other.current3_), |
14457 | begin4_(other.begin4_), |
14458 | end4_(other.end4_), |
14459 | current4_(other.current4_), |
14460 | begin5_(other.begin5_), |
14461 | end5_(other.end5_), |
14462 | current5_(other.current5_), |
14463 | begin6_(other.begin6_), |
14464 | end6_(other.end6_), |
14465 | current6_(other.current6_) { |
14466 | ComputeCurrentValue(); |
14467 | } |
14468 | |
14469 | void ComputeCurrentValue() { |
14470 | if (!AtEnd()) |
14471 | current_value_ = ParamType(*current1_, *current2_, *current3_, |
14472 | *current4_, *current5_, *current6_); |
14473 | } |
14474 | bool AtEnd() const { |
14475 | // We must report iterator past the end of the range when either of the |
14476 | // component iterators has reached the end of its range. |
14477 | return |
14478 | current1_ == end1_ || |
14479 | current2_ == end2_ || |
14480 | current3_ == end3_ || |
14481 | current4_ == end4_ || |
14482 | current5_ == end5_ || |
14483 | current6_ == end6_; |
14484 | } |
14485 | |
14486 | // No implementation - assignment is unsupported. |
14487 | void operator=(const Iterator& other); |
14488 | |
14489 | const ParamGeneratorInterface<ParamType>* const base_; |
14490 | // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. |
14491 | // current[i]_ is the actual traversing iterator. |
14492 | const typename ParamGenerator<T1>::iterator begin1_; |
14493 | const typename ParamGenerator<T1>::iterator end1_; |
14494 | typename ParamGenerator<T1>::iterator current1_; |
14495 | const typename ParamGenerator<T2>::iterator begin2_; |
14496 | const typename ParamGenerator<T2>::iterator end2_; |
14497 | typename ParamGenerator<T2>::iterator current2_; |
14498 | const typename ParamGenerator<T3>::iterator begin3_; |
14499 | const typename ParamGenerator<T3>::iterator end3_; |
14500 | typename ParamGenerator<T3>::iterator current3_; |
14501 | const typename ParamGenerator<T4>::iterator begin4_; |
14502 | const typename ParamGenerator<T4>::iterator end4_; |
14503 | typename ParamGenerator<T4>::iterator current4_; |
14504 | const typename ParamGenerator<T5>::iterator begin5_; |
14505 | const typename ParamGenerator<T5>::iterator end5_; |
14506 | typename ParamGenerator<T5>::iterator current5_; |
14507 | const typename ParamGenerator<T6>::iterator begin6_; |
14508 | const typename ParamGenerator<T6>::iterator end6_; |
14509 | typename ParamGenerator<T6>::iterator current6_; |
14510 | ParamType current_value_; |
14511 | }; // class CartesianProductGenerator6::Iterator |
14512 | |
14513 | // No implementation - assignment is unsupported. |
14514 | void operator=(const CartesianProductGenerator6& other); |
14515 | |
14516 | const ParamGenerator<T1> g1_; |
14517 | const ParamGenerator<T2> g2_; |
14518 | const ParamGenerator<T3> g3_; |
14519 | const ParamGenerator<T4> g4_; |
14520 | const ParamGenerator<T5> g5_; |
14521 | const ParamGenerator<T6> g6_; |
14522 | }; // class CartesianProductGenerator6 |
14523 | |
14524 | |
14525 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
14526 | typename T6, typename T7> |
14527 | class CartesianProductGenerator7 |
14528 | : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, |
14529 | T7> > { |
14530 | public: |
14531 | typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType; |
14532 | |
14533 | CartesianProductGenerator7(const ParamGenerator<T1>& g1, |
14534 | const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3, |
14535 | const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5, |
14536 | const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7) |
14537 | : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {} |
14538 | virtual ~CartesianProductGenerator7() {} |
14539 | |
14540 | virtual ParamIteratorInterface<ParamType>* Begin() const { |
14541 | return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, |
14542 | g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, |
14543 | g7_.begin()); |
14544 | } |
14545 | virtual ParamIteratorInterface<ParamType>* End() const { |
14546 | return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), |
14547 | g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end()); |
14548 | } |
14549 | |
14550 | private: |
14551 | class Iterator : public ParamIteratorInterface<ParamType> { |
14552 | public: |
14553 | Iterator(const ParamGeneratorInterface<ParamType>* base, |
14554 | const ParamGenerator<T1>& g1, |
14555 | const typename ParamGenerator<T1>::iterator& current1, |
14556 | const ParamGenerator<T2>& g2, |
14557 | const typename ParamGenerator<T2>::iterator& current2, |
14558 | const ParamGenerator<T3>& g3, |
14559 | const typename ParamGenerator<T3>::iterator& current3, |
14560 | const ParamGenerator<T4>& g4, |
14561 | const typename ParamGenerator<T4>::iterator& current4, |
14562 | const ParamGenerator<T5>& g5, |
14563 | const typename ParamGenerator<T5>::iterator& current5, |
14564 | const ParamGenerator<T6>& g6, |
14565 | const typename ParamGenerator<T6>::iterator& current6, |
14566 | const ParamGenerator<T7>& g7, |
14567 | const typename ParamGenerator<T7>::iterator& current7) |
14568 | : base_(base), |
14569 | begin1_(g1.begin()), end1_(g1.end()), current1_(current1), |
14570 | begin2_(g2.begin()), end2_(g2.end()), current2_(current2), |
14571 | begin3_(g3.begin()), end3_(g3.end()), current3_(current3), |
14572 | begin4_(g4.begin()), end4_(g4.end()), current4_(current4), |
14573 | begin5_(g5.begin()), end5_(g5.end()), current5_(current5), |
14574 | begin6_(g6.begin()), end6_(g6.end()), current6_(current6), |
14575 | begin7_(g7.begin()), end7_(g7.end()), current7_(current7) { |
14576 | ComputeCurrentValue(); |
14577 | } |
14578 | virtual ~Iterator() {} |
14579 | |
14580 | virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { |
14581 | return base_; |
14582 | } |
14583 | // Advance should not be called on beyond-of-range iterators |
14584 | // so no component iterators must be beyond end of range, either. |
14585 | virtual void Advance() { |
14586 | assert(!AtEnd()); |
14587 | ++current7_; |
14588 | if (current7_ == end7_) { |
14589 | current7_ = begin7_; |
14590 | ++current6_; |
14591 | } |
14592 | if (current6_ == end6_) { |
14593 | current6_ = begin6_; |
14594 | ++current5_; |
14595 | } |
14596 | if (current5_ == end5_) { |
14597 | current5_ = begin5_; |
14598 | ++current4_; |
14599 | } |
14600 | if (current4_ == end4_) { |
14601 | current4_ = begin4_; |
14602 | ++current3_; |
14603 | } |
14604 | if (current3_ == end3_) { |
14605 | current3_ = begin3_; |
14606 | ++current2_; |
14607 | } |
14608 | if (current2_ == end2_) { |
14609 | current2_ = begin2_; |
14610 | ++current1_; |
14611 | } |
14612 | ComputeCurrentValue(); |
14613 | } |
14614 | virtual ParamIteratorInterface<ParamType>* Clone() const { |
14615 | return new Iterator(*this); |
14616 | } |
14617 | virtual const ParamType* Current() const { return ¤t_value_; } |
14618 | virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { |
14619 | // Having the same base generator guarantees that the other |
14620 | // iterator is of the same type and we can downcast. |
14621 | GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) |
14622 | << "The program attempted to compare iterators " |
14623 | << "from different generators." << std::endl; |
14624 | const Iterator* typed_other = |
14625 | CheckedDowncastToActualType<const Iterator>(&other); |
14626 | // We must report iterators equal if they both point beyond their |
14627 | // respective ranges. That can happen in a variety of fashions, |
14628 | // so we have to consult AtEnd(). |
14629 | return (AtEnd() && typed_other->AtEnd()) || |
14630 | ( |
14631 | current1_ == typed_other->current1_ && |
14632 | current2_ == typed_other->current2_ && |
14633 | current3_ == typed_other->current3_ && |
14634 | current4_ == typed_other->current4_ && |
14635 | current5_ == typed_other->current5_ && |
14636 | current6_ == typed_other->current6_ && |
14637 | current7_ == typed_other->current7_); |
14638 | } |
14639 | |
14640 | private: |
14641 | Iterator(const Iterator& other) |
14642 | : base_(other.base_), |
14643 | begin1_(other.begin1_), |
14644 | end1_(other.end1_), |
14645 | current1_(other.current1_), |
14646 | begin2_(other.begin2_), |
14647 | end2_(other.end2_), |
14648 | current2_(other.current2_), |
14649 | begin3_(other.begin3_), |
14650 | end3_(other.end3_), |
14651 | current3_(other.current3_), |
14652 | begin4_(other.begin4_), |
14653 | end4_(other.end4_), |
14654 | current4_(other.current4_), |
14655 | begin5_(other.begin5_), |
14656 | end5_(other.end5_), |
14657 | current5_(other.current5_), |
14658 | begin6_(other.begin6_), |
14659 | end6_(other.end6_), |
14660 | current6_(other.current6_), |
14661 | begin7_(other.begin7_), |
14662 | end7_(other.end7_), |
14663 | current7_(other.current7_) { |
14664 | ComputeCurrentValue(); |
14665 | } |
14666 | |
14667 | void ComputeCurrentValue() { |
14668 | if (!AtEnd()) |
14669 | current_value_ = ParamType(*current1_, *current2_, *current3_, |
14670 | *current4_, *current5_, *current6_, *current7_); |
14671 | } |
14672 | bool AtEnd() const { |
14673 | // We must report iterator past the end of the range when either of the |
14674 | // component iterators has reached the end of its range. |
14675 | return |
14676 | current1_ == end1_ || |
14677 | current2_ == end2_ || |
14678 | current3_ == end3_ || |
14679 | current4_ == end4_ || |
14680 | current5_ == end5_ || |
14681 | current6_ == end6_ || |
14682 | current7_ == end7_; |
14683 | } |
14684 | |
14685 | // No implementation - assignment is unsupported. |
14686 | void operator=(const Iterator& other); |
14687 | |
14688 | const ParamGeneratorInterface<ParamType>* const base_; |
14689 | // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. |
14690 | // current[i]_ is the actual traversing iterator. |
14691 | const typename ParamGenerator<T1>::iterator begin1_; |
14692 | const typename ParamGenerator<T1>::iterator end1_; |
14693 | typename ParamGenerator<T1>::iterator current1_; |
14694 | const typename ParamGenerator<T2>::iterator begin2_; |
14695 | const typename ParamGenerator<T2>::iterator end2_; |
14696 | typename ParamGenerator<T2>::iterator current2_; |
14697 | const typename ParamGenerator<T3>::iterator begin3_; |
14698 | const typename ParamGenerator<T3>::iterator end3_; |
14699 | typename ParamGenerator<T3>::iterator current3_; |
14700 | const typename ParamGenerator<T4>::iterator begin4_; |
14701 | const typename ParamGenerator<T4>::iterator end4_; |
14702 | typename ParamGenerator<T4>::iterator current4_; |
14703 | const typename ParamGenerator<T5>::iterator begin5_; |
14704 | const typename ParamGenerator<T5>::iterator end5_; |
14705 | typename ParamGenerator<T5>::iterator current5_; |
14706 | const typename ParamGenerator<T6>::iterator begin6_; |
14707 | const typename ParamGenerator<T6>::iterator end6_; |
14708 | typename ParamGenerator<T6>::iterator current6_; |
14709 | const typename ParamGenerator<T7>::iterator begin7_; |
14710 | const typename ParamGenerator<T7>::iterator end7_; |
14711 | typename ParamGenerator<T7>::iterator current7_; |
14712 | ParamType current_value_; |
14713 | }; // class CartesianProductGenerator7::Iterator |
14714 | |
14715 | // No implementation - assignment is unsupported. |
14716 | void operator=(const CartesianProductGenerator7& other); |
14717 | |
14718 | const ParamGenerator<T1> g1_; |
14719 | const ParamGenerator<T2> g2_; |
14720 | const ParamGenerator<T3> g3_; |
14721 | const ParamGenerator<T4> g4_; |
14722 | const ParamGenerator<T5> g5_; |
14723 | const ParamGenerator<T6> g6_; |
14724 | const ParamGenerator<T7> g7_; |
14725 | }; // class CartesianProductGenerator7 |
14726 | |
14727 | |
14728 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
14729 | typename T6, typename T7, typename T8> |
14730 | class CartesianProductGenerator8 |
14731 | : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, |
14732 | T7, T8> > { |
14733 | public: |
14734 | typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType; |
14735 | |
14736 | CartesianProductGenerator8(const ParamGenerator<T1>& g1, |
14737 | const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3, |
14738 | const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5, |
14739 | const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7, |
14740 | const ParamGenerator<T8>& g8) |
14741 | : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), |
14742 | g8_(g8) {} |
14743 | virtual ~CartesianProductGenerator8() {} |
14744 | |
14745 | virtual ParamIteratorInterface<ParamType>* Begin() const { |
14746 | return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, |
14747 | g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, |
14748 | g7_.begin(), g8_, g8_.begin()); |
14749 | } |
14750 | virtual ParamIteratorInterface<ParamType>* End() const { |
14751 | return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), |
14752 | g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, |
14753 | g8_.end()); |
14754 | } |
14755 | |
14756 | private: |
14757 | class Iterator : public ParamIteratorInterface<ParamType> { |
14758 | public: |
14759 | Iterator(const ParamGeneratorInterface<ParamType>* base, |
14760 | const ParamGenerator<T1>& g1, |
14761 | const typename ParamGenerator<T1>::iterator& current1, |
14762 | const ParamGenerator<T2>& g2, |
14763 | const typename ParamGenerator<T2>::iterator& current2, |
14764 | const ParamGenerator<T3>& g3, |
14765 | const typename ParamGenerator<T3>::iterator& current3, |
14766 | const ParamGenerator<T4>& g4, |
14767 | const typename ParamGenerator<T4>::iterator& current4, |
14768 | const ParamGenerator<T5>& g5, |
14769 | const typename ParamGenerator<T5>::iterator& current5, |
14770 | const ParamGenerator<T6>& g6, |
14771 | const typename ParamGenerator<T6>::iterator& current6, |
14772 | const ParamGenerator<T7>& g7, |
14773 | const typename ParamGenerator<T7>::iterator& current7, |
14774 | const ParamGenerator<T8>& g8, |
14775 | const typename ParamGenerator<T8>::iterator& current8) |
14776 | : base_(base), |
14777 | begin1_(g1.begin()), end1_(g1.end()), current1_(current1), |
14778 | begin2_(g2.begin()), end2_(g2.end()), current2_(current2), |
14779 | begin3_(g3.begin()), end3_(g3.end()), current3_(current3), |
14780 | begin4_(g4.begin()), end4_(g4.end()), current4_(current4), |
14781 | begin5_(g5.begin()), end5_(g5.end()), current5_(current5), |
14782 | begin6_(g6.begin()), end6_(g6.end()), current6_(current6), |
14783 | begin7_(g7.begin()), end7_(g7.end()), current7_(current7), |
14784 | begin8_(g8.begin()), end8_(g8.end()), current8_(current8) { |
14785 | ComputeCurrentValue(); |
14786 | } |
14787 | virtual ~Iterator() {} |
14788 | |
14789 | virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { |
14790 | return base_; |
14791 | } |
14792 | // Advance should not be called on beyond-of-range iterators |
14793 | // so no component iterators must be beyond end of range, either. |
14794 | virtual void Advance() { |
14795 | assert(!AtEnd()); |
14796 | ++current8_; |
14797 | if (current8_ == end8_) { |
14798 | current8_ = begin8_; |
14799 | ++current7_; |
14800 | } |
14801 | if (current7_ == end7_) { |
14802 | current7_ = begin7_; |
14803 | ++current6_; |
14804 | } |
14805 | if (current6_ == end6_) { |
14806 | current6_ = begin6_; |
14807 | ++current5_; |
14808 | } |
14809 | if (current5_ == end5_) { |
14810 | current5_ = begin5_; |
14811 | ++current4_; |
14812 | } |
14813 | if (current4_ == end4_) { |
14814 | current4_ = begin4_; |
14815 | ++current3_; |
14816 | } |
14817 | if (current3_ == end3_) { |
14818 | current3_ = begin3_; |
14819 | ++current2_; |
14820 | } |
14821 | if (current2_ == end2_) { |
14822 | current2_ = begin2_; |
14823 | ++current1_; |
14824 | } |
14825 | ComputeCurrentValue(); |
14826 | } |
14827 | virtual ParamIteratorInterface<ParamType>* Clone() const { |
14828 | return new Iterator(*this); |
14829 | } |
14830 | virtual const ParamType* Current() const { return ¤t_value_; } |
14831 | virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { |
14832 | // Having the same base generator guarantees that the other |
14833 | // iterator is of the same type and we can downcast. |
14834 | GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) |
14835 | << "The program attempted to compare iterators " |
14836 | << "from different generators." << std::endl; |
14837 | const Iterator* typed_other = |
14838 | CheckedDowncastToActualType<const Iterator>(&other); |
14839 | // We must report iterators equal if they both point beyond their |
14840 | // respective ranges. That can happen in a variety of fashions, |
14841 | // so we have to consult AtEnd(). |
14842 | return (AtEnd() && typed_other->AtEnd()) || |
14843 | ( |
14844 | current1_ == typed_other->current1_ && |
14845 | current2_ == typed_other->current2_ && |
14846 | current3_ == typed_other->current3_ && |
14847 | current4_ == typed_other->current4_ && |
14848 | current5_ == typed_other->current5_ && |
14849 | current6_ == typed_other->current6_ && |
14850 | current7_ == typed_other->current7_ && |
14851 | current8_ == typed_other->current8_); |
14852 | } |
14853 | |
14854 | private: |
14855 | Iterator(const Iterator& other) |
14856 | : base_(other.base_), |
14857 | begin1_(other.begin1_), |
14858 | end1_(other.end1_), |
14859 | current1_(other.current1_), |
14860 | begin2_(other.begin2_), |
14861 | end2_(other.end2_), |
14862 | current2_(other.current2_), |
14863 | begin3_(other.begin3_), |
14864 | end3_(other.end3_), |
14865 | current3_(other.current3_), |
14866 | begin4_(other.begin4_), |
14867 | end4_(other.end4_), |
14868 | current4_(other.current4_), |
14869 | begin5_(other.begin5_), |
14870 | end5_(other.end5_), |
14871 | current5_(other.current5_), |
14872 | begin6_(other.begin6_), |
14873 | end6_(other.end6_), |
14874 | current6_(other.current6_), |
14875 | begin7_(other.begin7_), |
14876 | end7_(other.end7_), |
14877 | current7_(other.current7_), |
14878 | begin8_(other.begin8_), |
14879 | end8_(other.end8_), |
14880 | current8_(other.current8_) { |
14881 | ComputeCurrentValue(); |
14882 | } |
14883 | |
14884 | void ComputeCurrentValue() { |
14885 | if (!AtEnd()) |
14886 | current_value_ = ParamType(*current1_, *current2_, *current3_, |
14887 | *current4_, *current5_, *current6_, *current7_, *current8_); |
14888 | } |
14889 | bool AtEnd() const { |
14890 | // We must report iterator past the end of the range when either of the |
14891 | // component iterators has reached the end of its range. |
14892 | return |
14893 | current1_ == end1_ || |
14894 | current2_ == end2_ || |
14895 | current3_ == end3_ || |
14896 | current4_ == end4_ || |
14897 | current5_ == end5_ || |
14898 | current6_ == end6_ || |
14899 | current7_ == end7_ || |
14900 | current8_ == end8_; |
14901 | } |
14902 | |
14903 | // No implementation - assignment is unsupported. |
14904 | void operator=(const Iterator& other); |
14905 | |
14906 | const ParamGeneratorInterface<ParamType>* const base_; |
14907 | // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. |
14908 | // current[i]_ is the actual traversing iterator. |
14909 | const typename ParamGenerator<T1>::iterator begin1_; |
14910 | const typename ParamGenerator<T1>::iterator end1_; |
14911 | typename ParamGenerator<T1>::iterator current1_; |
14912 | const typename ParamGenerator<T2>::iterator begin2_; |
14913 | const typename ParamGenerator<T2>::iterator end2_; |
14914 | typename ParamGenerator<T2>::iterator current2_; |
14915 | const typename ParamGenerator<T3>::iterator begin3_; |
14916 | const typename ParamGenerator<T3>::iterator end3_; |
14917 | typename ParamGenerator<T3>::iterator current3_; |
14918 | const typename ParamGenerator<T4>::iterator begin4_; |
14919 | const typename ParamGenerator<T4>::iterator end4_; |
14920 | typename ParamGenerator<T4>::iterator current4_; |
14921 | const typename ParamGenerator<T5>::iterator begin5_; |
14922 | const typename ParamGenerator<T5>::iterator end5_; |
14923 | typename ParamGenerator<T5>::iterator current5_; |
14924 | const typename ParamGenerator<T6>::iterator begin6_; |
14925 | const typename ParamGenerator<T6>::iterator end6_; |
14926 | typename ParamGenerator<T6>::iterator current6_; |
14927 | const typename ParamGenerator<T7>::iterator begin7_; |
14928 | const typename ParamGenerator<T7>::iterator end7_; |
14929 | typename ParamGenerator<T7>::iterator current7_; |
14930 | const typename ParamGenerator<T8>::iterator begin8_; |
14931 | const typename ParamGenerator<T8>::iterator end8_; |
14932 | typename ParamGenerator<T8>::iterator current8_; |
14933 | ParamType current_value_; |
14934 | }; // class CartesianProductGenerator8::Iterator |
14935 | |
14936 | // No implementation - assignment is unsupported. |
14937 | void operator=(const CartesianProductGenerator8& other); |
14938 | |
14939 | const ParamGenerator<T1> g1_; |
14940 | const ParamGenerator<T2> g2_; |
14941 | const ParamGenerator<T3> g3_; |
14942 | const ParamGenerator<T4> g4_; |
14943 | const ParamGenerator<T5> g5_; |
14944 | const ParamGenerator<T6> g6_; |
14945 | const ParamGenerator<T7> g7_; |
14946 | const ParamGenerator<T8> g8_; |
14947 | }; // class CartesianProductGenerator8 |
14948 | |
14949 | |
14950 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
14951 | typename T6, typename T7, typename T8, typename T9> |
14952 | class CartesianProductGenerator9 |
14953 | : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, |
14954 | T7, T8, T9> > { |
14955 | public: |
14956 | typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType; |
14957 | |
14958 | CartesianProductGenerator9(const ParamGenerator<T1>& g1, |
14959 | const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3, |
14960 | const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5, |
14961 | const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7, |
14962 | const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9) |
14963 | : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), |
14964 | g9_(g9) {} |
14965 | virtual ~CartesianProductGenerator9() {} |
14966 | |
14967 | virtual ParamIteratorInterface<ParamType>* Begin() const { |
14968 | return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, |
14969 | g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, |
14970 | g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin()); |
14971 | } |
14972 | virtual ParamIteratorInterface<ParamType>* End() const { |
14973 | return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), |
14974 | g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, |
14975 | g8_.end(), g9_, g9_.end()); |
14976 | } |
14977 | |
14978 | private: |
14979 | class Iterator : public ParamIteratorInterface<ParamType> { |
14980 | public: |
14981 | Iterator(const ParamGeneratorInterface<ParamType>* base, |
14982 | const ParamGenerator<T1>& g1, |
14983 | const typename ParamGenerator<T1>::iterator& current1, |
14984 | const ParamGenerator<T2>& g2, |
14985 | const typename ParamGenerator<T2>::iterator& current2, |
14986 | const ParamGenerator<T3>& g3, |
14987 | const typename ParamGenerator<T3>::iterator& current3, |
14988 | const ParamGenerator<T4>& g4, |
14989 | const typename ParamGenerator<T4>::iterator& current4, |
14990 | const ParamGenerator<T5>& g5, |
14991 | const typename ParamGenerator<T5>::iterator& current5, |
14992 | const ParamGenerator<T6>& g6, |
14993 | const typename ParamGenerator<T6>::iterator& current6, |
14994 | const ParamGenerator<T7>& g7, |
14995 | const typename ParamGenerator<T7>::iterator& current7, |
14996 | const ParamGenerator<T8>& g8, |
14997 | const typename ParamGenerator<T8>::iterator& current8, |
14998 | const ParamGenerator<T9>& g9, |
14999 | const typename ParamGenerator<T9>::iterator& current9) |
15000 | : base_(base), |
15001 | begin1_(g1.begin()), end1_(g1.end()), current1_(current1), |
15002 | begin2_(g2.begin()), end2_(g2.end()), current2_(current2), |
15003 | begin3_(g3.begin()), end3_(g3.end()), current3_(current3), |
15004 | begin4_(g4.begin()), end4_(g4.end()), current4_(current4), |
15005 | begin5_(g5.begin()), end5_(g5.end()), current5_(current5), |
15006 | begin6_(g6.begin()), end6_(g6.end()), current6_(current6), |
15007 | begin7_(g7.begin()), end7_(g7.end()), current7_(current7), |
15008 | begin8_(g8.begin()), end8_(g8.end()), current8_(current8), |
15009 | begin9_(g9.begin()), end9_(g9.end()), current9_(current9) { |
15010 | ComputeCurrentValue(); |
15011 | } |
15012 | virtual ~Iterator() {} |
15013 | |
15014 | virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { |
15015 | return base_; |
15016 | } |
15017 | // Advance should not be called on beyond-of-range iterators |
15018 | // so no component iterators must be beyond end of range, either. |
15019 | virtual void Advance() { |
15020 | assert(!AtEnd()); |
15021 | ++current9_; |
15022 | if (current9_ == end9_) { |
15023 | current9_ = begin9_; |
15024 | ++current8_; |
15025 | } |
15026 | if (current8_ == end8_) { |
15027 | current8_ = begin8_; |
15028 | ++current7_; |
15029 | } |
15030 | if (current7_ == end7_) { |
15031 | current7_ = begin7_; |
15032 | ++current6_; |
15033 | } |
15034 | if (current6_ == end6_) { |
15035 | current6_ = begin6_; |
15036 | ++current5_; |
15037 | } |
15038 | if (current5_ == end5_) { |
15039 | current5_ = begin5_; |
15040 | ++current4_; |
15041 | } |
15042 | if (current4_ == end4_) { |
15043 | current4_ = begin4_; |
15044 | ++current3_; |
15045 | } |
15046 | if (current3_ == end3_) { |
15047 | current3_ = begin3_; |
15048 | ++current2_; |
15049 | } |
15050 | if (current2_ == end2_) { |
15051 | current2_ = begin2_; |
15052 | ++current1_; |
15053 | } |
15054 | ComputeCurrentValue(); |
15055 | } |
15056 | virtual ParamIteratorInterface<ParamType>* Clone() const { |
15057 | return new Iterator(*this); |
15058 | } |
15059 | virtual const ParamType* Current() const { return ¤t_value_; } |
15060 | virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { |
15061 | // Having the same base generator guarantees that the other |
15062 | // iterator is of the same type and we can downcast. |
15063 | GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) |
15064 | << "The program attempted to compare iterators " |
15065 | << "from different generators." << std::endl; |
15066 | const Iterator* typed_other = |
15067 | CheckedDowncastToActualType<const Iterator>(&other); |
15068 | // We must report iterators equal if they both point beyond their |
15069 | // respective ranges. That can happen in a variety of fashions, |
15070 | // so we have to consult AtEnd(). |
15071 | return (AtEnd() && typed_other->AtEnd()) || |
15072 | ( |
15073 | current1_ == typed_other->current1_ && |
15074 | current2_ == typed_other->current2_ && |
15075 | current3_ == typed_other->current3_ && |
15076 | current4_ == typed_other->current4_ && |
15077 | current5_ == typed_other->current5_ && |
15078 | current6_ == typed_other->current6_ && |
15079 | current7_ == typed_other->current7_ && |
15080 | current8_ == typed_other->current8_ && |
15081 | current9_ == typed_other->current9_); |
15082 | } |
15083 | |
15084 | private: |
15085 | Iterator(const Iterator& other) |
15086 | : base_(other.base_), |
15087 | begin1_(other.begin1_), |
15088 | end1_(other.end1_), |
15089 | current1_(other.current1_), |
15090 | begin2_(other.begin2_), |
15091 | end2_(other.end2_), |
15092 | current2_(other.current2_), |
15093 | begin3_(other.begin3_), |
15094 | end3_(other.end3_), |
15095 | current3_(other.current3_), |
15096 | begin4_(other.begin4_), |
15097 | end4_(other.end4_), |
15098 | current4_(other.current4_), |
15099 | begin5_(other.begin5_), |
15100 | end5_(other.end5_), |
15101 | current5_(other.current5_), |
15102 | begin6_(other.begin6_), |
15103 | end6_(other.end6_), |
15104 | current6_(other.current6_), |
15105 | begin7_(other.begin7_), |
15106 | end7_(other.end7_), |
15107 | current7_(other.current7_), |
15108 | begin8_(other.begin8_), |
15109 | end8_(other.end8_), |
15110 | current8_(other.current8_), |
15111 | begin9_(other.begin9_), |
15112 | end9_(other.end9_), |
15113 | current9_(other.current9_) { |
15114 | ComputeCurrentValue(); |
15115 | } |
15116 | |
15117 | void ComputeCurrentValue() { |
15118 | if (!AtEnd()) |
15119 | current_value_ = ParamType(*current1_, *current2_, *current3_, |
15120 | *current4_, *current5_, *current6_, *current7_, *current8_, |
15121 | *current9_); |
15122 | } |
15123 | bool AtEnd() const { |
15124 | // We must report iterator past the end of the range when either of the |
15125 | // component iterators has reached the end of its range. |
15126 | return |
15127 | current1_ == end1_ || |
15128 | current2_ == end2_ || |
15129 | current3_ == end3_ || |
15130 | current4_ == end4_ || |
15131 | current5_ == end5_ || |
15132 | current6_ == end6_ || |
15133 | current7_ == end7_ || |
15134 | current8_ == end8_ || |
15135 | current9_ == end9_; |
15136 | } |
15137 | |
15138 | // No implementation - assignment is unsupported. |
15139 | void operator=(const Iterator& other); |
15140 | |
15141 | const ParamGeneratorInterface<ParamType>* const base_; |
15142 | // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. |
15143 | // current[i]_ is the actual traversing iterator. |
15144 | const typename ParamGenerator<T1>::iterator begin1_; |
15145 | const typename ParamGenerator<T1>::iterator end1_; |
15146 | typename ParamGenerator<T1>::iterator current1_; |
15147 | const typename ParamGenerator<T2>::iterator begin2_; |
15148 | const typename ParamGenerator<T2>::iterator end2_; |
15149 | typename ParamGenerator<T2>::iterator current2_; |
15150 | const typename ParamGenerator<T3>::iterator begin3_; |
15151 | const typename ParamGenerator<T3>::iterator end3_; |
15152 | typename ParamGenerator<T3>::iterator current3_; |
15153 | const typename ParamGenerator<T4>::iterator begin4_; |
15154 | const typename ParamGenerator<T4>::iterator end4_; |
15155 | typename ParamGenerator<T4>::iterator current4_; |
15156 | const typename ParamGenerator<T5>::iterator begin5_; |
15157 | const typename ParamGenerator<T5>::iterator end5_; |
15158 | typename ParamGenerator<T5>::iterator current5_; |
15159 | const typename ParamGenerator<T6>::iterator begin6_; |
15160 | const typename ParamGenerator<T6>::iterator end6_; |
15161 | typename ParamGenerator<T6>::iterator current6_; |
15162 | const typename ParamGenerator<T7>::iterator begin7_; |
15163 | const typename ParamGenerator<T7>::iterator end7_; |
15164 | typename ParamGenerator<T7>::iterator current7_; |
15165 | const typename ParamGenerator<T8>::iterator begin8_; |
15166 | const typename ParamGenerator<T8>::iterator end8_; |
15167 | typename ParamGenerator<T8>::iterator current8_; |
15168 | const typename ParamGenerator<T9>::iterator begin9_; |
15169 | const typename ParamGenerator<T9>::iterator end9_; |
15170 | typename ParamGenerator<T9>::iterator current9_; |
15171 | ParamType current_value_; |
15172 | }; // class CartesianProductGenerator9::Iterator |
15173 | |
15174 | // No implementation - assignment is unsupported. |
15175 | void operator=(const CartesianProductGenerator9& other); |
15176 | |
15177 | const ParamGenerator<T1> g1_; |
15178 | const ParamGenerator<T2> g2_; |
15179 | const ParamGenerator<T3> g3_; |
15180 | const ParamGenerator<T4> g4_; |
15181 | const ParamGenerator<T5> g5_; |
15182 | const ParamGenerator<T6> g6_; |
15183 | const ParamGenerator<T7> g7_; |
15184 | const ParamGenerator<T8> g8_; |
15185 | const ParamGenerator<T9> g9_; |
15186 | }; // class CartesianProductGenerator9 |
15187 | |
15188 | |
15189 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
15190 | typename T6, typename T7, typename T8, typename T9, typename T10> |
15191 | class CartesianProductGenerator10 |
15192 | : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, |
15193 | T7, T8, T9, T10> > { |
15194 | public: |
15195 | typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType; |
15196 | |
15197 | CartesianProductGenerator10(const ParamGenerator<T1>& g1, |
15198 | const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3, |
15199 | const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5, |
15200 | const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7, |
15201 | const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9, |
15202 | const ParamGenerator<T10>& g10) |
15203 | : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), |
15204 | g9_(g9), g10_(g10) {} |
15205 | virtual ~CartesianProductGenerator10() {} |
15206 | |
15207 | virtual ParamIteratorInterface<ParamType>* Begin() const { |
15208 | return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, |
15209 | g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, |
15210 | g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin()); |
15211 | } |
15212 | virtual ParamIteratorInterface<ParamType>* End() const { |
15213 | return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), |
15214 | g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, |
15215 | g8_.end(), g9_, g9_.end(), g10_, g10_.end()); |
15216 | } |
15217 | |
15218 | private: |
15219 | class Iterator : public ParamIteratorInterface<ParamType> { |
15220 | public: |
15221 | Iterator(const ParamGeneratorInterface<ParamType>* base, |
15222 | const ParamGenerator<T1>& g1, |
15223 | const typename ParamGenerator<T1>::iterator& current1, |
15224 | const ParamGenerator<T2>& g2, |
15225 | const typename ParamGenerator<T2>::iterator& current2, |
15226 | const ParamGenerator<T3>& g3, |
15227 | const typename ParamGenerator<T3>::iterator& current3, |
15228 | const ParamGenerator<T4>& g4, |
15229 | const typename ParamGenerator<T4>::iterator& current4, |
15230 | const ParamGenerator<T5>& g5, |
15231 | const typename ParamGenerator<T5>::iterator& current5, |
15232 | const ParamGenerator<T6>& g6, |
15233 | const typename ParamGenerator<T6>::iterator& current6, |
15234 | const ParamGenerator<T7>& g7, |
15235 | const typename ParamGenerator<T7>::iterator& current7, |
15236 | const ParamGenerator<T8>& g8, |
15237 | const typename ParamGenerator<T8>::iterator& current8, |
15238 | const ParamGenerator<T9>& g9, |
15239 | const typename ParamGenerator<T9>::iterator& current9, |
15240 | const ParamGenerator<T10>& g10, |
15241 | const typename ParamGenerator<T10>::iterator& current10) |
15242 | : base_(base), |
15243 | begin1_(g1.begin()), end1_(g1.end()), current1_(current1), |
15244 | begin2_(g2.begin()), end2_(g2.end()), current2_(current2), |
15245 | begin3_(g3.begin()), end3_(g3.end()), current3_(current3), |
15246 | begin4_(g4.begin()), end4_(g4.end()), current4_(current4), |
15247 | begin5_(g5.begin()), end5_(g5.end()), current5_(current5), |
15248 | begin6_(g6.begin()), end6_(g6.end()), current6_(current6), |
15249 | begin7_(g7.begin()), end7_(g7.end()), current7_(current7), |
15250 | begin8_(g8.begin()), end8_(g8.end()), current8_(current8), |
15251 | begin9_(g9.begin()), end9_(g9.end()), current9_(current9), |
15252 | begin10_(g10.begin()), end10_(g10.end()), current10_(current10) { |
15253 | ComputeCurrentValue(); |
15254 | } |
15255 | virtual ~Iterator() {} |
15256 | |
15257 | virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const { |
15258 | return base_; |
15259 | } |
15260 | // Advance should not be called on beyond-of-range iterators |
15261 | // so no component iterators must be beyond end of range, either. |
15262 | virtual void Advance() { |
15263 | assert(!AtEnd()); |
15264 | ++current10_; |
15265 | if (current10_ == end10_) { |
15266 | current10_ = begin10_; |
15267 | ++current9_; |
15268 | } |
15269 | if (current9_ == end9_) { |
15270 | current9_ = begin9_; |
15271 | ++current8_; |
15272 | } |
15273 | if (current8_ == end8_) { |
15274 | current8_ = begin8_; |
15275 | ++current7_; |
15276 | } |
15277 | if (current7_ == end7_) { |
15278 | current7_ = begin7_; |
15279 | ++current6_; |
15280 | } |
15281 | if (current6_ == end6_) { |
15282 | current6_ = begin6_; |
15283 | ++current5_; |
15284 | } |
15285 | if (current5_ == end5_) { |
15286 | current5_ = begin5_; |
15287 | ++current4_; |
15288 | } |
15289 | if (current4_ == end4_) { |
15290 | current4_ = begin4_; |
15291 | ++current3_; |
15292 | } |
15293 | if (current3_ == end3_) { |
15294 | current3_ = begin3_; |
15295 | ++current2_; |
15296 | } |
15297 | if (current2_ == end2_) { |
15298 | current2_ = begin2_; |
15299 | ++current1_; |
15300 | } |
15301 | ComputeCurrentValue(); |
15302 | } |
15303 | virtual ParamIteratorInterface<ParamType>* Clone() const { |
15304 | return new Iterator(*this); |
15305 | } |
15306 | virtual const ParamType* Current() const { return ¤t_value_; } |
15307 | virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const { |
15308 | // Having the same base generator guarantees that the other |
15309 | // iterator is of the same type and we can downcast. |
15310 | GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) |
15311 | << "The program attempted to compare iterators " |
15312 | << "from different generators." << std::endl; |
15313 | const Iterator* typed_other = |
15314 | CheckedDowncastToActualType<const Iterator>(&other); |
15315 | // We must report iterators equal if they both point beyond their |
15316 | // respective ranges. That can happen in a variety of fashions, |
15317 | // so we have to consult AtEnd(). |
15318 | return (AtEnd() && typed_other->AtEnd()) || |
15319 | ( |
15320 | current1_ == typed_other->current1_ && |
15321 | current2_ == typed_other->current2_ && |
15322 | current3_ == typed_other->current3_ && |
15323 | current4_ == typed_other->current4_ && |
15324 | current5_ == typed_other->current5_ && |
15325 | current6_ == typed_other->current6_ && |
15326 | current7_ == typed_other->current7_ && |
15327 | current8_ == typed_other->current8_ && |
15328 | current9_ == typed_other->current9_ && |
15329 | current10_ == typed_other->current10_); |
15330 | } |
15331 | |
15332 | private: |
15333 | Iterator(const Iterator& other) |
15334 | : base_(other.base_), |
15335 | begin1_(other.begin1_), |
15336 | end1_(other.end1_), |
15337 | current1_(other.current1_), |
15338 | begin2_(other.begin2_), |
15339 | end2_(other.end2_), |
15340 | current2_(other.current2_), |
15341 | begin3_(other.begin3_), |
15342 | end3_(other.end3_), |
15343 | current3_(other.current3_), |
15344 | begin4_(other.begin4_), |
15345 | end4_(other.end4_), |
15346 | current4_(other.current4_), |
15347 | begin5_(other.begin5_), |
15348 | end5_(other.end5_), |
15349 | current5_(other.current5_), |
15350 | begin6_(other.begin6_), |
15351 | end6_(other.end6_), |
15352 | current6_(other.current6_), |
15353 | begin7_(other.begin7_), |
15354 | end7_(other.end7_), |
15355 | current7_(other.current7_), |
15356 | begin8_(other.begin8_), |
15357 | end8_(other.end8_), |
15358 | current8_(other.current8_), |
15359 | begin9_(other.begin9_), |
15360 | end9_(other.end9_), |
15361 | current9_(other.current9_), |
15362 | begin10_(other.begin10_), |
15363 | end10_(other.end10_), |
15364 | current10_(other.current10_) { |
15365 | ComputeCurrentValue(); |
15366 | } |
15367 | |
15368 | void ComputeCurrentValue() { |
15369 | if (!AtEnd()) |
15370 | current_value_ = ParamType(*current1_, *current2_, *current3_, |
15371 | *current4_, *current5_, *current6_, *current7_, *current8_, |
15372 | *current9_, *current10_); |
15373 | } |
15374 | bool AtEnd() const { |
15375 | // We must report iterator past the end of the range when either of the |
15376 | // component iterators has reached the end of its range. |
15377 | return |
15378 | current1_ == end1_ || |
15379 | current2_ == end2_ || |
15380 | current3_ == end3_ || |
15381 | current4_ == end4_ || |
15382 | current5_ == end5_ || |
15383 | current6_ == end6_ || |
15384 | current7_ == end7_ || |
15385 | current8_ == end8_ || |
15386 | current9_ == end9_ || |
15387 | current10_ == end10_; |
15388 | } |
15389 | |
15390 | // No implementation - assignment is unsupported. |
15391 | void operator=(const Iterator& other); |
15392 | |
15393 | const ParamGeneratorInterface<ParamType>* const base_; |
15394 | // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. |
15395 | // current[i]_ is the actual traversing iterator. |
15396 | const typename ParamGenerator<T1>::iterator begin1_; |
15397 | const typename ParamGenerator<T1>::iterator end1_; |
15398 | typename ParamGenerator<T1>::iterator current1_; |
15399 | const typename ParamGenerator<T2>::iterator begin2_; |
15400 | const typename ParamGenerator<T2>::iterator end2_; |
15401 | typename ParamGenerator<T2>::iterator current2_; |
15402 | const typename ParamGenerator<T3>::iterator begin3_; |
15403 | const typename ParamGenerator<T3>::iterator end3_; |
15404 | typename ParamGenerator<T3>::iterator current3_; |
15405 | const typename ParamGenerator<T4>::iterator begin4_; |
15406 | const typename ParamGenerator<T4>::iterator end4_; |
15407 | typename ParamGenerator<T4>::iterator current4_; |
15408 | const typename ParamGenerator<T5>::iterator begin5_; |
15409 | const typename ParamGenerator<T5>::iterator end5_; |
15410 | typename ParamGenerator<T5>::iterator current5_; |
15411 | const typename ParamGenerator<T6>::iterator begin6_; |
15412 | const typename ParamGenerator<T6>::iterator end6_; |
15413 | typename ParamGenerator<T6>::iterator current6_; |
15414 | const typename ParamGenerator<T7>::iterator begin7_; |
15415 | const typename ParamGenerator<T7>::iterator end7_; |
15416 | typename ParamGenerator<T7>::iterator current7_; |
15417 | const typename ParamGenerator<T8>::iterator begin8_; |
15418 | const typename ParamGenerator<T8>::iterator end8_; |
15419 | typename ParamGenerator<T8>::iterator current8_; |
15420 | const typename ParamGenerator<T9>::iterator begin9_; |
15421 | const typename ParamGenerator<T9>::iterator end9_; |
15422 | typename ParamGenerator<T9>::iterator current9_; |
15423 | const typename ParamGenerator<T10>::iterator begin10_; |
15424 | const typename ParamGenerator<T10>::iterator end10_; |
15425 | typename ParamGenerator<T10>::iterator current10_; |
15426 | ParamType current_value_; |
15427 | }; // class CartesianProductGenerator10::Iterator |
15428 | |
15429 | // No implementation - assignment is unsupported. |
15430 | void operator=(const CartesianProductGenerator10& other); |
15431 | |
15432 | const ParamGenerator<T1> g1_; |
15433 | const ParamGenerator<T2> g2_; |
15434 | const ParamGenerator<T3> g3_; |
15435 | const ParamGenerator<T4> g4_; |
15436 | const ParamGenerator<T5> g5_; |
15437 | const ParamGenerator<T6> g6_; |
15438 | const ParamGenerator<T7> g7_; |
15439 | const ParamGenerator<T8> g8_; |
15440 | const ParamGenerator<T9> g9_; |
15441 | const ParamGenerator<T10> g10_; |
15442 | }; // class CartesianProductGenerator10 |
15443 | |
15444 | |
15445 | // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. |
15446 | // |
15447 | // Helper classes providing Combine() with polymorphic features. They allow |
15448 | // casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is |
15449 | // convertible to U. |
15450 | // |
15451 | template <class Generator1, class Generator2> |
15452 | class CartesianProductHolder2 { |
15453 | public: |
15454 | CartesianProductHolder2(const Generator1& g1, const Generator2& g2) |
15455 | : g1_(g1), g2_(g2) {} |
15456 | template <typename T1, typename T2> |
15457 | operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const { |
15458 | return ParamGenerator< ::std::tr1::tuple<T1, T2> >( |
15459 | new CartesianProductGenerator2<T1, T2>( |
15460 | static_cast<ParamGenerator<T1> >(g1_), |
15461 | static_cast<ParamGenerator<T2> >(g2_))); |
15462 | } |
15463 | |
15464 | private: |
15465 | // No implementation - assignment is unsupported. |
15466 | void operator=(const CartesianProductHolder2& other); |
15467 | |
15468 | const Generator1 g1_; |
15469 | const Generator2 g2_; |
15470 | }; // class CartesianProductHolder2 |
15471 | |
15472 | template <class Generator1, class Generator2, class Generator3> |
15473 | class CartesianProductHolder3 { |
15474 | public: |
15475 | CartesianProductHolder3(const Generator1& g1, const Generator2& g2, |
15476 | const Generator3& g3) |
15477 | : g1_(g1), g2_(g2), g3_(g3) {} |
15478 | template <typename T1, typename T2, typename T3> |
15479 | operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const { |
15480 | return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >( |
15481 | new CartesianProductGenerator3<T1, T2, T3>( |
15482 | static_cast<ParamGenerator<T1> >(g1_), |
15483 | static_cast<ParamGenerator<T2> >(g2_), |
15484 | static_cast<ParamGenerator<T3> >(g3_))); |
15485 | } |
15486 | |
15487 | private: |
15488 | // No implementation - assignment is unsupported. |
15489 | void operator=(const CartesianProductHolder3& other); |
15490 | |
15491 | const Generator1 g1_; |
15492 | const Generator2 g2_; |
15493 | const Generator3 g3_; |
15494 | }; // class CartesianProductHolder3 |
15495 | |
15496 | template <class Generator1, class Generator2, class Generator3, |
15497 | class Generator4> |
15498 | class CartesianProductHolder4 { |
15499 | public: |
15500 | CartesianProductHolder4(const Generator1& g1, const Generator2& g2, |
15501 | const Generator3& g3, const Generator4& g4) |
15502 | : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {} |
15503 | template <typename T1, typename T2, typename T3, typename T4> |
15504 | operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const { |
15505 | return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >( |
15506 | new CartesianProductGenerator4<T1, T2, T3, T4>( |
15507 | static_cast<ParamGenerator<T1> >(g1_), |
15508 | static_cast<ParamGenerator<T2> >(g2_), |
15509 | static_cast<ParamGenerator<T3> >(g3_), |
15510 | static_cast<ParamGenerator<T4> >(g4_))); |
15511 | } |
15512 | |
15513 | private: |
15514 | // No implementation - assignment is unsupported. |
15515 | void operator=(const CartesianProductHolder4& other); |
15516 | |
15517 | const Generator1 g1_; |
15518 | const Generator2 g2_; |
15519 | const Generator3 g3_; |
15520 | const Generator4 g4_; |
15521 | }; // class CartesianProductHolder4 |
15522 | |
15523 | template <class Generator1, class Generator2, class Generator3, |
15524 | class Generator4, class Generator5> |
15525 | class CartesianProductHolder5 { |
15526 | public: |
15527 | CartesianProductHolder5(const Generator1& g1, const Generator2& g2, |
15528 | const Generator3& g3, const Generator4& g4, const Generator5& g5) |
15529 | : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {} |
15530 | template <typename T1, typename T2, typename T3, typename T4, typename T5> |
15531 | operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const { |
15532 | return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >( |
15533 | new CartesianProductGenerator5<T1, T2, T3, T4, T5>( |
15534 | static_cast<ParamGenerator<T1> >(g1_), |
15535 | static_cast<ParamGenerator<T2> >(g2_), |
15536 | static_cast<ParamGenerator<T3> >(g3_), |
15537 | static_cast<ParamGenerator<T4> >(g4_), |
15538 | static_cast<ParamGenerator<T5> >(g5_))); |
15539 | } |
15540 | |
15541 | private: |
15542 | // No implementation - assignment is unsupported. |
15543 | void operator=(const CartesianProductHolder5& other); |
15544 | |
15545 | const Generator1 g1_; |
15546 | const Generator2 g2_; |
15547 | const Generator3 g3_; |
15548 | const Generator4 g4_; |
15549 | const Generator5 g5_; |
15550 | }; // class CartesianProductHolder5 |
15551 | |
15552 | template <class Generator1, class Generator2, class Generator3, |
15553 | class Generator4, class Generator5, class Generator6> |
15554 | class CartesianProductHolder6 { |
15555 | public: |
15556 | CartesianProductHolder6(const Generator1& g1, const Generator2& g2, |
15557 | const Generator3& g3, const Generator4& g4, const Generator5& g5, |
15558 | const Generator6& g6) |
15559 | : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {} |
15560 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
15561 | typename T6> |
15562 | operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const { |
15563 | return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >( |
15564 | new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>( |
15565 | static_cast<ParamGenerator<T1> >(g1_), |
15566 | static_cast<ParamGenerator<T2> >(g2_), |
15567 | static_cast<ParamGenerator<T3> >(g3_), |
15568 | static_cast<ParamGenerator<T4> >(g4_), |
15569 | static_cast<ParamGenerator<T5> >(g5_), |
15570 | static_cast<ParamGenerator<T6> >(g6_))); |
15571 | } |
15572 | |
15573 | private: |
15574 | // No implementation - assignment is unsupported. |
15575 | void operator=(const CartesianProductHolder6& other); |
15576 | |
15577 | const Generator1 g1_; |
15578 | const Generator2 g2_; |
15579 | const Generator3 g3_; |
15580 | const Generator4 g4_; |
15581 | const Generator5 g5_; |
15582 | const Generator6 g6_; |
15583 | }; // class CartesianProductHolder6 |
15584 | |
15585 | template <class Generator1, class Generator2, class Generator3, |
15586 | class Generator4, class Generator5, class Generator6, class Generator7> |
15587 | class CartesianProductHolder7 { |
15588 | public: |
15589 | CartesianProductHolder7(const Generator1& g1, const Generator2& g2, |
15590 | const Generator3& g3, const Generator4& g4, const Generator5& g5, |
15591 | const Generator6& g6, const Generator7& g7) |
15592 | : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {} |
15593 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
15594 | typename T6, typename T7> |
15595 | operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, |
15596 | T7> >() const { |
15597 | return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >( |
15598 | new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>( |
15599 | static_cast<ParamGenerator<T1> >(g1_), |
15600 | static_cast<ParamGenerator<T2> >(g2_), |
15601 | static_cast<ParamGenerator<T3> >(g3_), |
15602 | static_cast<ParamGenerator<T4> >(g4_), |
15603 | static_cast<ParamGenerator<T5> >(g5_), |
15604 | static_cast<ParamGenerator<T6> >(g6_), |
15605 | static_cast<ParamGenerator<T7> >(g7_))); |
15606 | } |
15607 | |
15608 | private: |
15609 | // No implementation - assignment is unsupported. |
15610 | void operator=(const CartesianProductHolder7& other); |
15611 | |
15612 | const Generator1 g1_; |
15613 | const Generator2 g2_; |
15614 | const Generator3 g3_; |
15615 | const Generator4 g4_; |
15616 | const Generator5 g5_; |
15617 | const Generator6 g6_; |
15618 | const Generator7 g7_; |
15619 | }; // class CartesianProductHolder7 |
15620 | |
15621 | template <class Generator1, class Generator2, class Generator3, |
15622 | class Generator4, class Generator5, class Generator6, class Generator7, |
15623 | class Generator8> |
15624 | class CartesianProductHolder8 { |
15625 | public: |
15626 | CartesianProductHolder8(const Generator1& g1, const Generator2& g2, |
15627 | const Generator3& g3, const Generator4& g4, const Generator5& g5, |
15628 | const Generator6& g6, const Generator7& g7, const Generator8& g8) |
15629 | : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), |
15630 | g8_(g8) {} |
15631 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
15632 | typename T6, typename T7, typename T8> |
15633 | operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, |
15634 | T8> >() const { |
15635 | return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >( |
15636 | new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>( |
15637 | static_cast<ParamGenerator<T1> >(g1_), |
15638 | static_cast<ParamGenerator<T2> >(g2_), |
15639 | static_cast<ParamGenerator<T3> >(g3_), |
15640 | static_cast<ParamGenerator<T4> >(g4_), |
15641 | static_cast<ParamGenerator<T5> >(g5_), |
15642 | static_cast<ParamGenerator<T6> >(g6_), |
15643 | static_cast<ParamGenerator<T7> >(g7_), |
15644 | static_cast<ParamGenerator<T8> >(g8_))); |
15645 | } |
15646 | |
15647 | private: |
15648 | // No implementation - assignment is unsupported. |
15649 | void operator=(const CartesianProductHolder8& other); |
15650 | |
15651 | const Generator1 g1_; |
15652 | const Generator2 g2_; |
15653 | const Generator3 g3_; |
15654 | const Generator4 g4_; |
15655 | const Generator5 g5_; |
15656 | const Generator6 g6_; |
15657 | const Generator7 g7_; |
15658 | const Generator8 g8_; |
15659 | }; // class CartesianProductHolder8 |
15660 | |
15661 | template <class Generator1, class Generator2, class Generator3, |
15662 | class Generator4, class Generator5, class Generator6, class Generator7, |
15663 | class Generator8, class Generator9> |
15664 | class CartesianProductHolder9 { |
15665 | public: |
15666 | CartesianProductHolder9(const Generator1& g1, const Generator2& g2, |
15667 | const Generator3& g3, const Generator4& g4, const Generator5& g5, |
15668 | const Generator6& g6, const Generator7& g7, const Generator8& g8, |
15669 | const Generator9& g9) |
15670 | : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), |
15671 | g9_(g9) {} |
15672 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
15673 | typename T6, typename T7, typename T8, typename T9> |
15674 | operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, |
15675 | T9> >() const { |
15676 | return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, |
15677 | T9> >( |
15678 | new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>( |
15679 | static_cast<ParamGenerator<T1> >(g1_), |
15680 | static_cast<ParamGenerator<T2> >(g2_), |
15681 | static_cast<ParamGenerator<T3> >(g3_), |
15682 | static_cast<ParamGenerator<T4> >(g4_), |
15683 | static_cast<ParamGenerator<T5> >(g5_), |
15684 | static_cast<ParamGenerator<T6> >(g6_), |
15685 | static_cast<ParamGenerator<T7> >(g7_), |
15686 | static_cast<ParamGenerator<T8> >(g8_), |
15687 | static_cast<ParamGenerator<T9> >(g9_))); |
15688 | } |
15689 | |
15690 | private: |
15691 | // No implementation - assignment is unsupported. |
15692 | void operator=(const CartesianProductHolder9& other); |
15693 | |
15694 | const Generator1 g1_; |
15695 | const Generator2 g2_; |
15696 | const Generator3 g3_; |
15697 | const Generator4 g4_; |
15698 | const Generator5 g5_; |
15699 | const Generator6 g6_; |
15700 | const Generator7 g7_; |
15701 | const Generator8 g8_; |
15702 | const Generator9 g9_; |
15703 | }; // class CartesianProductHolder9 |
15704 | |
15705 | template <class Generator1, class Generator2, class Generator3, |
15706 | class Generator4, class Generator5, class Generator6, class Generator7, |
15707 | class Generator8, class Generator9, class Generator10> |
15708 | class CartesianProductHolder10 { |
15709 | public: |
15710 | CartesianProductHolder10(const Generator1& g1, const Generator2& g2, |
15711 | const Generator3& g3, const Generator4& g4, const Generator5& g5, |
15712 | const Generator6& g6, const Generator7& g7, const Generator8& g8, |
15713 | const Generator9& g9, const Generator10& g10) |
15714 | : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), |
15715 | g9_(g9), g10_(g10) {} |
15716 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
15717 | typename T6, typename T7, typename T8, typename T9, typename T10> |
15718 | operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, |
15719 | T9, T10> >() const { |
15720 | return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, |
15721 | T9, T10> >( |
15722 | new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9, |
15723 | T10>( |
15724 | static_cast<ParamGenerator<T1> >(g1_), |
15725 | static_cast<ParamGenerator<T2> >(g2_), |
15726 | static_cast<ParamGenerator<T3> >(g3_), |
15727 | static_cast<ParamGenerator<T4> >(g4_), |
15728 | static_cast<ParamGenerator<T5> >(g5_), |
15729 | static_cast<ParamGenerator<T6> >(g6_), |
15730 | static_cast<ParamGenerator<T7> >(g7_), |
15731 | static_cast<ParamGenerator<T8> >(g8_), |
15732 | static_cast<ParamGenerator<T9> >(g9_), |
15733 | static_cast<ParamGenerator<T10> >(g10_))); |
15734 | } |
15735 | |
15736 | private: |
15737 | // No implementation - assignment is unsupported. |
15738 | void operator=(const CartesianProductHolder10& other); |
15739 | |
15740 | const Generator1 g1_; |
15741 | const Generator2 g2_; |
15742 | const Generator3 g3_; |
15743 | const Generator4 g4_; |
15744 | const Generator5 g5_; |
15745 | const Generator6 g6_; |
15746 | const Generator7 g7_; |
15747 | const Generator8 g8_; |
15748 | const Generator9 g9_; |
15749 | const Generator10 g10_; |
15750 | }; // class CartesianProductHolder10 |
15751 | |
15752 | # endif // GTEST_HAS_COMBINE |
15753 | |
15754 | } // namespace internal |
15755 | } // namespace testing |
15756 | |
15757 | #endif // GTEST_HAS_PARAM_TEST |
15758 | |
15759 | #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ |
15760 | |
15761 | #if GTEST_HAS_PARAM_TEST |
15762 | |
15763 | namespace testing { |
15764 | |
15765 | // Functions producing parameter generators. |
15766 | // |
15767 | // Google Test uses these generators to produce parameters for value- |
15768 | // parameterized tests. When a parameterized test case is instantiated |
15769 | // with a particular generator, Google Test creates and runs tests |
15770 | // for each element in the sequence produced by the generator. |
15771 | // |
15772 | // In the following sample, tests from test case FooTest are instantiated |
15773 | // each three times with parameter values 3, 5, and 8: |
15774 | // |
15775 | // class FooTest : public TestWithParam<int> { ... }; |
15776 | // |
15777 | // TEST_P(FooTest, TestThis) { |
15778 | // } |
15779 | // TEST_P(FooTest, TestThat) { |
15780 | // } |
15781 | // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8)); |
15782 | // |
15783 | |
15784 | // Range() returns generators providing sequences of values in a range. |
15785 | // |
15786 | // Synopsis: |
15787 | // Range(start, end) |
15788 | // - returns a generator producing a sequence of values {start, start+1, |
15789 | // start+2, ..., }. |
15790 | // Range(start, end, step) |
15791 | // - returns a generator producing a sequence of values {start, start+step, |
15792 | // start+step+step, ..., }. |
15793 | // Notes: |
15794 | // * The generated sequences never include end. For example, Range(1, 5) |
15795 | // returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2) |
15796 | // returns a generator producing {1, 3, 5, 7}. |
15797 | // * start and end must have the same type. That type may be any integral or |
15798 | // floating-point type or a user defined type satisfying these conditions: |
15799 | // * It must be assignable (have operator=() defined). |
15800 | // * It must have operator+() (operator+(int-compatible type) for |
15801 | // two-operand version). |
15802 | // * It must have operator<() defined. |
15803 | // Elements in the resulting sequences will also have that type. |
15804 | // * Condition start < end must be satisfied in order for resulting sequences |
15805 | // to contain any elements. |
15806 | // |
15807 | template <typename T, typename IncrementT> |
15808 | internal::ParamGenerator<T> Range(T start, T end, IncrementT step) { |
15809 | return internal::ParamGenerator<T>( |
15810 | new internal::RangeGenerator<T, IncrementT>(start, end, step)); |
15811 | } |
15812 | |
15813 | template <typename T> |
15814 | internal::ParamGenerator<T> Range(T start, T end) { |
15815 | return Range(start, end, 1); |
15816 | } |
15817 | |
15818 | // ValuesIn() function allows generation of tests with parameters coming from |
15819 | // a container. |
15820 | // |
15821 | // Synopsis: |
15822 | // ValuesIn(const T (&array)[N]) |
15823 | // - returns a generator producing sequences with elements from |
15824 | // a C-style array. |
15825 | // ValuesIn(const Container& container) |
15826 | // - returns a generator producing sequences with elements from |
15827 | // an STL-style container. |
15828 | // ValuesIn(Iterator begin, Iterator end) |
15829 | // - returns a generator producing sequences with elements from |
15830 | // a range [begin, end) defined by a pair of STL-style iterators. These |
15831 | // iterators can also be plain C pointers. |
15832 | // |
15833 | // Please note that ValuesIn copies the values from the containers |
15834 | // passed in and keeps them to generate tests in RUN_ALL_TESTS(). |
15835 | // |
15836 | // Examples: |
15837 | // |
15838 | // This instantiates tests from test case StringTest |
15839 | // each with C-string values of "foo", "bar", and "baz": |
15840 | // |
15841 | // const char* strings[] = {"foo", "bar", "baz"}; |
15842 | // INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings)); |
15843 | // |
15844 | // This instantiates tests from test case StlStringTest |
15845 | // each with STL strings with values "a" and "b": |
15846 | // |
15847 | // ::std::vector< ::std::string> GetParameterStrings() { |
15848 | // ::std::vector< ::std::string> v; |
15849 | // v.push_back("a"); |
15850 | // v.push_back("b"); |
15851 | // return v; |
15852 | // } |
15853 | // |
15854 | // INSTANTIATE_TEST_CASE_P(CharSequence, |
15855 | // StlStringTest, |
15856 | // ValuesIn(GetParameterStrings())); |
15857 | // |
15858 | // |
15859 | // This will also instantiate tests from CharTest |
15860 | // each with parameter values 'a' and 'b': |
15861 | // |
15862 | // ::std::list<char> GetParameterChars() { |
15863 | // ::std::list<char> list; |
15864 | // list.push_back('a'); |
15865 | // list.push_back('b'); |
15866 | // return list; |
15867 | // } |
15868 | // ::std::list<char> l = GetParameterChars(); |
15869 | // INSTANTIATE_TEST_CASE_P(CharSequence2, |
15870 | // CharTest, |
15871 | // ValuesIn(l.begin(), l.end())); |
15872 | // |
15873 | template <typename ForwardIterator> |
15874 | internal::ParamGenerator< |
15875 | typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type> |
15876 | ValuesIn(ForwardIterator begin, ForwardIterator end) { |
15877 | typedef typename ::testing::internal::IteratorTraits<ForwardIterator> |
15878 | ::value_type ParamType; |
15879 | return internal::ParamGenerator<ParamType>( |
15880 | new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end)); |
15881 | } |
15882 | |
15883 | template <typename T, size_t N> |
15884 | internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) { |
15885 | return ValuesIn(array, array + N); |
15886 | } |
15887 | |
15888 | template <class Container> |
15889 | internal::ParamGenerator<typename Container::value_type> ValuesIn( |
15890 | const Container& container) { |
15891 | return ValuesIn(container.begin(), container.end()); |
15892 | } |
15893 | |
15894 | // Values() allows generating tests from explicitly specified list of |
15895 | // parameters. |
15896 | // |
15897 | // Synopsis: |
15898 | // Values(T v1, T v2, ..., T vN) |
15899 | // - returns a generator producing sequences with elements v1, v2, ..., vN. |
15900 | // |
15901 | // For example, this instantiates tests from test case BarTest each |
15902 | // with values "one", "two", and "three": |
15903 | // |
15904 | // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); |
15905 | // |
15906 | // This instantiates tests from test case BazTest each with values 1, 2, 3.5. |
15907 | // The exact type of values will depend on the type of parameter in BazTest. |
15908 | // |
15909 | // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); |
15910 | // |
15911 | // Currently, Values() supports from 1 to 50 parameters. |
15912 | // |
15913 | template <typename T1> |
15914 | internal::ValueArray1<T1> Values(T1 v1) { |
15915 | return internal::ValueArray1<T1>(v1); |
15916 | } |
15917 | |
15918 | template <typename T1, typename T2> |
15919 | internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) { |
15920 | return internal::ValueArray2<T1, T2>(v1, v2); |
15921 | } |
15922 | |
15923 | template <typename T1, typename T2, typename T3> |
15924 | internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) { |
15925 | return internal::ValueArray3<T1, T2, T3>(v1, v2, v3); |
15926 | } |
15927 | |
15928 | template <typename T1, typename T2, typename T3, typename T4> |
15929 | internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) { |
15930 | return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4); |
15931 | } |
15932 | |
15933 | template <typename T1, typename T2, typename T3, typename T4, typename T5> |
15934 | internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4, |
15935 | T5 v5) { |
15936 | return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5); |
15937 | } |
15938 | |
15939 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
15940 | typename T6> |
15941 | internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3, |
15942 | T4 v4, T5 v5, T6 v6) { |
15943 | return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6); |
15944 | } |
15945 | |
15946 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
15947 | typename T6, typename T7> |
15948 | internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3, |
15949 | T4 v4, T5 v5, T6 v6, T7 v7) { |
15950 | return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5, |
15951 | v6, v7); |
15952 | } |
15953 | |
15954 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
15955 | typename T6, typename T7, typename T8> |
15956 | internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2, |
15957 | T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { |
15958 | return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4, |
15959 | v5, v6, v7, v8); |
15960 | } |
15961 | |
15962 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
15963 | typename T6, typename T7, typename T8, typename T9> |
15964 | internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2, |
15965 | T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { |
15966 | return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3, |
15967 | v4, v5, v6, v7, v8, v9); |
15968 | } |
15969 | |
15970 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
15971 | typename T6, typename T7, typename T8, typename T9, typename T10> |
15972 | internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1, |
15973 | T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { |
15974 | return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1, |
15975 | v2, v3, v4, v5, v6, v7, v8, v9, v10); |
15976 | } |
15977 | |
15978 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
15979 | typename T6, typename T7, typename T8, typename T9, typename T10, |
15980 | typename T11> |
15981 | internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, |
15982 | T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
15983 | T10 v10, T11 v11) { |
15984 | return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, |
15985 | T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); |
15986 | } |
15987 | |
15988 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
15989 | typename T6, typename T7, typename T8, typename T9, typename T10, |
15990 | typename T11, typename T12> |
15991 | internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
15992 | T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
15993 | T10 v10, T11 v11, T12 v12) { |
15994 | return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
15995 | T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); |
15996 | } |
15997 | |
15998 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
15999 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16000 | typename T11, typename T12, typename T13> |
16001 | internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, |
16002 | T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
16003 | T10 v10, T11 v11, T12 v12, T13 v13) { |
16004 | return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16005 | T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); |
16006 | } |
16007 | |
16008 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16009 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16010 | typename T11, typename T12, typename T13, typename T14> |
16011 | internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16012 | T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
16013 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { |
16014 | return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16015 | T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, |
16016 | v14); |
16017 | } |
16018 | |
16019 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16020 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16021 | typename T11, typename T12, typename T13, typename T14, typename T15> |
16022 | internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16023 | T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, |
16024 | T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { |
16025 | return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16026 | T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, |
16027 | v13, v14, v15); |
16028 | } |
16029 | |
16030 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16031 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16032 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16033 | typename T16> |
16034 | internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16035 | T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, |
16036 | T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
16037 | T16 v16) { |
16038 | return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16039 | T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, |
16040 | v12, v13, v14, v15, v16); |
16041 | } |
16042 | |
16043 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16044 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16045 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16046 | typename T16, typename T17> |
16047 | internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16048 | T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, |
16049 | T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
16050 | T16 v16, T17 v17) { |
16051 | return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16052 | T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, |
16053 | v11, v12, v13, v14, v15, v16, v17); |
16054 | } |
16055 | |
16056 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16057 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16058 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16059 | typename T16, typename T17, typename T18> |
16060 | internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16061 | T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, |
16062 | T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
16063 | T16 v16, T17 v17, T18 v18) { |
16064 | return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16065 | T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9, |
16066 | v10, v11, v12, v13, v14, v15, v16, v17, v18); |
16067 | } |
16068 | |
16069 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16070 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16071 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16072 | typename T16, typename T17, typename T18, typename T19> |
16073 | internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16074 | T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, |
16075 | T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, |
16076 | T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) { |
16077 | return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16078 | T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8, |
16079 | v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); |
16080 | } |
16081 | |
16082 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16083 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16084 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16085 | typename T16, typename T17, typename T18, typename T19, typename T20> |
16086 | internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16087 | T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4, |
16088 | T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, |
16089 | T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) { |
16090 | return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16091 | T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7, |
16092 | v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); |
16093 | } |
16094 | |
16095 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16096 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16097 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16098 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16099 | typename T21> |
16100 | internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16101 | T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4, |
16102 | T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, |
16103 | T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) { |
16104 | return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16105 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6, |
16106 | v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); |
16107 | } |
16108 | |
16109 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16110 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16111 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16112 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16113 | typename T21, typename T22> |
16114 | internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16115 | T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3, |
16116 | T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, |
16117 | T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, |
16118 | T21 v21, T22 v22) { |
16119 | return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16120 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4, |
16121 | v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, |
16122 | v20, v21, v22); |
16123 | } |
16124 | |
16125 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16126 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16127 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16128 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16129 | typename T21, typename T22, typename T23> |
16130 | internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16131 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2, |
16132 | T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, |
16133 | T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, |
16134 | T21 v21, T22 v22, T23 v23) { |
16135 | return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16136 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3, |
16137 | v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, |
16138 | v20, v21, v22, v23); |
16139 | } |
16140 | |
16141 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16142 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16143 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16144 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16145 | typename T21, typename T22, typename T23, typename T24> |
16146 | internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16147 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2, |
16148 | T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, |
16149 | T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, |
16150 | T21 v21, T22 v22, T23 v23, T24 v24) { |
16151 | return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16152 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2, |
16153 | v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, |
16154 | v19, v20, v21, v22, v23, v24); |
16155 | } |
16156 | |
16157 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16158 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16159 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16160 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16161 | typename T21, typename T22, typename T23, typename T24, typename T25> |
16162 | internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16163 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1, |
16164 | T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, |
16165 | T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, |
16166 | T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) { |
16167 | return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16168 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1, |
16169 | v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, |
16170 | v18, v19, v20, v21, v22, v23, v24, v25); |
16171 | } |
16172 | |
16173 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16174 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16175 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16176 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16177 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16178 | typename T26> |
16179 | internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16180 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16181 | T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
16182 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
16183 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
16184 | T26 v26) { |
16185 | return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16186 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16187 | T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, |
16188 | v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); |
16189 | } |
16190 | |
16191 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16192 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16193 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16194 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16195 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16196 | typename T26, typename T27> |
16197 | internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16198 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, |
16199 | T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
16200 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
16201 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
16202 | T26 v26, T27 v27) { |
16203 | return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16204 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16205 | T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, |
16206 | v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); |
16207 | } |
16208 | |
16209 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16210 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16211 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16212 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16213 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16214 | typename T26, typename T27, typename T28> |
16215 | internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16216 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, |
16217 | T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
16218 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
16219 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
16220 | T26 v26, T27 v27, T28 v28) { |
16221 | return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16222 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16223 | T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, |
16224 | v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, |
16225 | v28); |
16226 | } |
16227 | |
16228 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16229 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16230 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16231 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16232 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16233 | typename T26, typename T27, typename T28, typename T29> |
16234 | internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16235 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16236 | T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
16237 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
16238 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
16239 | T26 v26, T27 v27, T28 v28, T29 v29) { |
16240 | return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16241 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16242 | T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, |
16243 | v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, |
16244 | v27, v28, v29); |
16245 | } |
16246 | |
16247 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16248 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16249 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16250 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16251 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16252 | typename T26, typename T27, typename T28, typename T29, typename T30> |
16253 | internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16254 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16255 | T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, |
16256 | T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, |
16257 | T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, |
16258 | T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) { |
16259 | return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16260 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16261 | T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, |
16262 | v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, |
16263 | v26, v27, v28, v29, v30); |
16264 | } |
16265 | |
16266 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16267 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16268 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16269 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16270 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16271 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16272 | typename T31> |
16273 | internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16274 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16275 | T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, |
16276 | T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
16277 | T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, |
16278 | T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) { |
16279 | return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16280 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16281 | T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, |
16282 | v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, |
16283 | v25, v26, v27, v28, v29, v30, v31); |
16284 | } |
16285 | |
16286 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16287 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16288 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16289 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16290 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16291 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16292 | typename T31, typename T32> |
16293 | internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16294 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16295 | T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, |
16296 | T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
16297 | T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, |
16298 | T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, |
16299 | T32 v32) { |
16300 | return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16301 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16302 | T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9, |
16303 | v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, |
16304 | v24, v25, v26, v27, v28, v29, v30, v31, v32); |
16305 | } |
16306 | |
16307 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16308 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16309 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16310 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16311 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16312 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16313 | typename T31, typename T32, typename T33> |
16314 | internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16315 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16316 | T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, |
16317 | T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
16318 | T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, |
16319 | T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, |
16320 | T32 v32, T33 v33) { |
16321 | return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16322 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16323 | T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8, |
16324 | v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, |
16325 | v24, v25, v26, v27, v28, v29, v30, v31, v32, v33); |
16326 | } |
16327 | |
16328 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16329 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16330 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16331 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16332 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16333 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16334 | typename T31, typename T32, typename T33, typename T34> |
16335 | internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16336 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16337 | T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, |
16338 | T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, |
16339 | T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, |
16340 | T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, |
16341 | T31 v31, T32 v32, T33 v33, T34 v34) { |
16342 | return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16343 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16344 | T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7, |
16345 | v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, |
16346 | v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34); |
16347 | } |
16348 | |
16349 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16350 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16351 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16352 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16353 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16354 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16355 | typename T31, typename T32, typename T33, typename T34, typename T35> |
16356 | internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16357 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16358 | T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4, |
16359 | T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, |
16360 | T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, |
16361 | T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, |
16362 | T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) { |
16363 | return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16364 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16365 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6, |
16366 | v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, |
16367 | v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35); |
16368 | } |
16369 | |
16370 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16371 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16372 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16373 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16374 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16375 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16376 | typename T31, typename T32, typename T33, typename T34, typename T35, |
16377 | typename T36> |
16378 | internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16379 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16380 | T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4, |
16381 | T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, |
16382 | T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, |
16383 | T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, |
16384 | T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) { |
16385 | return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16386 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16387 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4, |
16388 | v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, |
16389 | v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, |
16390 | v34, v35, v36); |
16391 | } |
16392 | |
16393 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16394 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16395 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16396 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16397 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16398 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16399 | typename T31, typename T32, typename T33, typename T34, typename T35, |
16400 | typename T36, typename T37> |
16401 | internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16402 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16403 | T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3, |
16404 | T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, |
16405 | T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, |
16406 | T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, |
16407 | T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, |
16408 | T37 v37) { |
16409 | return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16410 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16411 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3, |
16412 | v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, |
16413 | v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, |
16414 | v34, v35, v36, v37); |
16415 | } |
16416 | |
16417 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16418 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16419 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16420 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16421 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16422 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16423 | typename T31, typename T32, typename T33, typename T34, typename T35, |
16424 | typename T36, typename T37, typename T38> |
16425 | internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16426 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16427 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2, |
16428 | T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, |
16429 | T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, |
16430 | T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, |
16431 | T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, |
16432 | T37 v37, T38 v38) { |
16433 | return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16434 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16435 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2, |
16436 | v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, |
16437 | v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, |
16438 | v33, v34, v35, v36, v37, v38); |
16439 | } |
16440 | |
16441 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16442 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16443 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16444 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16445 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16446 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16447 | typename T31, typename T32, typename T33, typename T34, typename T35, |
16448 | typename T36, typename T37, typename T38, typename T39> |
16449 | internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16450 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16451 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2, |
16452 | T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, |
16453 | T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, |
16454 | T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, |
16455 | T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, |
16456 | T37 v37, T38 v38, T39 v39) { |
16457 | return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16458 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16459 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1, |
16460 | v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, |
16461 | v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, |
16462 | v32, v33, v34, v35, v36, v37, v38, v39); |
16463 | } |
16464 | |
16465 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16466 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16467 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16468 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16469 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16470 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16471 | typename T31, typename T32, typename T33, typename T34, typename T35, |
16472 | typename T36, typename T37, typename T38, typename T39, typename T40> |
16473 | internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16474 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16475 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1, |
16476 | T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, |
16477 | T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, |
16478 | T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, |
16479 | T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, |
16480 | T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) { |
16481 | return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16482 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16483 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
16484 | T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, |
16485 | v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, |
16486 | v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40); |
16487 | } |
16488 | |
16489 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16490 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16491 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16492 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16493 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16494 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16495 | typename T31, typename T32, typename T33, typename T34, typename T35, |
16496 | typename T36, typename T37, typename T38, typename T39, typename T40, |
16497 | typename T41> |
16498 | internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16499 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16500 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, |
16501 | T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
16502 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
16503 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
16504 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
16505 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) { |
16506 | return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16507 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16508 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
16509 | T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, |
16510 | v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, |
16511 | v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41); |
16512 | } |
16513 | |
16514 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16515 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16516 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16517 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16518 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16519 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16520 | typename T31, typename T32, typename T33, typename T34, typename T35, |
16521 | typename T36, typename T37, typename T38, typename T39, typename T40, |
16522 | typename T41, typename T42> |
16523 | internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16524 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16525 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, |
16526 | T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
16527 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
16528 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
16529 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
16530 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, |
16531 | T42 v42) { |
16532 | return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16533 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16534 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
16535 | T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, |
16536 | v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, |
16537 | v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, |
16538 | v42); |
16539 | } |
16540 | |
16541 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16542 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16543 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16544 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16545 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16546 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16547 | typename T31, typename T32, typename T33, typename T34, typename T35, |
16548 | typename T36, typename T37, typename T38, typename T39, typename T40, |
16549 | typename T41, typename T42, typename T43> |
16550 | internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16551 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16552 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, |
16553 | T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
16554 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
16555 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
16556 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
16557 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, |
16558 | T42 v42, T43 v43) { |
16559 | return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16560 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16561 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
16562 | T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, |
16563 | v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, |
16564 | v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, |
16565 | v41, v42, v43); |
16566 | } |
16567 | |
16568 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16569 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16570 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16571 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16572 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16573 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16574 | typename T31, typename T32, typename T33, typename T34, typename T35, |
16575 | typename T36, typename T37, typename T38, typename T39, typename T40, |
16576 | typename T41, typename T42, typename T43, typename T44> |
16577 | internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16578 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16579 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
16580 | T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, |
16581 | T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, |
16582 | T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, |
16583 | T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, |
16584 | T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, |
16585 | T42 v42, T43 v43, T44 v44) { |
16586 | return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16587 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16588 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
16589 | T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, |
16590 | v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, |
16591 | v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, |
16592 | v40, v41, v42, v43, v44); |
16593 | } |
16594 | |
16595 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16596 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16597 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16598 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16599 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16600 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16601 | typename T31, typename T32, typename T33, typename T34, typename T35, |
16602 | typename T36, typename T37, typename T38, typename T39, typename T40, |
16603 | typename T41, typename T42, typename T43, typename T44, typename T45> |
16604 | internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16605 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16606 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
16607 | T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, |
16608 | T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, |
16609 | T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, |
16610 | T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, |
16611 | T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, |
16612 | T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) { |
16613 | return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16614 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16615 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
16616 | T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, |
16617 | v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, |
16618 | v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, |
16619 | v39, v40, v41, v42, v43, v44, v45); |
16620 | } |
16621 | |
16622 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16623 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16624 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16625 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16626 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16627 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16628 | typename T31, typename T32, typename T33, typename T34, typename T35, |
16629 | typename T36, typename T37, typename T38, typename T39, typename T40, |
16630 | typename T41, typename T42, typename T43, typename T44, typename T45, |
16631 | typename T46> |
16632 | internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16633 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16634 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
16635 | T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, |
16636 | T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
16637 | T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, |
16638 | T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, |
16639 | T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, |
16640 | T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) { |
16641 | return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16642 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16643 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
16644 | T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9, |
16645 | v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, |
16646 | v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, |
16647 | v38, v39, v40, v41, v42, v43, v44, v45, v46); |
16648 | } |
16649 | |
16650 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16651 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16652 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16653 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16654 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16655 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16656 | typename T31, typename T32, typename T33, typename T34, typename T35, |
16657 | typename T36, typename T37, typename T38, typename T39, typename T40, |
16658 | typename T41, typename T42, typename T43, typename T44, typename T45, |
16659 | typename T46, typename T47> |
16660 | internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16661 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16662 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
16663 | T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, |
16664 | T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
16665 | T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, |
16666 | T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, |
16667 | T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, |
16668 | T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) { |
16669 | return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16670 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16671 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
16672 | T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8, |
16673 | v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, |
16674 | v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, |
16675 | v38, v39, v40, v41, v42, v43, v44, v45, v46, v47); |
16676 | } |
16677 | |
16678 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16679 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16680 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16681 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16682 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16683 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16684 | typename T31, typename T32, typename T33, typename T34, typename T35, |
16685 | typename T36, typename T37, typename T38, typename T39, typename T40, |
16686 | typename T41, typename T42, typename T43, typename T44, typename T45, |
16687 | typename T46, typename T47, typename T48> |
16688 | internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16689 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16690 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
16691 | T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, |
16692 | T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, |
16693 | T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, |
16694 | T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, |
16695 | T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, |
16696 | T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, |
16697 | T48 v48) { |
16698 | return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16699 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16700 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
16701 | T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7, |
16702 | v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, |
16703 | v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, |
16704 | v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48); |
16705 | } |
16706 | |
16707 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16708 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16709 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16710 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16711 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16712 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16713 | typename T31, typename T32, typename T33, typename T34, typename T35, |
16714 | typename T36, typename T37, typename T38, typename T39, typename T40, |
16715 | typename T41, typename T42, typename T43, typename T44, typename T45, |
16716 | typename T46, typename T47, typename T48, typename T49> |
16717 | internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16718 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16719 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
16720 | T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, |
16721 | T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, |
16722 | T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, |
16723 | T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, |
16724 | T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, |
16725 | T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, |
16726 | T47 v47, T48 v48, T49 v49) { |
16727 | return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16728 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16729 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
16730 | T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6, |
16731 | v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, |
16732 | v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, |
16733 | v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49); |
16734 | } |
16735 | |
16736 | template <typename T1, typename T2, typename T3, typename T4, typename T5, |
16737 | typename T6, typename T7, typename T8, typename T9, typename T10, |
16738 | typename T11, typename T12, typename T13, typename T14, typename T15, |
16739 | typename T16, typename T17, typename T18, typename T19, typename T20, |
16740 | typename T21, typename T22, typename T23, typename T24, typename T25, |
16741 | typename T26, typename T27, typename T28, typename T29, typename T30, |
16742 | typename T31, typename T32, typename T33, typename T34, typename T35, |
16743 | typename T36, typename T37, typename T38, typename T39, typename T40, |
16744 | typename T41, typename T42, typename T43, typename T44, typename T45, |
16745 | typename T46, typename T47, typename T48, typename T49, typename T50> |
16746 | internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, |
16747 | T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, |
16748 | T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, |
16749 | T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4, |
16750 | T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, |
16751 | T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, |
16752 | T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, |
16753 | T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, |
16754 | T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, |
16755 | T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) { |
16756 | return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, |
16757 | T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, |
16758 | T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, |
16759 | T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4, |
16760 | v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, |
16761 | v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, |
16762 | v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, |
16763 | v48, v49, v50); |
16764 | } |
16765 | |
16766 | // Bool() allows generating tests with parameters in a set of (false, true). |
16767 | // |
16768 | // Synopsis: |
16769 | // Bool() |
16770 | // - returns a generator producing sequences with elements {false, true}. |
16771 | // |
16772 | // It is useful when testing code that depends on Boolean flags. Combinations |
16773 | // of multiple flags can be tested when several Bool()'s are combined using |
16774 | // Combine() function. |
16775 | // |
16776 | // In the following example all tests in the test case FlagDependentTest |
16777 | // will be instantiated twice with parameters false and true. |
16778 | // |
16779 | // class FlagDependentTest : public testing::TestWithParam<bool> { |
16780 | // virtual void SetUp() { |
16781 | // external_flag = GetParam(); |
16782 | // } |
16783 | // } |
16784 | // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool()); |
16785 | // |
16786 | inline internal::ParamGenerator<bool> Bool() { |
16787 | return Values(false, true); |
16788 | } |
16789 | |
16790 | # if GTEST_HAS_COMBINE |
16791 | // Combine() allows the user to combine two or more sequences to produce |
16792 | // values of a Cartesian product of those sequences' elements. |
16793 | // |
16794 | // Synopsis: |
16795 | // Combine(gen1, gen2, ..., genN) |
16796 | // - returns a generator producing sequences with elements coming from |
16797 | // the Cartesian product of elements from the sequences generated by |
16798 | // gen1, gen2, ..., genN. The sequence elements will have a type of |
16799 | // tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types |
16800 | // of elements from sequences produces by gen1, gen2, ..., genN. |
16801 | // |
16802 | // Combine can have up to 10 arguments. This number is currently limited |
16803 | // by the maximum number of elements in the tuple implementation used by Google |
16804 | // Test. |
16805 | // |
16806 | // Example: |
16807 | // |
16808 | // This will instantiate tests in test case AnimalTest each one with |
16809 | // the parameter values tuple("cat", BLACK), tuple("cat", WHITE), |
16810 | // tuple("dog", BLACK), and tuple("dog", WHITE): |
16811 | // |
16812 | // enum Color { BLACK, GRAY, WHITE }; |
16813 | // class AnimalTest |
16814 | // : public testing::TestWithParam<tuple<const char*, Color> > {...}; |
16815 | // |
16816 | // TEST_P(AnimalTest, AnimalLooksNice) {...} |
16817 | // |
16818 | // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest, |
16819 | // Combine(Values("cat", "dog"), |
16820 | // Values(BLACK, WHITE))); |
16821 | // |
16822 | // This will instantiate tests in FlagDependentTest with all variations of two |
16823 | // Boolean flags: |
16824 | // |
16825 | // class FlagDependentTest |
16826 | // : public testing::TestWithParam<tuple<bool, bool> > { |
16827 | // virtual void SetUp() { |
16828 | // // Assigns external_flag_1 and external_flag_2 values from the tuple. |
16829 | // tie(external_flag_1, external_flag_2) = GetParam(); |
16830 | // } |
16831 | // }; |
16832 | // |
16833 | // TEST_P(FlagDependentTest, TestFeature1) { |
16834 | // // Test your code using external_flag_1 and external_flag_2 here. |
16835 | // } |
16836 | // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest, |
16837 | // Combine(Bool(), Bool())); |
16838 | // |
16839 | template <typename Generator1, typename Generator2> |
16840 | internal::CartesianProductHolder2<Generator1, Generator2> Combine( |
16841 | const Generator1& g1, const Generator2& g2) { |
16842 | return internal::CartesianProductHolder2<Generator1, Generator2>( |
16843 | g1, g2); |
16844 | } |
16845 | |
16846 | template <typename Generator1, typename Generator2, typename Generator3> |
16847 | internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine( |
16848 | const Generator1& g1, const Generator2& g2, const Generator3& g3) { |
16849 | return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>( |
16850 | g1, g2, g3); |
16851 | } |
16852 | |
16853 | template <typename Generator1, typename Generator2, typename Generator3, |
16854 | typename Generator4> |
16855 | internal::CartesianProductHolder4<Generator1, Generator2, Generator3, |
16856 | Generator4> Combine( |
16857 | const Generator1& g1, const Generator2& g2, const Generator3& g3, |
16858 | const Generator4& g4) { |
16859 | return internal::CartesianProductHolder4<Generator1, Generator2, Generator3, |
16860 | Generator4>( |
16861 | g1, g2, g3, g4); |
16862 | } |
16863 | |
16864 | template <typename Generator1, typename Generator2, typename Generator3, |
16865 | typename Generator4, typename Generator5> |
16866 | internal::CartesianProductHolder5<Generator1, Generator2, Generator3, |
16867 | Generator4, Generator5> Combine( |
16868 | const Generator1& g1, const Generator2& g2, const Generator3& g3, |
16869 | const Generator4& g4, const Generator5& g5) { |
16870 | return internal::CartesianProductHolder5<Generator1, Generator2, Generator3, |
16871 | Generator4, Generator5>( |
16872 | g1, g2, g3, g4, g5); |
16873 | } |
16874 | |
16875 | template <typename Generator1, typename Generator2, typename Generator3, |
16876 | typename Generator4, typename Generator5, typename Generator6> |
16877 | internal::CartesianProductHolder6<Generator1, Generator2, Generator3, |
16878 | Generator4, Generator5, Generator6> Combine( |
16879 | const Generator1& g1, const Generator2& g2, const Generator3& g3, |
16880 | const Generator4& g4, const Generator5& g5, const Generator6& g6) { |
16881 | return internal::CartesianProductHolder6<Generator1, Generator2, Generator3, |
16882 | Generator4, Generator5, Generator6>( |
16883 | g1, g2, g3, g4, g5, g6); |
16884 | } |
16885 | |
16886 | template <typename Generator1, typename Generator2, typename Generator3, |
16887 | typename Generator4, typename Generator5, typename Generator6, |
16888 | typename Generator7> |
16889 | internal::CartesianProductHolder7<Generator1, Generator2, Generator3, |
16890 | Generator4, Generator5, Generator6, Generator7> Combine( |
16891 | const Generator1& g1, const Generator2& g2, const Generator3& g3, |
16892 | const Generator4& g4, const Generator5& g5, const Generator6& g6, |
16893 | const Generator7& g7) { |
16894 | return internal::CartesianProductHolder7<Generator1, Generator2, Generator3, |
16895 | Generator4, Generator5, Generator6, Generator7>( |
16896 | g1, g2, g3, g4, g5, g6, g7); |
16897 | } |
16898 | |
16899 | template <typename Generator1, typename Generator2, typename Generator3, |
16900 | typename Generator4, typename Generator5, typename Generator6, |
16901 | typename Generator7, typename Generator8> |
16902 | internal::CartesianProductHolder8<Generator1, Generator2, Generator3, |
16903 | Generator4, Generator5, Generator6, Generator7, Generator8> Combine( |
16904 | const Generator1& g1, const Generator2& g2, const Generator3& g3, |
16905 | const Generator4& g4, const Generator5& g5, const Generator6& g6, |
16906 | const Generator7& g7, const Generator8& g8) { |
16907 | return internal::CartesianProductHolder8<Generator1, Generator2, Generator3, |
16908 | Generator4, Generator5, Generator6, Generator7, Generator8>( |
16909 | g1, g2, g3, g4, g5, g6, g7, g8); |
16910 | } |
16911 | |
16912 | template <typename Generator1, typename Generator2, typename Generator3, |
16913 | typename Generator4, typename Generator5, typename Generator6, |
16914 | typename Generator7, typename Generator8, typename Generator9> |
16915 | internal::CartesianProductHolder9<Generator1, Generator2, Generator3, |
16916 | Generator4, Generator5, Generator6, Generator7, Generator8, |
16917 | Generator9> Combine( |
16918 | const Generator1& g1, const Generator2& g2, const Generator3& g3, |
16919 | const Generator4& g4, const Generator5& g5, const Generator6& g6, |
16920 | const Generator7& g7, const Generator8& g8, const Generator9& g9) { |
16921 | return internal::CartesianProductHolder9<Generator1, Generator2, Generator3, |
16922 | Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>( |
16923 | g1, g2, g3, g4, g5, g6, g7, g8, g9); |
16924 | } |
16925 | |
16926 | template <typename Generator1, typename Generator2, typename Generator3, |
16927 | typename Generator4, typename Generator5, typename Generator6, |
16928 | typename Generator7, typename Generator8, typename Generator9, |
16929 | typename Generator10> |
16930 | internal::CartesianProductHolder10<Generator1, Generator2, Generator3, |
16931 | Generator4, Generator5, Generator6, Generator7, Generator8, Generator9, |
16932 | Generator10> Combine( |
16933 | const Generator1& g1, const Generator2& g2, const Generator3& g3, |
16934 | const Generator4& g4, const Generator5& g5, const Generator6& g6, |
16935 | const Generator7& g7, const Generator8& g8, const Generator9& g9, |
16936 | const Generator10& g10) { |
16937 | return internal::CartesianProductHolder10<Generator1, Generator2, Generator3, |
16938 | Generator4, Generator5, Generator6, Generator7, Generator8, Generator9, |
16939 | Generator10>( |
16940 | g1, g2, g3, g4, g5, g6, g7, g8, g9, g10); |
16941 | } |
16942 | # endif // GTEST_HAS_COMBINE |
16943 | |
16944 | |
16945 | |
16946 | # define TEST_P(test_case_name, test_name) \ |
16947 | class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ |
16948 | : public test_case_name { \ |
16949 | public: \ |
16950 | GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ |
16951 | virtual void TestBody(); \ |
16952 | private: \ |
16953 | static int AddToRegistry() { \ |
16954 | ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ |
16955 | GetTestCasePatternHolder<test_case_name>(\ |
16956 | #test_case_name, __FILE__, __LINE__)->AddTestPattern(\ |
16957 | #test_case_name, \ |
16958 | #test_name, \ |
16959 | new ::testing::internal::TestMetaFactory< \ |
16960 | GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \ |
16961 | return 0; \ |
16962 | } \ |
16963 | static int gtest_registering_dummy_; \ |
16964 | GTEST_DISALLOW_COPY_AND_ASSIGN_(\ |
16965 | GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ |
16966 | }; \ |
16967 | int GTEST_TEST_CLASS_NAME_(test_case_name, \ |
16968 | test_name)::gtest_registering_dummy_ = \ |
16969 | GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ |
16970 | void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() |
16971 | |
16972 | # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \ |
16973 | ::testing::internal::ParamGenerator<test_case_name::ParamType> \ |
16974 | gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ |
16975 | int gtest_##prefix##test_case_name##_dummy_ = \ |
16976 | ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ |
16977 | GetTestCasePatternHolder<test_case_name>(\ |
16978 | #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\ |
16979 | #prefix, \ |
16980 | >est_##prefix##test_case_name##_EvalGenerator_, \ |
16981 | __FILE__, __LINE__) |
16982 | |
16983 | } // namespace testing |
16984 | |
16985 | #endif // GTEST_HAS_PARAM_TEST |
16986 | |
16987 | #endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ |
16988 | // Copyright 2006, Google Inc. |
16989 | // All rights reserved. |
16990 | // |
16991 | // Redistribution and use in source and binary forms, with or without |
16992 | // modification, are permitted provided that the following conditions are |
16993 | // met: |
16994 | // |
16995 | // * Redistributions of source code must retain the above copyright |
16996 | // notice, this list of conditions and the following disclaimer. |
16997 | // * Redistributions in binary form must reproduce the above |
16998 | // copyright notice, this list of conditions and the following disclaimer |
16999 | // in the documentation and/or other materials provided with the |
17000 | // distribution. |
17001 | // * Neither the name of Google Inc. nor the names of its |
17002 | // contributors may be used to endorse or promote products derived from |
17003 | // this software without specific prior written permission. |
17004 | // |
17005 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
17006 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
17007 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
17008 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
17009 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
17010 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
17011 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
17012 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
17013 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
17014 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
17015 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
17016 | // |
17017 | // Author: wan@google.com (Zhanyong Wan) |
17018 | // |
17019 | // Google C++ Testing Framework definitions useful in production code. |
17020 | |
17021 | #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_ |
17022 | #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_ |
17023 | |
17024 | // When you need to test the private or protected members of a class, |
17025 | // use the FRIEND_TEST macro to declare your tests as friends of the |
17026 | // class. For example: |
17027 | // |
17028 | // class MyClass { |
17029 | // private: |
17030 | // void MyMethod(); |
17031 | // FRIEND_TEST(MyClassTest, MyMethod); |
17032 | // }; |
17033 | // |
17034 | // class MyClassTest : public testing::Test { |
17035 | // // ... |
17036 | // }; |
17037 | // |
17038 | // TEST_F(MyClassTest, MyMethod) { |
17039 | // // Can call MyClass::MyMethod() here. |
17040 | // } |
17041 | |
17042 | #define FRIEND_TEST(test_case_name, test_name)\ |
17043 | friend class test_case_name##_##test_name##_Test |
17044 | |
17045 | #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_ |
17046 | // Copyright 2008, Google Inc. |
17047 | // All rights reserved. |
17048 | // |
17049 | // Redistribution and use in source and binary forms, with or without |
17050 | // modification, are permitted provided that the following conditions are |
17051 | // met: |
17052 | // |
17053 | // * Redistributions of source code must retain the above copyright |
17054 | // notice, this list of conditions and the following disclaimer. |
17055 | // * Redistributions in binary form must reproduce the above |
17056 | // copyright notice, this list of conditions and the following disclaimer |
17057 | // in the documentation and/or other materials provided with the |
17058 | // distribution. |
17059 | // * Neither the name of Google Inc. nor the names of its |
17060 | // contributors may be used to endorse or promote products derived from |
17061 | // this software without specific prior written permission. |
17062 | // |
17063 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
17064 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
17065 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
17066 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
17067 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
17068 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
17069 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
17070 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
17071 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
17072 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
17073 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
17074 | // |
17075 | // Author: mheule@google.com (Markus Heule) |
17076 | // |
17077 | |
17078 | #ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ |
17079 | #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ |
17080 | |
17081 | #include <iosfwd> |
17082 | #include <vector> |
17083 | |
17084 | namespace testing { |
17085 | |
17086 | // A copyable object representing the result of a test part (i.e. an |
17087 | // assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()). |
17088 | // |
17089 | // Don't inherit from TestPartResult as its destructor is not virtual. |
17090 | class GTEST_API_ TestPartResult { |
17091 | public: |
17092 | // The possible outcomes of a test part (i.e. an assertion or an |
17093 | // explicit SUCCEED(), FAIL(), or ADD_FAILURE()). |
17094 | enum Type { |
17095 | kSuccess, // Succeeded. |
17096 | kNonFatalFailure, // Failed but the test can continue. |
17097 | kFatalFailure // Failed and the test should be terminated. |
17098 | }; |
17099 | |
17100 | // C'tor. TestPartResult does NOT have a default constructor. |
17101 | // Always use this constructor (with parameters) to create a |
17102 | // TestPartResult object. |
17103 | TestPartResult(Type a_type, |
17104 | const char* a_file_name, |
17105 | int a_line_number, |
17106 | const char* a_message) |
17107 | : type_(a_type), |
17108 | file_name_(a_file_name == NULL ? "" : a_file_name), |
17109 | line_number_(a_line_number), |
17110 | summary_(ExtractSummary(a_message)), |
17111 | message_(a_message) { |
17112 | } |
17113 | |
17114 | // Gets the outcome of the test part. |
17115 | Type type() const { return type_; } |
17116 | |
17117 | // Gets the name of the source file where the test part took place, or |
17118 | // NULL if it's unknown. |
17119 | const char* file_name() const { |
17120 | return file_name_.empty() ? NULL : file_name_.c_str(); |
17121 | } |
17122 | |
17123 | // Gets the line in the source file where the test part took place, |
17124 | // or -1 if it's unknown. |
17125 | int line_number() const { return line_number_; } |
17126 | |
17127 | // Gets the summary of the failure message. |
17128 | const char* summary() const { return summary_.c_str(); } |
17129 | |
17130 | // Gets the message associated with the test part. |
17131 | const char* message() const { return message_.c_str(); } |
17132 | |
17133 | // Returns true iff the test part passed. |
17134 | bool passed() const { return type_ == kSuccess; } |
17135 | |
17136 | // Returns true iff the test part failed. |
17137 | bool failed() const { return type_ != kSuccess; } |
17138 | |
17139 | // Returns true iff the test part non-fatally failed. |
17140 | bool nonfatally_failed() const { return type_ == kNonFatalFailure; } |
17141 | |
17142 | // Returns true iff the test part fatally failed. |
17143 | bool fatally_failed() const { return type_ == kFatalFailure; } |
17144 | |
17145 | private: |
17146 | Type type_; |
17147 | |
17148 | // Gets the summary of the failure message by omitting the stack |
17149 | // trace in it. |
17150 | static std::string (const char* message); |
17151 | |
17152 | // The name of the source file where the test part took place, or |
17153 | // "" if the source file is unknown. |
17154 | std::string file_name_; |
17155 | // The line in the source file where the test part took place, or -1 |
17156 | // if the line number is unknown. |
17157 | int line_number_; |
17158 | std::string summary_; // The test failure summary. |
17159 | std::string message_; // The test failure message. |
17160 | }; |
17161 | |
17162 | // Prints a TestPartResult object. |
17163 | std::ostream& operator<<(std::ostream& os, const TestPartResult& result); |
17164 | |
17165 | // An array of TestPartResult objects. |
17166 | // |
17167 | // Don't inherit from TestPartResultArray as its destructor is not |
17168 | // virtual. |
17169 | class GTEST_API_ TestPartResultArray { |
17170 | public: |
17171 | TestPartResultArray() {} |
17172 | |
17173 | // Appends the given TestPartResult to the array. |
17174 | void Append(const TestPartResult& result); |
17175 | |
17176 | // Returns the TestPartResult at the given index (0-based). |
17177 | const TestPartResult& GetTestPartResult(int index) const; |
17178 | |
17179 | // Returns the number of TestPartResult objects in the array. |
17180 | int size() const; |
17181 | |
17182 | private: |
17183 | std::vector<TestPartResult> array_; |
17184 | |
17185 | GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray); |
17186 | }; |
17187 | |
17188 | // This interface knows how to report a test part result. |
17189 | class TestPartResultReporterInterface { |
17190 | public: |
17191 | virtual ~TestPartResultReporterInterface() {} |
17192 | |
17193 | virtual void ReportTestPartResult(const TestPartResult& result) = 0; |
17194 | }; |
17195 | |
17196 | namespace internal { |
17197 | |
17198 | // This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a |
17199 | // statement generates new fatal failures. To do so it registers itself as the |
17200 | // current test part result reporter. Besides checking if fatal failures were |
17201 | // reported, it only delegates the reporting to the former result reporter. |
17202 | // The original result reporter is restored in the destructor. |
17203 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
17204 | class GTEST_API_ HasNewFatalFailureHelper |
17205 | : public TestPartResultReporterInterface { |
17206 | public: |
17207 | HasNewFatalFailureHelper(); |
17208 | virtual ~HasNewFatalFailureHelper(); |
17209 | virtual void ReportTestPartResult(const TestPartResult& result); |
17210 | bool has_new_fatal_failure() const { return has_new_fatal_failure_; } |
17211 | private: |
17212 | bool has_new_fatal_failure_; |
17213 | TestPartResultReporterInterface* original_reporter_; |
17214 | |
17215 | GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper); |
17216 | }; |
17217 | |
17218 | } // namespace internal |
17219 | |
17220 | } // namespace testing |
17221 | |
17222 | #endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ |
17223 | // Copyright 2008 Google Inc. |
17224 | // All Rights Reserved. |
17225 | // |
17226 | // Redistribution and use in source and binary forms, with or without |
17227 | // modification, are permitted provided that the following conditions are |
17228 | // met: |
17229 | // |
17230 | // * Redistributions of source code must retain the above copyright |
17231 | // notice, this list of conditions and the following disclaimer. |
17232 | // * Redistributions in binary form must reproduce the above |
17233 | // copyright notice, this list of conditions and the following disclaimer |
17234 | // in the documentation and/or other materials provided with the |
17235 | // distribution. |
17236 | // * Neither the name of Google Inc. nor the names of its |
17237 | // contributors may be used to endorse or promote products derived from |
17238 | // this software without specific prior written permission. |
17239 | // |
17240 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
17241 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
17242 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
17243 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
17244 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
17245 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
17246 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
17247 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
17248 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
17249 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
17250 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
17251 | // |
17252 | // Author: wan@google.com (Zhanyong Wan) |
17253 | |
17254 | #ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ |
17255 | #define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ |
17256 | |
17257 | // This header implements typed tests and type-parameterized tests. |
17258 | |
17259 | // Typed (aka type-driven) tests repeat the same test for types in a |
17260 | // list. You must know which types you want to test with when writing |
17261 | // typed tests. Here's how you do it: |
17262 | |
17263 | #if 0 |
17264 | |
17265 | // First, define a fixture class template. It should be parameterized |
17266 | // by a type. Remember to derive it from testing::Test. |
17267 | template <typename T> |
17268 | class FooTest : public testing::Test { |
17269 | public: |
17270 | ... |
17271 | typedef std::list<T> List; |
17272 | static T shared_; |
17273 | T value_; |
17274 | }; |
17275 | |
17276 | // Next, associate a list of types with the test case, which will be |
17277 | // repeated for each type in the list. The typedef is necessary for |
17278 | // the macro to parse correctly. |
17279 | typedef testing::Types<char, int, unsigned int> MyTypes; |
17280 | TYPED_TEST_CASE(FooTest, MyTypes); |
17281 | |
17282 | // If the type list contains only one type, you can write that type |
17283 | // directly without Types<...>: |
17284 | // TYPED_TEST_CASE(FooTest, int); |
17285 | |
17286 | // Then, use TYPED_TEST() instead of TEST_F() to define as many typed |
17287 | // tests for this test case as you want. |
17288 | TYPED_TEST(FooTest, DoesBlah) { |
17289 | // Inside a test, refer to TypeParam to get the type parameter. |
17290 | // Since we are inside a derived class template, C++ requires use to |
17291 | // visit the members of FooTest via 'this'. |
17292 | TypeParam n = this->value_; |
17293 | |
17294 | // To visit static members of the fixture, add the TestFixture:: |
17295 | // prefix. |
17296 | n += TestFixture::shared_; |
17297 | |
17298 | // To refer to typedefs in the fixture, add the "typename |
17299 | // TestFixture::" prefix. |
17300 | typename TestFixture::List values; |
17301 | values.push_back(n); |
17302 | ... |
17303 | } |
17304 | |
17305 | TYPED_TEST(FooTest, HasPropertyA) { ... } |
17306 | |
17307 | #endif // 0 |
17308 | |
17309 | // Type-parameterized tests are abstract test patterns parameterized |
17310 | // by a type. Compared with typed tests, type-parameterized tests |
17311 | // allow you to define the test pattern without knowing what the type |
17312 | // parameters are. The defined pattern can be instantiated with |
17313 | // different types any number of times, in any number of translation |
17314 | // units. |
17315 | // |
17316 | // If you are designing an interface or concept, you can define a |
17317 | // suite of type-parameterized tests to verify properties that any |
17318 | // valid implementation of the interface/concept should have. Then, |
17319 | // each implementation can easily instantiate the test suite to verify |
17320 | // that it conforms to the requirements, without having to write |
17321 | // similar tests repeatedly. Here's an example: |
17322 | |
17323 | #if 0 |
17324 | |
17325 | // First, define a fixture class template. It should be parameterized |
17326 | // by a type. Remember to derive it from testing::Test. |
17327 | template <typename T> |
17328 | class FooTest : public testing::Test { |
17329 | ... |
17330 | }; |
17331 | |
17332 | // Next, declare that you will define a type-parameterized test case |
17333 | // (the _P suffix is for "parameterized" or "pattern", whichever you |
17334 | // prefer): |
17335 | TYPED_TEST_CASE_P(FooTest); |
17336 | |
17337 | // Then, use TYPED_TEST_P() to define as many type-parameterized tests |
17338 | // for this type-parameterized test case as you want. |
17339 | TYPED_TEST_P(FooTest, DoesBlah) { |
17340 | // Inside a test, refer to TypeParam to get the type parameter. |
17341 | TypeParam n = 0; |
17342 | ... |
17343 | } |
17344 | |
17345 | TYPED_TEST_P(FooTest, HasPropertyA) { ... } |
17346 | |
17347 | // Now the tricky part: you need to register all test patterns before |
17348 | // you can instantiate them. The first argument of the macro is the |
17349 | // test case name; the rest are the names of the tests in this test |
17350 | // case. |
17351 | REGISTER_TYPED_TEST_CASE_P(FooTest, |
17352 | DoesBlah, HasPropertyA); |
17353 | |
17354 | // Finally, you are free to instantiate the pattern with the types you |
17355 | // want. If you put the above code in a header file, you can #include |
17356 | // it in multiple C++ source files and instantiate it multiple times. |
17357 | // |
17358 | // To distinguish different instances of the pattern, the first |
17359 | // argument to the INSTANTIATE_* macro is a prefix that will be added |
17360 | // to the actual test case name. Remember to pick unique prefixes for |
17361 | // different instances. |
17362 | typedef testing::Types<char, int, unsigned int> MyTypes; |
17363 | INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes); |
17364 | |
17365 | // If the type list contains only one type, you can write that type |
17366 | // directly without Types<...>: |
17367 | // INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int); |
17368 | |
17369 | #endif // 0 |
17370 | |
17371 | |
17372 | // Implements typed tests. |
17373 | |
17374 | #if GTEST_HAS_TYPED_TEST |
17375 | |
17376 | // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. |
17377 | // |
17378 | // Expands to the name of the typedef for the type parameters of the |
17379 | // given test case. |
17380 | # define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_ |
17381 | |
17382 | // The 'Types' template argument below must have spaces around it |
17383 | // since some compilers may choke on '>>' when passing a template |
17384 | // instance (e.g. Types<int>) |
17385 | # define TYPED_TEST_CASE(CaseName, Types) \ |
17386 | typedef ::testing::internal::TypeList< Types >::type \ |
17387 | GTEST_TYPE_PARAMS_(CaseName) |
17388 | |
17389 | # define TYPED_TEST(CaseName, TestName) \ |
17390 | template <typename gtest_TypeParam_> \ |
17391 | class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ |
17392 | : public CaseName<gtest_TypeParam_> { \ |
17393 | private: \ |
17394 | typedef CaseName<gtest_TypeParam_> TestFixture; \ |
17395 | typedef gtest_TypeParam_ TypeParam; \ |
17396 | virtual void TestBody(); \ |
17397 | }; \ |
17398 | bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \ |
17399 | ::testing::internal::TypeParameterizedTest< \ |
17400 | CaseName, \ |
17401 | ::testing::internal::TemplateSel< \ |
17402 | GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \ |
17403 | GTEST_TYPE_PARAMS_(CaseName)>::Register(\ |
17404 | "", #CaseName, #TestName, 0); \ |
17405 | template <typename gtest_TypeParam_> \ |
17406 | void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody() |
17407 | |
17408 | #endif // GTEST_HAS_TYPED_TEST |
17409 | |
17410 | // Implements type-parameterized tests. |
17411 | |
17412 | #if GTEST_HAS_TYPED_TEST_P |
17413 | |
17414 | // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. |
17415 | // |
17416 | // Expands to the namespace name that the type-parameterized tests for |
17417 | // the given type-parameterized test case are defined in. The exact |
17418 | // name of the namespace is subject to change without notice. |
17419 | # define GTEST_CASE_NAMESPACE_(TestCaseName) \ |
17420 | gtest_case_##TestCaseName##_ |
17421 | |
17422 | // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. |
17423 | // |
17424 | // Expands to the name of the variable used to remember the names of |
17425 | // the defined tests in the given test case. |
17426 | # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \ |
17427 | gtest_typed_test_case_p_state_##TestCaseName##_ |
17428 | |
17429 | // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY. |
17430 | // |
17431 | // Expands to the name of the variable used to remember the names of |
17432 | // the registered tests in the given test case. |
17433 | # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \ |
17434 | gtest_registered_test_names_##TestCaseName##_ |
17435 | |
17436 | // The variables defined in the type-parameterized test macros are |
17437 | // static as typically these macros are used in a .h file that can be |
17438 | // #included in multiple translation units linked together. |
17439 | # define TYPED_TEST_CASE_P(CaseName) \ |
17440 | static ::testing::internal::TypedTestCasePState \ |
17441 | GTEST_TYPED_TEST_CASE_P_STATE_(CaseName) |
17442 | |
17443 | # define TYPED_TEST_P(CaseName, TestName) \ |
17444 | namespace GTEST_CASE_NAMESPACE_(CaseName) { \ |
17445 | template <typename gtest_TypeParam_> \ |
17446 | class TestName : public CaseName<gtest_TypeParam_> { \ |
17447 | private: \ |
17448 | typedef CaseName<gtest_TypeParam_> TestFixture; \ |
17449 | typedef gtest_TypeParam_ TypeParam; \ |
17450 | virtual void TestBody(); \ |
17451 | }; \ |
17452 | static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ |
17453 | GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\ |
17454 | __FILE__, __LINE__, #CaseName, #TestName); \ |
17455 | } \ |
17456 | template <typename gtest_TypeParam_> \ |
17457 | void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody() |
17458 | |
17459 | # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \ |
17460 | namespace GTEST_CASE_NAMESPACE_(CaseName) { \ |
17461 | typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \ |
17462 | } \ |
17463 | static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \ |
17464 | GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\ |
17465 | __FILE__, __LINE__, #__VA_ARGS__) |
17466 | |
17467 | // The 'Types' template argument below must have spaces around it |
17468 | // since some compilers may choke on '>>' when passing a template |
17469 | // instance (e.g. Types<int>) |
17470 | # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \ |
17471 | bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \ |
17472 | ::testing::internal::TypeParameterizedTestCase<CaseName, \ |
17473 | GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \ |
17474 | ::testing::internal::TypeList< Types >::type>::Register(\ |
17475 | #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName)) |
17476 | |
17477 | #endif // GTEST_HAS_TYPED_TEST_P |
17478 | |
17479 | #endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ |
17480 | |
17481 | // Depending on the platform, different string classes are available. |
17482 | // On Linux, in addition to ::std::string, Google also makes use of |
17483 | // class ::string, which has the same interface as ::std::string, but |
17484 | // has a different implementation. |
17485 | // |
17486 | // The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that |
17487 | // ::string is available AND is a distinct type to ::std::string, or |
17488 | // define it to 0 to indicate otherwise. |
17489 | // |
17490 | // If the user's ::std::string and ::string are the same class due to |
17491 | // aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0. |
17492 | // |
17493 | // If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined |
17494 | // heuristically. |
17495 | |
17496 | namespace testing { |
17497 | |
17498 | // Declares the flags. |
17499 | |
17500 | // This flag temporary enables the disabled tests. |
17501 | GTEST_DECLARE_bool_(also_run_disabled_tests); |
17502 | |
17503 | // This flag brings the debugger on an assertion failure. |
17504 | GTEST_DECLARE_bool_(break_on_failure); |
17505 | |
17506 | // This flag controls whether Google Test catches all test-thrown exceptions |
17507 | // and logs them as failures. |
17508 | GTEST_DECLARE_bool_(catch_exceptions); |
17509 | |
17510 | // This flag enables using colors in terminal output. Available values are |
17511 | // "yes" to enable colors, "no" (disable colors), or "auto" (the default) |
17512 | // to let Google Test decide. |
17513 | GTEST_DECLARE_string_(color); |
17514 | |
17515 | // This flag sets up the filter to select by name using a glob pattern |
17516 | // the tests to run. If the filter is not given all tests are executed. |
17517 | GTEST_DECLARE_string_(filter); |
17518 | |
17519 | // This flag causes the Google Test to list tests. None of the tests listed |
17520 | // are actually run if the flag is provided. |
17521 | GTEST_DECLARE_bool_(list_tests); |
17522 | |
17523 | // This flag controls whether Google Test emits a detailed XML report to a file |
17524 | // in addition to its normal textual output. |
17525 | GTEST_DECLARE_string_(output); |
17526 | |
17527 | // This flags control whether Google Test prints the elapsed time for each |
17528 | // test. |
17529 | GTEST_DECLARE_bool_(print_time); |
17530 | |
17531 | // This flag specifies the random number seed. |
17532 | GTEST_DECLARE_int32_(random_seed); |
17533 | |
17534 | // This flag sets how many times the tests are repeated. The default value |
17535 | // is 1. If the value is -1 the tests are repeating forever. |
17536 | GTEST_DECLARE_int32_(repeat); |
17537 | |
17538 | // This flag controls whether Google Test includes Google Test internal |
17539 | // stack frames in failure stack traces. |
17540 | GTEST_DECLARE_bool_(show_internal_stack_frames); |
17541 | |
17542 | // When this flag is specified, tests' order is randomized on every iteration. |
17543 | GTEST_DECLARE_bool_(shuffle); |
17544 | |
17545 | // This flag specifies the maximum number of stack frames to be |
17546 | // printed in a failure message. |
17547 | GTEST_DECLARE_int32_(stack_trace_depth); |
17548 | |
17549 | // When this flag is specified, a failed assertion will throw an |
17550 | // exception if exceptions are enabled, or exit the program with a |
17551 | // non-zero code otherwise. |
17552 | GTEST_DECLARE_bool_(throw_on_failure); |
17553 | |
17554 | // When this flag is set with a "host:port" string, on supported |
17555 | // platforms test results are streamed to the specified port on |
17556 | // the specified host machine. |
17557 | GTEST_DECLARE_string_(stream_result_to); |
17558 | |
17559 | // The upper limit for valid stack trace depths. |
17560 | const int kMaxStackTraceDepth = 100; |
17561 | |
17562 | namespace internal { |
17563 | |
17564 | class AssertHelper; |
17565 | class DefaultGlobalTestPartResultReporter; |
17566 | class ExecDeathTest; |
17567 | class NoExecDeathTest; |
17568 | class FinalSuccessChecker; |
17569 | class GTestFlagSaver; |
17570 | class StreamingListenerTest; |
17571 | class TestResultAccessor; |
17572 | class TestEventListenersAccessor; |
17573 | class TestEventRepeater; |
17574 | class UnitTestRecordPropertyTestHelper; |
17575 | class WindowsDeathTest; |
17576 | class UnitTestImpl* GetUnitTestImpl(); |
17577 | void ReportFailureInUnknownLocation(TestPartResult::Type result_type, |
17578 | const std::string& message); |
17579 | |
17580 | } // namespace internal |
17581 | |
17582 | // The friend relationship of some of these classes is cyclic. |
17583 | // If we don't forward declare them the compiler might confuse the classes |
17584 | // in friendship clauses with same named classes on the scope. |
17585 | class Test; |
17586 | class TestCase; |
17587 | class TestInfo; |
17588 | class UnitTest; |
17589 | |
17590 | // A class for indicating whether an assertion was successful. When |
17591 | // the assertion wasn't successful, the AssertionResult object |
17592 | // remembers a non-empty message that describes how it failed. |
17593 | // |
17594 | // To create an instance of this class, use one of the factory functions |
17595 | // (AssertionSuccess() and AssertionFailure()). |
17596 | // |
17597 | // This class is useful for two purposes: |
17598 | // 1. Defining predicate functions to be used with Boolean test assertions |
17599 | // EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts |
17600 | // 2. Defining predicate-format functions to be |
17601 | // used with predicate assertions (ASSERT_PRED_FORMAT*, etc). |
17602 | // |
17603 | // For example, if you define IsEven predicate: |
17604 | // |
17605 | // testing::AssertionResult IsEven(int n) { |
17606 | // if ((n % 2) == 0) |
17607 | // return testing::AssertionSuccess(); |
17608 | // else |
17609 | // return testing::AssertionFailure() << n << " is odd"; |
17610 | // } |
17611 | // |
17612 | // Then the failed expectation EXPECT_TRUE(IsEven(Fib(5))) |
17613 | // will print the message |
17614 | // |
17615 | // Value of: IsEven(Fib(5)) |
17616 | // Actual: false (5 is odd) |
17617 | // Expected: true |
17618 | // |
17619 | // instead of a more opaque |
17620 | // |
17621 | // Value of: IsEven(Fib(5)) |
17622 | // Actual: false |
17623 | // Expected: true |
17624 | // |
17625 | // in case IsEven is a simple Boolean predicate. |
17626 | // |
17627 | // If you expect your predicate to be reused and want to support informative |
17628 | // messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up |
17629 | // about half as often as positive ones in our tests), supply messages for |
17630 | // both success and failure cases: |
17631 | // |
17632 | // testing::AssertionResult IsEven(int n) { |
17633 | // if ((n % 2) == 0) |
17634 | // return testing::AssertionSuccess() << n << " is even"; |
17635 | // else |
17636 | // return testing::AssertionFailure() << n << " is odd"; |
17637 | // } |
17638 | // |
17639 | // Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print |
17640 | // |
17641 | // Value of: IsEven(Fib(6)) |
17642 | // Actual: true (8 is even) |
17643 | // Expected: false |
17644 | // |
17645 | // NB: Predicates that support negative Boolean assertions have reduced |
17646 | // performance in positive ones so be careful not to use them in tests |
17647 | // that have lots (tens of thousands) of positive Boolean assertions. |
17648 | // |
17649 | // To use this class with EXPECT_PRED_FORMAT assertions such as: |
17650 | // |
17651 | // // Verifies that Foo() returns an even number. |
17652 | // EXPECT_PRED_FORMAT1(IsEven, Foo()); |
17653 | // |
17654 | // you need to define: |
17655 | // |
17656 | // testing::AssertionResult IsEven(const char* expr, int n) { |
17657 | // if ((n % 2) == 0) |
17658 | // return testing::AssertionSuccess(); |
17659 | // else |
17660 | // return testing::AssertionFailure() |
17661 | // << "Expected: " << expr << " is even\n Actual: it's " << n; |
17662 | // } |
17663 | // |
17664 | // If Foo() returns 5, you will see the following message: |
17665 | // |
17666 | // Expected: Foo() is even |
17667 | // Actual: it's 5 |
17668 | // |
17669 | class GTEST_API_ AssertionResult { |
17670 | public: |
17671 | // Copy constructor. |
17672 | // Used in EXPECT_TRUE/FALSE(assertion_result). |
17673 | AssertionResult(const AssertionResult& other); |
17674 | // Used in the EXPECT_TRUE/FALSE(bool_expression). |
17675 | explicit AssertionResult(bool success) : success_(success) {} |
17676 | |
17677 | // Returns true iff the assertion succeeded. |
17678 | operator bool() const { return success_; } // NOLINT |
17679 | |
17680 | // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE. |
17681 | AssertionResult operator!() const; |
17682 | |
17683 | // Returns the text streamed into this AssertionResult. Test assertions |
17684 | // use it when they fail (i.e., the predicate's outcome doesn't match the |
17685 | // assertion's expectation). When nothing has been streamed into the |
17686 | // object, returns an empty string. |
17687 | const char* message() const { |
17688 | return message_.get() != NULL ? message_->c_str() : "" ; |
17689 | } |
17690 | // TODO(vladl@google.com): Remove this after making sure no clients use it. |
17691 | // Deprecated; please use message() instead. |
17692 | const char* failure_message() const { return message(); } |
17693 | |
17694 | // Streams a custom failure message into this object. |
17695 | template <typename T> AssertionResult& operator<<(const T& value) { |
17696 | AppendMessage(Message() << value); |
17697 | return *this; |
17698 | } |
17699 | |
17700 | // Allows streaming basic output manipulators such as endl or flush into |
17701 | // this object. |
17702 | AssertionResult& operator<<( |
17703 | ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) { |
17704 | AppendMessage(Message() << basic_manipulator); |
17705 | return *this; |
17706 | } |
17707 | |
17708 | private: |
17709 | // Appends the contents of message to message_. |
17710 | void AppendMessage(const Message& a_message) { |
17711 | if (message_.get() == NULL) |
17712 | message_.reset(new ::std::string); |
17713 | message_->append(a_message.GetString().c_str()); |
17714 | } |
17715 | |
17716 | // Stores result of the assertion predicate. |
17717 | bool success_; |
17718 | // Stores the message describing the condition in case the expectation |
17719 | // construct is not satisfied with the predicate's outcome. |
17720 | // Referenced via a pointer to avoid taking too much stack frame space |
17721 | // with test assertions. |
17722 | internal::scoped_ptr< ::std::string> message_; |
17723 | |
17724 | GTEST_DISALLOW_ASSIGN_(AssertionResult); |
17725 | }; |
17726 | |
17727 | // Makes a successful assertion result. |
17728 | GTEST_API_ AssertionResult AssertionSuccess(); |
17729 | |
17730 | // Makes a failed assertion result. |
17731 | GTEST_API_ AssertionResult AssertionFailure(); |
17732 | |
17733 | // Makes a failed assertion result with the given failure message. |
17734 | // Deprecated; use AssertionFailure() << msg. |
17735 | GTEST_API_ AssertionResult AssertionFailure(const Message& msg); |
17736 | |
17737 | // The abstract class that all tests inherit from. |
17738 | // |
17739 | // In Google Test, a unit test program contains one or many TestCases, and |
17740 | // each TestCase contains one or many Tests. |
17741 | // |
17742 | // When you define a test using the TEST macro, you don't need to |
17743 | // explicitly derive from Test - the TEST macro automatically does |
17744 | // this for you. |
17745 | // |
17746 | // The only time you derive from Test is when defining a test fixture |
17747 | // to be used a TEST_F. For example: |
17748 | // |
17749 | // class FooTest : public testing::Test { |
17750 | // protected: |
17751 | // virtual void SetUp() { ... } |
17752 | // virtual void TearDown() { ... } |
17753 | // ... |
17754 | // }; |
17755 | // |
17756 | // TEST_F(FooTest, Bar) { ... } |
17757 | // TEST_F(FooTest, Baz) { ... } |
17758 | // |
17759 | // Test is not copyable. |
17760 | class GTEST_API_ Test { |
17761 | public: |
17762 | friend class TestInfo; |
17763 | |
17764 | // Defines types for pointers to functions that set up and tear down |
17765 | // a test case. |
17766 | typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc; |
17767 | typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc; |
17768 | |
17769 | // The d'tor is virtual as we intend to inherit from Test. |
17770 | virtual ~Test(); |
17771 | |
17772 | // Sets up the stuff shared by all tests in this test case. |
17773 | // |
17774 | // Google Test will call Foo::SetUpTestCase() before running the first |
17775 | // test in test case Foo. Hence a sub-class can define its own |
17776 | // SetUpTestCase() method to shadow the one defined in the super |
17777 | // class. |
17778 | static void SetUpTestCase() {} |
17779 | |
17780 | // Tears down the stuff shared by all tests in this test case. |
17781 | // |
17782 | // Google Test will call Foo::TearDownTestCase() after running the last |
17783 | // test in test case Foo. Hence a sub-class can define its own |
17784 | // TearDownTestCase() method to shadow the one defined in the super |
17785 | // class. |
17786 | static void TearDownTestCase() {} |
17787 | |
17788 | // Returns true iff the current test has a fatal failure. |
17789 | static bool HasFatalFailure(); |
17790 | |
17791 | // Returns true iff the current test has a non-fatal failure. |
17792 | static bool HasNonfatalFailure(); |
17793 | |
17794 | // Returns true iff the current test has a (either fatal or |
17795 | // non-fatal) failure. |
17796 | static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); } |
17797 | |
17798 | // Logs a property for the current test, test case, or for the entire |
17799 | // invocation of the test program when used outside of the context of a |
17800 | // test case. Only the last value for a given key is remembered. These |
17801 | // are public static so they can be called from utility functions that are |
17802 | // not members of the test fixture. Calls to RecordProperty made during |
17803 | // lifespan of the test (from the moment its constructor starts to the |
17804 | // moment its destructor finishes) will be output in XML as attributes of |
17805 | // the <testcase> element. Properties recorded from fixture's |
17806 | // SetUpTestCase or TearDownTestCase are logged as attributes of the |
17807 | // corresponding <testsuite> element. Calls to RecordProperty made in the |
17808 | // global context (before or after invocation of RUN_ALL_TESTS and from |
17809 | // SetUp/TearDown method of Environment objects registered with Google |
17810 | // Test) will be output as attributes of the <testsuites> element. |
17811 | static void RecordProperty(const std::string& key, const std::string& value); |
17812 | static void RecordProperty(const std::string& key, int value); |
17813 | |
17814 | protected: |
17815 | // Creates a Test object. |
17816 | Test(); |
17817 | |
17818 | // Sets up the test fixture. |
17819 | virtual void SetUp(); |
17820 | |
17821 | // Tears down the test fixture. |
17822 | virtual void TearDown(); |
17823 | |
17824 | private: |
17825 | // Returns true iff the current test has the same fixture class as |
17826 | // the first test in the current test case. |
17827 | static bool HasSameFixtureClass(); |
17828 | |
17829 | // Runs the test after the test fixture has been set up. |
17830 | // |
17831 | // A sub-class must implement this to define the test logic. |
17832 | // |
17833 | // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM. |
17834 | // Instead, use the TEST or TEST_F macro. |
17835 | virtual void TestBody() = 0; |
17836 | |
17837 | // Sets up, executes, and tears down the test. |
17838 | void Run(); |
17839 | |
17840 | // Deletes self. We deliberately pick an unusual name for this |
17841 | // internal method to avoid clashing with names used in user TESTs. |
17842 | void DeleteSelf_() { delete this; } |
17843 | |
17844 | // Uses a GTestFlagSaver to save and restore all Google Test flags. |
17845 | const internal::GTestFlagSaver* const gtest_flag_saver_; |
17846 | |
17847 | // Often a user mis-spells SetUp() as Setup() and spends a long time |
17848 | // wondering why it is never called by Google Test. The declaration of |
17849 | // the following method is solely for catching such an error at |
17850 | // compile time: |
17851 | // |
17852 | // - The return type is deliberately chosen to be not void, so it |
17853 | // will be a conflict if a user declares void Setup() in his test |
17854 | // fixture. |
17855 | // |
17856 | // - This method is private, so it will be another compiler error |
17857 | // if a user calls it from his test fixture. |
17858 | // |
17859 | // DO NOT OVERRIDE THIS FUNCTION. |
17860 | // |
17861 | // If you see an error about overriding the following function or |
17862 | // about it being private, you have mis-spelled SetUp() as Setup(). |
17863 | struct Setup_should_be_spelled_SetUp {}; |
17864 | virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; } |
17865 | |
17866 | // We disallow copying Tests. |
17867 | GTEST_DISALLOW_COPY_AND_ASSIGN_(Test); |
17868 | }; |
17869 | |
17870 | typedef internal::TimeInMillis TimeInMillis; |
17871 | |
17872 | // A copyable object representing a user specified test property which can be |
17873 | // output as a key/value string pair. |
17874 | // |
17875 | // Don't inherit from TestProperty as its destructor is not virtual. |
17876 | class TestProperty { |
17877 | public: |
17878 | // C'tor. TestProperty does NOT have a default constructor. |
17879 | // Always use this constructor (with parameters) to create a |
17880 | // TestProperty object. |
17881 | TestProperty(const std::string& a_key, const std::string& a_value) : |
17882 | key_(a_key), value_(a_value) { |
17883 | } |
17884 | |
17885 | // Gets the user supplied key. |
17886 | const char* key() const { |
17887 | return key_.c_str(); |
17888 | } |
17889 | |
17890 | // Gets the user supplied value. |
17891 | const char* value() const { |
17892 | return value_.c_str(); |
17893 | } |
17894 | |
17895 | // Sets a new value, overriding the one supplied in the constructor. |
17896 | void SetValue(const std::string& new_value) { |
17897 | value_ = new_value; |
17898 | } |
17899 | |
17900 | private: |
17901 | // The key supplied by the user. |
17902 | std::string key_; |
17903 | // The value supplied by the user. |
17904 | std::string value_; |
17905 | }; |
17906 | |
17907 | // The result of a single Test. This includes a list of |
17908 | // TestPartResults, a list of TestProperties, a count of how many |
17909 | // death tests there are in the Test, and how much time it took to run |
17910 | // the Test. |
17911 | // |
17912 | // TestResult is not copyable. |
17913 | class GTEST_API_ TestResult { |
17914 | public: |
17915 | // Creates an empty TestResult. |
17916 | TestResult(); |
17917 | |
17918 | // D'tor. Do not inherit from TestResult. |
17919 | ~TestResult(); |
17920 | |
17921 | // Gets the number of all test parts. This is the sum of the number |
17922 | // of successful test parts and the number of failed test parts. |
17923 | int total_part_count() const; |
17924 | |
17925 | // Returns the number of the test properties. |
17926 | int test_property_count() const; |
17927 | |
17928 | // Returns true iff the test passed (i.e. no test part failed). |
17929 | bool Passed() const { return !Failed(); } |
17930 | |
17931 | // Returns true iff the test failed. |
17932 | bool Failed() const; |
17933 | |
17934 | // Returns true iff the test fatally failed. |
17935 | bool HasFatalFailure() const; |
17936 | |
17937 | // Returns true iff the test has a non-fatal failure. |
17938 | bool HasNonfatalFailure() const; |
17939 | |
17940 | // Returns the elapsed time, in milliseconds. |
17941 | TimeInMillis elapsed_time() const { return elapsed_time_; } |
17942 | |
17943 | // Returns the i-th test part result among all the results. i can range |
17944 | // from 0 to test_property_count() - 1. If i is not in that range, aborts |
17945 | // the program. |
17946 | const TestPartResult& GetTestPartResult(int i) const; |
17947 | |
17948 | // Returns the i-th test property. i can range from 0 to |
17949 | // test_property_count() - 1. If i is not in that range, aborts the |
17950 | // program. |
17951 | const TestProperty& GetTestProperty(int i) const; |
17952 | |
17953 | private: |
17954 | friend class TestInfo; |
17955 | friend class TestCase; |
17956 | friend class UnitTest; |
17957 | friend class internal::DefaultGlobalTestPartResultReporter; |
17958 | friend class internal::ExecDeathTest; |
17959 | friend class internal::TestResultAccessor; |
17960 | friend class internal::UnitTestImpl; |
17961 | friend class internal::WindowsDeathTest; |
17962 | |
17963 | // Gets the vector of TestPartResults. |
17964 | const std::vector<TestPartResult>& test_part_results() const { |
17965 | return test_part_results_; |
17966 | } |
17967 | |
17968 | // Gets the vector of TestProperties. |
17969 | const std::vector<TestProperty>& test_properties() const { |
17970 | return test_properties_; |
17971 | } |
17972 | |
17973 | // Sets the elapsed time. |
17974 | void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } |
17975 | |
17976 | // Adds a test property to the list. The property is validated and may add |
17977 | // a non-fatal failure if invalid (e.g., if it conflicts with reserved |
17978 | // key names). If a property is already recorded for the same key, the |
17979 | // value will be updated, rather than storing multiple values for the same |
17980 | // key. xml_element specifies the element for which the property is being |
17981 | // recorded and is used for validation. |
17982 | void RecordProperty(const std::string& xml_element, |
17983 | const TestProperty& test_property); |
17984 | |
17985 | // Adds a failure if the key is a reserved attribute of Google Test |
17986 | // testcase tags. Returns true if the property is valid. |
17987 | // TODO(russr): Validate attribute names are legal and human readable. |
17988 | static bool ValidateTestProperty(const std::string& xml_element, |
17989 | const TestProperty& test_property); |
17990 | |
17991 | // Adds a test part result to the list. |
17992 | void AddTestPartResult(const TestPartResult& test_part_result); |
17993 | |
17994 | // Returns the death test count. |
17995 | int death_test_count() const { return death_test_count_; } |
17996 | |
17997 | // Increments the death test count, returning the new count. |
17998 | int increment_death_test_count() { return ++death_test_count_; } |
17999 | |
18000 | // Clears the test part results. |
18001 | void ClearTestPartResults(); |
18002 | |
18003 | // Clears the object. |
18004 | void Clear(); |
18005 | |
18006 | // Protects mutable state of the property vector and of owned |
18007 | // properties, whose values may be updated. |
18008 | internal::Mutex test_properites_mutex_; |
18009 | |
18010 | // The vector of TestPartResults |
18011 | std::vector<TestPartResult> test_part_results_; |
18012 | // The vector of TestProperties |
18013 | std::vector<TestProperty> test_properties_; |
18014 | // Running count of death tests. |
18015 | int death_test_count_; |
18016 | // The elapsed time, in milliseconds. |
18017 | TimeInMillis elapsed_time_; |
18018 | |
18019 | // We disallow copying TestResult. |
18020 | GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult); |
18021 | }; // class TestResult |
18022 | |
18023 | // A TestInfo object stores the following information about a test: |
18024 | // |
18025 | // Test case name |
18026 | // Test name |
18027 | // Whether the test should be run |
18028 | // A function pointer that creates the test object when invoked |
18029 | // Test result |
18030 | // |
18031 | // The constructor of TestInfo registers itself with the UnitTest |
18032 | // singleton such that the RUN_ALL_TESTS() macro knows which tests to |
18033 | // run. |
18034 | class GTEST_API_ TestInfo { |
18035 | public: |
18036 | // Destructs a TestInfo object. This function is not virtual, so |
18037 | // don't inherit from TestInfo. |
18038 | ~TestInfo(); |
18039 | |
18040 | // Returns the test case name. |
18041 | const char* test_case_name() const { return test_case_name_.c_str(); } |
18042 | |
18043 | // Returns the test name. |
18044 | const char* name() const { return name_.c_str(); } |
18045 | |
18046 | // Returns the name of the parameter type, or NULL if this is not a typed |
18047 | // or a type-parameterized test. |
18048 | const char* type_param() const { |
18049 | if (type_param_.get() != NULL) |
18050 | return type_param_->c_str(); |
18051 | return NULL; |
18052 | } |
18053 | |
18054 | // Returns the text representation of the value parameter, or NULL if this |
18055 | // is not a value-parameterized test. |
18056 | const char* value_param() const { |
18057 | if (value_param_.get() != NULL) |
18058 | return value_param_->c_str(); |
18059 | return NULL; |
18060 | } |
18061 | |
18062 | // Returns true if this test should run, that is if the test is not |
18063 | // disabled (or it is disabled but the also_run_disabled_tests flag has |
18064 | // been specified) and its full name matches the user-specified filter. |
18065 | // |
18066 | // Google Test allows the user to filter the tests by their full names. |
18067 | // The full name of a test Bar in test case Foo is defined as |
18068 | // "Foo.Bar". Only the tests that match the filter will run. |
18069 | // |
18070 | // A filter is a colon-separated list of glob (not regex) patterns, |
18071 | // optionally followed by a '-' and a colon-separated list of |
18072 | // negative patterns (tests to exclude). A test is run if it |
18073 | // matches one of the positive patterns and does not match any of |
18074 | // the negative patterns. |
18075 | // |
18076 | // For example, *A*:Foo.* is a filter that matches any string that |
18077 | // contains the character 'A' or starts with "Foo.". |
18078 | bool should_run() const { return should_run_; } |
18079 | |
18080 | // Returns true iff this test will appear in the XML report. |
18081 | bool is_reportable() const { |
18082 | // For now, the XML report includes all tests matching the filter. |
18083 | // In the future, we may trim tests that are excluded because of |
18084 | // sharding. |
18085 | return matches_filter_; |
18086 | } |
18087 | |
18088 | // Returns the result of the test. |
18089 | const TestResult* result() const { return &result_; } |
18090 | |
18091 | private: |
18092 | #if GTEST_HAS_DEATH_TEST |
18093 | friend class internal::DefaultDeathTestFactory; |
18094 | #endif // GTEST_HAS_DEATH_TEST |
18095 | friend class Test; |
18096 | friend class TestCase; |
18097 | friend class internal::UnitTestImpl; |
18098 | friend class internal::StreamingListenerTest; |
18099 | friend TestInfo* internal::MakeAndRegisterTestInfo( |
18100 | const char* test_case_name, |
18101 | const char* name, |
18102 | const char* type_param, |
18103 | const char* value_param, |
18104 | internal::TypeId fixture_class_id, |
18105 | Test::SetUpTestCaseFunc set_up_tc, |
18106 | Test::TearDownTestCaseFunc tear_down_tc, |
18107 | internal::TestFactoryBase* factory); |
18108 | |
18109 | // Constructs a TestInfo object. The newly constructed instance assumes |
18110 | // ownership of the factory object. |
18111 | TestInfo(const std::string& test_case_name, |
18112 | const std::string& name, |
18113 | const char* a_type_param, // NULL if not a type-parameterized test |
18114 | const char* a_value_param, // NULL if not a value-parameterized test |
18115 | internal::TypeId fixture_class_id, |
18116 | internal::TestFactoryBase* factory); |
18117 | |
18118 | // Increments the number of death tests encountered in this test so |
18119 | // far. |
18120 | int increment_death_test_count() { |
18121 | return result_.increment_death_test_count(); |
18122 | } |
18123 | |
18124 | // Creates the test object, runs it, records its result, and then |
18125 | // deletes it. |
18126 | void Run(); |
18127 | |
18128 | static void ClearTestResult(TestInfo* test_info) { |
18129 | test_info->result_.Clear(); |
18130 | } |
18131 | |
18132 | // These fields are immutable properties of the test. |
18133 | const std::string test_case_name_; // Test case name |
18134 | const std::string name_; // Test name |
18135 | // Name of the parameter type, or NULL if this is not a typed or a |
18136 | // type-parameterized test. |
18137 | const internal::scoped_ptr<const ::std::string> type_param_; |
18138 | // Text representation of the value parameter, or NULL if this is not a |
18139 | // value-parameterized test. |
18140 | const internal::scoped_ptr<const ::std::string> value_param_; |
18141 | const internal::TypeId fixture_class_id_; // ID of the test fixture class |
18142 | bool should_run_; // True iff this test should run |
18143 | bool is_disabled_; // True iff this test is disabled |
18144 | bool matches_filter_; // True if this test matches the |
18145 | // user-specified filter. |
18146 | internal::TestFactoryBase* const factory_; // The factory that creates |
18147 | // the test object |
18148 | |
18149 | // This field is mutable and needs to be reset before running the |
18150 | // test for the second time. |
18151 | TestResult result_; |
18152 | |
18153 | GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo); |
18154 | }; |
18155 | |
18156 | // A test case, which consists of a vector of TestInfos. |
18157 | // |
18158 | // TestCase is not copyable. |
18159 | class GTEST_API_ TestCase { |
18160 | public: |
18161 | // Creates a TestCase with the given name. |
18162 | // |
18163 | // TestCase does NOT have a default constructor. Always use this |
18164 | // constructor to create a TestCase object. |
18165 | // |
18166 | // Arguments: |
18167 | // |
18168 | // name: name of the test case |
18169 | // a_type_param: the name of the test's type parameter, or NULL if |
18170 | // this is not a type-parameterized test. |
18171 | // set_up_tc: pointer to the function that sets up the test case |
18172 | // tear_down_tc: pointer to the function that tears down the test case |
18173 | TestCase(const char* name, const char* a_type_param, |
18174 | Test::SetUpTestCaseFunc set_up_tc, |
18175 | Test::TearDownTestCaseFunc tear_down_tc); |
18176 | |
18177 | // Destructor of TestCase. |
18178 | virtual ~TestCase(); |
18179 | |
18180 | // Gets the name of the TestCase. |
18181 | const char* name() const { return name_.c_str(); } |
18182 | |
18183 | // Returns the name of the parameter type, or NULL if this is not a |
18184 | // type-parameterized test case. |
18185 | const char* type_param() const { |
18186 | if (type_param_.get() != NULL) |
18187 | return type_param_->c_str(); |
18188 | return NULL; |
18189 | } |
18190 | |
18191 | // Returns true if any test in this test case should run. |
18192 | bool should_run() const { return should_run_; } |
18193 | |
18194 | // Gets the number of successful tests in this test case. |
18195 | int successful_test_count() const; |
18196 | |
18197 | // Gets the number of failed tests in this test case. |
18198 | int failed_test_count() const; |
18199 | |
18200 | // Gets the number of disabled tests that will be reported in the XML report. |
18201 | int reportable_disabled_test_count() const; |
18202 | |
18203 | // Gets the number of disabled tests in this test case. |
18204 | int disabled_test_count() const; |
18205 | |
18206 | // Gets the number of tests to be printed in the XML report. |
18207 | int reportable_test_count() const; |
18208 | |
18209 | // Get the number of tests in this test case that should run. |
18210 | int test_to_run_count() const; |
18211 | |
18212 | // Gets the number of all tests in this test case. |
18213 | int total_test_count() const; |
18214 | |
18215 | // Returns true iff the test case passed. |
18216 | bool Passed() const { return !Failed(); } |
18217 | |
18218 | // Returns true iff the test case failed. |
18219 | bool Failed() const { return failed_test_count() > 0; } |
18220 | |
18221 | // Returns the elapsed time, in milliseconds. |
18222 | TimeInMillis elapsed_time() const { return elapsed_time_; } |
18223 | |
18224 | // Returns the i-th test among all the tests. i can range from 0 to |
18225 | // total_test_count() - 1. If i is not in that range, returns NULL. |
18226 | const TestInfo* GetTestInfo(int i) const; |
18227 | |
18228 | // Returns the TestResult that holds test properties recorded during |
18229 | // execution of SetUpTestCase and TearDownTestCase. |
18230 | const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; } |
18231 | |
18232 | private: |
18233 | friend class Test; |
18234 | friend class internal::UnitTestImpl; |
18235 | |
18236 | // Gets the (mutable) vector of TestInfos in this TestCase. |
18237 | std::vector<TestInfo*>& test_info_list() { return test_info_list_; } |
18238 | |
18239 | // Gets the (immutable) vector of TestInfos in this TestCase. |
18240 | const std::vector<TestInfo*>& test_info_list() const { |
18241 | return test_info_list_; |
18242 | } |
18243 | |
18244 | // Returns the i-th test among all the tests. i can range from 0 to |
18245 | // total_test_count() - 1. If i is not in that range, returns NULL. |
18246 | TestInfo* GetMutableTestInfo(int i); |
18247 | |
18248 | // Sets the should_run member. |
18249 | void set_should_run(bool should) { should_run_ = should; } |
18250 | |
18251 | // Adds a TestInfo to this test case. Will delete the TestInfo upon |
18252 | // destruction of the TestCase object. |
18253 | void AddTestInfo(TestInfo * test_info); |
18254 | |
18255 | // Clears the results of all tests in this test case. |
18256 | void ClearResult(); |
18257 | |
18258 | // Clears the results of all tests in the given test case. |
18259 | static void ClearTestCaseResult(TestCase* test_case) { |
18260 | test_case->ClearResult(); |
18261 | } |
18262 | |
18263 | // Runs every test in this TestCase. |
18264 | void Run(); |
18265 | |
18266 | // Runs SetUpTestCase() for this TestCase. This wrapper is needed |
18267 | // for catching exceptions thrown from SetUpTestCase(). |
18268 | void RunSetUpTestCase() { (*set_up_tc_)(); } |
18269 | |
18270 | // Runs TearDownTestCase() for this TestCase. This wrapper is |
18271 | // needed for catching exceptions thrown from TearDownTestCase(). |
18272 | void RunTearDownTestCase() { (*tear_down_tc_)(); } |
18273 | |
18274 | // Returns true iff test passed. |
18275 | static bool TestPassed(const TestInfo* test_info) { |
18276 | return test_info->should_run() && test_info->result()->Passed(); |
18277 | } |
18278 | |
18279 | // Returns true iff test failed. |
18280 | static bool TestFailed(const TestInfo* test_info) { |
18281 | return test_info->should_run() && test_info->result()->Failed(); |
18282 | } |
18283 | |
18284 | // Returns true iff the test is disabled and will be reported in the XML |
18285 | // report. |
18286 | static bool TestReportableDisabled(const TestInfo* test_info) { |
18287 | return test_info->is_reportable() && test_info->is_disabled_; |
18288 | } |
18289 | |
18290 | // Returns true iff test is disabled. |
18291 | static bool TestDisabled(const TestInfo* test_info) { |
18292 | return test_info->is_disabled_; |
18293 | } |
18294 | |
18295 | // Returns true iff this test will appear in the XML report. |
18296 | static bool TestReportable(const TestInfo* test_info) { |
18297 | return test_info->is_reportable(); |
18298 | } |
18299 | |
18300 | // Returns true if the given test should run. |
18301 | static bool ShouldRunTest(const TestInfo* test_info) { |
18302 | return test_info->should_run(); |
18303 | } |
18304 | |
18305 | // Shuffles the tests in this test case. |
18306 | void ShuffleTests(internal::Random* random); |
18307 | |
18308 | // Restores the test order to before the first shuffle. |
18309 | void UnshuffleTests(); |
18310 | |
18311 | // Name of the test case. |
18312 | std::string name_; |
18313 | // Name of the parameter type, or NULL if this is not a typed or a |
18314 | // type-parameterized test. |
18315 | const internal::scoped_ptr<const ::std::string> type_param_; |
18316 | // The vector of TestInfos in their original order. It owns the |
18317 | // elements in the vector. |
18318 | std::vector<TestInfo*> test_info_list_; |
18319 | // Provides a level of indirection for the test list to allow easy |
18320 | // shuffling and restoring the test order. The i-th element in this |
18321 | // vector is the index of the i-th test in the shuffled test list. |
18322 | std::vector<int> test_indices_; |
18323 | // Pointer to the function that sets up the test case. |
18324 | Test::SetUpTestCaseFunc set_up_tc_; |
18325 | // Pointer to the function that tears down the test case. |
18326 | Test::TearDownTestCaseFunc tear_down_tc_; |
18327 | // True iff any test in this test case should run. |
18328 | bool should_run_; |
18329 | // Elapsed time, in milliseconds. |
18330 | TimeInMillis elapsed_time_; |
18331 | // Holds test properties recorded during execution of SetUpTestCase and |
18332 | // TearDownTestCase. |
18333 | TestResult ad_hoc_test_result_; |
18334 | |
18335 | // We disallow copying TestCases. |
18336 | GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase); |
18337 | }; |
18338 | |
18339 | // An Environment object is capable of setting up and tearing down an |
18340 | // environment. The user should subclass this to define his own |
18341 | // environment(s). |
18342 | // |
18343 | // An Environment object does the set-up and tear-down in virtual |
18344 | // methods SetUp() and TearDown() instead of the constructor and the |
18345 | // destructor, as: |
18346 | // |
18347 | // 1. You cannot safely throw from a destructor. This is a problem |
18348 | // as in some cases Google Test is used where exceptions are enabled, and |
18349 | // we may want to implement ASSERT_* using exceptions where they are |
18350 | // available. |
18351 | // 2. You cannot use ASSERT_* directly in a constructor or |
18352 | // destructor. |
18353 | class Environment { |
18354 | public: |
18355 | // The d'tor is virtual as we need to subclass Environment. |
18356 | virtual ~Environment() {} |
18357 | |
18358 | // Override this to define how to set up the environment. |
18359 | virtual void SetUp() {} |
18360 | |
18361 | // Override this to define how to tear down the environment. |
18362 | virtual void TearDown() {} |
18363 | private: |
18364 | // If you see an error about overriding the following function or |
18365 | // about it being private, you have mis-spelled SetUp() as Setup(). |
18366 | struct Setup_should_be_spelled_SetUp {}; |
18367 | virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; } |
18368 | }; |
18369 | |
18370 | // The interface for tracing execution of tests. The methods are organized in |
18371 | // the order the corresponding events are fired. |
18372 | class TestEventListener { |
18373 | public: |
18374 | virtual ~TestEventListener() {} |
18375 | |
18376 | // Fired before any test activity starts. |
18377 | virtual void OnTestProgramStart(const UnitTest& unit_test) = 0; |
18378 | |
18379 | // Fired before each iteration of tests starts. There may be more than |
18380 | // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration |
18381 | // index, starting from 0. |
18382 | virtual void OnTestIterationStart(const UnitTest& unit_test, |
18383 | int iteration) = 0; |
18384 | |
18385 | // Fired before environment set-up for each iteration of tests starts. |
18386 | virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0; |
18387 | |
18388 | // Fired after environment set-up for each iteration of tests ends. |
18389 | virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0; |
18390 | |
18391 | // Fired before the test case starts. |
18392 | virtual void OnTestCaseStart(const TestCase& test_case) = 0; |
18393 | |
18394 | // Fired before the test starts. |
18395 | virtual void OnTestStart(const TestInfo& test_info) = 0; |
18396 | |
18397 | // Fired after a failed assertion or a SUCCEED() invocation. |
18398 | virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0; |
18399 | |
18400 | // Fired after the test ends. |
18401 | virtual void OnTestEnd(const TestInfo& test_info) = 0; |
18402 | |
18403 | // Fired after the test case ends. |
18404 | virtual void OnTestCaseEnd(const TestCase& test_case) = 0; |
18405 | |
18406 | // Fired before environment tear-down for each iteration of tests starts. |
18407 | virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0; |
18408 | |
18409 | // Fired after environment tear-down for each iteration of tests ends. |
18410 | virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0; |
18411 | |
18412 | // Fired after each iteration of tests finishes. |
18413 | virtual void OnTestIterationEnd(const UnitTest& unit_test, |
18414 | int iteration) = 0; |
18415 | |
18416 | // Fired after all test activities have ended. |
18417 | virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; |
18418 | }; |
18419 | |
18420 | // The convenience class for users who need to override just one or two |
18421 | // methods and are not concerned that a possible change to a signature of |
18422 | // the methods they override will not be caught during the build. For |
18423 | // comments about each method please see the definition of TestEventListener |
18424 | // above. |
18425 | class EmptyTestEventListener : public TestEventListener { |
18426 | public: |
18427 | virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} |
18428 | virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, |
18429 | int /*iteration*/) {} |
18430 | virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} |
18431 | virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} |
18432 | virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} |
18433 | virtual void OnTestStart(const TestInfo& /*test_info*/) {} |
18434 | virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} |
18435 | virtual void OnTestEnd(const TestInfo& /*test_info*/) {} |
18436 | virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} |
18437 | virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} |
18438 | virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} |
18439 | virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, |
18440 | int /*iteration*/) {} |
18441 | virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {} |
18442 | }; |
18443 | |
18444 | // TestEventListeners lets users add listeners to track events in Google Test. |
18445 | class GTEST_API_ TestEventListeners { |
18446 | public: |
18447 | TestEventListeners(); |
18448 | ~TestEventListeners(); |
18449 | |
18450 | // Appends an event listener to the end of the list. Google Test assumes |
18451 | // the ownership of the listener (i.e. it will delete the listener when |
18452 | // the test program finishes). |
18453 | void Append(TestEventListener* listener); |
18454 | |
18455 | // Removes the given event listener from the list and returns it. It then |
18456 | // becomes the caller's responsibility to delete the listener. Returns |
18457 | // NULL if the listener is not found in the list. |
18458 | TestEventListener* Release(TestEventListener* listener); |
18459 | |
18460 | // Returns the standard listener responsible for the default console |
18461 | // output. Can be removed from the listeners list to shut down default |
18462 | // console output. Note that removing this object from the listener list |
18463 | // with Release transfers its ownership to the caller and makes this |
18464 | // function return NULL the next time. |
18465 | TestEventListener* default_result_printer() const { |
18466 | return default_result_printer_; |
18467 | } |
18468 | |
18469 | // Returns the standard listener responsible for the default XML output |
18470 | // controlled by the --gtest_output=xml flag. Can be removed from the |
18471 | // listeners list by users who want to shut down the default XML output |
18472 | // controlled by this flag and substitute it with custom one. Note that |
18473 | // removing this object from the listener list with Release transfers its |
18474 | // ownership to the caller and makes this function return NULL the next |
18475 | // time. |
18476 | TestEventListener* default_xml_generator() const { |
18477 | return default_xml_generator_; |
18478 | } |
18479 | |
18480 | private: |
18481 | friend class TestCase; |
18482 | friend class TestInfo; |
18483 | friend class internal::DefaultGlobalTestPartResultReporter; |
18484 | friend class internal::NoExecDeathTest; |
18485 | friend class internal::TestEventListenersAccessor; |
18486 | friend class internal::UnitTestImpl; |
18487 | |
18488 | // Returns repeater that broadcasts the TestEventListener events to all |
18489 | // subscribers. |
18490 | TestEventListener* repeater(); |
18491 | |
18492 | // Sets the default_result_printer attribute to the provided listener. |
18493 | // The listener is also added to the listener list and previous |
18494 | // default_result_printer is removed from it and deleted. The listener can |
18495 | // also be NULL in which case it will not be added to the list. Does |
18496 | // nothing if the previous and the current listener objects are the same. |
18497 | void SetDefaultResultPrinter(TestEventListener* listener); |
18498 | |
18499 | // Sets the default_xml_generator attribute to the provided listener. The |
18500 | // listener is also added to the listener list and previous |
18501 | // default_xml_generator is removed from it and deleted. The listener can |
18502 | // also be NULL in which case it will not be added to the list. Does |
18503 | // nothing if the previous and the current listener objects are the same. |
18504 | void SetDefaultXmlGenerator(TestEventListener* listener); |
18505 | |
18506 | // Controls whether events will be forwarded by the repeater to the |
18507 | // listeners in the list. |
18508 | bool EventForwardingEnabled() const; |
18509 | void SuppressEventForwarding(); |
18510 | |
18511 | // The actual list of listeners. |
18512 | internal::TestEventRepeater* repeater_; |
18513 | // Listener responsible for the standard result output. |
18514 | TestEventListener* default_result_printer_; |
18515 | // Listener responsible for the creation of the XML output file. |
18516 | TestEventListener* default_xml_generator_; |
18517 | |
18518 | // We disallow copying TestEventListeners. |
18519 | GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners); |
18520 | }; |
18521 | |
18522 | // A UnitTest consists of a vector of TestCases. |
18523 | // |
18524 | // This is a singleton class. The only instance of UnitTest is |
18525 | // created when UnitTest::GetInstance() is first called. This |
18526 | // instance is never deleted. |
18527 | // |
18528 | // UnitTest is not copyable. |
18529 | // |
18530 | // This class is thread-safe as long as the methods are called |
18531 | // according to their specification. |
18532 | class GTEST_API_ UnitTest { |
18533 | public: |
18534 | // Gets the singleton UnitTest object. The first time this method |
18535 | // is called, a UnitTest object is constructed and returned. |
18536 | // Consecutive calls will return the same object. |
18537 | static UnitTest* GetInstance(); |
18538 | |
18539 | // Runs all tests in this UnitTest object and prints the result. |
18540 | // Returns 0 if successful, or 1 otherwise. |
18541 | // |
18542 | // This method can only be called from the main thread. |
18543 | // |
18544 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
18545 | int Run() GTEST_MUST_USE_RESULT_; |
18546 | |
18547 | // Returns the working directory when the first TEST() or TEST_F() |
18548 | // was executed. The UnitTest object owns the string. |
18549 | const char* original_working_dir() const; |
18550 | |
18551 | // Returns the TestCase object for the test that's currently running, |
18552 | // or NULL if no test is running. |
18553 | const TestCase* current_test_case() const |
18554 | GTEST_LOCK_EXCLUDED_(mutex_); |
18555 | |
18556 | // Returns the TestInfo object for the test that's currently running, |
18557 | // or NULL if no test is running. |
18558 | const TestInfo* current_test_info() const |
18559 | GTEST_LOCK_EXCLUDED_(mutex_); |
18560 | |
18561 | // Returns the random seed used at the start of the current test run. |
18562 | int random_seed() const; |
18563 | |
18564 | #if GTEST_HAS_PARAM_TEST |
18565 | // Returns the ParameterizedTestCaseRegistry object used to keep track of |
18566 | // value-parameterized tests and instantiate and register them. |
18567 | // |
18568 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
18569 | internal::ParameterizedTestCaseRegistry& parameterized_test_registry() |
18570 | GTEST_LOCK_EXCLUDED_(mutex_); |
18571 | #endif // GTEST_HAS_PARAM_TEST |
18572 | |
18573 | // Gets the number of successful test cases. |
18574 | int successful_test_case_count() const; |
18575 | |
18576 | // Gets the number of failed test cases. |
18577 | int failed_test_case_count() const; |
18578 | |
18579 | // Gets the number of all test cases. |
18580 | int total_test_case_count() const; |
18581 | |
18582 | // Gets the number of all test cases that contain at least one test |
18583 | // that should run. |
18584 | int test_case_to_run_count() const; |
18585 | |
18586 | // Gets the number of successful tests. |
18587 | int successful_test_count() const; |
18588 | |
18589 | // Gets the number of failed tests. |
18590 | int failed_test_count() const; |
18591 | |
18592 | // Gets the number of disabled tests that will be reported in the XML report. |
18593 | int reportable_disabled_test_count() const; |
18594 | |
18595 | // Gets the number of disabled tests. |
18596 | int disabled_test_count() const; |
18597 | |
18598 | // Gets the number of tests to be printed in the XML report. |
18599 | int reportable_test_count() const; |
18600 | |
18601 | // Gets the number of all tests. |
18602 | int total_test_count() const; |
18603 | |
18604 | // Gets the number of tests that should run. |
18605 | int test_to_run_count() const; |
18606 | |
18607 | // Gets the time of the test program start, in ms from the start of the |
18608 | // UNIX epoch. |
18609 | TimeInMillis start_timestamp() const; |
18610 | |
18611 | // Gets the elapsed time, in milliseconds. |
18612 | TimeInMillis elapsed_time() const; |
18613 | |
18614 | // Returns true iff the unit test passed (i.e. all test cases passed). |
18615 | bool Passed() const; |
18616 | |
18617 | // Returns true iff the unit test failed (i.e. some test case failed |
18618 | // or something outside of all tests failed). |
18619 | bool Failed() const; |
18620 | |
18621 | // Gets the i-th test case among all the test cases. i can range from 0 to |
18622 | // total_test_case_count() - 1. If i is not in that range, returns NULL. |
18623 | const TestCase* GetTestCase(int i) const; |
18624 | |
18625 | // Returns the TestResult containing information on test failures and |
18626 | // properties logged outside of individual test cases. |
18627 | const TestResult& ad_hoc_test_result() const; |
18628 | |
18629 | // Returns the list of event listeners that can be used to track events |
18630 | // inside Google Test. |
18631 | TestEventListeners& listeners(); |
18632 | |
18633 | private: |
18634 | // Registers and returns a global test environment. When a test |
18635 | // program is run, all global test environments will be set-up in |
18636 | // the order they were registered. After all tests in the program |
18637 | // have finished, all global test environments will be torn-down in |
18638 | // the *reverse* order they were registered. |
18639 | // |
18640 | // The UnitTest object takes ownership of the given environment. |
18641 | // |
18642 | // This method can only be called from the main thread. |
18643 | Environment* AddEnvironment(Environment* env); |
18644 | |
18645 | // Adds a TestPartResult to the current TestResult object. All |
18646 | // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) |
18647 | // eventually call this to report their results. The user code |
18648 | // should use the assertion macros instead of calling this directly. |
18649 | void AddTestPartResult(TestPartResult::Type result_type, |
18650 | const char* file_name, |
18651 | int line_number, |
18652 | const std::string& message, |
18653 | const std::string& os_stack_trace) |
18654 | GTEST_LOCK_EXCLUDED_(mutex_); |
18655 | |
18656 | // Adds a TestProperty to the current TestResult object when invoked from |
18657 | // inside a test, to current TestCase's ad_hoc_test_result_ when invoked |
18658 | // from SetUpTestCase or TearDownTestCase, or to the global property set |
18659 | // when invoked elsewhere. If the result already contains a property with |
18660 | // the same key, the value will be updated. |
18661 | void RecordProperty(const std::string& key, const std::string& value); |
18662 | |
18663 | // Gets the i-th test case among all the test cases. i can range from 0 to |
18664 | // total_test_case_count() - 1. If i is not in that range, returns NULL. |
18665 | TestCase* GetMutableTestCase(int i); |
18666 | |
18667 | // Accessors for the implementation object. |
18668 | internal::UnitTestImpl* impl() { return impl_; } |
18669 | const internal::UnitTestImpl* impl() const { return impl_; } |
18670 | |
18671 | // These classes and funcions are friends as they need to access private |
18672 | // members of UnitTest. |
18673 | friend class Test; |
18674 | friend class internal::AssertHelper; |
18675 | friend class internal::ScopedTrace; |
18676 | friend class internal::StreamingListenerTest; |
18677 | friend class internal::UnitTestRecordPropertyTestHelper; |
18678 | friend Environment* AddGlobalTestEnvironment(Environment* env); |
18679 | friend internal::UnitTestImpl* internal::GetUnitTestImpl(); |
18680 | friend void internal::ReportFailureInUnknownLocation( |
18681 | TestPartResult::Type result_type, |
18682 | const std::string& message); |
18683 | |
18684 | // Creates an empty UnitTest. |
18685 | UnitTest(); |
18686 | |
18687 | // D'tor |
18688 | virtual ~UnitTest(); |
18689 | |
18690 | // Pushes a trace defined by SCOPED_TRACE() on to the per-thread |
18691 | // Google Test trace stack. |
18692 | void PushGTestTrace(const internal::TraceInfo& trace) |
18693 | GTEST_LOCK_EXCLUDED_(mutex_); |
18694 | |
18695 | // Pops a trace from the per-thread Google Test trace stack. |
18696 | void PopGTestTrace() |
18697 | GTEST_LOCK_EXCLUDED_(mutex_); |
18698 | |
18699 | // Protects mutable state in *impl_. This is mutable as some const |
18700 | // methods need to lock it too. |
18701 | mutable internal::Mutex mutex_; |
18702 | |
18703 | // Opaque implementation object. This field is never changed once |
18704 | // the object is constructed. We don't mark it as const here, as |
18705 | // doing so will cause a warning in the constructor of UnitTest. |
18706 | // Mutable state in *impl_ is protected by mutex_. |
18707 | internal::UnitTestImpl* impl_; |
18708 | |
18709 | // We disallow copying UnitTest. |
18710 | GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest); |
18711 | }; |
18712 | |
18713 | // A convenient wrapper for adding an environment for the test |
18714 | // program. |
18715 | // |
18716 | // You should call this before RUN_ALL_TESTS() is called, probably in |
18717 | // main(). If you use gtest_main, you need to call this before main() |
18718 | // starts for it to take effect. For example, you can define a global |
18719 | // variable like this: |
18720 | // |
18721 | // testing::Environment* const foo_env = |
18722 | // testing::AddGlobalTestEnvironment(new FooEnvironment); |
18723 | // |
18724 | // However, we strongly recommend you to write your own main() and |
18725 | // call AddGlobalTestEnvironment() there, as relying on initialization |
18726 | // of global variables makes the code harder to read and may cause |
18727 | // problems when you register multiple environments from different |
18728 | // translation units and the environments have dependencies among them |
18729 | // (remember that the compiler doesn't guarantee the order in which |
18730 | // global variables from different translation units are initialized). |
18731 | inline Environment* AddGlobalTestEnvironment(Environment* env) { |
18732 | return UnitTest::GetInstance()->AddEnvironment(env); |
18733 | } |
18734 | |
18735 | // Initializes Google Test. This must be called before calling |
18736 | // RUN_ALL_TESTS(). In particular, it parses a command line for the |
18737 | // flags that Google Test recognizes. Whenever a Google Test flag is |
18738 | // seen, it is removed from argv, and *argc is decremented. |
18739 | // |
18740 | // No value is returned. Instead, the Google Test flag variables are |
18741 | // updated. |
18742 | // |
18743 | // Calling the function for the second time has no user-visible effect. |
18744 | GTEST_API_ void InitGoogleTest(int* argc, char** argv); |
18745 | |
18746 | // This overloaded version can be used in Windows programs compiled in |
18747 | // UNICODE mode. |
18748 | GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv); |
18749 | |
18750 | namespace internal { |
18751 | |
18752 | // FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a |
18753 | // value of type ToPrint that is an operand of a comparison assertion |
18754 | // (e.g. ASSERT_EQ). OtherOperand is the type of the other operand in |
18755 | // the comparison, and is used to help determine the best way to |
18756 | // format the value. In particular, when the value is a C string |
18757 | // (char pointer) and the other operand is an STL string object, we |
18758 | // want to format the C string as a string, since we know it is |
18759 | // compared by value with the string object. If the value is a char |
18760 | // pointer but the other operand is not an STL string object, we don't |
18761 | // know whether the pointer is supposed to point to a NUL-terminated |
18762 | // string, and thus want to print it as a pointer to be safe. |
18763 | // |
18764 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
18765 | |
18766 | // The default case. |
18767 | template <typename ToPrint, typename OtherOperand> |
18768 | class FormatForComparison { |
18769 | public: |
18770 | static ::std::string Format(const ToPrint& value) { |
18771 | return ::testing::PrintToString(value); |
18772 | } |
18773 | }; |
18774 | |
18775 | // Array. |
18776 | template <typename ToPrint, size_t N, typename OtherOperand> |
18777 | class FormatForComparison<ToPrint[N], OtherOperand> { |
18778 | public: |
18779 | static ::std::string Format(const ToPrint* value) { |
18780 | return FormatForComparison<const ToPrint*, OtherOperand>::Format(value); |
18781 | } |
18782 | }; |
18783 | |
18784 | // By default, print C string as pointers to be safe, as we don't know |
18785 | // whether they actually point to a NUL-terminated string. |
18786 | |
18787 | #define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \ |
18788 | template <typename OtherOperand> \ |
18789 | class FormatForComparison<CharType*, OtherOperand> { \ |
18790 | public: \ |
18791 | static ::std::string Format(CharType* value) { \ |
18792 | return ::testing::PrintToString(static_cast<const void*>(value)); \ |
18793 | } \ |
18794 | } |
18795 | |
18796 | GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char); |
18797 | GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char); |
18798 | GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t); |
18799 | GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t); |
18800 | |
18801 | #undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_ |
18802 | |
18803 | // If a C string is compared with an STL string object, we know it's meant |
18804 | // to point to a NUL-terminated string, and thus can print it as a string. |
18805 | |
18806 | #define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \ |
18807 | template <> \ |
18808 | class FormatForComparison<CharType*, OtherStringType> { \ |
18809 | public: \ |
18810 | static ::std::string Format(CharType* value) { \ |
18811 | return ::testing::PrintToString(value); \ |
18812 | } \ |
18813 | } |
18814 | |
18815 | GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string); |
18816 | GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string); |
18817 | |
18818 | #if GTEST_HAS_GLOBAL_STRING |
18819 | GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string); |
18820 | GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string); |
18821 | #endif |
18822 | |
18823 | #if GTEST_HAS_GLOBAL_WSTRING |
18824 | GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring); |
18825 | GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring); |
18826 | #endif |
18827 | |
18828 | #if GTEST_HAS_STD_WSTRING |
18829 | GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring); |
18830 | GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring); |
18831 | #endif |
18832 | |
18833 | #undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_ |
18834 | |
18835 | // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc) |
18836 | // operand to be used in a failure message. The type (but not value) |
18837 | // of the other operand may affect the format. This allows us to |
18838 | // print a char* as a raw pointer when it is compared against another |
18839 | // char* or void*, and print it as a C string when it is compared |
18840 | // against an std::string object, for example. |
18841 | // |
18842 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
18843 | template <typename T1, typename T2> |
18844 | std::string FormatForComparisonFailureMessage( |
18845 | const T1& value, const T2& /* other_operand */) { |
18846 | return FormatForComparison<T1, T2>::Format(value); |
18847 | } |
18848 | |
18849 | // The helper function for {ASSERT|EXPECT}_EQ. |
18850 | template <typename T1, typename T2> |
18851 | AssertionResult CmpHelperEQ(const char* expected_expression, |
18852 | const char* actual_expression, |
18853 | const T1& expected, |
18854 | const T2& actual) { |
18855 | #ifdef _MSC_VER |
18856 | # pragma warning(push) // Saves the current warning state. |
18857 | # pragma warning(disable:4389) // Temporarily disables warning on |
18858 | // signed/unsigned mismatch. |
18859 | #endif |
18860 | |
18861 | if (expected == actual) { |
18862 | return AssertionSuccess(); |
18863 | } |
18864 | |
18865 | #ifdef _MSC_VER |
18866 | # pragma warning(pop) // Restores the warning state. |
18867 | #endif |
18868 | |
18869 | return EqFailure(expected_expression, |
18870 | actual_expression, |
18871 | FormatForComparisonFailureMessage(expected, actual), |
18872 | FormatForComparisonFailureMessage(actual, expected), |
18873 | false); |
18874 | } |
18875 | |
18876 | // With this overloaded version, we allow anonymous enums to be used |
18877 | // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums |
18878 | // can be implicitly cast to BiggestInt. |
18879 | GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression, |
18880 | const char* actual_expression, |
18881 | BiggestInt expected, |
18882 | BiggestInt actual); |
18883 | |
18884 | // The helper class for {ASSERT|EXPECT}_EQ. The template argument |
18885 | // lhs_is_null_literal is true iff the first argument to ASSERT_EQ() |
18886 | // is a null pointer literal. The following default implementation is |
18887 | // for lhs_is_null_literal being false. |
18888 | template <bool lhs_is_null_literal> |
18889 | class EqHelper { |
18890 | public: |
18891 | // This templatized version is for the general case. |
18892 | template <typename T1, typename T2> |
18893 | static AssertionResult Compare(const char* expected_expression, |
18894 | const char* actual_expression, |
18895 | const T1& expected, |
18896 | const T2& actual) { |
18897 | return CmpHelperEQ(expected_expression, actual_expression, expected, |
18898 | actual); |
18899 | } |
18900 | |
18901 | // With this overloaded version, we allow anonymous enums to be used |
18902 | // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous |
18903 | // enums can be implicitly cast to BiggestInt. |
18904 | // |
18905 | // Even though its body looks the same as the above version, we |
18906 | // cannot merge the two, as it will make anonymous enums unhappy. |
18907 | static AssertionResult Compare(const char* expected_expression, |
18908 | const char* actual_expression, |
18909 | BiggestInt expected, |
18910 | BiggestInt actual) { |
18911 | return CmpHelperEQ(expected_expression, actual_expression, expected, |
18912 | actual); |
18913 | } |
18914 | }; |
18915 | |
18916 | // This specialization is used when the first argument to ASSERT_EQ() |
18917 | // is a null pointer literal, like NULL, false, or 0. |
18918 | template <> |
18919 | class EqHelper<true> { |
18920 | public: |
18921 | // We define two overloaded versions of Compare(). The first |
18922 | // version will be picked when the second argument to ASSERT_EQ() is |
18923 | // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or |
18924 | // EXPECT_EQ(false, a_bool). |
18925 | template <typename T1, typename T2> |
18926 | static AssertionResult Compare( |
18927 | const char* expected_expression, |
18928 | const char* actual_expression, |
18929 | const T1& expected, |
18930 | const T2& actual, |
18931 | // The following line prevents this overload from being considered if T2 |
18932 | // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr) |
18933 | // expands to Compare("", "", NULL, my_ptr), which requires a conversion |
18934 | // to match the Secret* in the other overload, which would otherwise make |
18935 | // this template match better. |
18936 | typename EnableIf<!is_pointer<T2>::value>::type* = 0) { |
18937 | return CmpHelperEQ(expected_expression, actual_expression, expected, |
18938 | actual); |
18939 | } |
18940 | |
18941 | // This version will be picked when the second argument to ASSERT_EQ() is a |
18942 | // pointer, e.g. ASSERT_EQ(NULL, a_pointer). |
18943 | template <typename T> |
18944 | static AssertionResult Compare( |
18945 | const char* expected_expression, |
18946 | const char* actual_expression, |
18947 | // We used to have a second template parameter instead of Secret*. That |
18948 | // template parameter would deduce to 'long', making this a better match |
18949 | // than the first overload even without the first overload's EnableIf. |
18950 | // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to |
18951 | // non-pointer argument" (even a deduced integral argument), so the old |
18952 | // implementation caused warnings in user code. |
18953 | Secret* /* expected (NULL) */, |
18954 | T* actual) { |
18955 | // We already know that 'expected' is a null pointer. |
18956 | return CmpHelperEQ(expected_expression, actual_expression, |
18957 | static_cast<T*>(NULL), actual); |
18958 | } |
18959 | }; |
18960 | |
18961 | // A macro for implementing the helper functions needed to implement |
18962 | // ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste |
18963 | // of similar code. |
18964 | // |
18965 | // For each templatized helper function, we also define an overloaded |
18966 | // version for BiggestInt in order to reduce code bloat and allow |
18967 | // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled |
18968 | // with gcc 4. |
18969 | // |
18970 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
18971 | #define GTEST_IMPL_CMP_HELPER_(op_name, op)\ |
18972 | template <typename T1, typename T2>\ |
18973 | AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ |
18974 | const T1& val1, const T2& val2) {\ |
18975 | if (val1 op val2) {\ |
18976 | return AssertionSuccess();\ |
18977 | } else {\ |
18978 | return AssertionFailure() \ |
18979 | << "Expected: (" << expr1 << ") " #op " (" << expr2\ |
18980 | << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\ |
18981 | << " vs " << FormatForComparisonFailureMessage(val2, val1);\ |
18982 | }\ |
18983 | }\ |
18984 | GTEST_API_ AssertionResult CmpHelper##op_name(\ |
18985 | const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2) |
18986 | |
18987 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
18988 | |
18989 | // Implements the helper function for {ASSERT|EXPECT}_NE |
18990 | GTEST_IMPL_CMP_HELPER_(NE, !=); |
18991 | // Implements the helper function for {ASSERT|EXPECT}_LE |
18992 | GTEST_IMPL_CMP_HELPER_(LE, <=); |
18993 | // Implements the helper function for {ASSERT|EXPECT}_LT |
18994 | GTEST_IMPL_CMP_HELPER_(LT, <); |
18995 | // Implements the helper function for {ASSERT|EXPECT}_GE |
18996 | GTEST_IMPL_CMP_HELPER_(GE, >=); |
18997 | // Implements the helper function for {ASSERT|EXPECT}_GT |
18998 | GTEST_IMPL_CMP_HELPER_(GT, >); |
18999 | |
19000 | #undef GTEST_IMPL_CMP_HELPER_ |
19001 | |
19002 | // The helper function for {ASSERT|EXPECT}_STREQ. |
19003 | // |
19004 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
19005 | GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression, |
19006 | const char* actual_expression, |
19007 | const char* expected, |
19008 | const char* actual); |
19009 | |
19010 | // The helper function for {ASSERT|EXPECT}_STRCASEEQ. |
19011 | // |
19012 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
19013 | GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression, |
19014 | const char* actual_expression, |
19015 | const char* expected, |
19016 | const char* actual); |
19017 | |
19018 | // The helper function for {ASSERT|EXPECT}_STRNE. |
19019 | // |
19020 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
19021 | GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, |
19022 | const char* s2_expression, |
19023 | const char* s1, |
19024 | const char* s2); |
19025 | |
19026 | // The helper function for {ASSERT|EXPECT}_STRCASENE. |
19027 | // |
19028 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
19029 | GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, |
19030 | const char* s2_expression, |
19031 | const char* s1, |
19032 | const char* s2); |
19033 | |
19034 | |
19035 | // Helper function for *_STREQ on wide strings. |
19036 | // |
19037 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
19038 | GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression, |
19039 | const char* actual_expression, |
19040 | const wchar_t* expected, |
19041 | const wchar_t* actual); |
19042 | |
19043 | // Helper function for *_STRNE on wide strings. |
19044 | // |
19045 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
19046 | GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, |
19047 | const char* s2_expression, |
19048 | const wchar_t* s1, |
19049 | const wchar_t* s2); |
19050 | |
19051 | } // namespace internal |
19052 | |
19053 | // IsSubstring() and IsNotSubstring() are intended to be used as the |
19054 | // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by |
19055 | // themselves. They check whether needle is a substring of haystack |
19056 | // (NULL is considered a substring of itself only), and return an |
19057 | // appropriate error message when they fail. |
19058 | // |
19059 | // The {needle,haystack}_expr arguments are the stringified |
19060 | // expressions that generated the two real arguments. |
19061 | GTEST_API_ AssertionResult IsSubstring( |
19062 | const char* needle_expr, const char* haystack_expr, |
19063 | const char* needle, const char* haystack); |
19064 | GTEST_API_ AssertionResult IsSubstring( |
19065 | const char* needle_expr, const char* haystack_expr, |
19066 | const wchar_t* needle, const wchar_t* haystack); |
19067 | GTEST_API_ AssertionResult IsNotSubstring( |
19068 | const char* needle_expr, const char* haystack_expr, |
19069 | const char* needle, const char* haystack); |
19070 | GTEST_API_ AssertionResult IsNotSubstring( |
19071 | const char* needle_expr, const char* haystack_expr, |
19072 | const wchar_t* needle, const wchar_t* haystack); |
19073 | GTEST_API_ AssertionResult IsSubstring( |
19074 | const char* needle_expr, const char* haystack_expr, |
19075 | const ::std::string& needle, const ::std::string& haystack); |
19076 | GTEST_API_ AssertionResult IsNotSubstring( |
19077 | const char* needle_expr, const char* haystack_expr, |
19078 | const ::std::string& needle, const ::std::string& haystack); |
19079 | |
19080 | #if GTEST_HAS_STD_WSTRING |
19081 | GTEST_API_ AssertionResult IsSubstring( |
19082 | const char* needle_expr, const char* haystack_expr, |
19083 | const ::std::wstring& needle, const ::std::wstring& haystack); |
19084 | GTEST_API_ AssertionResult IsNotSubstring( |
19085 | const char* needle_expr, const char* haystack_expr, |
19086 | const ::std::wstring& needle, const ::std::wstring& haystack); |
19087 | #endif // GTEST_HAS_STD_WSTRING |
19088 | |
19089 | namespace internal { |
19090 | |
19091 | // Helper template function for comparing floating-points. |
19092 | // |
19093 | // Template parameter: |
19094 | // |
19095 | // RawType: the raw floating-point type (either float or double) |
19096 | // |
19097 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
19098 | template <typename RawType> |
19099 | AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression, |
19100 | const char* actual_expression, |
19101 | RawType expected, |
19102 | RawType actual) { |
19103 | const FloatingPoint<RawType> lhs(expected), rhs(actual); |
19104 | |
19105 | if (lhs.AlmostEquals(rhs)) { |
19106 | return AssertionSuccess(); |
19107 | } |
19108 | |
19109 | ::std::stringstream expected_ss; |
19110 | expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2) |
19111 | << expected; |
19112 | |
19113 | ::std::stringstream actual_ss; |
19114 | actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2) |
19115 | << actual; |
19116 | |
19117 | return EqFailure(expected_expression, |
19118 | actual_expression, |
19119 | StringStreamToString(&expected_ss), |
19120 | StringStreamToString(&actual_ss), |
19121 | false); |
19122 | } |
19123 | |
19124 | // Helper function for implementing ASSERT_NEAR. |
19125 | // |
19126 | // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. |
19127 | GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1, |
19128 | const char* expr2, |
19129 | const char* abs_error_expr, |
19130 | double val1, |
19131 | double val2, |
19132 | double abs_error); |
19133 | |
19134 | // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. |
19135 | // A class that enables one to stream messages to assertion macros |
19136 | class GTEST_API_ AssertHelper { |
19137 | public: |
19138 | // Constructor. |
19139 | AssertHelper(TestPartResult::Type type, |
19140 | const char* file, |
19141 | int line, |
19142 | const char* message); |
19143 | ~AssertHelper(); |
19144 | |
19145 | // Message assignment is a semantic trick to enable assertion |
19146 | // streaming; see the GTEST_MESSAGE_ macro below. |
19147 | void operator=(const Message& message) const; |
19148 | |
19149 | private: |
19150 | // We put our data in a struct so that the size of the AssertHelper class can |
19151 | // be as small as possible. This is important because gcc is incapable of |
19152 | // re-using stack space even for temporary variables, so every EXPECT_EQ |
19153 | // reserves stack space for another AssertHelper. |
19154 | struct AssertHelperData { |
19155 | AssertHelperData(TestPartResult::Type t, |
19156 | const char* srcfile, |
19157 | int line_num, |
19158 | const char* msg) |
19159 | : type(t), file(srcfile), line(line_num), message(msg) { } |
19160 | |
19161 | TestPartResult::Type const type; |
19162 | const char* const file; |
19163 | int const line; |
19164 | std::string const message; |
19165 | |
19166 | private: |
19167 | GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData); |
19168 | }; |
19169 | |
19170 | AssertHelperData* const data_; |
19171 | |
19172 | GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper); |
19173 | }; |
19174 | |
19175 | } // namespace internal |
19176 | |
19177 | #if GTEST_HAS_PARAM_TEST |
19178 | // The pure interface class that all value-parameterized tests inherit from. |
19179 | // A value-parameterized class must inherit from both ::testing::Test and |
19180 | // ::testing::WithParamInterface. In most cases that just means inheriting |
19181 | // from ::testing::TestWithParam, but more complicated test hierarchies |
19182 | // may need to inherit from Test and WithParamInterface at different levels. |
19183 | // |
19184 | // This interface has support for accessing the test parameter value via |
19185 | // the GetParam() method. |
19186 | // |
19187 | // Use it with one of the parameter generator defining functions, like Range(), |
19188 | // Values(), ValuesIn(), Bool(), and Combine(). |
19189 | // |
19190 | // class FooTest : public ::testing::TestWithParam<int> { |
19191 | // protected: |
19192 | // FooTest() { |
19193 | // // Can use GetParam() here. |
19194 | // } |
19195 | // virtual ~FooTest() { |
19196 | // // Can use GetParam() here. |
19197 | // } |
19198 | // virtual void SetUp() { |
19199 | // // Can use GetParam() here. |
19200 | // } |
19201 | // virtual void TearDown { |
19202 | // // Can use GetParam() here. |
19203 | // } |
19204 | // }; |
19205 | // TEST_P(FooTest, DoesBar) { |
19206 | // // Can use GetParam() method here. |
19207 | // Foo foo; |
19208 | // ASSERT_TRUE(foo.DoesBar(GetParam())); |
19209 | // } |
19210 | // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10)); |
19211 | |
19212 | template <typename T> |
19213 | class WithParamInterface { |
19214 | public: |
19215 | typedef T ParamType; |
19216 | virtual ~WithParamInterface() {} |
19217 | |
19218 | // The current parameter value. Is also available in the test fixture's |
19219 | // constructor. This member function is non-static, even though it only |
19220 | // references static data, to reduce the opportunity for incorrect uses |
19221 | // like writing 'WithParamInterface<bool>::GetParam()' for a test that |
19222 | // uses a fixture whose parameter type is int. |
19223 | const ParamType& GetParam() const { |
19224 | GTEST_CHECK_(parameter_ != NULL) |
19225 | << "GetParam() can only be called inside a value-parameterized test " |
19226 | << "-- did you intend to write TEST_P instead of TEST_F?" ; |
19227 | return *parameter_; |
19228 | } |
19229 | |
19230 | private: |
19231 | // Sets parameter value. The caller is responsible for making sure the value |
19232 | // remains alive and unchanged throughout the current test. |
19233 | static void SetParam(const ParamType* parameter) { |
19234 | parameter_ = parameter; |
19235 | } |
19236 | |
19237 | // Static value used for accessing parameter during a test lifetime. |
19238 | static const ParamType* parameter_; |
19239 | |
19240 | // TestClass must be a subclass of WithParamInterface<T> and Test. |
19241 | template <class TestClass> friend class internal::ParameterizedTestFactory; |
19242 | }; |
19243 | |
19244 | template <typename T> |
19245 | const T* WithParamInterface<T>::parameter_ = NULL; |
19246 | |
19247 | // Most value-parameterized classes can ignore the existence of |
19248 | // WithParamInterface, and can just inherit from ::testing::TestWithParam. |
19249 | |
19250 | template <typename T> |
19251 | class TestWithParam : public Test, public WithParamInterface<T> { |
19252 | }; |
19253 | |
19254 | #endif // GTEST_HAS_PARAM_TEST |
19255 | |
19256 | // Macros for indicating success/failure in test code. |
19257 | |
19258 | // ADD_FAILURE unconditionally adds a failure to the current test. |
19259 | // SUCCEED generates a success - it doesn't automatically make the |
19260 | // current test successful, as a test is only successful when it has |
19261 | // no failure. |
19262 | // |
19263 | // EXPECT_* verifies that a certain condition is satisfied. If not, |
19264 | // it behaves like ADD_FAILURE. In particular: |
19265 | // |
19266 | // EXPECT_TRUE verifies that a Boolean condition is true. |
19267 | // EXPECT_FALSE verifies that a Boolean condition is false. |
19268 | // |
19269 | // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except |
19270 | // that they will also abort the current function on failure. People |
19271 | // usually want the fail-fast behavior of FAIL and ASSERT_*, but those |
19272 | // writing data-driven tests often find themselves using ADD_FAILURE |
19273 | // and EXPECT_* more. |
19274 | |
19275 | // Generates a nonfatal failure with a generic message. |
19276 | #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed") |
19277 | |
19278 | // Generates a nonfatal failure at the given source file location with |
19279 | // a generic message. |
19280 | #define ADD_FAILURE_AT(file, line) \ |
19281 | GTEST_MESSAGE_AT_(file, line, "Failed", \ |
19282 | ::testing::TestPartResult::kNonFatalFailure) |
19283 | |
19284 | // Generates a fatal failure with a generic message. |
19285 | #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed") |
19286 | |
19287 | // Define this macro to 1 to omit the definition of FAIL(), which is a |
19288 | // generic name and clashes with some other libraries. |
19289 | #if !GTEST_DONT_DEFINE_FAIL |
19290 | # define FAIL() GTEST_FAIL() |
19291 | #endif |
19292 | |
19293 | // Generates a success with a generic message. |
19294 | #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded") |
19295 | |
19296 | // Define this macro to 1 to omit the definition of SUCCEED(), which |
19297 | // is a generic name and clashes with some other libraries. |
19298 | #if !GTEST_DONT_DEFINE_SUCCEED |
19299 | # define SUCCEED() GTEST_SUCCEED() |
19300 | #endif |
19301 | |
19302 | // Macros for testing exceptions. |
19303 | // |
19304 | // * {ASSERT|EXPECT}_THROW(statement, expected_exception): |
19305 | // Tests that the statement throws the expected exception. |
19306 | // * {ASSERT|EXPECT}_NO_THROW(statement): |
19307 | // Tests that the statement doesn't throw any exception. |
19308 | // * {ASSERT|EXPECT}_ANY_THROW(statement): |
19309 | // Tests that the statement throws an exception. |
19310 | |
19311 | #define EXPECT_THROW(statement, expected_exception) \ |
19312 | GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_) |
19313 | #define EXPECT_NO_THROW(statement) \ |
19314 | GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_) |
19315 | #define EXPECT_ANY_THROW(statement) \ |
19316 | GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_) |
19317 | #define ASSERT_THROW(statement, expected_exception) \ |
19318 | GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_) |
19319 | #define ASSERT_NO_THROW(statement) \ |
19320 | GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_) |
19321 | #define ASSERT_ANY_THROW(statement) \ |
19322 | GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_) |
19323 | |
19324 | // Boolean assertions. Condition can be either a Boolean expression or an |
19325 | // AssertionResult. For more information on how to use AssertionResult with |
19326 | // these macros see comments on that class. |
19327 | #define EXPECT_TRUE(condition) \ |
19328 | GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ |
19329 | GTEST_NONFATAL_FAILURE_) |
19330 | #define EXPECT_FALSE(condition) \ |
19331 | GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \ |
19332 | GTEST_NONFATAL_FAILURE_) |
19333 | #define ASSERT_TRUE(condition) \ |
19334 | GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ |
19335 | GTEST_FATAL_FAILURE_) |
19336 | #define ASSERT_FALSE(condition) \ |
19337 | GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \ |
19338 | GTEST_FATAL_FAILURE_) |
19339 | |
19340 | // Includes the auto-generated header that implements a family of |
19341 | // generic predicate assertion macros. |
19342 | // Copyright 2006, Google Inc. |
19343 | // All rights reserved. |
19344 | // |
19345 | // Redistribution and use in source and binary forms, with or without |
19346 | // modification, are permitted provided that the following conditions are |
19347 | // met: |
19348 | // |
19349 | // * Redistributions of source code must retain the above copyright |
19350 | // notice, this list of conditions and the following disclaimer. |
19351 | // * Redistributions in binary form must reproduce the above |
19352 | // copyright notice, this list of conditions and the following disclaimer |
19353 | // in the documentation and/or other materials provided with the |
19354 | // distribution. |
19355 | // * Neither the name of Google Inc. nor the names of its |
19356 | // contributors may be used to endorse or promote products derived from |
19357 | // this software without specific prior written permission. |
19358 | // |
19359 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19360 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
19361 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
19362 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
19363 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
19364 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
19365 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
19366 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
19367 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
19368 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
19369 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
19370 | |
19371 | // This file is AUTOMATICALLY GENERATED on 10/31/2011 by command |
19372 | // 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND! |
19373 | // |
19374 | // Implements a family of generic predicate assertion macros. |
19375 | |
19376 | #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ |
19377 | #define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ |
19378 | |
19379 | // Makes sure this header is not included before gtest.h. |
19380 | #ifndef GTEST_INCLUDE_GTEST_GTEST_H_ |
19381 | # error Do not include gtest_pred_impl.h directly. Include gtest.h instead. |
19382 | #endif // GTEST_INCLUDE_GTEST_GTEST_H_ |
19383 | |
19384 | // This header implements a family of generic predicate assertion |
19385 | // macros: |
19386 | // |
19387 | // ASSERT_PRED_FORMAT1(pred_format, v1) |
19388 | // ASSERT_PRED_FORMAT2(pred_format, v1, v2) |
19389 | // ... |
19390 | // |
19391 | // where pred_format is a function or functor that takes n (in the |
19392 | // case of ASSERT_PRED_FORMATn) values and their source expression |
19393 | // text, and returns a testing::AssertionResult. See the definition |
19394 | // of ASSERT_EQ in gtest.h for an example. |
19395 | // |
19396 | // If you don't care about formatting, you can use the more |
19397 | // restrictive version: |
19398 | // |
19399 | // ASSERT_PRED1(pred, v1) |
19400 | // ASSERT_PRED2(pred, v1, v2) |
19401 | // ... |
19402 | // |
19403 | // where pred is an n-ary function or functor that returns bool, |
19404 | // and the values v1, v2, ..., must support the << operator for |
19405 | // streaming to std::ostream. |
19406 | // |
19407 | // We also define the EXPECT_* variations. |
19408 | // |
19409 | // For now we only support predicates whose arity is at most 5. |
19410 | // Please email googletestframework@googlegroups.com if you need |
19411 | // support for higher arities. |
19412 | |
19413 | // GTEST_ASSERT_ is the basic statement to which all of the assertions |
19414 | // in this file reduce. Don't use this in your code. |
19415 | |
19416 | #define GTEST_ASSERT_(expression, on_failure) \ |
19417 | GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ |
19418 | if (const ::testing::AssertionResult gtest_ar = (expression)) \ |
19419 | ; \ |
19420 | else \ |
19421 | on_failure(gtest_ar.failure_message()) |
19422 | |
19423 | |
19424 | // Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use |
19425 | // this in your code. |
19426 | template <typename Pred, |
19427 | typename T1> |
19428 | AssertionResult AssertPred1Helper(const char* pred_text, |
19429 | const char* e1, |
19430 | Pred pred, |
19431 | const T1& v1) { |
19432 | if (pred(v1)) return AssertionSuccess(); |
19433 | |
19434 | return AssertionFailure() << pred_text << "(" |
19435 | << e1 << ") evaluates to false, where" |
19436 | << "\n" << e1 << " evaluates to " << v1; |
19437 | } |
19438 | |
19439 | // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1. |
19440 | // Don't use this in your code. |
19441 | #define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\ |
19442 | GTEST_ASSERT_(pred_format(#v1, v1), \ |
19443 | on_failure) |
19444 | |
19445 | // Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use |
19446 | // this in your code. |
19447 | #define GTEST_PRED1_(pred, v1, on_failure)\ |
19448 | GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \ |
19449 | #v1, \ |
19450 | pred, \ |
19451 | v1), on_failure) |
19452 | |
19453 | // Unary predicate assertion macros. |
19454 | #define EXPECT_PRED_FORMAT1(pred_format, v1) \ |
19455 | GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_) |
19456 | #define EXPECT_PRED1(pred, v1) \ |
19457 | GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_) |
19458 | #define ASSERT_PRED_FORMAT1(pred_format, v1) \ |
19459 | GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_) |
19460 | #define ASSERT_PRED1(pred, v1) \ |
19461 | GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_) |
19462 | |
19463 | |
19464 | |
19465 | // Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use |
19466 | // this in your code. |
19467 | template <typename Pred, |
19468 | typename T1, |
19469 | typename T2> |
19470 | AssertionResult AssertPred2Helper(const char* pred_text, |
19471 | const char* e1, |
19472 | const char* e2, |
19473 | Pred pred, |
19474 | const T1& v1, |
19475 | const T2& v2) { |
19476 | if (pred(v1, v2)) return AssertionSuccess(); |
19477 | |
19478 | return AssertionFailure() << pred_text << "(" |
19479 | << e1 << ", " |
19480 | << e2 << ") evaluates to false, where" |
19481 | << "\n" << e1 << " evaluates to " << v1 |
19482 | << "\n" << e2 << " evaluates to " << v2; |
19483 | } |
19484 | |
19485 | // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2. |
19486 | // Don't use this in your code. |
19487 | #define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\ |
19488 | GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \ |
19489 | on_failure) |
19490 | |
19491 | // Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use |
19492 | // this in your code. |
19493 | #define GTEST_PRED2_(pred, v1, v2, on_failure)\ |
19494 | GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \ |
19495 | #v1, \ |
19496 | #v2, \ |
19497 | pred, \ |
19498 | v1, \ |
19499 | v2), on_failure) |
19500 | |
19501 | // Binary predicate assertion macros. |
19502 | #define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \ |
19503 | GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_) |
19504 | #define EXPECT_PRED2(pred, v1, v2) \ |
19505 | GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_) |
19506 | #define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \ |
19507 | GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_) |
19508 | #define ASSERT_PRED2(pred, v1, v2) \ |
19509 | GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_) |
19510 | |
19511 | |
19512 | |
19513 | // Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use |
19514 | // this in your code. |
19515 | template <typename Pred, |
19516 | typename T1, |
19517 | typename T2, |
19518 | typename T3> |
19519 | AssertionResult AssertPred3Helper(const char* pred_text, |
19520 | const char* e1, |
19521 | const char* e2, |
19522 | const char* e3, |
19523 | Pred pred, |
19524 | const T1& v1, |
19525 | const T2& v2, |
19526 | const T3& v3) { |
19527 | if (pred(v1, v2, v3)) return AssertionSuccess(); |
19528 | |
19529 | return AssertionFailure() << pred_text << "(" |
19530 | << e1 << ", " |
19531 | << e2 << ", " |
19532 | << e3 << ") evaluates to false, where" |
19533 | << "\n" << e1 << " evaluates to " << v1 |
19534 | << "\n" << e2 << " evaluates to " << v2 |
19535 | << "\n" << e3 << " evaluates to " << v3; |
19536 | } |
19537 | |
19538 | // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3. |
19539 | // Don't use this in your code. |
19540 | #define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\ |
19541 | GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \ |
19542 | on_failure) |
19543 | |
19544 | // Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use |
19545 | // this in your code. |
19546 | #define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\ |
19547 | GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \ |
19548 | #v1, \ |
19549 | #v2, \ |
19550 | #v3, \ |
19551 | pred, \ |
19552 | v1, \ |
19553 | v2, \ |
19554 | v3), on_failure) |
19555 | |
19556 | // Ternary predicate assertion macros. |
19557 | #define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \ |
19558 | GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_) |
19559 | #define EXPECT_PRED3(pred, v1, v2, v3) \ |
19560 | GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_) |
19561 | #define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \ |
19562 | GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_) |
19563 | #define ASSERT_PRED3(pred, v1, v2, v3) \ |
19564 | GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_) |
19565 | |
19566 | |
19567 | |
19568 | // Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use |
19569 | // this in your code. |
19570 | template <typename Pred, |
19571 | typename T1, |
19572 | typename T2, |
19573 | typename T3, |
19574 | typename T4> |
19575 | AssertionResult AssertPred4Helper(const char* pred_text, |
19576 | const char* e1, |
19577 | const char* e2, |
19578 | const char* e3, |
19579 | const char* e4, |
19580 | Pred pred, |
19581 | const T1& v1, |
19582 | const T2& v2, |
19583 | const T3& v3, |
19584 | const T4& v4) { |
19585 | if (pred(v1, v2, v3, v4)) return AssertionSuccess(); |
19586 | |
19587 | return AssertionFailure() << pred_text << "(" |
19588 | << e1 << ", " |
19589 | << e2 << ", " |
19590 | << e3 << ", " |
19591 | << e4 << ") evaluates to false, where" |
19592 | << "\n" << e1 << " evaluates to " << v1 |
19593 | << "\n" << e2 << " evaluates to " << v2 |
19594 | << "\n" << e3 << " evaluates to " << v3 |
19595 | << "\n" << e4 << " evaluates to " << v4; |
19596 | } |
19597 | |
19598 | // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4. |
19599 | // Don't use this in your code. |
19600 | #define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\ |
19601 | GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \ |
19602 | on_failure) |
19603 | |
19604 | // Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use |
19605 | // this in your code. |
19606 | #define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\ |
19607 | GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \ |
19608 | #v1, \ |
19609 | #v2, \ |
19610 | #v3, \ |
19611 | #v4, \ |
19612 | pred, \ |
19613 | v1, \ |
19614 | v2, \ |
19615 | v3, \ |
19616 | v4), on_failure) |
19617 | |
19618 | // 4-ary predicate assertion macros. |
19619 | #define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \ |
19620 | GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_) |
19621 | #define EXPECT_PRED4(pred, v1, v2, v3, v4) \ |
19622 | GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_) |
19623 | #define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \ |
19624 | GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_) |
19625 | #define ASSERT_PRED4(pred, v1, v2, v3, v4) \ |
19626 | GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_) |
19627 | |
19628 | |
19629 | |
19630 | // Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use |
19631 | // this in your code. |
19632 | template <typename Pred, |
19633 | typename T1, |
19634 | typename T2, |
19635 | typename T3, |
19636 | typename T4, |
19637 | typename T5> |
19638 | AssertionResult AssertPred5Helper(const char* pred_text, |
19639 | const char* e1, |
19640 | const char* e2, |
19641 | const char* e3, |
19642 | const char* e4, |
19643 | const char* e5, |
19644 | Pred pred, |
19645 | const T1& v1, |
19646 | const T2& v2, |
19647 | const T3& v3, |
19648 | const T4& v4, |
19649 | const T5& v5) { |
19650 | if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess(); |
19651 | |
19652 | return AssertionFailure() << pred_text << "(" |
19653 | << e1 << ", " |
19654 | << e2 << ", " |
19655 | << e3 << ", " |
19656 | << e4 << ", " |
19657 | << e5 << ") evaluates to false, where" |
19658 | << "\n" << e1 << " evaluates to " << v1 |
19659 | << "\n" << e2 << " evaluates to " << v2 |
19660 | << "\n" << e3 << " evaluates to " << v3 |
19661 | << "\n" << e4 << " evaluates to " << v4 |
19662 | << "\n" << e5 << " evaluates to " << v5; |
19663 | } |
19664 | |
19665 | // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5. |
19666 | // Don't use this in your code. |
19667 | #define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\ |
19668 | GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \ |
19669 | on_failure) |
19670 | |
19671 | // Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use |
19672 | // this in your code. |
19673 | #define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\ |
19674 | GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \ |
19675 | #v1, \ |
19676 | #v2, \ |
19677 | #v3, \ |
19678 | #v4, \ |
19679 | #v5, \ |
19680 | pred, \ |
19681 | v1, \ |
19682 | v2, \ |
19683 | v3, \ |
19684 | v4, \ |
19685 | v5), on_failure) |
19686 | |
19687 | // 5-ary predicate assertion macros. |
19688 | #define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \ |
19689 | GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_) |
19690 | #define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \ |
19691 | GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_) |
19692 | #define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \ |
19693 | GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_) |
19694 | #define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \ |
19695 | GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_) |
19696 | |
19697 | |
19698 | |
19699 | #endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ |
19700 | |
19701 | // Macros for testing equalities and inequalities. |
19702 | // |
19703 | // * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual |
19704 | // * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2 |
19705 | // * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2 |
19706 | // * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2 |
19707 | // * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2 |
19708 | // * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2 |
19709 | // |
19710 | // When they are not, Google Test prints both the tested expressions and |
19711 | // their actual values. The values must be compatible built-in types, |
19712 | // or you will get a compiler error. By "compatible" we mean that the |
19713 | // values can be compared by the respective operator. |
19714 | // |
19715 | // Note: |
19716 | // |
19717 | // 1. It is possible to make a user-defined type work with |
19718 | // {ASSERT|EXPECT}_??(), but that requires overloading the |
19719 | // comparison operators and is thus discouraged by the Google C++ |
19720 | // Usage Guide. Therefore, you are advised to use the |
19721 | // {ASSERT|EXPECT}_TRUE() macro to assert that two objects are |
19722 | // equal. |
19723 | // |
19724 | // 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on |
19725 | // pointers (in particular, C strings). Therefore, if you use it |
19726 | // with two C strings, you are testing how their locations in memory |
19727 | // are related, not how their content is related. To compare two C |
19728 | // strings by content, use {ASSERT|EXPECT}_STR*(). |
19729 | // |
19730 | // 3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to |
19731 | // {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you |
19732 | // what the actual value is when it fails, and similarly for the |
19733 | // other comparisons. |
19734 | // |
19735 | // 4. Do not depend on the order in which {ASSERT|EXPECT}_??() |
19736 | // evaluate their arguments, which is undefined. |
19737 | // |
19738 | // 5. These macros evaluate their arguments exactly once. |
19739 | // |
19740 | // Examples: |
19741 | // |
19742 | // EXPECT_NE(5, Foo()); |
19743 | // EXPECT_EQ(NULL, a_pointer); |
19744 | // ASSERT_LT(i, array_size); |
19745 | // ASSERT_GT(records.size(), 0) << "There is no record left."; |
19746 | |
19747 | #define EXPECT_EQ(expected, actual) \ |
19748 | EXPECT_PRED_FORMAT2(::testing::internal:: \ |
19749 | EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \ |
19750 | expected, actual) |
19751 | #define EXPECT_NE(expected, actual) \ |
19752 | EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual) |
19753 | #define EXPECT_LE(val1, val2) \ |
19754 | EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) |
19755 | #define EXPECT_LT(val1, val2) \ |
19756 | EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) |
19757 | #define EXPECT_GE(val1, val2) \ |
19758 | EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) |
19759 | #define EXPECT_GT(val1, val2) \ |
19760 | EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) |
19761 | |
19762 | #define GTEST_ASSERT_EQ(expected, actual) \ |
19763 | ASSERT_PRED_FORMAT2(::testing::internal:: \ |
19764 | EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \ |
19765 | expected, actual) |
19766 | #define GTEST_ASSERT_NE(val1, val2) \ |
19767 | ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2) |
19768 | #define GTEST_ASSERT_LE(val1, val2) \ |
19769 | ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) |
19770 | #define GTEST_ASSERT_LT(val1, val2) \ |
19771 | ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) |
19772 | #define GTEST_ASSERT_GE(val1, val2) \ |
19773 | ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) |
19774 | #define GTEST_ASSERT_GT(val1, val2) \ |
19775 | ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) |
19776 | |
19777 | // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of |
19778 | // ASSERT_XY(), which clashes with some users' own code. |
19779 | |
19780 | #if !GTEST_DONT_DEFINE_ASSERT_EQ |
19781 | # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2) |
19782 | #endif |
19783 | |
19784 | #if !GTEST_DONT_DEFINE_ASSERT_NE |
19785 | # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2) |
19786 | #endif |
19787 | |
19788 | #if !GTEST_DONT_DEFINE_ASSERT_LE |
19789 | # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2) |
19790 | #endif |
19791 | |
19792 | #if !GTEST_DONT_DEFINE_ASSERT_LT |
19793 | # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2) |
19794 | #endif |
19795 | |
19796 | #if !GTEST_DONT_DEFINE_ASSERT_GE |
19797 | # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2) |
19798 | #endif |
19799 | |
19800 | #if !GTEST_DONT_DEFINE_ASSERT_GT |
19801 | # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2) |
19802 | #endif |
19803 | |
19804 | // C-string Comparisons. All tests treat NULL and any non-NULL string |
19805 | // as different. Two NULLs are equal. |
19806 | // |
19807 | // * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2 |
19808 | // * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2 |
19809 | // * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case |
19810 | // * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case |
19811 | // |
19812 | // For wide or narrow string objects, you can use the |
19813 | // {ASSERT|EXPECT}_??() macros. |
19814 | // |
19815 | // Don't depend on the order in which the arguments are evaluated, |
19816 | // which is undefined. |
19817 | // |
19818 | // These macros evaluate their arguments exactly once. |
19819 | |
19820 | #define EXPECT_STREQ(expected, actual) \ |
19821 | EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual) |
19822 | #define EXPECT_STRNE(s1, s2) \ |
19823 | EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) |
19824 | #define EXPECT_STRCASEEQ(expected, actual) \ |
19825 | EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual) |
19826 | #define EXPECT_STRCASENE(s1, s2)\ |
19827 | EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) |
19828 | |
19829 | #define ASSERT_STREQ(expected, actual) \ |
19830 | ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual) |
19831 | #define ASSERT_STRNE(s1, s2) \ |
19832 | ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) |
19833 | #define ASSERT_STRCASEEQ(expected, actual) \ |
19834 | ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual) |
19835 | #define ASSERT_STRCASENE(s1, s2)\ |
19836 | ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) |
19837 | |
19838 | // Macros for comparing floating-point numbers. |
19839 | // |
19840 | // * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual): |
19841 | // Tests that two float values are almost equal. |
19842 | // * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual): |
19843 | // Tests that two double values are almost equal. |
19844 | // * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error): |
19845 | // Tests that v1 and v2 are within the given distance to each other. |
19846 | // |
19847 | // Google Test uses ULP-based comparison to automatically pick a default |
19848 | // error bound that is appropriate for the operands. See the |
19849 | // FloatingPoint template class in gtest-internal.h if you are |
19850 | // interested in the implementation details. |
19851 | |
19852 | #define EXPECT_FLOAT_EQ(expected, actual)\ |
19853 | EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \ |
19854 | expected, actual) |
19855 | |
19856 | #define EXPECT_DOUBLE_EQ(expected, actual)\ |
19857 | EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \ |
19858 | expected, actual) |
19859 | |
19860 | #define ASSERT_FLOAT_EQ(expected, actual)\ |
19861 | ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \ |
19862 | expected, actual) |
19863 | |
19864 | #define ASSERT_DOUBLE_EQ(expected, actual)\ |
19865 | ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \ |
19866 | expected, actual) |
19867 | |
19868 | #define EXPECT_NEAR(val1, val2, abs_error)\ |
19869 | EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ |
19870 | val1, val2, abs_error) |
19871 | |
19872 | #define ASSERT_NEAR(val1, val2, abs_error)\ |
19873 | ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ |
19874 | val1, val2, abs_error) |
19875 | |
19876 | // These predicate format functions work on floating-point values, and |
19877 | // can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g. |
19878 | // |
19879 | // EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0); |
19880 | |
19881 | // Asserts that val1 is less than, or almost equal to, val2. Fails |
19882 | // otherwise. In particular, it fails if either val1 or val2 is NaN. |
19883 | GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2, |
19884 | float val1, float val2); |
19885 | GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2, |
19886 | double val1, double val2); |
19887 | |
19888 | |
19889 | #if GTEST_OS_WINDOWS |
19890 | |
19891 | // Macros that test for HRESULT failure and success, these are only useful |
19892 | // on Windows, and rely on Windows SDK macros and APIs to compile. |
19893 | // |
19894 | // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) |
19895 | // |
19896 | // When expr unexpectedly fails or succeeds, Google Test prints the |
19897 | // expected result and the actual result with both a human-readable |
19898 | // string representation of the error, if available, as well as the |
19899 | // hex result code. |
19900 | # define EXPECT_HRESULT_SUCCEEDED(expr) \ |
19901 | EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) |
19902 | |
19903 | # define ASSERT_HRESULT_SUCCEEDED(expr) \ |
19904 | ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) |
19905 | |
19906 | # define EXPECT_HRESULT_FAILED(expr) \ |
19907 | EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) |
19908 | |
19909 | # define ASSERT_HRESULT_FAILED(expr) \ |
19910 | ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) |
19911 | |
19912 | #endif // GTEST_OS_WINDOWS |
19913 | |
19914 | // Macros that execute statement and check that it doesn't generate new fatal |
19915 | // failures in the current thread. |
19916 | // |
19917 | // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); |
19918 | // |
19919 | // Examples: |
19920 | // |
19921 | // EXPECT_NO_FATAL_FAILURE(Process()); |
19922 | // ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed"; |
19923 | // |
19924 | #define ASSERT_NO_FATAL_FAILURE(statement) \ |
19925 | GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_) |
19926 | #define EXPECT_NO_FATAL_FAILURE(statement) \ |
19927 | GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_) |
19928 | |
19929 | // Causes a trace (including the source file path, the current line |
19930 | // number, and the given message) to be included in every test failure |
19931 | // message generated by code in the current scope. The effect is |
19932 | // undone when the control leaves the current scope. |
19933 | // |
19934 | // The message argument can be anything streamable to std::ostream. |
19935 | // |
19936 | // In the implementation, we include the current line number as part |
19937 | // of the dummy variable name, thus allowing multiple SCOPED_TRACE()s |
19938 | // to appear in the same block - as long as they are on different |
19939 | // lines. |
19940 | #define SCOPED_TRACE(message) \ |
19941 | ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\ |
19942 | __FILE__, __LINE__, ::testing::Message() << (message)) |
19943 | |
19944 | // Compile-time assertion for type equality. |
19945 | // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are |
19946 | // the same type. The value it returns is not interesting. |
19947 | // |
19948 | // Instead of making StaticAssertTypeEq a class template, we make it a |
19949 | // function template that invokes a helper class template. This |
19950 | // prevents a user from misusing StaticAssertTypeEq<T1, T2> by |
19951 | // defining objects of that type. |
19952 | // |
19953 | // CAVEAT: |
19954 | // |
19955 | // When used inside a method of a class template, |
19956 | // StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is |
19957 | // instantiated. For example, given: |
19958 | // |
19959 | // template <typename T> class Foo { |
19960 | // public: |
19961 | // void Bar() { testing::StaticAssertTypeEq<int, T>(); } |
19962 | // }; |
19963 | // |
19964 | // the code: |
19965 | // |
19966 | // void Test1() { Foo<bool> foo; } |
19967 | // |
19968 | // will NOT generate a compiler error, as Foo<bool>::Bar() is never |
19969 | // actually instantiated. Instead, you need: |
19970 | // |
19971 | // void Test2() { Foo<bool> foo; foo.Bar(); } |
19972 | // |
19973 | // to cause a compiler error. |
19974 | template <typename T1, typename T2> |
19975 | bool StaticAssertTypeEq() { |
19976 | (void)internal::StaticAssertTypeEqHelper<T1, T2>(); |
19977 | return true; |
19978 | } |
19979 | |
19980 | // Defines a test. |
19981 | // |
19982 | // The first parameter is the name of the test case, and the second |
19983 | // parameter is the name of the test within the test case. |
19984 | // |
19985 | // The convention is to end the test case name with "Test". For |
19986 | // example, a test case for the Foo class can be named FooTest. |
19987 | // |
19988 | // The user should put his test code between braces after using this |
19989 | // macro. Example: |
19990 | // |
19991 | // TEST(FooTest, InitializesCorrectly) { |
19992 | // Foo foo; |
19993 | // EXPECT_TRUE(foo.StatusIsOK()); |
19994 | // } |
19995 | |
19996 | // Note that we call GetTestTypeId() instead of GetTypeId< |
19997 | // ::testing::Test>() here to get the type ID of testing::Test. This |
19998 | // is to work around a suspected linker bug when using Google Test as |
19999 | // a framework on Mac OS X. The bug causes GetTypeId< |
20000 | // ::testing::Test>() to return different values depending on whether |
20001 | // the call is from the Google Test framework itself or from user test |
20002 | // code. GetTestTypeId() is guaranteed to always return the same |
20003 | // value, as it always calls GetTypeId<>() from the Google Test |
20004 | // framework. |
20005 | #define GTEST_TEST(test_case_name, test_name)\ |
20006 | GTEST_TEST_(test_case_name, test_name, \ |
20007 | ::testing::Test, ::testing::internal::GetTestTypeId()) |
20008 | |
20009 | // Define this macro to 1 to omit the definition of TEST(), which |
20010 | // is a generic name and clashes with some other libraries. |
20011 | #if !GTEST_DONT_DEFINE_TEST |
20012 | # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name) |
20013 | #endif |
20014 | |
20015 | // Defines a test that uses a test fixture. |
20016 | // |
20017 | // The first parameter is the name of the test fixture class, which |
20018 | // also doubles as the test case name. The second parameter is the |
20019 | // name of the test within the test case. |
20020 | // |
20021 | // A test fixture class must be declared earlier. The user should put |
20022 | // his test code between braces after using this macro. Example: |
20023 | // |
20024 | // class FooTest : public testing::Test { |
20025 | // protected: |
20026 | // virtual void SetUp() { b_.AddElement(3); } |
20027 | // |
20028 | // Foo a_; |
20029 | // Foo b_; |
20030 | // }; |
20031 | // |
20032 | // TEST_F(FooTest, InitializesCorrectly) { |
20033 | // EXPECT_TRUE(a_.StatusIsOK()); |
20034 | // } |
20035 | // |
20036 | // TEST_F(FooTest, ReturnsElementCountCorrectly) { |
20037 | // EXPECT_EQ(0, a_.size()); |
20038 | // EXPECT_EQ(1, b_.size()); |
20039 | // } |
20040 | |
20041 | #define TEST_F(test_fixture, test_name)\ |
20042 | GTEST_TEST_(test_fixture, test_name, test_fixture, \ |
20043 | ::testing::internal::GetTypeId<test_fixture>()) |
20044 | |
20045 | } // namespace testing |
20046 | |
20047 | // Use this function in main() to run all tests. It returns 0 if all |
20048 | // tests are successful, or 1 otherwise. |
20049 | // |
20050 | // RUN_ALL_TESTS() should be invoked after the command line has been |
20051 | // parsed by InitGoogleTest(). |
20052 | // |
20053 | // This function was formerly a macro; thus, it is in the global |
20054 | // namespace and has an all-caps name. |
20055 | int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_; |
20056 | |
20057 | inline int RUN_ALL_TESTS() { |
20058 | return ::testing::UnitTest::GetInstance()->Run(); |
20059 | } |
20060 | |
20061 | #endif // GTEST_INCLUDE_GTEST_GTEST_H_ |
20062 | |