1 // Copyright 2005, Google Inc.
2 // All rights reserved.
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
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
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.
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.
30 // Author: wan@google.com (Zhanyong Wan)
32 // The Google C++ Testing Framework (Google Test)
34 // This header file defines the public API for Google Test. It should be
35 // included by any test program that uses Google Test.
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:
41 // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
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
47 // Acknowledgment: Google Test borrowed the idea of automatic test
48 // registration from Barthelemy Dagenais' (barthelemy@prologique.com)
49 // easyUnit framework.
51 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
52 #define GTEST_INCLUDE_GTEST_GTEST_H_
58 // Copyright 2005, Google Inc.
59 // All rights reserved.
61 // Redistribution and use in source and binary forms, with or without
62 // modification, are permitted provided that the following conditions are
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
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.
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.
87 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
89 // The Google C++ Testing Framework (Google Test)
91 // This header file declares functions and macros used internally by
92 // Google Test. They are subject to change without notice.
94 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
95 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
97 // Copyright 2005, Google Inc.
98 // All rights reserved.
100 // Redistribution and use in source and binary forms, with or without
101 // modification, are permitted provided that the following conditions are
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
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.
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.
126 // Authors: wan@google.com (Zhanyong Wan)
128 // Low-level types and utilities for porting Google Test to various
129 // platforms. All macros ending with _ and symbols defined in an
130 // internal namespace are subject to change without notice. Code
131 // outside Google Test MUST NOT USE THEM DIRECTLY. Macros that don't
132 // end with _ are part of Google Test's public API and can be used by
133 // code outside Google Test.
135 // This file is fundamental to Google Test. All other Google Test source
136 // files are expected to #include this. Therefore, it cannot #include
137 // any other Google Test header.
139 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
140 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
142 // Environment-describing macros
143 // -----------------------------
145 // Google Test can be used in many different environments. Macros in
146 // this section tell Google Test what kind of environment it is being
147 // used in, such that Google Test can provide environment-specific
148 // features and implementations.
150 // Google Test tries to automatically detect the properties of its
151 // environment, so users usually don't need to worry about these
152 // macros. However, the automatic detection is not perfect.
153 // Sometimes it's necessary for a user to define some of the following
154 // macros in the build script to override Google Test's decisions.
156 // If the user doesn't define a macro in the list, Google Test will
157 // provide a default definition. After this header is #included, all
158 // macros in this list will be defined to either 1 or 0.
160 // Notes to maintainers:
161 // - Each macro here is a user-tweakable knob; do not grow the list
163 // - Use #if to key off these macros. Don't use #ifdef or "#if
164 // defined(...)", which will not work as these macros are ALWAYS
167 // GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
168 // is/isn't available.
169 // GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
171 // GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
172 // is/isn't available (some systems define
173 // ::string, which is different to std::string).
174 // GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
175 // is/isn't available (some systems define
176 // ::wstring, which is different to std::wstring).
177 // GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
178 // expressions are/aren't available.
179 // GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
180 // is/isn't available.
181 // GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't
183 // GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
184 // std::wstring does/doesn't work (Google Test can
185 // be used where std::wstring is unavailable).
186 // GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
187 // is/isn't available.
188 // GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
189 // compiler supports Microsoft's "Structured
190 // Exception Handling".
191 // GTEST_HAS_STREAM_REDIRECTION
192 // - Define it to 1/0 to indicate whether the
193 // platform supports I/O stream redirection using
195 // GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
196 // Test's own tr1 tuple implementation should be
197 // used. Unused when the user sets
198 // GTEST_HAS_TR1_TUPLE to 0.
199 // GTEST_LANG_CXX11 - Define it to 1/0 to indicate that Google Test
200 // is building in C++11/C++98 mode.
201 // GTEST_LINKED_AS_SHARED_LIBRARY
202 // - Define to 1 when compiling tests that use
203 // Google Test as a shared library (known as
205 // GTEST_CREATE_SHARED_LIBRARY
206 // - Define to 1 when compiling Google Test itself
207 // as a shared library.
209 // Platform-indicating macros
210 // --------------------------
212 // Macros indicating the platform on which Google Test is being used
213 // (a macro is defined to 1 if compiled on the given platform;
214 // otherwise UNDEFINED -- it's never defined to 0.). Google Test
215 // defines these macros automatically. Code outside Google Test MUST
218 // GTEST_OS_AIX - IBM AIX
219 // GTEST_OS_CYGWIN - Cygwin
220 // GTEST_OS_FREEBSD - FreeBSD
221 // GTEST_OS_HPUX - HP-UX
222 // GTEST_OS_LINUX - Linux
223 // GTEST_OS_LINUX_ANDROID - Google Android
224 // GTEST_OS_MAC - Mac OS X
225 // GTEST_OS_IOS - iOS
226 // GTEST_OS_NACL - Google Native Client (NaCl)
227 // GTEST_OS_OPENBSD - OpenBSD
228 // GTEST_OS_QNX - QNX
229 // GTEST_OS_SOLARIS - Sun Solaris
230 // GTEST_OS_SYMBIAN - Symbian
231 // GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile)
232 // GTEST_OS_WINDOWS_DESKTOP - Windows Desktop
233 // GTEST_OS_WINDOWS_MINGW - MinGW
234 // GTEST_OS_WINDOWS_MOBILE - Windows Mobile
235 // GTEST_OS_WINDOWS_PHONE - Windows Phone
236 // GTEST_OS_WINDOWS_RT - Windows Store App/WinRT
237 // GTEST_OS_ZOS - z/OS
239 // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
240 // most stable support. Since core members of the Google Test project
241 // don't have access to other platforms, support for them may be less
242 // stable. If you notice any problems on your platform, please notify
243 // googletestframework@googlegroups.com (patches for fixing them are
244 // even more welcome!).
246 // It is possible that none of the GTEST_OS_* macros are defined.
248 // Feature-indicating macros
249 // -------------------------
251 // Macros indicating which Google Test features are available (a macro
252 // is defined to 1 if the corresponding feature is supported;
253 // otherwise UNDEFINED -- it's never defined to 0.). Google Test
254 // defines these macros automatically. Code outside Google Test MUST
257 // These macros are public so that portable tests can be written.
258 // Such tests typically surround code using a feature with an #if
259 // which controls that code. For example:
261 // #if GTEST_HAS_DEATH_TEST
262 // EXPECT_DEATH(DoSomethingDeadly());
265 // GTEST_HAS_COMBINE - the Combine() function (for value-parameterized
267 // GTEST_HAS_DEATH_TEST - death tests
268 // GTEST_HAS_PARAM_TEST - value-parameterized tests
269 // GTEST_HAS_TYPED_TEST - typed tests
270 // GTEST_HAS_TYPED_TEST_P - type-parameterized tests
271 // GTEST_IS_THREADSAFE - Google Test is thread-safe.
272 // GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with
273 // GTEST_HAS_POSIX_RE (see above) which users can
274 // define themselves.
275 // GTEST_USES_SIMPLE_RE - our own simple regex is used;
276 // the above two are mutually exclusive.
277 // GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
279 // Misc public macros
280 // ------------------
282 // GTEST_FLAG(flag_name) - references the variable corresponding to
283 // the given Google Test flag.
285 // Internal utilities
286 // ------------------
288 // The following macros and utilities are for Google Test's INTERNAL
289 // use only. Code outside Google Test MUST NOT USE THEM DIRECTLY.
291 // Macros for basic C++ coding:
292 // GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
293 // GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a
294 // variable don't have to be used.
295 // GTEST_DISALLOW_ASSIGN_ - disables operator=.
296 // GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
297 // GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
298 // GTEST_INTENTIONAL_CONST_COND_PUSH_ - start code section where MSVC C4127 is
299 // suppressed (constant conditional).
300 // GTEST_INTENTIONAL_CONST_COND_POP_ - finish code section where MSVC C4127
303 // C++11 feature wrappers:
305 // testing::internal::move - portability wrapper for std::move.
308 // Mutex, MutexLock, ThreadLocal, GetThreadCount()
309 // - synchronization primitives.
311 // Template meta programming:
312 // is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only.
313 // IteratorTraits - partial implementation of std::iterator_traits, which
314 // is not available in libCstd when compiled with Sun C++.
317 // scoped_ptr - as in TR2.
319 // Regular expressions:
320 // RE - a simple regular expression class using the POSIX
321 // Extended Regular Expression syntax on UNIX-like
322 // platforms, or a reduced regular exception syntax on
323 // other platforms, including Windows.
326 // GTEST_LOG_() - logs messages at the specified severity level.
327 // LogToStderr() - directs all log messages to stderr.
328 // FlushInfoLog() - flushes informational log messages.
330 // Stdout and stderr capturing:
331 // CaptureStdout() - starts capturing stdout.
332 // GetCapturedStdout() - stops capturing stdout and returns the captured
334 // CaptureStderr() - starts capturing stderr.
335 // GetCapturedStderr() - stops capturing stderr and returns the captured
339 // TypeWithSize - maps an integer to a int type.
340 // Int32, UInt32, Int64, UInt64, TimeInMillis
341 // - integers of known sizes.
342 // BiggestInt - the biggest signed integer type.
344 // Command-line utilities:
345 // GTEST_DECLARE_*() - declares a flag.
346 // GTEST_DEFINE_*() - defines a flag.
347 // GetInjectableArgvs() - returns the command line as a vector of strings.
349 // Environment variable utilities:
350 // GetEnv() - gets the value of an environment variable.
351 // BoolFromGTestEnv() - parses a bool environment variable.
352 // Int32FromGTestEnv() - parses an Int32 environment variable.
353 // StringFromGTestEnv() - parses a string environment variable.
355 #include <ctype.h> // for isspace, etc
356 #include <stddef.h> // for ptrdiff_t
361 # include <sys/types.h>
362 # include <sys/stat.h>
363 #endif // !_WIN32_WCE
365 #if defined __APPLE__
366 # include <AvailabilityMacros.h>
367 # include <TargetConditionals.h>
370 #include <algorithm> // NOLINT
371 #include <iostream> // NOLINT
372 #include <sstream> // NOLINT
373 #include <string> // NOLINT
375 #include <vector> // NOLINT
377 // Copyright 2015, Google Inc.
378 // All rights reserved.
380 // Redistribution and use in source and binary forms, with or without
381 // modification, are permitted provided that the following conditions are
384 // * Redistributions of source code must retain the above copyright
385 // notice, this list of conditions and the following disclaimer.
386 // * Redistributions in binary form must reproduce the above
387 // copyright notice, this list of conditions and the following disclaimer
388 // in the documentation and/or other materials provided with the
390 // * Neither the name of Google Inc. nor the names of its
391 // contributors may be used to endorse or promote products derived from
392 // this software without specific prior written permission.
394 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
395 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
396 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
397 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
398 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
399 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
400 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
401 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
402 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
403 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
404 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
406 // The Google C++ Testing Framework (Google Test)
408 // This header file defines the GTEST_OS_* macro.
409 // It is separate from gtest-port.h so that custom/gtest-port.h can include it.
411 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
412 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
414 // Determines the platform on which Google Test is compiled.
416 # define GTEST_OS_CYGWIN 1
417 #elif defined __SYMBIAN32__
418 # define GTEST_OS_SYMBIAN 1
420 # define GTEST_OS_WINDOWS 1
422 # define GTEST_OS_WINDOWS_MOBILE 1
423 # elif defined(__MINGW__) || defined(__MINGW32__)
424 # define GTEST_OS_WINDOWS_MINGW 1
425 # elif defined(WINAPI_FAMILY)
426 # include <winapifamily.h>
427 # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
428 # define GTEST_OS_WINDOWS_DESKTOP 1
429 # elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
430 # define GTEST_OS_WINDOWS_PHONE 1
431 # elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
432 # define GTEST_OS_WINDOWS_RT 1
434 // WINAPI_FAMILY defined but no known partition matched.
435 // Default to desktop.
436 # define GTEST_OS_WINDOWS_DESKTOP 1
439 # define GTEST_OS_WINDOWS_DESKTOP 1
440 # endif // _WIN32_WCE
441 #elif defined __APPLE__
442 # define GTEST_OS_MAC 1
443 # if TARGET_OS_IPHONE
444 # define GTEST_OS_IOS 1
446 #elif defined __FreeBSD__
447 # define GTEST_OS_FREEBSD 1
448 #elif defined __linux__
449 # define GTEST_OS_LINUX 1
450 # if defined __ANDROID__
451 # define GTEST_OS_LINUX_ANDROID 1
453 #elif defined __MVS__
454 # define GTEST_OS_ZOS 1
455 #elif defined(__sun) && defined(__SVR4)
456 # define GTEST_OS_SOLARIS 1
458 # define GTEST_OS_AIX 1
459 #elif defined(__hpux)
460 # define GTEST_OS_HPUX 1
461 #elif defined __native_client__
462 # define GTEST_OS_NACL 1
463 #elif defined __OpenBSD__
464 # define GTEST_OS_OPENBSD 1
465 #elif defined __QNX__
466 # define GTEST_OS_QNX 1
469 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
470 // Copyright 2015, Google Inc.
471 // All rights reserved.
473 // Redistribution and use in source and binary forms, with or without
474 // modification, are permitted provided that the following conditions are
477 // * Redistributions of source code must retain the above copyright
478 // notice, this list of conditions and the following disclaimer.
479 // * Redistributions in binary form must reproduce the above
480 // copyright notice, this list of conditions and the following disclaimer
481 // in the documentation and/or other materials provided with the
483 // * Neither the name of Google Inc. nor the names of its
484 // contributors may be used to endorse or promote products derived from
485 // this software without specific prior written permission.
487 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
488 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
489 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
490 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
491 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
492 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
493 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
494 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
495 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
496 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
497 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
499 // Injection point for custom user configurations.
500 // The following macros can be defined:
502 // Flag related macros:
503 // GTEST_FLAG(flag_name)
504 // GTEST_USE_OWN_FLAGFILE_FLAG_ - Define to 0 when the system provides its
505 // own flagfile flag parsing.
506 // GTEST_DECLARE_bool_(name)
507 // GTEST_DECLARE_int32_(name)
508 // GTEST_DECLARE_string_(name)
509 // GTEST_DEFINE_bool_(name, default_val, doc)
510 // GTEST_DEFINE_int32_(name, default_val, doc)
511 // GTEST_DEFINE_string_(name, default_val, doc)
514 // GTEST_TEST_FILTER_ENV_VAR_ - The name of an environment variable that
515 // will be used if --GTEST_FLAG(test_filter)
519 // GTEST_LOG_(severity)
520 // GTEST_CHECK_(condition)
521 // Functions LogToStderr() and FlushInfoLog() have to be provided too.
524 // GTEST_HAS_NOTIFICATION_ - Enabled if Notification is already provided.
525 // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ - Enabled if Mutex and ThreadLocal are
527 // Must also provide GTEST_DECLARE_STATIC_MUTEX_(mutex) and
528 // GTEST_DEFINE_STATIC_MUTEX_(mutex)
530 // GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
531 // GTEST_LOCK_EXCLUDED_(locks)
533 // ** Custom implementation starts here **
535 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
536 #define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
538 #endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
540 #if !defined(GTEST_DEV_EMAIL_)
541 # define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
542 # define GTEST_FLAG_PREFIX_ "gtest_"
543 # define GTEST_FLAG_PREFIX_DASH_ "gtest-"
544 # define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
545 # define GTEST_NAME_ "Google Test"
546 # define GTEST_PROJECT_URL_ "https://github.com/google/googletest/"
547 #endif // !defined(GTEST_DEV_EMAIL_)
549 #if !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
550 # define GTEST_INIT_GOOGLE_TEST_NAME_ "testing::InitGoogleTest"
551 #endif // !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
553 // Determines the version of gcc that is used to compile this.
555 // 40302 means version 4.3.2.
556 # define GTEST_GCC_VER_ \
557 (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
560 // Macros for disabling Microsoft Visual C++ warnings.
562 // GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 4385)
563 // /* code that triggers warnings C4800 and C4385 */
564 // GTEST_DISABLE_MSC_WARNINGS_POP_()
566 # define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings) \
567 __pragma(warning(push)) \
568 __pragma(warning(disable: warnings))
569 # define GTEST_DISABLE_MSC_WARNINGS_POP_() \
570 __pragma(warning(pop))
572 // Older versions of MSVC don't have __pragma.
573 # define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
574 # define GTEST_DISABLE_MSC_WARNINGS_POP_()
577 #ifndef GTEST_LANG_CXX11
578 // gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
579 // -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a
580 // value for __cplusplus, and recent versions of clang, gcc, and
581 // probably other compilers set that too in C++11 mode.
582 # if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L
583 // Compiling in at least C++11 mode.
584 # define GTEST_LANG_CXX11 1
586 # define GTEST_LANG_CXX11 0
590 // Distinct from C++11 language support, some environments don't provide
591 // proper C++11 library support. Notably, it's possible to build in
592 // C++11 mode when targeting Mac OS X 10.6, which has an old libstdc++
593 // with no C++11 support.
595 // libstdc++ has sufficient C++11 support as of GCC 4.6.0, __GLIBCXX__
596 // 20110325, but maintenance releases in the 4.4 and 4.5 series followed
597 // this date, so check for those versions by their date stamps.
598 // https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning
599 #if GTEST_LANG_CXX11 && \
600 (!defined(__GLIBCXX__) || ( \
601 __GLIBCXX__ >= 20110325ul && /* GCC >= 4.6.0 */ \
602 /* Blacklist of patch releases of older branches: */ \
603 __GLIBCXX__ != 20110416ul && /* GCC 4.4.6 */ \
604 __GLIBCXX__ != 20120313ul && /* GCC 4.4.7 */ \
605 __GLIBCXX__ != 20110428ul && /* GCC 4.5.3 */ \
606 __GLIBCXX__ != 20120702ul)) /* GCC 4.5.4 */
607 # define GTEST_STDLIB_CXX11 1
610 // Only use C++11 library features if the library provides them.
611 #if GTEST_STDLIB_CXX11
612 # define GTEST_HAS_STD_BEGIN_AND_END_ 1
613 # define GTEST_HAS_STD_FORWARD_LIST_ 1
614 # define GTEST_HAS_STD_FUNCTION_ 1
615 # define GTEST_HAS_STD_INITIALIZER_LIST_ 1
616 # define GTEST_HAS_STD_MOVE_ 1
617 # define GTEST_HAS_STD_SHARED_PTR_ 1
618 # define GTEST_HAS_STD_TYPE_TRAITS_ 1
619 # define GTEST_HAS_STD_UNIQUE_PTR_ 1
622 // C++11 specifies that <tuple> provides std::tuple.
623 // Some platforms still might not have it, however.
625 # define GTEST_HAS_STD_TUPLE_ 1
626 # if defined(__clang__)
627 // Inspired by http://clang.llvm.org/docs/LanguageExtensions.html#__has_include
628 # if defined(__has_include) && !__has_include(<tuple>)
629 # undef GTEST_HAS_STD_TUPLE_
631 # elif defined(_MSC_VER)
632 // Inspired by boost/config/stdlib/dinkumware.hpp
633 # if defined(_CPPLIB_VER) && _CPPLIB_VER < 520
634 # undef GTEST_HAS_STD_TUPLE_
636 # elif defined(__GLIBCXX__)
637 // Inspired by boost/config/stdlib/libstdcpp3.hpp,
638 // http://gcc.gnu.org/gcc-4.2/changes.html and
639 // http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01.html#manual.intro.status.standard.200x
640 # if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
641 # undef GTEST_HAS_STD_TUPLE_
646 // Brings in definitions for functions used in the testing::internal::posix
647 // namespace (read, write, close, chdir, isatty, stat). We do not currently
648 // use them on Windows Mobile.
650 # if !GTEST_OS_WINDOWS_MOBILE
654 // In order to avoid having to include <windows.h>, use forward declaration
655 #if GTEST_OS_WINDOWS_MINGW && !defined(__MINGW64_VERSION_MAJOR)
656 // MinGW defined _CRITICAL_SECTION and _RTL_CRITICAL_SECTION as two
657 // separate (equivalent) structs, instead of using typedef
658 typedef struct _CRITICAL_SECTION GTEST_CRITICAL_SECTION;
660 // Assume CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.
661 // This assumption is verified by
662 // WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION.
663 typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
666 // This assumes that non-Windows OSes provide unistd.h. For OSes where this
667 // is not the case, we need to include headers that provide the functions
670 # include <strings.h>
671 #endif // GTEST_OS_WINDOWS
673 #if GTEST_OS_LINUX_ANDROID
674 // Used to define __ANDROID_API__ matching the target NDK API level.
675 # include <android/api-level.h> // NOLINT
678 // Defines this to true iff Google Test can use POSIX regular expressions.
679 #ifndef GTEST_HAS_POSIX_RE
680 # if GTEST_OS_LINUX_ANDROID
681 // On Android, <regex.h> is only available starting with Gingerbread.
682 # define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9)
684 # define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
689 // The appropriate headers have already been included.
691 #elif GTEST_HAS_POSIX_RE
693 // On some platforms, <regex.h> needs someone to define size_t, and
694 // won't compile otherwise. We can #include it here as we already
695 // included <stdlib.h>, which is guaranteed to define size_t through
697 # include <regex.h> // NOLINT
699 # define GTEST_USES_POSIX_RE 1
701 #elif GTEST_OS_WINDOWS
703 // <regex.h> is not available on Windows. Use our own simple regex
704 // implementation instead.
705 # define GTEST_USES_SIMPLE_RE 1
709 // <regex.h> may not be available on this platform. Use our own
710 // simple regex implementation instead.
711 # define GTEST_USES_SIMPLE_RE 1
713 #endif // GTEST_USES_PCRE
715 #ifndef GTEST_HAS_EXCEPTIONS
716 // The user didn't tell us whether exceptions are enabled, so we need
718 # if defined(_MSC_VER) || defined(__BORLANDC__)
719 // MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
720 // macro to enable exceptions, so we'll do the same.
721 // Assumes that exceptions are enabled by default.
722 # ifndef _HAS_EXCEPTIONS
723 # define _HAS_EXCEPTIONS 1
724 # endif // _HAS_EXCEPTIONS
725 # define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
726 # elif defined(__clang__)
727 // clang defines __EXCEPTIONS iff exceptions are enabled before clang 220714,
728 // but iff cleanups are enabled after that. In Obj-C++ files, there can be
729 // cleanups for ObjC exceptions which also need cleanups, even if C++ exceptions
730 // are disabled. clang has __has_feature(cxx_exceptions) which checks for C++
731 // exceptions starting at clang r206352, but which checked for cleanups prior to
732 // that. To reliably check for C++ exception availability with clang, check for
733 // __EXCEPTIONS && __has_feature(cxx_exceptions).
734 # define GTEST_HAS_EXCEPTIONS (__EXCEPTIONS && __has_feature(cxx_exceptions))
735 # elif defined(__GNUC__) && __EXCEPTIONS
736 // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
737 # define GTEST_HAS_EXCEPTIONS 1
738 # elif defined(__SUNPRO_CC)
739 // Sun Pro CC supports exceptions. However, there is no compile-time way of
740 // detecting whether they are enabled or not. Therefore, we assume that
741 // they are enabled unless the user tells us otherwise.
742 # define GTEST_HAS_EXCEPTIONS 1
743 # elif defined(__IBMCPP__) && __EXCEPTIONS
744 // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
745 # define GTEST_HAS_EXCEPTIONS 1
746 # elif defined(__HP_aCC)
747 // Exception handling is in effect by default in HP aCC compiler. It has to
748 // be turned of by +noeh compiler option if desired.
749 # define GTEST_HAS_EXCEPTIONS 1
751 // For other compilers, we assume exceptions are disabled to be
753 # define GTEST_HAS_EXCEPTIONS 0
754 # endif // defined(_MSC_VER) || defined(__BORLANDC__)
755 #endif // GTEST_HAS_EXCEPTIONS
757 #if !defined(GTEST_HAS_STD_STRING)
758 // Even though we don't use this macro any longer, we keep it in case
759 // some clients still depend on it.
760 # define GTEST_HAS_STD_STRING 1
761 #elif !GTEST_HAS_STD_STRING
762 // The user told us that ::std::string isn't available.
763 # error "Google Test cannot be used where ::std::string isn't available."
764 #endif // !defined(GTEST_HAS_STD_STRING)
766 #ifndef GTEST_HAS_GLOBAL_STRING
767 // The user didn't tell us whether ::string is available, so we need
770 # define GTEST_HAS_GLOBAL_STRING 0
772 #endif // GTEST_HAS_GLOBAL_STRING
774 #ifndef GTEST_HAS_STD_WSTRING
775 // The user didn't tell us whether ::std::wstring is available, so we need
777 // TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
780 // Cygwin 1.7 and below doesn't support ::std::wstring.
781 // Solaris' libc++ doesn't support it either. Android has
782 // no support for it at least as recent as Froyo (2.2).
783 # define GTEST_HAS_STD_WSTRING \
784 (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
786 #endif // GTEST_HAS_STD_WSTRING
788 #ifndef GTEST_HAS_GLOBAL_WSTRING
789 // The user didn't tell us whether ::wstring is available, so we need
791 # define GTEST_HAS_GLOBAL_WSTRING \
792 (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
793 #endif // GTEST_HAS_GLOBAL_WSTRING
795 // Determines whether RTTI is available.
796 #ifndef GTEST_HAS_RTTI
797 // The user didn't tell us whether RTTI is enabled, so we need to
802 # ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled.
803 # define GTEST_HAS_RTTI 1
805 # define GTEST_HAS_RTTI 0
808 // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
809 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
812 // When building against STLport with the Android NDK and with
813 // -frtti -fno-exceptions, the build fails at link time with undefined
814 // references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
815 // so disable RTTI when detected.
816 # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \
817 !defined(__EXCEPTIONS)
818 # define GTEST_HAS_RTTI 0
820 # define GTEST_HAS_RTTI 1
821 # endif // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS
823 # define GTEST_HAS_RTTI 0
824 # endif // __GXX_RTTI
826 // Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
827 // using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
828 // first version with C++ support.
829 # elif defined(__clang__)
831 # define GTEST_HAS_RTTI __has_feature(cxx_rtti)
833 // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
834 // both the typeid and dynamic_cast features are present.
835 # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
838 # define GTEST_HAS_RTTI 1
840 # define GTEST_HAS_RTTI 0
845 // For all other compilers, we assume RTTI is enabled.
846 # define GTEST_HAS_RTTI 1
850 #endif // GTEST_HAS_RTTI
852 // It's this header's responsibility to #include <typeinfo> when RTTI
858 // Determines whether Google Test can use the pthreads library.
859 #ifndef GTEST_HAS_PTHREAD
860 // The user didn't tell us explicitly, so we make reasonable assumptions about
861 // which platforms have pthreads support.
863 // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
864 // to your compiler flags.
865 # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
866 || GTEST_OS_QNX || GTEST_OS_FREEBSD || GTEST_OS_NACL)
867 #endif // GTEST_HAS_PTHREAD
869 #if GTEST_HAS_PTHREAD
870 // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
872 # include <pthread.h> // NOLINT
874 // For timespec and nanosleep, used below.
875 # include <time.h> // NOLINT
878 // Determines if hash_map/hash_set are available.
879 // Only used for testing against those containers.
880 #if !defined(GTEST_HAS_HASH_MAP_)
882 # define GTEST_HAS_HASH_MAP_ 1 // Indicates that hash_map is available.
883 # define GTEST_HAS_HASH_SET_ 1 // Indicates that hash_set is available.
885 #endif // !defined(GTEST_HAS_HASH_MAP_)
887 // Determines whether Google Test can use tr1/tuple. You can define
888 // this macro to 0 to prevent Google Test from using tuple (any
889 // feature depending on tuple with be disabled in this mode).
890 #ifndef GTEST_HAS_TR1_TUPLE
891 # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
892 // STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
893 # define GTEST_HAS_TR1_TUPLE 0
895 // The user didn't tell us not to do it, so we assume it's OK.
896 # define GTEST_HAS_TR1_TUPLE 1
898 #endif // GTEST_HAS_TR1_TUPLE
900 // Determines whether Google Test's own tr1 tuple implementation
902 #ifndef GTEST_USE_OWN_TR1_TUPLE
903 // The user didn't tell us, so we need to figure it out.
905 // We use our own TR1 tuple if we aren't sure the user has an
906 // implementation of it already. At this time, libstdc++ 4.0.0+ and
907 // MSVC 2010 are the only mainstream standard libraries that come
908 // with a TR1 tuple implementation. NVIDIA's CUDA NVCC compiler
909 // pretends to be GCC by defining __GNUC__ and friends, but cannot
910 // compile GCC's tuple implementation. MSVC 2008 (9.0) provides TR1
911 // tuple in a 323 MB Feature Pack download, which we cannot assume the
912 // user has. QNX's QCC compiler is a modified GCC but it doesn't
913 // support TR1 tuple. libc++ only provides std::tuple, in C++11 mode,
914 // and it can be used with some compilers that define __GNUC__.
915 # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
916 && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600
917 # define GTEST_ENV_HAS_TR1_TUPLE_ 1
920 // C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
921 // in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
922 // can build with clang but need to use gcc4.2's libstdc++).
923 # if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
924 # define GTEST_ENV_HAS_STD_TUPLE_ 1
927 # if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
928 # define GTEST_USE_OWN_TR1_TUPLE 0
930 # define GTEST_USE_OWN_TR1_TUPLE 1
933 #endif // GTEST_USE_OWN_TR1_TUPLE
935 // To avoid conditional compilation everywhere, we make it
936 // gtest-port.h's responsibility to #include the header implementing
938 #if GTEST_HAS_STD_TUPLE_
939 # include <tuple> // IWYU pragma: export
940 # define GTEST_TUPLE_NAMESPACE_ ::std
941 #endif // GTEST_HAS_STD_TUPLE_
943 // We include tr1::tuple even if std::tuple is available to define printers for
945 #if GTEST_HAS_TR1_TUPLE
946 # ifndef GTEST_TUPLE_NAMESPACE_
947 # define GTEST_TUPLE_NAMESPACE_ ::std::tr1
948 # endif // GTEST_TUPLE_NAMESPACE_
950 # if GTEST_USE_OWN_TR1_TUPLE
951 // This file was GENERATED by command:
952 // pump.py gtest-tuple.h.pump
953 // DO NOT EDIT BY HAND!!!
955 // Copyright 2009 Google Inc.
956 // All Rights Reserved.
958 // Redistribution and use in source and binary forms, with or without
959 // modification, are permitted provided that the following conditions are
962 // * Redistributions of source code must retain the above copyright
963 // notice, this list of conditions and the following disclaimer.
964 // * Redistributions in binary form must reproduce the above
965 // copyright notice, this list of conditions and the following disclaimer
966 // in the documentation and/or other materials provided with the
968 // * Neither the name of Google Inc. nor the names of its
969 // contributors may be used to endorse or promote products derived from
970 // this software without specific prior written permission.
972 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
973 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
974 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
975 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
976 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
977 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
978 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
979 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
980 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
981 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
982 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
984 // Author: wan@google.com (Zhanyong Wan)
986 // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
988 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
989 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
991 #include <utility> // For ::std::pair.
993 // The compiler used in Symbian has a bug that prevents us from declaring the
994 // tuple template as a friend (it complains that tuple is redefined). This
995 // hack bypasses the bug by declaring the members that should otherwise be
996 // private as public.
997 // Sun Studio versions < 12 also have the above bug.
998 #if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
999 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
1001 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
1002 template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
1006 // Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that conflict
1007 // with our own definitions. Therefore using our own tuple does not work on
1009 #if defined(_MSC_VER) && _MSC_VER >= 1600 /* 1600 is Visual Studio 2010 */
1010 # error "gtest's tuple doesn't compile on Visual Studio 2010 or later. \
1011 GTEST_USE_OWN_TR1_TUPLE must be set to 0 on those compilers."
1014 // GTEST_n_TUPLE_(T) is the type of an n-tuple.
1015 #define GTEST_0_TUPLE_(T) tuple<>
1016 #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
1018 #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
1020 #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
1022 #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
1024 #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
1026 #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
1028 #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
1030 #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
1032 #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
1034 #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
1037 // GTEST_n_TYPENAMES_(T) declares a list of n typenames.
1038 #define GTEST_0_TYPENAMES_(T)
1039 #define GTEST_1_TYPENAMES_(T) typename T##0
1040 #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
1041 #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
1042 #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1044 #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1045 typename T##3, typename T##4
1046 #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1047 typename T##3, typename T##4, typename T##5
1048 #define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1049 typename T##3, typename T##4, typename T##5, typename T##6
1050 #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1051 typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
1052 #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1053 typename T##3, typename T##4, typename T##5, typename T##6, \
1054 typename T##7, typename T##8
1055 #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
1056 typename T##3, typename T##4, typename T##5, typename T##6, \
1057 typename T##7, typename T##8, typename T##9
1059 // In theory, defining stuff in the ::std namespace is undefined
1060 // behavior. We can do this as we are playing the role of a standard
1065 template <typename T0 = void, typename T1 = void, typename T2 = void,
1066 typename T3 = void, typename T4 = void, typename T5 = void,
1067 typename T6 = void, typename T7 = void, typename T8 = void,
1071 // Anything in namespace gtest_internal is Google Test's INTERNAL
1072 // IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
1073 namespace gtest_internal {
1075 // ByRef<T>::type is T if T is a reference; otherwise it's const T&.
1076 template <typename T>
1077 struct ByRef { typedef const T& type; }; // NOLINT
1078 template <typename T>
1079 struct ByRef<T&> { typedef T& type; }; // NOLINT
1081 // A handy wrapper for ByRef.
1082 #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
1084 // AddRef<T>::type is T if T is a reference; otherwise it's T&. This
1085 // is the same as tr1::add_reference<T>::type.
1086 template <typename T>
1087 struct AddRef { typedef T& type; }; // NOLINT
1088 template <typename T>
1089 struct AddRef<T&> { typedef T& type; }; // NOLINT
1091 // A handy wrapper for AddRef.
1092 #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
1094 // A helper for implementing get<k>().
1095 template <int k> class Get;
1097 // A helper for implementing tuple_element<k, T>. kIndexValid is true
1098 // iff k < the number of fields in tuple type T.
1099 template <bool kIndexValid, int kIndex, class Tuple>
1100 struct TupleElement;
1102 template <GTEST_10_TYPENAMES_(T)>
1103 struct TupleElement<true, 0, GTEST_10_TUPLE_(T) > {
1107 template <GTEST_10_TYPENAMES_(T)>
1108 struct TupleElement<true, 1, GTEST_10_TUPLE_(T) > {
1112 template <GTEST_10_TYPENAMES_(T)>
1113 struct TupleElement<true, 2, GTEST_10_TUPLE_(T) > {
1117 template <GTEST_10_TYPENAMES_(T)>
1118 struct TupleElement<true, 3, GTEST_10_TUPLE_(T) > {
1122 template <GTEST_10_TYPENAMES_(T)>
1123 struct TupleElement<true, 4, GTEST_10_TUPLE_(T) > {
1127 template <GTEST_10_TYPENAMES_(T)>
1128 struct TupleElement<true, 5, GTEST_10_TUPLE_(T) > {
1132 template <GTEST_10_TYPENAMES_(T)>
1133 struct TupleElement<true, 6, GTEST_10_TUPLE_(T) > {
1137 template <GTEST_10_TYPENAMES_(T)>
1138 struct TupleElement<true, 7, GTEST_10_TUPLE_(T) > {
1142 template <GTEST_10_TYPENAMES_(T)>
1143 struct TupleElement<true, 8, GTEST_10_TUPLE_(T) > {
1147 template <GTEST_10_TYPENAMES_(T)>
1148 struct TupleElement<true, 9, GTEST_10_TUPLE_(T) > {
1152 } // namespace gtest_internal
1158 tuple(const tuple& /* t */) {}
1159 tuple& operator=(const tuple& /* t */) { return *this; }
1162 template <GTEST_1_TYPENAMES_(T)>
1163 class GTEST_1_TUPLE_(T) {
1165 template <int k> friend class gtest_internal::Get;
1169 explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
1171 tuple(const tuple& t) : f0_(t.f0_) {}
1173 template <GTEST_1_TYPENAMES_(U)>
1174 tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
1176 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1178 template <GTEST_1_TYPENAMES_(U)>
1179 tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
1183 GTEST_DECLARE_TUPLE_AS_FRIEND_
1185 template <GTEST_1_TYPENAMES_(U)>
1186 tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
1194 template <GTEST_2_TYPENAMES_(T)>
1195 class GTEST_2_TUPLE_(T) {
1197 template <int k> friend class gtest_internal::Get;
1199 tuple() : f0_(), f1_() {}
1201 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
1204 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
1206 template <GTEST_2_TYPENAMES_(U)>
1207 tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
1208 template <typename U0, typename U1>
1209 tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
1211 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1213 template <GTEST_2_TYPENAMES_(U)>
1214 tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
1217 template <typename U0, typename U1>
1218 tuple& operator=(const ::std::pair<U0, U1>& p) {
1224 GTEST_DECLARE_TUPLE_AS_FRIEND_
1226 template <GTEST_2_TYPENAMES_(U)>
1227 tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
1237 template <GTEST_3_TYPENAMES_(T)>
1238 class GTEST_3_TUPLE_(T) {
1240 template <int k> friend class gtest_internal::Get;
1242 tuple() : f0_(), f1_(), f2_() {}
1244 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1245 GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
1247 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
1249 template <GTEST_3_TYPENAMES_(U)>
1250 tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
1252 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1254 template <GTEST_3_TYPENAMES_(U)>
1255 tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
1259 GTEST_DECLARE_TUPLE_AS_FRIEND_
1261 template <GTEST_3_TYPENAMES_(U)>
1262 tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
1274 template <GTEST_4_TYPENAMES_(T)>
1275 class GTEST_4_TUPLE_(T) {
1277 template <int k> friend class gtest_internal::Get;
1279 tuple() : f0_(), f1_(), f2_(), f3_() {}
1281 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1282 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
1285 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
1287 template <GTEST_4_TYPENAMES_(U)>
1288 tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1291 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1293 template <GTEST_4_TYPENAMES_(U)>
1294 tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
1298 GTEST_DECLARE_TUPLE_AS_FRIEND_
1300 template <GTEST_4_TYPENAMES_(U)>
1301 tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
1315 template <GTEST_5_TYPENAMES_(T)>
1316 class GTEST_5_TUPLE_(T) {
1318 template <int k> friend class gtest_internal::Get;
1320 tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
1322 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1323 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
1324 GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
1326 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1329 template <GTEST_5_TYPENAMES_(U)>
1330 tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1331 f3_(t.f3_), f4_(t.f4_) {}
1333 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1335 template <GTEST_5_TYPENAMES_(U)>
1336 tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
1340 GTEST_DECLARE_TUPLE_AS_FRIEND_
1342 template <GTEST_5_TYPENAMES_(U)>
1343 tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
1359 template <GTEST_6_TYPENAMES_(T)>
1360 class GTEST_6_TUPLE_(T) {
1362 template <int k> friend class gtest_internal::Get;
1364 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
1366 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1367 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1368 GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1371 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1372 f4_(t.f4_), f5_(t.f5_) {}
1374 template <GTEST_6_TYPENAMES_(U)>
1375 tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1376 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
1378 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1380 template <GTEST_6_TYPENAMES_(U)>
1381 tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
1385 GTEST_DECLARE_TUPLE_AS_FRIEND_
1387 template <GTEST_6_TYPENAMES_(U)>
1388 tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
1406 template <GTEST_7_TYPENAMES_(T)>
1407 class GTEST_7_TUPLE_(T) {
1409 template <int k> friend class gtest_internal::Get;
1411 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
1413 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1414 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1415 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
1416 f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
1418 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1419 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1421 template <GTEST_7_TYPENAMES_(U)>
1422 tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1423 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1425 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1427 template <GTEST_7_TYPENAMES_(U)>
1428 tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
1432 GTEST_DECLARE_TUPLE_AS_FRIEND_
1434 template <GTEST_7_TYPENAMES_(U)>
1435 tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
1455 template <GTEST_8_TYPENAMES_(T)>
1456 class GTEST_8_TUPLE_(T) {
1458 template <int k> friend class gtest_internal::Get;
1460 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
1462 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1463 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1464 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
1465 GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1466 f5_(f5), f6_(f6), f7_(f7) {}
1468 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1469 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1471 template <GTEST_8_TYPENAMES_(U)>
1472 tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1473 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1475 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1477 template <GTEST_8_TYPENAMES_(U)>
1478 tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
1482 GTEST_DECLARE_TUPLE_AS_FRIEND_
1484 template <GTEST_8_TYPENAMES_(U)>
1485 tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
1507 template <GTEST_9_TYPENAMES_(T)>
1508 class GTEST_9_TUPLE_(T) {
1510 template <int k> friend class gtest_internal::Get;
1512 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
1514 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1515 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1516 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1517 GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1518 f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
1520 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1521 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1523 template <GTEST_9_TYPENAMES_(U)>
1524 tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1525 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1527 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1529 template <GTEST_9_TYPENAMES_(U)>
1530 tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
1534 GTEST_DECLARE_TUPLE_AS_FRIEND_
1536 template <GTEST_9_TYPENAMES_(U)>
1537 tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
1561 template <GTEST_10_TYPENAMES_(T)>
1564 template <int k> friend class gtest_internal::Get;
1566 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
1569 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1570 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1571 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1572 GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
1573 f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
1575 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1576 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
1578 template <GTEST_10_TYPENAMES_(U)>
1579 tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1580 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
1583 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1585 template <GTEST_10_TYPENAMES_(U)>
1586 tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
1590 GTEST_DECLARE_TUPLE_AS_FRIEND_
1592 template <GTEST_10_TYPENAMES_(U)>
1593 tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
1619 // 6.1.3.2 Tuple creation functions.
1621 // Known limitations: we don't support passing an
1622 // std::tr1::reference_wrapper<T> to make_tuple(). And we don't
1625 inline tuple<> make_tuple() { return tuple<>(); }
1627 template <GTEST_1_TYPENAMES_(T)>
1628 inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
1629 return GTEST_1_TUPLE_(T)(f0);
1632 template <GTEST_2_TYPENAMES_(T)>
1633 inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
1634 return GTEST_2_TUPLE_(T)(f0, f1);
1637 template <GTEST_3_TYPENAMES_(T)>
1638 inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
1639 return GTEST_3_TUPLE_(T)(f0, f1, f2);
1642 template <GTEST_4_TYPENAMES_(T)>
1643 inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1645 return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
1648 template <GTEST_5_TYPENAMES_(T)>
1649 inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1650 const T3& f3, const T4& f4) {
1651 return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
1654 template <GTEST_6_TYPENAMES_(T)>
1655 inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1656 const T3& f3, const T4& f4, const T5& f5) {
1657 return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
1660 template <GTEST_7_TYPENAMES_(T)>
1661 inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1662 const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
1663 return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
1666 template <GTEST_8_TYPENAMES_(T)>
1667 inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1668 const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
1669 return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
1672 template <GTEST_9_TYPENAMES_(T)>
1673 inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1674 const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1676 return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
1679 template <GTEST_10_TYPENAMES_(T)>
1680 inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1681 const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1682 const T8& f8, const T9& f9) {
1683 return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
1686 // 6.1.3.3 Tuple helper classes.
1688 template <typename Tuple> struct tuple_size;
1690 template <GTEST_0_TYPENAMES_(T)>
1691 struct tuple_size<GTEST_0_TUPLE_(T) > {
1692 static const int value = 0;
1695 template <GTEST_1_TYPENAMES_(T)>
1696 struct tuple_size<GTEST_1_TUPLE_(T) > {
1697 static const int value = 1;
1700 template <GTEST_2_TYPENAMES_(T)>
1701 struct tuple_size<GTEST_2_TUPLE_(T) > {
1702 static const int value = 2;
1705 template <GTEST_3_TYPENAMES_(T)>
1706 struct tuple_size<GTEST_3_TUPLE_(T) > {
1707 static const int value = 3;
1710 template <GTEST_4_TYPENAMES_(T)>
1711 struct tuple_size<GTEST_4_TUPLE_(T) > {
1712 static const int value = 4;
1715 template <GTEST_5_TYPENAMES_(T)>
1716 struct tuple_size<GTEST_5_TUPLE_(T) > {
1717 static const int value = 5;
1720 template <GTEST_6_TYPENAMES_(T)>
1721 struct tuple_size<GTEST_6_TUPLE_(T) > {
1722 static const int value = 6;
1725 template <GTEST_7_TYPENAMES_(T)>
1726 struct tuple_size<GTEST_7_TUPLE_(T) > {
1727 static const int value = 7;
1730 template <GTEST_8_TYPENAMES_(T)>
1731 struct tuple_size<GTEST_8_TUPLE_(T) > {
1732 static const int value = 8;
1735 template <GTEST_9_TYPENAMES_(T)>
1736 struct tuple_size<GTEST_9_TUPLE_(T) > {
1737 static const int value = 9;
1740 template <GTEST_10_TYPENAMES_(T)>
1741 struct tuple_size<GTEST_10_TUPLE_(T) > {
1742 static const int value = 10;
1745 template <int k, class Tuple>
1746 struct tuple_element {
1747 typedef typename gtest_internal::TupleElement<
1748 k < (tuple_size<Tuple>::value), k, Tuple>::type type;
1751 #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
1753 // 6.1.3.4 Element access.
1755 namespace gtest_internal {
1760 template <class Tuple>
1761 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1762 Field(Tuple& t) { return t.f0_; } // NOLINT
1764 template <class Tuple>
1765 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1766 ConstField(const Tuple& t) { return t.f0_; }
1772 template <class Tuple>
1773 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1774 Field(Tuple& t) { return t.f1_; } // NOLINT
1776 template <class Tuple>
1777 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1778 ConstField(const Tuple& t) { return t.f1_; }
1784 template <class Tuple>
1785 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1786 Field(Tuple& t) { return t.f2_; } // NOLINT
1788 template <class Tuple>
1789 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1790 ConstField(const Tuple& t) { return t.f2_; }
1796 template <class Tuple>
1797 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1798 Field(Tuple& t) { return t.f3_; } // NOLINT
1800 template <class Tuple>
1801 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1802 ConstField(const Tuple& t) { return t.f3_; }
1808 template <class Tuple>
1809 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1810 Field(Tuple& t) { return t.f4_; } // NOLINT
1812 template <class Tuple>
1813 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1814 ConstField(const Tuple& t) { return t.f4_; }
1820 template <class Tuple>
1821 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1822 Field(Tuple& t) { return t.f5_; } // NOLINT
1824 template <class Tuple>
1825 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1826 ConstField(const Tuple& t) { return t.f5_; }
1832 template <class Tuple>
1833 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1834 Field(Tuple& t) { return t.f6_; } // NOLINT
1836 template <class Tuple>
1837 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1838 ConstField(const Tuple& t) { return t.f6_; }
1844 template <class Tuple>
1845 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1846 Field(Tuple& t) { return t.f7_; } // NOLINT
1848 template <class Tuple>
1849 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1850 ConstField(const Tuple& t) { return t.f7_; }
1856 template <class Tuple>
1857 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1858 Field(Tuple& t) { return t.f8_; } // NOLINT
1860 template <class Tuple>
1861 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1862 ConstField(const Tuple& t) { return t.f8_; }
1868 template <class Tuple>
1869 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1870 Field(Tuple& t) { return t.f9_; } // NOLINT
1872 template <class Tuple>
1873 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1874 ConstField(const Tuple& t) { return t.f9_; }
1877 } // namespace gtest_internal
1879 template <int k, GTEST_10_TYPENAMES_(T)>
1880 GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
1881 get(GTEST_10_TUPLE_(T)& t) {
1882 return gtest_internal::Get<k>::Field(t);
1885 template <int k, GTEST_10_TYPENAMES_(T)>
1886 GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
1887 get(const GTEST_10_TUPLE_(T)& t) {
1888 return gtest_internal::Get<k>::ConstField(t);
1891 // 6.1.3.5 Relational operators
1893 // We only implement == and !=, as we don't have a need for the rest yet.
1895 namespace gtest_internal {
1897 // SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
1898 // first k fields of t1 equals the first k fields of t2.
1899 // SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
1901 template <int kSize1, int kSize2>
1902 struct SameSizeTuplePrefixComparator;
1905 struct SameSizeTuplePrefixComparator<0, 0> {
1906 template <class Tuple1, class Tuple2>
1907 static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
1913 struct SameSizeTuplePrefixComparator<k, k> {
1914 template <class Tuple1, class Tuple2>
1915 static bool Eq(const Tuple1& t1, const Tuple2& t2) {
1916 return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
1917 ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
1921 } // namespace gtest_internal
1923 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1924 inline bool operator==(const GTEST_10_TUPLE_(T)& t,
1925 const GTEST_10_TUPLE_(U)& u) {
1926 return gtest_internal::SameSizeTuplePrefixComparator<
1927 tuple_size<GTEST_10_TUPLE_(T) >::value,
1928 tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u);
1931 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1932 inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
1933 const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
1941 #undef GTEST_0_TUPLE_
1942 #undef GTEST_1_TUPLE_
1943 #undef GTEST_2_TUPLE_
1944 #undef GTEST_3_TUPLE_
1945 #undef GTEST_4_TUPLE_
1946 #undef GTEST_5_TUPLE_
1947 #undef GTEST_6_TUPLE_
1948 #undef GTEST_7_TUPLE_
1949 #undef GTEST_8_TUPLE_
1950 #undef GTEST_9_TUPLE_
1951 #undef GTEST_10_TUPLE_
1953 #undef GTEST_0_TYPENAMES_
1954 #undef GTEST_1_TYPENAMES_
1955 #undef GTEST_2_TYPENAMES_
1956 #undef GTEST_3_TYPENAMES_
1957 #undef GTEST_4_TYPENAMES_
1958 #undef GTEST_5_TYPENAMES_
1959 #undef GTEST_6_TYPENAMES_
1960 #undef GTEST_7_TYPENAMES_
1961 #undef GTEST_8_TYPENAMES_
1962 #undef GTEST_9_TYPENAMES_
1963 #undef GTEST_10_TYPENAMES_
1965 #undef GTEST_DECLARE_TUPLE_AS_FRIEND_
1966 #undef GTEST_BY_REF_
1967 #undef GTEST_ADD_REF_
1968 #undef GTEST_TUPLE_ELEMENT_
1970 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
1971 # elif GTEST_ENV_HAS_STD_TUPLE_
1973 // C++11 puts its tuple into the ::std namespace rather than
1974 // ::std::tr1. gtest expects tuple to live in ::std::tr1, so put it there.
1975 // This causes undefined behavior, but supported compilers react in
1976 // the way we intend.
1980 using ::std::make_tuple;
1982 using ::std::tuple_element;
1983 using ::std::tuple_size;
1987 # elif GTEST_OS_SYMBIAN
1989 // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
1990 // use STLport's tuple implementation, which unfortunately doesn't
1991 // work as the copy of STLport distributed with Symbian is incomplete.
1992 // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
1993 // use its own tuple implementation.
1994 # ifdef BOOST_HAS_TR1_TUPLE
1995 # undef BOOST_HAS_TR1_TUPLE
1996 # endif // BOOST_HAS_TR1_TUPLE
1998 // This prevents <boost/tr1/detail/config.hpp>, which defines
1999 // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
2000 # define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
2001 # include <tuple> // IWYU pragma: export // NOLINT
2003 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
2004 // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
2005 // not conform to the TR1 spec, which requires the header to be <tuple>.
2007 # if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
2008 // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
2009 // which is #included by <tr1/tuple>, to not compile when RTTI is
2010 // disabled. _TR1_FUNCTIONAL is the header guard for
2011 // <tr1/functional>. Hence the following #define is a hack to prevent
2012 // <tr1/functional> from being included.
2013 # define _TR1_FUNCTIONAL 1
2014 # include <tr1/tuple>
2015 # undef _TR1_FUNCTIONAL // Allows the user to #include
2016 // <tr1/functional> if he chooses to.
2018 # include <tr1/tuple> // NOLINT
2019 # endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
2022 // If the compiler is not GCC 4.0+, we assume the user is using a
2023 // spec-conforming TR1 implementation.
2024 # include <tuple> // IWYU pragma: export // NOLINT
2025 # endif // GTEST_USE_OWN_TR1_TUPLE
2027 #endif // GTEST_HAS_TR1_TUPLE
2029 // Determines whether clone(2) is supported.
2030 // Usually it will only be available on Linux, excluding
2031 // Linux on the Itanium architecture.
2032 // Also see http://linux.die.net/man/2/clone.
2033 #ifndef GTEST_HAS_CLONE
2034 // The user didn't tell us, so we need to figure it out.
2036 # if GTEST_OS_LINUX && !defined(__ia64__)
2037 # if GTEST_OS_LINUX_ANDROID
2038 // On Android, clone() became available at different API levels for each 32-bit
2040 # if defined(__LP64__) || \
2041 (defined(__arm__) && __ANDROID_API__ >= 9) || \
2042 (defined(__mips__) && __ANDROID_API__ >= 12) || \
2043 (defined(__i386__) && __ANDROID_API__ >= 17)
2044 # define GTEST_HAS_CLONE 1
2046 # define GTEST_HAS_CLONE 0
2049 # define GTEST_HAS_CLONE 1
2052 # define GTEST_HAS_CLONE 0
2053 # endif // GTEST_OS_LINUX && !defined(__ia64__)
2055 #endif // GTEST_HAS_CLONE
2057 // Determines whether to support stream redirection. This is used to test
2058 // output correctness and to implement death tests.
2059 #ifndef GTEST_HAS_STREAM_REDIRECTION
2060 // By default, we assume that stream redirection is supported on all
2061 // platforms except known mobile ones.
2062 # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \
2063 GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
2064 # define GTEST_HAS_STREAM_REDIRECTION 0
2066 # define GTEST_HAS_STREAM_REDIRECTION 1
2067 # endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
2068 #endif // GTEST_HAS_STREAM_REDIRECTION
2070 // Determines whether to support death tests.
2071 // Google Test does not support death tests for VC 7.1 and earlier as
2072 // abort() in a VC 7.1 application compiled as GUI in debug config
2073 // pops up a dialog window that cannot be suppressed programmatically.
2074 #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
2075 (GTEST_OS_MAC && !GTEST_OS_IOS) || \
2076 (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
2077 GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
2078 GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD)
2079 # define GTEST_HAS_DEATH_TEST 1
2082 // We don't support MSVC 7.1 with exceptions disabled now. Therefore
2083 // all the compilers we care about are adequate for supporting
2084 // value-parameterized tests.
2085 #define GTEST_HAS_PARAM_TEST 1
2087 // Determines whether to support type-driven tests.
2089 // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
2090 // Sun Pro CC, IBM Visual Age, and HP aCC support.
2091 #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
2092 defined(__IBMCPP__) || defined(__HP_aCC)
2093 # define GTEST_HAS_TYPED_TEST 1
2094 # define GTEST_HAS_TYPED_TEST_P 1
2097 // Determines whether to support Combine(). This only makes sense when
2098 // value-parameterized tests are enabled. The implementation doesn't
2099 // work on Sun Studio since it doesn't understand templated conversion
2101 #if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
2102 # define GTEST_HAS_COMBINE 1
2105 // Determines whether the system compiler uses UTF-16 for encoding wide strings.
2106 #define GTEST_WIDE_STRING_USES_UTF16_ \
2107 (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
2109 // Determines whether test results can be streamed to a socket.
2111 # define GTEST_CAN_STREAM_RESULTS_ 1
2114 // Defines some utility macros.
2116 // The GNU compiler emits a warning if nested "if" statements are followed by
2117 // an "else" statement and braces are not used to explicitly disambiguate the
2118 // "else" binding. This leads to problems with code like:
2121 // ASSERT_*(condition) << "Some message";
2123 // The "switch (0) case 0:" idiom is used to suppress this.
2124 #ifdef __INTEL_COMPILER
2125 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_
2127 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT
2130 // Use this annotation at the end of a struct/class definition to
2131 // prevent the compiler from optimizing away instances that are never
2132 // used. This is useful when all interesting logic happens inside the
2133 // c'tor and / or d'tor. Example:
2137 // } GTEST_ATTRIBUTE_UNUSED_;
2139 // Also use it after a variable or parameter declaration to tell the
2140 // compiler the variable/parameter does not have to be used.
2141 #if defined(__GNUC__) && !defined(COMPILER_ICC)
2142 # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
2143 #elif defined(__clang__)
2144 # if __has_attribute(unused)
2145 # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
2148 #ifndef GTEST_ATTRIBUTE_UNUSED_
2149 # define GTEST_ATTRIBUTE_UNUSED_
2152 // A macro to disallow operator=
2153 // This should be used in the private: declarations for a class.
2154 #define GTEST_DISALLOW_ASSIGN_(type)\
2155 void operator=(type const &)
2157 // A macro to disallow copy constructor and operator=
2158 // This should be used in the private: declarations for a class.
2159 #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
2160 type(type const &);\
2161 GTEST_DISALLOW_ASSIGN_(type)
2163 // Tell the compiler to warn about unused return values for functions declared
2164 // with this macro. The macro should be used on function declarations
2165 // following the argument list:
2167 // Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
2168 #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
2169 # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
2171 # define GTEST_MUST_USE_RESULT_
2172 #endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
2174 // MS C++ compiler emits warning when a conditional expression is compile time
2175 // constant. In some contexts this warning is false positive and needs to be
2176 // suppressed. Use the following two macros in such cases:
2178 // GTEST_INTENTIONAL_CONST_COND_PUSH_()
2180 // GTEST_INTENTIONAL_CONST_COND_POP_()
2182 # define GTEST_INTENTIONAL_CONST_COND_PUSH_() \
2183 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127)
2184 # define GTEST_INTENTIONAL_CONST_COND_POP_() \
2185 GTEST_DISABLE_MSC_WARNINGS_POP_()
2187 // Determine whether the compiler supports Microsoft's Structured Exception
2188 // Handling. This is supported by several Windows compilers but generally
2189 // does not exist on any other system.
2190 #ifndef GTEST_HAS_SEH
2191 // The user didn't tell us, so we need to figure it out.
2193 # if defined(_MSC_VER) || defined(__BORLANDC__)
2194 // These two compilers are known to support SEH.
2195 # define GTEST_HAS_SEH 1
2198 # define GTEST_HAS_SEH 0
2201 #define GTEST_IS_THREADSAFE \
2202 (GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ \
2203 || (GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT) \
2204 || GTEST_HAS_PTHREAD)
2206 #endif // GTEST_HAS_SEH
2209 # if GTEST_LINKED_AS_SHARED_LIBRARY
2210 # define GTEST_API_ __declspec(dllimport)
2211 # elif GTEST_CREATE_SHARED_LIBRARY
2212 # define GTEST_API_ __declspec(dllexport)
2214 #elif __GNUC__ >= 4 || defined(__clang__)
2215 # define GTEST_API_ __attribute__((visibility ("default")))
2223 // Ask the compiler to never inline a given function.
2224 # define GTEST_NO_INLINE_ __attribute__((noinline))
2226 # define GTEST_NO_INLINE_
2229 // _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
2230 #if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)
2231 # define GTEST_HAS_CXXABI_H_ 1
2233 # define GTEST_HAS_CXXABI_H_ 0
2236 // A function level attribute to disable checking for use of uninitialized
2237 // memory when built with MemorySanitizer.
2238 #if defined(__clang__)
2239 # if __has_feature(memory_sanitizer)
2240 # define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ \
2241 __attribute__((no_sanitize_memory))
2243 # define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
2244 # endif // __has_feature(memory_sanitizer)
2246 # define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
2249 // A function level attribute to disable AddressSanitizer instrumentation.
2250 #if defined(__clang__)
2251 # if __has_feature(address_sanitizer)
2252 # define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ \
2253 __attribute__((no_sanitize_address))
2255 # define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
2256 # endif // __has_feature(address_sanitizer)
2258 # define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
2261 // A function level attribute to disable ThreadSanitizer instrumentation.
2262 #if defined(__clang__)
2263 # if __has_feature(thread_sanitizer)
2264 # define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ \
2265 __attribute__((no_sanitize_thread))
2267 # define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
2268 # endif // __has_feature(thread_sanitizer)
2270 # define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
2277 #if defined(GTEST_TUPLE_NAMESPACE_)
2278 // Import tuple and friends into the ::testing namespace.
2279 // It is part of our interface, having them in ::testing allows us to change
2280 // their types as needed.
2281 using GTEST_TUPLE_NAMESPACE_::get;
2282 using GTEST_TUPLE_NAMESPACE_::make_tuple;
2283 using GTEST_TUPLE_NAMESPACE_::tuple;
2284 using GTEST_TUPLE_NAMESPACE_::tuple_size;
2285 using GTEST_TUPLE_NAMESPACE_::tuple_element;
2286 #endif // defined(GTEST_TUPLE_NAMESPACE_)
2288 namespace internal {
2290 // A secret type that Google Test users don't know about. It has no
2291 // definition on purpose. Therefore it's impossible to create a
2292 // Secret object, which is what we want.
2295 // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
2296 // expression is true. For example, you could use it to verify the
2297 // size of a static array:
2299 // GTEST_COMPILE_ASSERT_(GTEST_ARRAY_SIZE_(names) == NUM_NAMES,
2300 // names_incorrect_size);
2302 // or to make sure a struct is smaller than a certain size:
2304 // GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
2306 // The second argument to the macro is the name of the variable. If
2307 // the expression is false, most compilers will issue a warning/error
2308 // containing the name of the variable.
2310 #if GTEST_LANG_CXX11
2311 # define GTEST_COMPILE_ASSERT_(expr, msg) static_assert(expr, #msg)
2312 #else // !GTEST_LANG_CXX11
2314 struct CompileAssert {
2317 # define GTEST_COMPILE_ASSERT_(expr, msg) \
2318 typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
2319 msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
2320 #endif // !GTEST_LANG_CXX11
2322 // Implementation details of GTEST_COMPILE_ASSERT_:
2324 // (In C++11, we simply use static_assert instead of the following)
2326 // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
2327 // elements (and thus is invalid) when the expression is false.
2329 // - The simpler definition
2331 // #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
2333 // does not work, as gcc supports variable-length arrays whose sizes
2334 // are determined at run-time (this is gcc's extension and not part
2335 // of the C++ standard). As a result, gcc fails to reject the
2336 // following code with the simple definition:
2339 // GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
2340 // // not a compile-time constant.
2342 // - By using the type CompileAssert<(bool(expr))>, we ensures that
2343 // expr is a compile-time constant. (Template arguments must be
2344 // determined at compile-time.)
2346 // - The outter parentheses in CompileAssert<(bool(expr))> are necessary
2347 // to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
2349 // CompileAssert<bool(expr)>
2351 // instead, these compilers will refuse to compile
2353 // GTEST_COMPILE_ASSERT_(5 > 0, some_message);
2355 // (They seem to think the ">" in "5 > 0" marks the end of the
2356 // template argument list.)
2358 // - The array size is (bool(expr) ? 1 : -1), instead of simply
2360 // ((expr) ? 1 : -1).
2362 // This is to avoid running into a bug in MS VC 7.1, which
2363 // causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
2365 // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
2367 // This template is declared, but intentionally undefined.
2368 template <typename T1, typename T2>
2369 struct StaticAssertTypeEqHelper;
2371 template <typename T>
2372 struct StaticAssertTypeEqHelper<T, T> {
2373 enum { value = true };
2376 // Evaluates to the number of elements in 'array'.
2377 #define GTEST_ARRAY_SIZE_(array) (sizeof(array) / sizeof(array[0]))
2379 #if GTEST_HAS_GLOBAL_STRING
2380 typedef ::string string;
2382 typedef ::std::string string;
2383 #endif // GTEST_HAS_GLOBAL_STRING
2385 #if GTEST_HAS_GLOBAL_WSTRING
2386 typedef ::wstring wstring;
2387 #elif GTEST_HAS_STD_WSTRING
2388 typedef ::std::wstring wstring;
2389 #endif // GTEST_HAS_GLOBAL_WSTRING
2391 // A helper for suppressing warnings on constant condition. It just
2392 // returns 'condition'.
2393 GTEST_API_ bool IsTrue(bool condition);
2395 // Defines scoped_ptr.
2397 // This implementation of scoped_ptr is PARTIAL - it only contains
2398 // enough stuff to satisfy Google Test's need.
2399 template <typename T>
2402 typedef T element_type;
2404 explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
2405 ~scoped_ptr() { reset(); }
2407 T& operator*() const { return *ptr_; }
2408 T* operator->() const { return ptr_; }
2409 T* get() const { return ptr_; }
2412 T* const ptr = ptr_;
2417 void reset(T* p = NULL) {
2419 if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
2426 friend void swap(scoped_ptr& a, scoped_ptr& b) {
2428 swap(a.ptr_, b.ptr_);
2434 GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
2439 // A simple C++ wrapper for <regex.h>. It uses the POSIX Extended
2440 // Regular Expression syntax.
2441 class GTEST_API_ RE {
2443 // A copy constructor is required by the Standard to initialize object
2444 // references from r-values.
2445 RE(const RE& other) { Init(other.pattern()); }
2447 // Constructs an RE from a string.
2448 RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT
2450 #if GTEST_HAS_GLOBAL_STRING
2452 RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT
2454 #endif // GTEST_HAS_GLOBAL_STRING
2456 RE(const char* regex) { Init(regex); } // NOLINT
2459 // Returns the string representation of the regex.
2460 const char* pattern() const { return pattern_; }
2462 // FullMatch(str, re) returns true iff regular expression re matches
2464 // PartialMatch(str, re) returns true iff regular expression re
2465 // matches a substring of str (including str itself).
2467 // TODO(wan@google.com): make FullMatch() and PartialMatch() work
2468 // when str contains NUL characters.
2469 static bool FullMatch(const ::std::string& str, const RE& re) {
2470 return FullMatch(str.c_str(), re);
2472 static bool PartialMatch(const ::std::string& str, const RE& re) {
2473 return PartialMatch(str.c_str(), re);
2476 #if GTEST_HAS_GLOBAL_STRING
2478 static bool FullMatch(const ::string& str, const RE& re) {
2479 return FullMatch(str.c_str(), re);
2481 static bool PartialMatch(const ::string& str, const RE& re) {
2482 return PartialMatch(str.c_str(), re);
2485 #endif // GTEST_HAS_GLOBAL_STRING
2487 static bool FullMatch(const char* str, const RE& re);
2488 static bool PartialMatch(const char* str, const RE& re);
2491 void Init(const char* regex);
2493 // We use a const char* instead of an std::string, as Google Test used to be
2494 // used where std::string is not available. TODO(wan@google.com): change to
2496 const char* pattern_;
2499 #if GTEST_USES_POSIX_RE
2501 regex_t full_regex_; // For FullMatch().
2502 regex_t partial_regex_; // For PartialMatch().
2504 #else // GTEST_USES_SIMPLE_RE
2506 const char* full_pattern_; // For FullMatch();
2510 GTEST_DISALLOW_ASSIGN_(RE);
2513 // Formats a source file path and a line number as they would appear
2514 // in an error message from the compiler used to compile this code.
2515 GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
2517 // Formats a file location for compiler-independent XML output.
2518 // Although this function is not platform dependent, we put it next to
2519 // FormatFileLocation in order to contrast the two functions.
2520 GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
2523 // Defines logging utilities:
2524 // GTEST_LOG_(severity) - logs messages at the specified severity level. The
2525 // message itself is streamed into the macro.
2526 // LogToStderr() - directs all log messages to stderr.
2527 // FlushInfoLog() - flushes informational log messages.
2529 enum GTestLogSeverity {
2536 // Formats log entry severity, provides a stream object for streaming the
2537 // log message, and terminates the message with a newline when going out of
2539 class GTEST_API_ GTestLog {
2541 GTestLog(GTestLogSeverity severity, const char* file, int line);
2543 // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
2546 ::std::ostream& GetStream() { return ::std::cerr; }
2549 const GTestLogSeverity severity_;
2551 GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
2554 #if !defined(GTEST_LOG_)
2556 # define GTEST_LOG_(severity) \
2557 ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
2558 __FILE__, __LINE__).GetStream()
2560 inline void LogToStderr() {}
2561 inline void FlushInfoLog() { fflush(NULL); }
2563 #endif // !defined(GTEST_LOG_)
2565 #if !defined(GTEST_CHECK_)
2566 // INTERNAL IMPLEMENTATION - DO NOT USE.
2568 // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
2569 // is not satisfied.
2571 // GTEST_CHECK_(boolean_condition);
2573 // GTEST_CHECK_(boolean_condition) << "Additional message";
2575 // This checks the condition and if the condition is not satisfied
2576 // it prints message about the condition violation, including the
2577 // condition itself, plus additional message streamed into it, if any,
2578 // and then it aborts the program. It aborts the program irrespective of
2579 // whether it is built in the debug mode or not.
2580 # define GTEST_CHECK_(condition) \
2581 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
2582 if (::testing::internal::IsTrue(condition)) \
2585 GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
2586 #endif // !defined(GTEST_CHECK_)
2588 // An all-mode assert to verify that the given POSIX-style function
2589 // call returns 0 (indicating success). Known limitation: this
2590 // doesn't expand to a balanced 'if' statement, so enclose the macro
2591 // in {} if you need to use it as the only statement in an 'if'
2593 #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
2594 if (const int gtest_error = (posix_call)) \
2595 GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
2598 #if GTEST_HAS_STD_MOVE_
2600 #else // GTEST_HAS_STD_MOVE_
2601 template <typename T>
2602 const T& move(const T& t) {
2605 #endif // GTEST_HAS_STD_MOVE_
2607 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
2609 // Use ImplicitCast_ as a safe version of static_cast for upcasting in
2610 // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
2611 // const Foo*). When you use ImplicitCast_, the compiler checks that
2612 // the cast is safe. Such explicit ImplicitCast_s are necessary in
2613 // surprisingly many situations where C++ demands an exact type match
2614 // instead of an argument type convertable to a target type.
2616 // The syntax for using ImplicitCast_ is the same as for static_cast:
2618 // ImplicitCast_<ToType>(expr)
2620 // ImplicitCast_ would have been part of the C++ standard library,
2621 // but the proposal was submitted too late. It will probably make
2622 // its way into the language in the future.
2624 // This relatively ugly name is intentional. It prevents clashes with
2625 // similar functions users may have (e.g., implicit_cast). The internal
2626 // namespace alone is not enough because the function can be found by ADL.
2627 template<typename To>
2628 inline To ImplicitCast_(To x) { return x; }
2630 // When you upcast (that is, cast a pointer from type Foo to type
2631 // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
2632 // always succeed. When you downcast (that is, cast a pointer from
2633 // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
2634 // how do you know the pointer is really of type SubclassOfFoo? It
2635 // could be a bare Foo, or of type DifferentSubclassOfFoo. Thus,
2636 // when you downcast, you should use this macro. In debug mode, we
2637 // use dynamic_cast<> to double-check the downcast is legal (we die
2638 // if it's not). In normal mode, we do the efficient static_cast<>
2639 // instead. Thus, it's important to test in debug mode to make sure
2640 // the cast is legal!
2641 // This is the only place in the code we should use dynamic_cast<>.
2642 // In particular, you SHOULDN'T be using dynamic_cast<> in order to
2643 // do RTTI (eg code like this:
2644 // if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
2645 // if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
2646 // You should design the code some other way not to need this.
2648 // This relatively ugly name is intentional. It prevents clashes with
2649 // similar functions users may have (e.g., down_cast). The internal
2650 // namespace alone is not enough because the function can be found by ADL.
2651 template<typename To, typename From> // use like this: DownCast_<T*>(foo);
2652 inline To DownCast_(From* f) { // so we only accept pointers
2653 // Ensures that To is a sub-type of From *. This test is here only
2654 // for compile-time type checking, and has no overhead in an
2655 // optimized build at run-time, as it will be optimized away
2657 GTEST_INTENTIONAL_CONST_COND_PUSH_()
2659 GTEST_INTENTIONAL_CONST_COND_POP_()
2661 ::testing::internal::ImplicitCast_<From*>(to);
2665 // RTTI: debug mode only!
2666 GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
2668 return static_cast<To>(f);
2671 // Downcasts the pointer of type Base to Derived.
2672 // Derived must be a subclass of Base. The parameter MUST
2673 // point to a class of type Derived, not any subclass of it.
2674 // When RTTI is available, the function performs a runtime
2675 // check to enforce this.
2676 template <class Derived, class Base>
2677 Derived* CheckedDowncastToActualType(Base* base) {
2679 GTEST_CHECK_(typeid(*base) == typeid(Derived));
2682 #if GTEST_HAS_DOWNCAST_
2683 return ::down_cast<Derived*>(base);
2684 #elif GTEST_HAS_RTTI
2685 return dynamic_cast<Derived*>(base); // NOLINT
2687 return static_cast<Derived*>(base); // Poor man's downcast.
2691 #if GTEST_HAS_STREAM_REDIRECTION
2693 // Defines the stderr capturer:
2694 // CaptureStdout - starts capturing stdout.
2695 // GetCapturedStdout - stops capturing stdout and returns the captured string.
2696 // CaptureStderr - starts capturing stderr.
2697 // GetCapturedStderr - stops capturing stderr and returns the captured string.
2699 GTEST_API_ void CaptureStdout();
2700 GTEST_API_ std::string GetCapturedStdout();
2701 GTEST_API_ void CaptureStderr();
2702 GTEST_API_ std::string GetCapturedStderr();
2704 #endif // GTEST_HAS_STREAM_REDIRECTION
2706 // Returns a path to temporary directory.
2707 GTEST_API_ std::string TempDir();
2709 // Returns the size (in bytes) of a file.
2710 GTEST_API_ size_t GetFileSize(FILE* file);
2712 // Reads the entire content of a file as a string.
2713 GTEST_API_ std::string ReadEntireFile(FILE* file);
2715 // All command line arguments.
2716 GTEST_API_ const ::std::vector<testing::internal::string>& GetArgvs();
2718 #if GTEST_HAS_DEATH_TEST
2720 const ::std::vector<testing::internal::string>& GetInjectableArgvs();
2721 void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
2725 #endif // GTEST_HAS_DEATH_TEST
2727 // Defines synchronization primitives.
2728 #if GTEST_IS_THREADSAFE
2729 # if GTEST_HAS_PTHREAD
2730 // Sleeps for (roughly) n milliseconds. This function is only for testing
2731 // Google Test's own constructs. Don't use it in user tests, either
2732 // directly or indirectly.
2733 inline void SleepMilliseconds(int n) {
2734 const timespec time = {
2736 n * 1000L * 1000L, // And n ms.
2738 nanosleep(&time, NULL);
2740 # endif // GTEST_HAS_PTHREAD
2742 # if GTEST_HAS_NOTIFICATION_
2743 // Notification has already been imported into the namespace.
2744 // Nothing to do here.
2746 # elif GTEST_HAS_PTHREAD
2747 // Allows a controller thread to pause execution of newly created
2748 // threads until notified. Instances of this class must be created
2749 // and destroyed in the controller thread.
2751 // This class is only for testing Google Test's own constructs. Do not
2752 // use it in user tests, either directly or indirectly.
2753 class Notification {
2755 Notification() : notified_(false) {
2756 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
2759 pthread_mutex_destroy(&mutex_);
2762 // Notifies all threads created with this notification to start. Must
2763 // be called from the controller thread.
2765 pthread_mutex_lock(&mutex_);
2767 pthread_mutex_unlock(&mutex_);
2770 // Blocks until the controller thread notifies. Must be called from a test
2772 void WaitForNotification() {
2774 pthread_mutex_lock(&mutex_);
2775 const bool notified = notified_;
2776 pthread_mutex_unlock(&mutex_);
2779 SleepMilliseconds(10);
2784 pthread_mutex_t mutex_;
2787 GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
2790 # elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
2792 GTEST_API_ void SleepMilliseconds(int n);
2794 // Provides leak-safe Windows kernel handle ownership.
2795 // Used in death tests and in threading support.
2796 class GTEST_API_ AutoHandle {
2798 // Assume that Win32 HANDLE type is equivalent to void*. Doing so allows us to
2799 // avoid including <windows.h> in this header file. Including <windows.h> is
2800 // undesirable because it defines a lot of symbols and macros that tend to
2801 // conflict with client code. This assumption is verified by
2802 // WindowsTypesTest.HANDLEIsVoidStar.
2803 typedef void* Handle;
2805 explicit AutoHandle(Handle handle);
2811 void Reset(Handle handle);
2814 // Returns true iff the handle is a valid handle object that can be closed.
2815 bool IsCloseable() const;
2819 GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);
2822 // Allows a controller thread to pause execution of newly created
2823 // threads until notified. Instances of this class must be created
2824 // and destroyed in the controller thread.
2826 // This class is only for testing Google Test's own constructs. Do not
2827 // use it in user tests, either directly or indirectly.
2828 class GTEST_API_ Notification {
2832 void WaitForNotification();
2837 GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
2839 # endif // GTEST_HAS_NOTIFICATION_
2841 // On MinGW, we can have both GTEST_OS_WINDOWS and GTEST_HAS_PTHREAD
2842 // defined, but we don't want to use MinGW's pthreads implementation, which
2843 // has conformance problems with some versions of the POSIX standard.
2844 # if GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW
2846 // As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
2847 // Consequently, it cannot select a correct instantiation of ThreadWithParam
2848 // in order to call its Run(). Introducing ThreadWithParamBase as a
2849 // non-templated base class for ThreadWithParam allows us to bypass this
2851 class ThreadWithParamBase {
2853 virtual ~ThreadWithParamBase() {}
2854 virtual void Run() = 0;
2857 // pthread_create() accepts a pointer to a function type with the C linkage.
2858 // According to the Standard (7.5/1), function types with different linkages
2859 // are different even if they are otherwise identical. Some compilers (for
2860 // example, SunStudio) treat them as different types. Since class methods
2861 // cannot be defined with C-linkage we need to define a free C-function to
2862 // pass into pthread_create().
2863 extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
2864 static_cast<ThreadWithParamBase*>(thread)->Run();
2868 // Helper class for testing Google Test's multi-threading constructs.
2869 // To use it, write:
2871 // void ThreadFunc(int param) { /* Do things with param */ }
2872 // Notification thread_can_start;
2874 // // The thread_can_start parameter is optional; you can supply NULL.
2875 // ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
2876 // thread_can_start.Notify();
2878 // These classes are only for testing Google Test's own constructs. Do
2879 // not use them in user tests, either directly or indirectly.
2880 template <typename T>
2881 class ThreadWithParam : public ThreadWithParamBase {
2883 typedef void UserThreadFunc(T);
2885 ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
2888 thread_can_start_(thread_can_start),
2890 ThreadWithParamBase* const base = this;
2891 // The thread can be created only after all fields except thread_
2892 // have been initialized.
2893 GTEST_CHECK_POSIX_SUCCESS_(
2894 pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
2896 ~ThreadWithParam() { Join(); }
2900 GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
2905 virtual void Run() {
2906 if (thread_can_start_ != NULL)
2907 thread_can_start_->WaitForNotification();
2912 UserThreadFunc* const func_; // User-supplied thread function.
2913 const T param_; // User-supplied parameter to the thread function.
2914 // When non-NULL, used to block execution until the controller thread
2916 Notification* const thread_can_start_;
2917 bool finished_; // true iff we know that the thread function has finished.
2918 pthread_t thread_; // The native thread object.
2920 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
2922 # endif // !GTEST_OS_WINDOWS && GTEST_HAS_PTHREAD ||
2923 // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
2925 # if GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
2926 // Mutex and ThreadLocal have already been imported into the namespace.
2927 // Nothing to do here.
2929 # elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
2931 // Mutex implements mutex on Windows platforms. It is used in conjunction
2932 // with class MutexLock:
2936 // MutexLock lock(&mutex); // Acquires the mutex and releases it at the
2937 // // end of the current scope.
2939 // A static Mutex *must* be defined or declared using one of the following
2941 // GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
2942 // GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
2944 // (A non-static Mutex is defined/declared in the usual way).
2945 class GTEST_API_ Mutex {
2947 enum MutexType { kStatic = 0, kDynamic = 1 };
2948 // We rely on kStaticMutex being 0 as it is to what the linker initializes
2949 // type_ in static mutexes. critical_section_ will be initialized lazily
2950 // in ThreadSafeLazyInit().
2951 enum StaticConstructorSelector { kStaticMutex = 0 };
2953 // This constructor intentionally does nothing. It relies on type_ being
2954 // statically initialized to 0 (effectively setting it to kStatic) and on
2955 // ThreadSafeLazyInit() to lazily initialize the rest of the members.
2956 explicit Mutex(StaticConstructorSelector /*dummy*/) {}
2965 // Does nothing if the current thread holds the mutex. Otherwise, crashes
2966 // with high probability.
2970 // Initializes owner_thread_id_ and critical_section_ in static mutexes.
2971 void ThreadSafeLazyInit();
2973 // Per http://blogs.msdn.com/b/oldnewthing/archive/2004/02/23/78395.aspx,
2974 // we assume that 0 is an invalid value for thread IDs.
2975 unsigned int owner_thread_id_;
2977 // For static mutexes, we rely on these members being initialized to zeros
2980 long critical_section_init_phase_; // NOLINT
2981 GTEST_CRITICAL_SECTION* critical_section_;
2983 GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
2986 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
2987 extern ::testing::internal::Mutex mutex
2989 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
2990 ::testing::internal::Mutex mutex(::testing::internal::Mutex::kStaticMutex)
2992 // We cannot name this class MutexLock because the ctor declaration would
2993 // conflict with a macro named MutexLock, which is defined on some
2994 // platforms. That macro is used as a defensive measure to prevent against
2995 // inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
2996 // "MutexLock l(&mu)". Hence the typedef trick below.
2997 class GTestMutexLock {
2999 explicit GTestMutexLock(Mutex* mutex)
3000 : mutex_(mutex) { mutex_->Lock(); }
3002 ~GTestMutexLock() { mutex_->Unlock(); }
3005 Mutex* const mutex_;
3007 GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
3010 typedef GTestMutexLock MutexLock;
3012 // Base class for ValueHolder<T>. Allows a caller to hold and delete a value
3013 // without knowing its type.
3014 class ThreadLocalValueHolderBase {
3016 virtual ~ThreadLocalValueHolderBase() {}
3019 // Provides a way for a thread to send notifications to a ThreadLocal
3020 // regardless of its parameter type.
3021 class ThreadLocalBase {
3023 // Creates a new ValueHolder<T> object holding a default value passed to
3024 // this ThreadLocal<T>'s constructor and returns it. It is the caller's
3025 // responsibility not to call this when the ThreadLocal<T> instance already
3026 // has a value on the current thread.
3027 virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const = 0;
3030 ThreadLocalBase() {}
3031 virtual ~ThreadLocalBase() {}
3034 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocalBase);
3037 // Maps a thread to a set of ThreadLocals that have values instantiated on that
3038 // thread and notifies them when the thread exits. A ThreadLocal instance is
3039 // expected to persist until all threads it has values on have terminated.
3040 class GTEST_API_ ThreadLocalRegistry {
3042 // Registers thread_local_instance as having value on the current thread.
3043 // Returns a value that can be used to identify the thread from other threads.
3044 static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
3045 const ThreadLocalBase* thread_local_instance);
3047 // Invoked when a ThreadLocal instance is destroyed.
3048 static void OnThreadLocalDestroyed(
3049 const ThreadLocalBase* thread_local_instance);
3052 class GTEST_API_ ThreadWithParamBase {
3059 virtual ~Runnable() {}
3060 virtual void Run() = 0;
3063 ThreadWithParamBase(Runnable *runnable, Notification* thread_can_start);
3064 virtual ~ThreadWithParamBase();
3070 // Helper class for testing Google Test's multi-threading constructs.
3071 template <typename T>
3072 class ThreadWithParam : public ThreadWithParamBase {
3074 typedef void UserThreadFunc(T);
3076 ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
3077 : ThreadWithParamBase(new RunnableImpl(func, param), thread_can_start) {
3079 virtual ~ThreadWithParam() {}
3082 class RunnableImpl : public Runnable {
3084 RunnableImpl(UserThreadFunc* func, T param)
3088 virtual ~RunnableImpl() {}
3089 virtual void Run() {
3094 UserThreadFunc* const func_;
3097 GTEST_DISALLOW_COPY_AND_ASSIGN_(RunnableImpl);
3100 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
3103 // Implements thread-local storage on Windows systems.
3106 // ThreadLocal<int> tl(100); // 100 is the default value for each thread.
3109 // tl.set(150); // Changes the value for thread 2 only.
3110 // EXPECT_EQ(150, tl.get());
3113 // EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value.
3115 // EXPECT_EQ(200, tl.get());
3117 // The template type argument T must have a public copy constructor.
3118 // In addition, the default ThreadLocal constructor requires T to have
3119 // a public default constructor.
3121 // The users of a TheadLocal instance have to make sure that all but one
3122 // threads (including the main one) using that instance have exited before
3123 // destroying it. Otherwise, the per-thread objects managed for them by the
3124 // ThreadLocal instance are not guaranteed to be destroyed on all platforms.
3126 // Google Test only uses global ThreadLocal objects. That means they
3127 // will die after main() has returned. Therefore, no per-thread
3128 // object managed by Google Test will be leaked as long as all threads
3129 // using Google Test have exited when main() returns.
3130 template <typename T>
3131 class ThreadLocal : public ThreadLocalBase {
3133 ThreadLocal() : default_factory_(new DefaultValueHolderFactory()) {}
3134 explicit ThreadLocal(const T& value)
3135 : default_factory_(new InstanceValueHolderFactory(value)) {}
3137 ~ThreadLocal() { ThreadLocalRegistry::OnThreadLocalDestroyed(this); }
3139 T* pointer() { return GetOrCreateValue(); }
3140 const T* pointer() const { return GetOrCreateValue(); }
3141 const T& get() const { return *pointer(); }
3142 void set(const T& value) { *pointer() = value; }
3145 // Holds a value of T. Can be deleted via its base class without the caller
3146 // knowing the type of T.
3147 class ValueHolder : public ThreadLocalValueHolderBase {
3149 ValueHolder() : value_() {}
3150 explicit ValueHolder(const T& value) : value_(value) {}
3152 T* pointer() { return &value_; }
3156 GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
3160 T* GetOrCreateValue() const {
3161 return static_cast<ValueHolder*>(
3162 ThreadLocalRegistry::GetValueOnCurrentThread(this))->pointer();
3165 virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const {
3166 return default_factory_->MakeNewHolder();
3169 class ValueHolderFactory {
3171 ValueHolderFactory() {}
3172 virtual ~ValueHolderFactory() {}
3173 virtual ValueHolder* MakeNewHolder() const = 0;
3176 GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
3179 class DefaultValueHolderFactory : public ValueHolderFactory {
3181 DefaultValueHolderFactory() {}
3182 virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
3185 GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
3188 class InstanceValueHolderFactory : public ValueHolderFactory {
3190 explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
3191 virtual ValueHolder* MakeNewHolder() const {
3192 return new ValueHolder(value_);
3196 const T value_; // The value for each thread.
3198 GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
3201 scoped_ptr<ValueHolderFactory> default_factory_;
3203 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
3206 # elif GTEST_HAS_PTHREAD
3208 // MutexBase and Mutex implement mutex on pthreads-based platforms.
3211 // Acquires this mutex.
3213 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
3214 owner_ = pthread_self();
3218 // Releases this mutex.
3220 // Since the lock is being released the owner_ field should no longer be
3221 // considered valid. We don't protect writing to has_owner_ here, as it's
3222 // the caller's responsibility to ensure that the current thread holds the
3223 // mutex when this is called.
3225 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
3228 // Does nothing if the current thread holds the mutex. Otherwise, crashes
3229 // with high probability.
3230 void AssertHeld() const {
3231 GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
3232 << "The current thread is not holding the mutex @" << this;
3235 // A static mutex may be used before main() is entered. It may even
3236 // be used before the dynamic initialization stage. Therefore we
3237 // must be able to initialize a static mutex object at link time.
3238 // This means MutexBase has to be a POD and its member variables
3239 // have to be public.
3241 pthread_mutex_t mutex_; // The underlying pthread mutex.
3242 // has_owner_ indicates whether the owner_ field below contains a valid thread
3243 // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
3244 // accesses to the owner_ field should be protected by a check of this field.
3245 // An alternative might be to memset() owner_ to all zeros, but there's no
3246 // guarantee that a zero'd pthread_t is necessarily invalid or even different
3247 // from pthread_self().
3249 pthread_t owner_; // The thread holding the mutex.
3252 // Forward-declares a static mutex.
3253 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
3254 extern ::testing::internal::MutexBase mutex
3256 // Defines and statically (i.e. at link time) initializes a static mutex.
3257 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
3258 ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false, pthread_t() }
3260 // The Mutex class can only be used for mutexes created at runtime. It
3261 // shares its API with MutexBase otherwise.
3262 class Mutex : public MutexBase {
3265 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
3269 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
3273 GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
3276 // We cannot name this class MutexLock because the ctor declaration would
3277 // conflict with a macro named MutexLock, which is defined on some
3278 // platforms. That macro is used as a defensive measure to prevent against
3279 // inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
3280 // "MutexLock l(&mu)". Hence the typedef trick below.
3281 class GTestMutexLock {
3283 explicit GTestMutexLock(MutexBase* mutex)
3284 : mutex_(mutex) { mutex_->Lock(); }
3286 ~GTestMutexLock() { mutex_->Unlock(); }
3289 MutexBase* const mutex_;
3291 GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
3294 typedef GTestMutexLock MutexLock;
3296 // Helpers for ThreadLocal.
3298 // pthread_key_create() requires DeleteThreadLocalValue() to have
3299 // C-linkage. Therefore it cannot be templatized to access
3300 // ThreadLocal<T>. Hence the need for class
3301 // ThreadLocalValueHolderBase.
3302 class ThreadLocalValueHolderBase {
3304 virtual ~ThreadLocalValueHolderBase() {}
3307 // Called by pthread to delete thread-local data stored by
3308 // pthread_setspecific().
3309 extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
3310 delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
3313 // Implements thread-local storage on pthreads-based systems.
3314 template <typename T>
3318 : key_(CreateKey()), default_factory_(new DefaultValueHolderFactory()) {}
3319 explicit ThreadLocal(const T& value)
3320 : key_(CreateKey()),
3321 default_factory_(new InstanceValueHolderFactory(value)) {}
3324 // Destroys the managed object for the current thread, if any.
3325 DeleteThreadLocalValue(pthread_getspecific(key_));
3327 // Releases resources associated with the key. This will *not*
3328 // delete managed objects for other threads.
3329 GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
3332 T* pointer() { return GetOrCreateValue(); }
3333 const T* pointer() const { return GetOrCreateValue(); }
3334 const T& get() const { return *pointer(); }
3335 void set(const T& value) { *pointer() = value; }
3338 // Holds a value of type T.
3339 class ValueHolder : public ThreadLocalValueHolderBase {
3341 ValueHolder() : value_() {}
3342 explicit ValueHolder(const T& value) : value_(value) {}
3344 T* pointer() { return &value_; }
3348 GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
3351 static pthread_key_t CreateKey() {
3353 // When a thread exits, DeleteThreadLocalValue() will be called on
3354 // the object managed for that thread.
3355 GTEST_CHECK_POSIX_SUCCESS_(
3356 pthread_key_create(&key, &DeleteThreadLocalValue));
3360 T* GetOrCreateValue() const {
3361 ThreadLocalValueHolderBase* const holder =
3362 static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
3363 if (holder != NULL) {
3364 return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
3367 ValueHolder* const new_holder = default_factory_->MakeNewHolder();
3368 ThreadLocalValueHolderBase* const holder_base = new_holder;
3369 GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
3370 return new_holder->pointer();
3373 class ValueHolderFactory {
3375 ValueHolderFactory() {}
3376 virtual ~ValueHolderFactory() {}
3377 virtual ValueHolder* MakeNewHolder() const = 0;
3380 GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
3383 class DefaultValueHolderFactory : public ValueHolderFactory {
3385 DefaultValueHolderFactory() {}
3386 virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
3389 GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
3392 class InstanceValueHolderFactory : public ValueHolderFactory {
3394 explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
3395 virtual ValueHolder* MakeNewHolder() const {
3396 return new ValueHolder(value_);
3400 const T value_; // The value for each thread.
3402 GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
3405 // A key pthreads uses for looking up per-thread values.
3406 const pthread_key_t key_;
3407 scoped_ptr<ValueHolderFactory> default_factory_;
3409 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
3412 # endif // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
3414 #else // GTEST_IS_THREADSAFE
3416 // A dummy implementation of synchronization primitives (mutex, lock,
3417 // and thread-local variable). Necessary for compiling Google Test where
3418 // mutex is not supported - using Google Test in multiple threads is not
3419 // supported on such platforms.
3426 void AssertHeld() const {}
3429 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
3430 extern ::testing::internal::Mutex mutex
3432 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
3434 // We cannot name this class MutexLock because the ctor declaration would
3435 // conflict with a macro named MutexLock, which is defined on some
3436 // platforms. That macro is used as a defensive measure to prevent against
3437 // inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
3438 // "MutexLock l(&mu)". Hence the typedef trick below.
3439 class GTestMutexLock {
3441 explicit GTestMutexLock(Mutex*) {} // NOLINT
3444 typedef GTestMutexLock MutexLock;
3446 template <typename T>
3449 ThreadLocal() : value_() {}
3450 explicit ThreadLocal(const T& value) : value_(value) {}
3451 T* pointer() { return &value_; }
3452 const T* pointer() const { return &value_; }
3453 const T& get() const { return value_; }
3454 void set(const T& value) { value_ = value; }
3459 #endif // GTEST_IS_THREADSAFE
3461 // Returns the number of threads running in the process, or 0 to indicate that
3462 // we cannot detect it.
3463 GTEST_API_ size_t GetThreadCount();
3465 // Passing non-POD classes through ellipsis (...) crashes the ARM
3466 // compiler and generates a warning in Sun Studio. The Nokia Symbian
3467 // and the IBM XL C/C++ compiler try to instantiate a copy constructor
3468 // for objects passed through ellipsis (...), failing for uncopyable
3469 // objects. We define this to ensure that only POD is passed through
3470 // ellipsis on these systems.
3471 #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
3472 // We lose support for NULL detection where the compiler doesn't like
3473 // passing non-POD classes through ellipsis (...).
3474 # define GTEST_ELLIPSIS_NEEDS_POD_ 1
3476 # define GTEST_CAN_COMPARE_NULL 1
3479 // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
3480 // const T& and const T* in a function template. These compilers
3481 // _can_ decide between class template specializations for T and T*,
3482 // so a tr1::type_traits-like is_pointer works.
3483 #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
3484 # define GTEST_NEEDS_IS_POINTER_ 1
3487 template <bool bool_value>
3488 struct bool_constant {
3489 typedef bool_constant<bool_value> type;
3490 static const bool value = bool_value;
3492 template <bool bool_value> const bool bool_constant<bool_value>::value;
3494 typedef bool_constant<false> false_type;
3495 typedef bool_constant<true> true_type;
3497 template <typename T>
3498 struct is_pointer : public false_type {};
3500 template <typename T>
3501 struct is_pointer<T*> : public true_type {};
3503 template <typename Iterator>
3504 struct IteratorTraits {
3505 typedef typename Iterator::value_type value_type;
3508 template <typename T>
3509 struct IteratorTraits<T*> {
3510 typedef T value_type;
3513 template <typename T>
3514 struct IteratorTraits<const T*> {
3515 typedef T value_type;
3518 #if GTEST_OS_WINDOWS
3519 # define GTEST_PATH_SEP_ "\\"
3520 # define GTEST_HAS_ALT_PATH_SEP_ 1
3521 // The biggest signed integer type the compiler supports.
3522 typedef __int64 BiggestInt;
3524 # define GTEST_PATH_SEP_ "/"
3525 # define GTEST_HAS_ALT_PATH_SEP_ 0
3526 typedef long long BiggestInt; // NOLINT
3527 #endif // GTEST_OS_WINDOWS
3529 // Utilities for char.
3531 // isspace(int ch) and friends accept an unsigned char or EOF. char
3532 // may be signed, depending on the compiler (or compiler flags).
3533 // Therefore we need to cast a char to unsigned char before calling
3536 inline bool IsAlpha(char ch) {
3537 return isalpha(static_cast<unsigned char>(ch)) != 0;
3539 inline bool IsAlNum(char ch) {
3540 return isalnum(static_cast<unsigned char>(ch)) != 0;
3542 inline bool IsDigit(char ch) {
3543 return isdigit(static_cast<unsigned char>(ch)) != 0;
3545 inline bool IsLower(char ch) {
3546 return islower(static_cast<unsigned char>(ch)) != 0;
3548 inline bool IsSpace(char ch) {
3549 return isspace(static_cast<unsigned char>(ch)) != 0;
3551 inline bool IsUpper(char ch) {
3552 return isupper(static_cast<unsigned char>(ch)) != 0;
3554 inline bool IsXDigit(char ch) {
3555 return isxdigit(static_cast<unsigned char>(ch)) != 0;
3557 inline bool IsXDigit(wchar_t ch) {
3558 const unsigned char low_byte = static_cast<unsigned char>(ch);
3559 return ch == low_byte && isxdigit(low_byte) != 0;
3562 inline char ToLower(char ch) {
3563 return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
3565 inline char ToUpper(char ch) {
3566 return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
3569 inline std::string StripTrailingSpaces(std::string str) {
3570 std::string::iterator it = str.end();
3571 while (it != str.begin() && IsSpace(*--it))
3576 // The testing::internal::posix namespace holds wrappers for common
3577 // POSIX functions. These wrappers hide the differences between
3578 // Windows/MSVC and POSIX systems. Since some compilers define these
3579 // standard functions as macros, the wrapper cannot have the same name
3580 // as the wrapped function.
3584 // Functions with a different name on Windows.
3586 #if GTEST_OS_WINDOWS
3588 typedef struct _stat StatStruct;
3590 # ifdef __BORLANDC__
3591 inline int IsATTY(int fd) { return isatty(fd); }
3592 inline int StrCaseCmp(const char* s1, const char* s2) {
3593 return stricmp(s1, s2);
3595 inline char* StrDup(const char* src) { return strdup(src); }
3596 # else // !__BORLANDC__
3597 # if GTEST_OS_WINDOWS_MOBILE
3598 inline int IsATTY(int /* fd */) { return 0; }
3600 inline int IsATTY(int fd) { return _isatty(fd); }
3601 # endif // GTEST_OS_WINDOWS_MOBILE
3602 inline int StrCaseCmp(const char* s1, const char* s2) {
3603 return _stricmp(s1, s2);
3605 inline char* StrDup(const char* src) { return _strdup(src); }
3606 # endif // __BORLANDC__
3608 # if GTEST_OS_WINDOWS_MOBILE
3609 inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
3610 // Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
3611 // time and thus not defined there.
3613 inline int FileNo(FILE* file) { return _fileno(file); }
3614 inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
3615 inline int RmDir(const char* dir) { return _rmdir(dir); }
3616 inline bool IsDir(const StatStruct& st) {
3617 return (_S_IFDIR & st.st_mode) != 0;
3619 # endif // GTEST_OS_WINDOWS_MOBILE
3623 typedef struct stat StatStruct;
3625 inline int FileNo(FILE* file) { return fileno(file); }
3626 inline int IsATTY(int fd) { return isatty(fd); }
3627 inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
3628 inline int StrCaseCmp(const char* s1, const char* s2) {
3629 return strcasecmp(s1, s2);
3631 inline char* StrDup(const char* src) { return strdup(src); }
3632 inline int RmDir(const char* dir) { return rmdir(dir); }
3633 inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
3635 #endif // GTEST_OS_WINDOWS
3637 // Functions deprecated by MSVC 8.0.
3639 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996 /* deprecated function */)
3641 inline const char* StrNCpy(char* dest, const char* src, size_t n) {
3642 return strncpy(dest, src, n);
3645 // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
3646 // StrError() aren't needed on Windows CE at this time and thus not
3649 #if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
3650 inline int ChDir(const char* dir) { return chdir(dir); }
3652 inline FILE* FOpen(const char* path, const char* mode) {
3653 return fopen(path, mode);
3655 #if !GTEST_OS_WINDOWS_MOBILE
3656 inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
3657 return freopen(path, mode, stream);
3659 inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
3661 inline int FClose(FILE* fp) { return fclose(fp); }
3662 #if !GTEST_OS_WINDOWS_MOBILE
3663 inline int Read(int fd, void* buf, unsigned int count) {
3664 return static_cast<int>(read(fd, buf, count));
3666 inline int Write(int fd, const void* buf, unsigned int count) {
3667 return static_cast<int>(write(fd, buf, count));
3669 inline int Close(int fd) { return close(fd); }
3670 inline const char* StrError(int errnum) { return strerror(errnum); }
3672 inline const char* GetEnv(const char* name) {
3673 #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE | GTEST_OS_WINDOWS_RT
3674 // We are on Windows CE, which has no environment variables.
3675 static_cast<void>(name); // To prevent 'unused argument' warning.
3677 #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
3678 // Environment variables which we programmatically clear will be set to the
3679 // empty string rather than unset (NULL). Handle that case.
3680 const char* const env = getenv(name);
3681 return (env != NULL && env[0] != '\0') ? env : NULL;
3683 return getenv(name);
3687 GTEST_DISABLE_MSC_WARNINGS_POP_()
3689 #if GTEST_OS_WINDOWS_MOBILE
3690 // Windows CE has no C library. The abort() function is used in
3691 // several places in Google Test. This implementation provides a reasonable
3692 // imitation of standard behaviour.
3695 inline void Abort() { abort(); }
3696 #endif // GTEST_OS_WINDOWS_MOBILE
3698 } // namespace posix
3700 // MSVC "deprecates" snprintf and issues warnings wherever it is used. In
3701 // order to avoid these warnings, we need to use _snprintf or _snprintf_s on
3702 // MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate
3703 // function in order to achieve that. We use macro definition here because
3704 // snprintf is a variadic function.
3705 #if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
3706 // MSVC 2005 and above support variadic macros.
3707 # define GTEST_SNPRINTF_(buffer, size, format, ...) \
3708 _snprintf_s(buffer, size, size, format, __VA_ARGS__)
3709 #elif defined(_MSC_VER)
3710 // Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
3711 // complain about _snprintf.
3712 # define GTEST_SNPRINTF_ _snprintf
3714 # define GTEST_SNPRINTF_ snprintf
3717 // The maximum number a BiggestInt can represent. This definition
3718 // works no matter BiggestInt is represented in one's complement or
3719 // two's complement.
3721 // We cannot rely on numeric_limits in STL, as __int64 and long long
3722 // are not part of standard C++ and numeric_limits doesn't need to be
3723 // defined for them.
3724 const BiggestInt kMaxBiggestInt =
3725 ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
3727 // This template class serves as a compile-time function from size to
3728 // type. It maps a size in bytes to a primitive type with that
3731 // TypeWithSize<4>::UInt
3733 // is typedef-ed to be unsigned int (unsigned integer made up of 4
3736 // Such functionality should belong to STL, but I cannot find it
3739 // Google Test uses this class in the implementation of floating-point
3742 // For now it only handles UInt (unsigned int) as that's all Google Test
3743 // needs. Other types can be easily added in the future if need
3745 template <size_t size>
3746 class TypeWithSize {
3748 // This prevents the user from using TypeWithSize<N> with incorrect
3753 // The specialization for size 4.
3755 class TypeWithSize<4> {
3757 // unsigned int has size 4 in both gcc and MSVC.
3759 // As base/basictypes.h doesn't compile on Windows, we cannot use
3760 // uint32, uint64, and etc here.
3762 typedef unsigned int UInt;
3765 // The specialization for size 8.
3767 class TypeWithSize<8> {
3769 #if GTEST_OS_WINDOWS
3770 typedef __int64 Int;
3771 typedef unsigned __int64 UInt;
3773 typedef long long Int; // NOLINT
3774 typedef unsigned long long UInt; // NOLINT
3775 #endif // GTEST_OS_WINDOWS
3778 // Integer types of known sizes.
3779 typedef TypeWithSize<4>::Int Int32;
3780 typedef TypeWithSize<4>::UInt UInt32;
3781 typedef TypeWithSize<8>::Int Int64;
3782 typedef TypeWithSize<8>::UInt UInt64;
3783 typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
3785 // Utilities for command line flags and environment variables.
3787 // Macro for referencing flags.
3788 #if !defined(GTEST_FLAG)
3789 # define GTEST_FLAG(name) FLAGS_gtest_##name
3790 #endif // !defined(GTEST_FLAG)
3792 #if !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
3793 # define GTEST_USE_OWN_FLAGFILE_FLAG_ 1
3794 #endif // !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
3796 #if !defined(GTEST_DECLARE_bool_)
3797 # define GTEST_FLAG_SAVER_ ::testing::internal::GTestFlagSaver
3799 // Macros for declaring flags.
3800 # define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
3801 # define GTEST_DECLARE_int32_(name) \
3802 GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
3803 #define GTEST_DECLARE_string_(name) \
3804 GTEST_API_ extern ::std::string GTEST_FLAG(name)
3806 // Macros for defining flags.
3807 #define GTEST_DEFINE_bool_(name, default_val, doc) \
3808 GTEST_API_ bool GTEST_FLAG(name) = (default_val)
3809 #define GTEST_DEFINE_int32_(name, default_val, doc) \
3810 GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
3811 #define GTEST_DEFINE_string_(name, default_val, doc) \
3812 GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
3814 #endif // !defined(GTEST_DECLARE_bool_)
3816 // Thread annotations
3817 #if !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
3818 # define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
3819 # define GTEST_LOCK_EXCLUDED_(locks)
3820 #endif // !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
3822 // Parses 'str' for a 32-bit signed integer. If successful, writes the result
3823 // to *value and returns true; otherwise leaves *value unchanged and returns
3825 // TODO(chandlerc): Find a better way to refactor flag and environment parsing
3826 // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
3828 bool ParseInt32(const Message& src_text, const char* str, Int32* value);
3830 // Parses a bool/Int32/string from the environment variable
3831 // corresponding to the given Google Test flag.
3832 bool BoolFromGTestEnv(const char* flag, bool default_val);
3833 GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
3834 std::string StringFromGTestEnv(const char* flag, const char* default_val);
3836 } // namespace internal
3837 } // namespace testing
3839 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
3842 # include <stdlib.h>
3843 # include <sys/types.h>
3844 # include <sys/wait.h>
3845 # include <unistd.h>
3846 #endif // GTEST_OS_LINUX
3848 #if GTEST_HAS_EXCEPTIONS
3849 # include <stdexcept>
3862 // Copyright 2005, Google Inc.
3863 // All rights reserved.
3865 // Redistribution and use in source and binary forms, with or without
3866 // modification, are permitted provided that the following conditions are
3869 // * Redistributions of source code must retain the above copyright
3870 // notice, this list of conditions and the following disclaimer.
3871 // * Redistributions in binary form must reproduce the above
3872 // copyright notice, this list of conditions and the following disclaimer
3873 // in the documentation and/or other materials provided with the
3875 // * Neither the name of Google Inc. nor the names of its
3876 // contributors may be used to endorse or promote products derived from
3877 // this software without specific prior written permission.
3879 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3880 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3881 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3882 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3883 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3884 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3885 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3886 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3887 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3888 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3889 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3891 // Author: wan@google.com (Zhanyong Wan)
3893 // The Google C++ Testing Framework (Google Test)
3895 // This header file defines the Message class.
3897 // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
3898 // leave some internal implementation details in this header file.
3899 // They are clearly marked by comments like this:
3901 // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
3903 // Such code is NOT meant to be used by a user directly, and is subject
3904 // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
3907 #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
3908 #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
3913 // Ensures that there is at least one operator<< in the global namespace.
3914 // See Message& operator<<(...) below for why.
3915 void operator<<(const testing::internal::Secret&, int);
3919 // The Message class works like an ostream repeater.
3923 // 1. You stream a bunch of values to a Message object.
3924 // It will remember the text in a stringstream.
3925 // 2. Then you stream the Message object to an ostream.
3926 // This causes the text in the Message to be streamed
3931 // testing::Message foo;
3932 // foo << 1 << " != " << 2;
3933 // std::cout << foo;
3935 // will print "1 != 2".
3937 // Message is not intended to be inherited from. In particular, its
3938 // destructor is not virtual.
3940 // Note that stringstream behaves differently in gcc and in MSVC. You
3941 // can stream a NULL char pointer to it in the former, but not in the
3942 // latter (it causes an access violation if you do). The Message
3943 // class hides this difference by treating a NULL char pointer as
3945 class GTEST_API_ Message {
3947 // The type of basic IO manipulators (endl, ends, and flush) for
3949 typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
3952 // Constructs an empty Message.
3955 // Copy constructor.
3956 Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT
3957 *ss_ << msg.GetString();
3960 // Constructs a Message from a C-string.
3961 explicit Message(const char* str) : ss_(new ::std::stringstream) {
3965 #if GTEST_OS_SYMBIAN
3966 // Streams a value (either a pointer or not) to this object.
3967 template <typename T>
3968 inline Message& operator <<(const T& value) {
3969 StreamHelper(typename internal::is_pointer<T>::type(), value);
3973 // Streams a non-pointer value to this object.
3974 template <typename T>
3975 inline Message& operator <<(const T& val) {
3976 // Some libraries overload << for STL containers. These
3977 // overloads are defined in the global namespace instead of ::std.
3979 // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
3980 // overloads are visible in either the std namespace or the global
3981 // namespace, but not other namespaces, including the testing
3982 // namespace which Google Test's Message class is in.
3984 // To allow STL containers (and other types that has a << operator
3985 // defined in the global namespace) to be used in Google Test
3986 // assertions, testing::Message must access the custom << operator
3987 // from the global namespace. With this using declaration,
3988 // overloads of << defined in the global namespace and those
3989 // visible via Koenig lookup are both exposed in this function.
3990 using ::operator <<;
3995 // Streams a pointer value to this object.
3997 // This function is an overload of the previous one. When you
3998 // stream a pointer to a Message, this definition will be used as it
3999 // is more specialized. (The C++ Standard, section
4000 // [temp.func.order].) If you stream a non-pointer, then the
4001 // previous definition will be used.
4003 // The reason for this overload is that streaming a NULL pointer to
4004 // ostream is undefined behavior. Depending on the compiler, you
4005 // may get "0", "(nil)", "(null)", or an access violation. To
4006 // ensure consistent result across compilers, we always treat NULL
4008 template <typename T>
4009 inline Message& operator <<(T* const& pointer) { // NOLINT
4010 if (pointer == NULL) {
4017 #endif // GTEST_OS_SYMBIAN
4019 // Since the basic IO manipulators are overloaded for both narrow
4020 // and wide streams, we have to provide this specialized definition
4021 // of operator <<, even though its body is the same as the
4022 // templatized version above. Without this definition, streaming
4023 // endl or other basic IO manipulators to Message will confuse the
4025 Message& operator <<(BasicNarrowIoManip val) {
4030 // Instead of 1/0, we want to see true/false for bool values.
4031 Message& operator <<(bool b) {
4032 return *this << (b ? "true" : "false");
4035 // These two overloads allow streaming a wide C string to a Message
4036 // using the UTF-8 encoding.
4037 Message& operator <<(const wchar_t* wide_c_str);
4038 Message& operator <<(wchar_t* wide_c_str);
4040 #if GTEST_HAS_STD_WSTRING
4041 // Converts the given wide string to a narrow string using the UTF-8
4042 // encoding, and streams the result to this Message object.
4043 Message& operator <<(const ::std::wstring& wstr);
4044 #endif // GTEST_HAS_STD_WSTRING
4046 #if GTEST_HAS_GLOBAL_WSTRING
4047 // Converts the given wide string to a narrow string using the UTF-8
4048 // encoding, and streams the result to this Message object.
4049 Message& operator <<(const ::wstring& wstr);
4050 #endif // GTEST_HAS_GLOBAL_WSTRING
4052 // Gets the text streamed to this object so far as an std::string.
4053 // Each '\0' character in the buffer is replaced with "\\0".
4055 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
4056 std::string GetString() const;
4060 #if GTEST_OS_SYMBIAN
4061 // These are needed as the Nokia Symbian Compiler cannot decide between
4062 // const T& and const T* in a function template. The Nokia compiler _can_
4063 // decide between class template specializations for T and T*, so a
4064 // tr1::type_traits-like is_pointer works, and we can overload on that.
4065 template <typename T>
4066 inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
4067 if (pointer == NULL) {
4073 template <typename T>
4074 inline void StreamHelper(internal::false_type /*is_pointer*/,
4076 // See the comments in Message& operator <<(const T&) above for why
4077 // we need this using statement.
4078 using ::operator <<;
4081 #endif // GTEST_OS_SYMBIAN
4083 // We'll hold the text streamed to this object here.
4084 const internal::scoped_ptr< ::std::stringstream> ss_;
4086 // We declare (but don't implement) this to prevent the compiler
4087 // from implementing the assignment operator.
4088 void operator=(const Message&);
4091 // Streams a Message to an ostream.
4092 inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
4093 return os << sb.GetString();
4096 namespace internal {
4098 // Converts a streamable value to an std::string. A NULL pointer is
4099 // converted to "(null)". When the input value is a ::string,
4100 // ::std::string, ::wstring, or ::std::wstring object, each NUL
4101 // character in it is replaced with "\\0".
4102 template <typename T>
4103 std::string StreamableToString(const T& streamable) {
4104 return (Message() << streamable).GetString();
4107 } // namespace internal
4108 } // namespace testing
4110 #endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
4111 // Copyright 2005, Google Inc.
4112 // All rights reserved.
4114 // Redistribution and use in source and binary forms, with or without
4115 // modification, are permitted provided that the following conditions are
4118 // * Redistributions of source code must retain the above copyright
4119 // notice, this list of conditions and the following disclaimer.
4120 // * Redistributions in binary form must reproduce the above
4121 // copyright notice, this list of conditions and the following disclaimer
4122 // in the documentation and/or other materials provided with the
4124 // * Neither the name of Google Inc. nor the names of its
4125 // contributors may be used to endorse or promote products derived from
4126 // this software without specific prior written permission.
4128 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4129 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4130 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
4131 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
4132 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4133 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
4134 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
4135 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
4136 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4137 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
4138 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4140 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
4142 // The Google C++ Testing Framework (Google Test)
4144 // This header file declares the String class and functions used internally by
4145 // Google Test. They are subject to change without notice. They should not used
4146 // by code external to Google Test.
4148 // This header file is #included by <gtest/internal/gtest-internal.h>.
4149 // It should not be #included by other files.
4151 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
4152 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
4155 // string.h is not guaranteed to provide strcpy on C++ Builder.
4164 namespace internal {
4166 // String - an abstract class holding static string utilities.
4167 class GTEST_API_ String {
4169 // Static utility methods
4171 // Clones a 0-terminated C string, allocating memory using new. The
4172 // caller is responsible for deleting the return value using
4173 // delete[]. Returns the cloned string, or NULL if the input is
4176 // This is different from strdup() in string.h, which allocates
4177 // memory using malloc().
4178 static const char* CloneCString(const char* c_str);
4180 #if GTEST_OS_WINDOWS_MOBILE
4181 // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
4182 // able to pass strings to Win32 APIs on CE we need to convert them
4183 // to 'Unicode', UTF-16.
4185 // Creates a UTF-16 wide string from the given ANSI string, allocating
4186 // memory using new. The caller is responsible for deleting the return
4187 // value using delete[]. Returns the wide string, or NULL if the
4190 // The wide string is created using the ANSI codepage (CP_ACP) to
4191 // match the behaviour of the ANSI versions of Win32 calls and the
4193 static LPCWSTR AnsiToUtf16(const char* c_str);
4195 // Creates an ANSI string from the given wide string, allocating
4196 // memory using new. The caller is responsible for deleting the return
4197 // value using delete[]. Returns the ANSI string, or NULL if the
4200 // The returned string is created using the ANSI codepage (CP_ACP) to
4201 // match the behaviour of the ANSI versions of Win32 calls and the
4203 static const char* Utf16ToAnsi(LPCWSTR utf16_str);
4206 // Compares two C strings. Returns true iff they have the same content.
4208 // Unlike strcmp(), this function can handle NULL argument(s). A
4209 // NULL C string is considered different to any non-NULL C string,
4210 // including the empty string.
4211 static bool CStringEquals(const char* lhs, const char* rhs);
4213 // Converts a wide C string to a String using the UTF-8 encoding.
4214 // NULL will be converted to "(null)". If an error occurred during
4215 // the conversion, "(failed to convert from wide string)" is
4217 static std::string ShowWideCString(const wchar_t* wide_c_str);
4219 // Compares two wide C strings. Returns true iff they have the same
4222 // Unlike wcscmp(), this function can handle NULL argument(s). A
4223 // NULL C string is considered different to any non-NULL C string,
4224 // including the empty string.
4225 static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
4227 // Compares two C strings, ignoring case. Returns true iff they
4228 // have the same content.
4230 // Unlike strcasecmp(), this function can handle NULL argument(s).
4231 // A NULL C string is considered different to any non-NULL C string,
4232 // including the empty string.
4233 static bool CaseInsensitiveCStringEquals(const char* lhs,
4236 // Compares two wide C strings, ignoring case. Returns true iff they
4237 // have the same content.
4239 // Unlike wcscasecmp(), this function can handle NULL argument(s).
4240 // A NULL C string is considered different to any non-NULL wide C string,
4241 // including the empty string.
4242 // NB: The implementations on different platforms slightly differ.
4243 // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
4244 // environment variable. On GNU platform this method uses wcscasecmp
4245 // which compares according to LC_CTYPE category of the current locale.
4246 // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
4248 static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
4249 const wchar_t* rhs);
4251 // Returns true iff the given string ends with the given suffix, ignoring
4252 // case. Any string is considered to end with an empty suffix.
4253 static bool EndsWithCaseInsensitive(
4254 const std::string& str, const std::string& suffix);
4256 // Formats an int value as "%02d".
4257 static std::string FormatIntWidth2(int value); // "%02d" for width == 2
4259 // Formats an int value as "%X".
4260 static std::string FormatHexInt(int value);
4262 // Formats a byte as "%02X".
4263 static std::string FormatByte(unsigned char value);
4266 String(); // Not meant to be instantiated.
4269 // Gets the content of the stringstream's buffer as an std::string. Each '\0'
4270 // character in the buffer is replaced with "\\0".
4271 GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
4273 } // namespace internal
4274 } // namespace testing
4276 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
4277 // Copyright 2008, Google Inc.
4278 // All rights reserved.
4280 // Redistribution and use in source and binary forms, with or without
4281 // modification, are permitted provided that the following conditions are
4284 // * Redistributions of source code must retain the above copyright
4285 // notice, this list of conditions and the following disclaimer.
4286 // * Redistributions in binary form must reproduce the above
4287 // copyright notice, this list of conditions and the following disclaimer
4288 // in the documentation and/or other materials provided with the
4290 // * Neither the name of Google Inc. nor the names of its
4291 // contributors may be used to endorse or promote products derived from
4292 // this software without specific prior written permission.
4294 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4295 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4296 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
4297 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
4298 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4299 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
4300 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
4301 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
4302 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4303 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
4304 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4306 // Author: keith.ray@gmail.com (Keith Ray)
4308 // Google Test filepath utilities
4310 // This header file declares classes and functions used internally by
4311 // Google Test. They are subject to change without notice.
4313 // This file is #included in <gtest/internal/gtest-internal.h>.
4314 // Do not include this header file separately!
4316 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
4317 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
4321 namespace internal {
4323 // FilePath - a class for file and directory pathname manipulation which
4324 // handles platform-specific conventions (like the pathname separator).
4325 // Used for helper functions for naming files in a directory for xml output.
4326 // Except for Set methods, all methods are const or static, which provides an
4327 // "immutable value object" -- useful for peace of mind.
4328 // A FilePath with a value ending in a path separator ("like/this/") represents
4329 // a directory, otherwise it is assumed to represent a file. In either case,
4330 // it may or may not represent an actual file or directory in the file system.
4331 // Names are NOT checked for syntax correctness -- no checking for illegal
4332 // characters, malformed paths, etc.
4334 class GTEST_API_ FilePath {
4336 FilePath() : pathname_("") { }
4337 FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
4339 explicit FilePath(const std::string& pathname) : pathname_(pathname) {
4343 FilePath& operator=(const FilePath& rhs) {
4348 void Set(const FilePath& rhs) {
4349 pathname_ = rhs.pathname_;
4352 const std::string& string() const { return pathname_; }
4353 const char* c_str() const { return pathname_.c_str(); }
4355 // Returns the current working directory, or "" if unsuccessful.
4356 static FilePath GetCurrentDir();
4358 // Given directory = "dir", base_name = "test", number = 0,
4359 // extension = "xml", returns "dir/test.xml". If number is greater
4360 // than zero (e.g., 12), returns "dir/test_12.xml".
4361 // On Windows platform, uses \ as the separator rather than /.
4362 static FilePath MakeFileName(const FilePath& directory,
4363 const FilePath& base_name,
4365 const char* extension);
4367 // Given directory = "dir", relative_path = "test.xml",
4368 // returns "dir/test.xml".
4369 // On Windows, uses \ as the separator rather than /.
4370 static FilePath ConcatPaths(const FilePath& directory,
4371 const FilePath& relative_path);
4373 // Returns a pathname for a file that does not currently exist. The pathname
4374 // will be directory/base_name.extension or
4375 // directory/base_name_<number>.extension if directory/base_name.extension
4376 // already exists. The number will be incremented until a pathname is found
4377 // that does not already exist.
4378 // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
4379 // There could be a race condition if two or more processes are calling this
4380 // function at the same time -- they could both pick the same filename.
4381 static FilePath GenerateUniqueFileName(const FilePath& directory,
4382 const FilePath& base_name,
4383 const char* extension);
4385 // Returns true iff the path is "".
4386 bool IsEmpty() const { return pathname_.empty(); }
4388 // If input name has a trailing separator character, removes it and returns
4389 // the name, otherwise return the name string unmodified.
4390 // On Windows platform, uses \ as the separator, other platforms use /.
4391 FilePath RemoveTrailingPathSeparator() const;
4393 // Returns a copy of the FilePath with the directory part removed.
4394 // Example: FilePath("path/to/file").RemoveDirectoryName() returns
4395 // FilePath("file"). If there is no directory part ("just_a_file"), it returns
4396 // the FilePath unmodified. If there is no file part ("just_a_dir/") it
4397 // returns an empty FilePath ("").
4398 // On Windows platform, '\' is the path separator, otherwise it is '/'.
4399 FilePath RemoveDirectoryName() const;
4401 // RemoveFileName returns the directory path with the filename removed.
4402 // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
4403 // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
4404 // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
4405 // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
4406 // On Windows platform, '\' is the path separator, otherwise it is '/'.
4407 FilePath RemoveFileName() const;
4409 // Returns a copy of the FilePath with the case-insensitive extension removed.
4410 // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
4411 // FilePath("dir/file"). If a case-insensitive extension is not
4412 // found, returns a copy of the original FilePath.
4413 FilePath RemoveExtension(const char* extension) const;
4415 // Creates directories so that path exists. Returns true if successful or if
4416 // the directories already exist; returns false if unable to create
4417 // directories for any reason. Will also return false if the FilePath does
4418 // not represent a directory (that is, it doesn't end with a path separator).
4419 bool CreateDirectoriesRecursively() const;
4421 // Create the directory so that path exists. Returns true if successful or
4422 // if the directory already exists; returns false if unable to create the
4423 // directory for any reason, including if the parent directory does not
4424 // exist. Not named "CreateDirectory" because that's a macro on Windows.
4425 bool CreateFolder() const;
4427 // Returns true if FilePath describes something in the file-system,
4428 // either a file, directory, or whatever, and that something exists.
4429 bool FileOrDirectoryExists() const;
4431 // Returns true if pathname describes a directory in the file-system
4433 bool DirectoryExists() const;
4435 // Returns true if FilePath ends with a path separator, which indicates that
4436 // it is intended to represent a directory. Returns false otherwise.
4437 // This does NOT check that a directory (or file) actually exists.
4438 bool IsDirectory() const;
4440 // Returns true if pathname describes a root directory. (Windows has one
4441 // root directory per disk drive.)
4442 bool IsRootDirectory() const;
4444 // Returns true if pathname describes an absolute path.
4445 bool IsAbsolutePath() const;
4448 // Replaces multiple consecutive separators with a single separator.
4449 // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
4450 // redundancies that might be in a pathname involving "." or "..".
4452 // A pathname with multiple consecutive separators may occur either through
4453 // user error or as a result of some scripts or APIs that generate a pathname
4454 // with a trailing separator. On other platforms the same API or script
4455 // may NOT generate a pathname with a trailing "/". Then elsewhere that
4456 // pathname may have another "/" and pathname components added to it,
4457 // without checking for the separator already being there.
4458 // The script language and operating system may allow paths like "foo//bar"
4459 // but some of the functions in FilePath will not handle that correctly. In
4460 // particular, RemoveTrailingPathSeparator() only removes one separator, and
4461 // it is called in CreateDirectoriesRecursively() assuming that it will change
4462 // a pathname from directory syntax (trailing separator) to filename syntax.
4464 // On Windows this method also replaces the alternate path separator '/' with
4465 // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
4470 // Returns a pointer to the last occurence of a valid path separator in
4471 // the FilePath. On Windows, for example, both '/' and '\' are valid path
4472 // separators. Returns NULL if no path separator was found.
4473 const char* FindLastPathSeparator() const;
4475 std::string pathname_;
4476 }; // class FilePath
4478 } // namespace internal
4479 } // namespace testing
4481 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
4482 // This file was GENERATED by command:
4483 // pump.py gtest-type-util.h.pump
4484 // DO NOT EDIT BY HAND!!!
4486 // Copyright 2008 Google Inc.
4487 // All Rights Reserved.
4489 // Redistribution and use in source and binary forms, with or without
4490 // modification, are permitted provided that the following conditions are
4493 // * Redistributions of source code must retain the above copyright
4494 // notice, this list of conditions and the following disclaimer.
4495 // * Redistributions in binary form must reproduce the above
4496 // copyright notice, this list of conditions and the following disclaimer
4497 // in the documentation and/or other materials provided with the
4499 // * Neither the name of Google Inc. nor the names of its
4500 // contributors may be used to endorse or promote products derived from
4501 // this software without specific prior written permission.
4503 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4504 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4505 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
4506 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
4507 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4508 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
4509 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
4510 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
4511 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4512 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
4513 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4515 // Author: wan@google.com (Zhanyong Wan)
4517 // Type utilities needed for implementing typed and type-parameterized
4518 // tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
4520 // Currently we support at most 50 types in a list, and at most 50
4521 // type-parameterized tests in one type-parameterized test case.
4522 // Please contact googletestframework@googlegroups.com if you need
4525 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
4526 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
4529 // #ifdef __GNUC__ is too general here. It is possible to use gcc without using
4530 // libstdc++ (which is where cxxabi.h comes from).
4531 # if GTEST_HAS_CXXABI_H_
4532 # include <cxxabi.h>
4533 # elif defined(__HP_aCC)
4534 # include <acxx_demangle.h>
4535 # endif // GTEST_HASH_CXXABI_H_
4538 namespace internal {
4540 // GetTypeName<T>() returns a human-readable name of type T.
4541 // NB: This function is also used in Google Mock, so don't move it inside of
4542 // the typed-test-only section below.
4543 template <typename T>
4544 std::string GetTypeName() {
4547 const char* const name = typeid(T).name();
4548 # if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
4550 // gcc's implementation of typeid(T).name() mangles the type name,
4551 // so we have to demangle it.
4552 # if GTEST_HAS_CXXABI_H_
4553 using abi::__cxa_demangle;
4554 # endif // GTEST_HAS_CXXABI_H_
4555 char* const readable_name = __cxa_demangle(name, 0, 0, &status);
4556 const std::string name_str(status == 0 ? readable_name : name);
4557 free(readable_name);
4561 # endif // GTEST_HAS_CXXABI_H_ || __HP_aCC
4567 # endif // GTEST_HAS_RTTI
4570 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
4572 // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
4573 // type. This can be used as a compile-time assertion to ensure that
4574 // two types are equal.
4576 template <typename T1, typename T2>
4577 struct AssertTypeEq;
4579 template <typename T>
4580 struct AssertTypeEq<T, T> {
4584 // A unique type used as the default value for the arguments of class
4585 // template Types. This allows us to simulate variadic templates
4586 // (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
4587 // support directly.
4590 // The following family of struct and struct templates are used to
4591 // represent type lists. In particular, TypesN<T1, T2, ..., TN>
4592 // represents a type list with N types (T1, T2, ..., and TN) in it.
4593 // Except for Types0, every struct in the family has two member types:
4594 // Head for the first type in the list, and Tail for the rest of the
4597 // The empty type list.
4600 // Type lists of length 1, 2, 3, and so on.
4602 template <typename T1>
4605 typedef Types0 Tail;
4607 template <typename T1, typename T2>
4610 typedef Types1<T2> Tail;
4613 template <typename T1, typename T2, typename T3>
4616 typedef Types2<T2, T3> Tail;
4619 template <typename T1, typename T2, typename T3, typename T4>
4622 typedef Types3<T2, T3, T4> Tail;
4625 template <typename T1, typename T2, typename T3, typename T4, typename T5>
4628 typedef Types4<T2, T3, T4, T5> Tail;
4631 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4635 typedef Types5<T2, T3, T4, T5, T6> Tail;
4638 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4639 typename T6, typename T7>
4642 typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
4645 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4646 typename T6, typename T7, typename T8>
4649 typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
4652 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4653 typename T6, typename T7, typename T8, typename T9>
4656 typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
4659 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4660 typename T6, typename T7, typename T8, typename T9, typename T10>
4663 typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
4666 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4667 typename T6, typename T7, typename T8, typename T9, typename T10,
4671 typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
4674 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4675 typename T6, typename T7, typename T8, typename T9, typename T10,
4676 typename T11, typename T12>
4679 typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
4682 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4683 typename T6, typename T7, typename T8, typename T9, typename T10,
4684 typename T11, typename T12, typename T13>
4687 typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
4690 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4691 typename T6, typename T7, typename T8, typename T9, typename T10,
4692 typename T11, typename T12, typename T13, typename T14>
4695 typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
4698 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4699 typename T6, typename T7, typename T8, typename T9, typename T10,
4700 typename T11, typename T12, typename T13, typename T14, typename T15>
4703 typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4707 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4708 typename T6, typename T7, typename T8, typename T9, typename T10,
4709 typename T11, typename T12, typename T13, typename T14, typename T15,
4713 typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4717 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4718 typename T6, typename T7, typename T8, typename T9, typename T10,
4719 typename T11, typename T12, typename T13, typename T14, typename T15,
4720 typename T16, typename T17>
4723 typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4727 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4728 typename T6, typename T7, typename T8, typename T9, typename T10,
4729 typename T11, typename T12, typename T13, typename T14, typename T15,
4730 typename T16, typename T17, typename T18>
4733 typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4734 T16, T17, T18> Tail;
4737 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4738 typename T6, typename T7, typename T8, typename T9, typename T10,
4739 typename T11, typename T12, typename T13, typename T14, typename T15,
4740 typename T16, typename T17, typename T18, typename T19>
4743 typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4744 T16, T17, T18, T19> Tail;
4747 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4748 typename T6, typename T7, typename T8, typename T9, typename T10,
4749 typename T11, typename T12, typename T13, typename T14, typename T15,
4750 typename T16, typename T17, typename T18, typename T19, typename T20>
4753 typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4754 T16, T17, T18, T19, T20> Tail;
4757 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4758 typename T6, typename T7, typename T8, typename T9, typename T10,
4759 typename T11, typename T12, typename T13, typename T14, typename T15,
4760 typename T16, typename T17, typename T18, typename T19, typename T20,
4764 typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4765 T16, T17, T18, T19, T20, T21> Tail;
4768 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4769 typename T6, typename T7, typename T8, typename T9, typename T10,
4770 typename T11, typename T12, typename T13, typename T14, typename T15,
4771 typename T16, typename T17, typename T18, typename T19, typename T20,
4772 typename T21, typename T22>
4775 typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4776 T16, T17, T18, T19, T20, T21, T22> Tail;
4779 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4780 typename T6, typename T7, typename T8, typename T9, typename T10,
4781 typename T11, typename T12, typename T13, typename T14, typename T15,
4782 typename T16, typename T17, typename T18, typename T19, typename T20,
4783 typename T21, typename T22, typename T23>
4786 typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4787 T16, T17, T18, T19, T20, T21, T22, T23> Tail;
4790 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4791 typename T6, typename T7, typename T8, typename T9, typename T10,
4792 typename T11, typename T12, typename T13, typename T14, typename T15,
4793 typename T16, typename T17, typename T18, typename T19, typename T20,
4794 typename T21, typename T22, typename T23, typename T24>
4797 typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4798 T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
4801 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4802 typename T6, typename T7, typename T8, typename T9, typename T10,
4803 typename T11, typename T12, typename T13, typename T14, typename T15,
4804 typename T16, typename T17, typename T18, typename T19, typename T20,
4805 typename T21, typename T22, typename T23, typename T24, typename T25>
4808 typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4809 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
4812 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4813 typename T6, typename T7, typename T8, typename T9, typename T10,
4814 typename T11, typename T12, typename T13, typename T14, typename T15,
4815 typename T16, typename T17, typename T18, typename T19, typename T20,
4816 typename T21, typename T22, typename T23, typename T24, typename T25,
4820 typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4821 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
4824 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4825 typename T6, typename T7, typename T8, typename T9, typename T10,
4826 typename T11, typename T12, typename T13, typename T14, typename T15,
4827 typename T16, typename T17, typename T18, typename T19, typename T20,
4828 typename T21, typename T22, typename T23, typename T24, typename T25,
4829 typename T26, typename T27>
4832 typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4833 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
4836 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4837 typename T6, typename T7, typename T8, typename T9, typename T10,
4838 typename T11, typename T12, typename T13, typename T14, typename T15,
4839 typename T16, typename T17, typename T18, typename T19, typename T20,
4840 typename T21, typename T22, typename T23, typename T24, typename T25,
4841 typename T26, typename T27, typename T28>
4844 typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4845 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
4848 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4849 typename T6, typename T7, typename T8, typename T9, typename T10,
4850 typename T11, typename T12, typename T13, typename T14, typename T15,
4851 typename T16, typename T17, typename T18, typename T19, typename T20,
4852 typename T21, typename T22, typename T23, typename T24, typename T25,
4853 typename T26, typename T27, typename T28, typename T29>
4856 typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4857 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
4861 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4862 typename T6, typename T7, typename T8, typename T9, typename T10,
4863 typename T11, typename T12, typename T13, typename T14, typename T15,
4864 typename T16, typename T17, typename T18, typename T19, typename T20,
4865 typename T21, typename T22, typename T23, typename T24, typename T25,
4866 typename T26, typename T27, typename T28, typename T29, typename T30>
4869 typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4870 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4874 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4875 typename T6, typename T7, typename T8, typename T9, typename T10,
4876 typename T11, typename T12, typename T13, typename T14, typename T15,
4877 typename T16, typename T17, typename T18, typename T19, typename T20,
4878 typename T21, typename T22, typename T23, typename T24, typename T25,
4879 typename T26, typename T27, typename T28, typename T29, typename T30,
4883 typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4884 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4888 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4889 typename T6, typename T7, typename T8, typename T9, typename T10,
4890 typename T11, typename T12, typename T13, typename T14, typename T15,
4891 typename T16, typename T17, typename T18, typename T19, typename T20,
4892 typename T21, typename T22, typename T23, typename T24, typename T25,
4893 typename T26, typename T27, typename T28, typename T29, typename T30,
4894 typename T31, typename T32>
4897 typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4898 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4899 T30, T31, T32> Tail;
4902 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4903 typename T6, typename T7, typename T8, typename T9, typename T10,
4904 typename T11, typename T12, typename T13, typename T14, typename T15,
4905 typename T16, typename T17, typename T18, typename T19, typename T20,
4906 typename T21, typename T22, typename T23, typename T24, typename T25,
4907 typename T26, typename T27, typename T28, typename T29, typename T30,
4908 typename T31, typename T32, typename T33>
4911 typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4912 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4913 T30, T31, T32, T33> Tail;
4916 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4917 typename T6, typename T7, typename T8, typename T9, typename T10,
4918 typename T11, typename T12, typename T13, typename T14, typename T15,
4919 typename T16, typename T17, typename T18, typename T19, typename T20,
4920 typename T21, typename T22, typename T23, typename T24, typename T25,
4921 typename T26, typename T27, typename T28, typename T29, typename T30,
4922 typename T31, typename T32, typename T33, typename T34>
4925 typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4926 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4927 T30, T31, T32, T33, T34> Tail;
4930 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4931 typename T6, typename T7, typename T8, typename T9, typename T10,
4932 typename T11, typename T12, typename T13, typename T14, typename T15,
4933 typename T16, typename T17, typename T18, typename T19, typename T20,
4934 typename T21, typename T22, typename T23, typename T24, typename T25,
4935 typename T26, typename T27, typename T28, typename T29, typename T30,
4936 typename T31, typename T32, typename T33, typename T34, typename T35>
4939 typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4940 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4941 T30, T31, T32, T33, T34, T35> Tail;
4944 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4945 typename T6, typename T7, typename T8, typename T9, typename T10,
4946 typename T11, typename T12, typename T13, typename T14, typename T15,
4947 typename T16, typename T17, typename T18, typename T19, typename T20,
4948 typename T21, typename T22, typename T23, typename T24, typename T25,
4949 typename T26, typename T27, typename T28, typename T29, typename T30,
4950 typename T31, typename T32, typename T33, typename T34, typename T35,
4954 typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4955 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4956 T30, T31, T32, T33, T34, T35, T36> Tail;
4959 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4960 typename T6, typename T7, typename T8, typename T9, typename T10,
4961 typename T11, typename T12, typename T13, typename T14, typename T15,
4962 typename T16, typename T17, typename T18, typename T19, typename T20,
4963 typename T21, typename T22, typename T23, typename T24, typename T25,
4964 typename T26, typename T27, typename T28, typename T29, typename T30,
4965 typename T31, typename T32, typename T33, typename T34, typename T35,
4966 typename T36, typename T37>
4969 typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4970 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4971 T30, T31, T32, T33, T34, T35, T36, T37> Tail;
4974 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4975 typename T6, typename T7, typename T8, typename T9, typename T10,
4976 typename T11, typename T12, typename T13, typename T14, typename T15,
4977 typename T16, typename T17, typename T18, typename T19, typename T20,
4978 typename T21, typename T22, typename T23, typename T24, typename T25,
4979 typename T26, typename T27, typename T28, typename T29, typename T30,
4980 typename T31, typename T32, typename T33, typename T34, typename T35,
4981 typename T36, typename T37, typename T38>
4984 typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4985 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4986 T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
4989 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4990 typename T6, typename T7, typename T8, typename T9, typename T10,
4991 typename T11, typename T12, typename T13, typename T14, typename T15,
4992 typename T16, typename T17, typename T18, typename T19, typename T20,
4993 typename T21, typename T22, typename T23, typename T24, typename T25,
4994 typename T26, typename T27, typename T28, typename T29, typename T30,
4995 typename T31, typename T32, typename T33, typename T34, typename T35,
4996 typename T36, typename T37, typename T38, typename T39>
4999 typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5000 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5001 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
5004 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5005 typename T6, typename T7, typename T8, typename T9, typename T10,
5006 typename T11, typename T12, typename T13, typename T14, typename T15,
5007 typename T16, typename T17, typename T18, typename T19, typename T20,
5008 typename T21, typename T22, typename T23, typename T24, typename T25,
5009 typename T26, typename T27, typename T28, typename T29, typename T30,
5010 typename T31, typename T32, typename T33, typename T34, typename T35,
5011 typename T36, typename T37, typename T38, typename T39, typename T40>
5014 typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5015 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5016 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
5019 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5020 typename T6, typename T7, typename T8, typename T9, typename T10,
5021 typename T11, typename T12, typename T13, typename T14, typename T15,
5022 typename T16, typename T17, typename T18, typename T19, typename T20,
5023 typename T21, typename T22, typename T23, typename T24, typename T25,
5024 typename T26, typename T27, typename T28, typename T29, typename T30,
5025 typename T31, typename T32, typename T33, typename T34, typename T35,
5026 typename T36, typename T37, typename T38, typename T39, typename T40,
5030 typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5031 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5032 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
5035 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5036 typename T6, typename T7, typename T8, typename T9, typename T10,
5037 typename T11, typename T12, typename T13, typename T14, typename T15,
5038 typename T16, typename T17, typename T18, typename T19, typename T20,
5039 typename T21, typename T22, typename T23, typename T24, typename T25,
5040 typename T26, typename T27, typename T28, typename T29, typename T30,
5041 typename T31, typename T32, typename T33, typename T34, typename T35,
5042 typename T36, typename T37, typename T38, typename T39, typename T40,
5043 typename T41, typename T42>
5046 typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5047 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5048 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
5051 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5052 typename T6, typename T7, typename T8, typename T9, typename T10,
5053 typename T11, typename T12, typename T13, typename T14, typename T15,
5054 typename T16, typename T17, typename T18, typename T19, typename T20,
5055 typename T21, typename T22, typename T23, typename T24, typename T25,
5056 typename T26, typename T27, typename T28, typename T29, typename T30,
5057 typename T31, typename T32, typename T33, typename T34, typename T35,
5058 typename T36, typename T37, typename T38, typename T39, typename T40,
5059 typename T41, typename T42, typename T43>
5062 typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5063 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5064 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5068 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5069 typename T6, typename T7, typename T8, typename T9, typename T10,
5070 typename T11, typename T12, typename T13, typename T14, typename T15,
5071 typename T16, typename T17, typename T18, typename T19, typename T20,
5072 typename T21, typename T22, typename T23, typename T24, typename T25,
5073 typename T26, typename T27, typename T28, typename T29, typename T30,
5074 typename T31, typename T32, typename T33, typename T34, typename T35,
5075 typename T36, typename T37, typename T38, typename T39, typename T40,
5076 typename T41, typename T42, typename T43, typename T44>
5079 typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5080 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5081 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
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, typename T39, typename T40,
5093 typename T41, typename T42, typename T43, typename T44, typename T45>
5096 typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5097 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5098 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5102 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5103 typename T6, typename T7, typename T8, typename T9, typename T10,
5104 typename T11, typename T12, typename T13, typename T14, typename T15,
5105 typename T16, typename T17, typename T18, typename T19, typename T20,
5106 typename T21, typename T22, typename T23, typename T24, typename T25,
5107 typename T26, typename T27, typename T28, typename T29, typename T30,
5108 typename T31, typename T32, typename T33, typename T34, typename T35,
5109 typename T36, typename T37, typename T38, typename T39, typename T40,
5110 typename T41, typename T42, typename T43, typename T44, typename T45,
5114 typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5115 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5116 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5117 T44, T45, T46> Tail;
5120 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5121 typename T6, typename T7, typename T8, typename T9, typename T10,
5122 typename T11, typename T12, typename T13, typename T14, typename T15,
5123 typename T16, typename T17, typename T18, typename T19, typename T20,
5124 typename T21, typename T22, typename T23, typename T24, typename T25,
5125 typename T26, typename T27, typename T28, typename T29, typename T30,
5126 typename T31, typename T32, typename T33, typename T34, typename T35,
5127 typename T36, typename T37, typename T38, typename T39, typename T40,
5128 typename T41, typename T42, typename T43, typename T44, typename T45,
5129 typename T46, typename T47>
5132 typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5133 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5134 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5135 T44, T45, T46, T47> Tail;
5138 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5139 typename T6, typename T7, typename T8, typename T9, typename T10,
5140 typename T11, typename T12, typename T13, typename T14, typename T15,
5141 typename T16, typename T17, typename T18, typename T19, typename T20,
5142 typename T21, typename T22, typename T23, typename T24, typename T25,
5143 typename T26, typename T27, typename T28, typename T29, typename T30,
5144 typename T31, typename T32, typename T33, typename T34, typename T35,
5145 typename T36, typename T37, typename T38, typename T39, typename T40,
5146 typename T41, typename T42, typename T43, typename T44, typename T45,
5147 typename T46, typename T47, typename T48>
5150 typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5151 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5152 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5153 T44, T45, T46, T47, T48> Tail;
5156 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5157 typename T6, typename T7, typename T8, typename T9, typename T10,
5158 typename T11, typename T12, typename T13, typename T14, typename T15,
5159 typename T16, typename T17, typename T18, typename T19, typename T20,
5160 typename T21, typename T22, typename T23, typename T24, typename T25,
5161 typename T26, typename T27, typename T28, typename T29, typename T30,
5162 typename T31, typename T32, typename T33, typename T34, typename T35,
5163 typename T36, typename T37, typename T38, typename T39, typename T40,
5164 typename T41, typename T42, typename T43, typename T44, typename T45,
5165 typename T46, typename T47, typename T48, typename T49>
5168 typedef Types48<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,
5170 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5171 T44, T45, T46, T47, T48, T49> Tail;
5174 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5175 typename T6, typename T7, typename T8, typename T9, typename T10,
5176 typename T11, typename T12, typename T13, typename T14, typename T15,
5177 typename T16, typename T17, typename T18, typename T19, typename T20,
5178 typename T21, typename T22, typename T23, typename T24, typename T25,
5179 typename T26, typename T27, typename T28, typename T29, typename T30,
5180 typename T31, typename T32, typename T33, typename T34, typename T35,
5181 typename T36, typename T37, typename T38, typename T39, typename T40,
5182 typename T41, typename T42, typename T43, typename T44, typename T45,
5183 typename T46, typename T47, typename T48, typename T49, typename T50>
5186 typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5187 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5188 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5189 T44, T45, T46, T47, T48, T49, T50> Tail;
5193 } // namespace internal
5195 // We don't want to require the users to write TypesN<...> directly,
5196 // as that would require them to count the length. Types<...> is much
5197 // easier to write, but generates horrible messages when there is a
5198 // compiler error, as gcc insists on printing out each template
5199 // argument, even if it has the default value (this means Types<int>
5200 // will appear as Types<int, None, None, ..., None> in the compiler
5203 // Our solution is to combine the best part of the two approaches: a
5204 // user would write Types<T1, ..., TN>, and Google Test will translate
5205 // that to TypesN<T1, ..., TN> internally to make error messages
5206 // readable. The translation is done by the 'type' member of the
5208 template <typename T1 = internal::None, typename T2 = internal::None,
5209 typename T3 = internal::None, typename T4 = internal::None,
5210 typename T5 = internal::None, typename T6 = internal::None,
5211 typename T7 = internal::None, typename T8 = internal::None,
5212 typename T9 = internal::None, typename T10 = internal::None,
5213 typename T11 = internal::None, typename T12 = internal::None,
5214 typename T13 = internal::None, typename T14 = internal::None,
5215 typename T15 = internal::None, typename T16 = internal::None,
5216 typename T17 = internal::None, typename T18 = internal::None,
5217 typename T19 = internal::None, typename T20 = internal::None,
5218 typename T21 = internal::None, typename T22 = internal::None,
5219 typename T23 = internal::None, typename T24 = internal::None,
5220 typename T25 = internal::None, typename T26 = internal::None,
5221 typename T27 = internal::None, typename T28 = internal::None,
5222 typename T29 = internal::None, typename T30 = internal::None,
5223 typename T31 = internal::None, typename T32 = internal::None,
5224 typename T33 = internal::None, typename T34 = internal::None,
5225 typename T35 = internal::None, typename T36 = internal::None,
5226 typename T37 = internal::None, typename T38 = internal::None,
5227 typename T39 = internal::None, typename T40 = internal::None,
5228 typename T41 = internal::None, typename T42 = internal::None,
5229 typename T43 = internal::None, typename T44 = internal::None,
5230 typename T45 = internal::None, typename T46 = internal::None,
5231 typename T47 = internal::None, typename T48 = internal::None,
5232 typename T49 = internal::None, typename T50 = internal::None>
5234 typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5235 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5236 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5237 T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
5241 struct Types<internal::None, internal::None, internal::None, internal::None,
5242 internal::None, internal::None, internal::None, internal::None,
5243 internal::None, internal::None, internal::None, internal::None,
5244 internal::None, internal::None, internal::None, internal::None,
5245 internal::None, internal::None, internal::None, internal::None,
5246 internal::None, internal::None, internal::None, internal::None,
5247 internal::None, internal::None, internal::None, internal::None,
5248 internal::None, internal::None, internal::None, internal::None,
5249 internal::None, internal::None, internal::None, internal::None,
5250 internal::None, internal::None, internal::None, internal::None,
5251 internal::None, internal::None, internal::None, internal::None,
5252 internal::None, internal::None, internal::None, internal::None,
5253 internal::None, internal::None> {
5254 typedef internal::Types0 type;
5256 template <typename T1>
5257 struct Types<T1, internal::None, internal::None, internal::None,
5258 internal::None, internal::None, internal::None, internal::None,
5259 internal::None, internal::None, internal::None, internal::None,
5260 internal::None, internal::None, internal::None, internal::None,
5261 internal::None, internal::None, internal::None, internal::None,
5262 internal::None, internal::None, internal::None, internal::None,
5263 internal::None, internal::None, internal::None, internal::None,
5264 internal::None, internal::None, internal::None, internal::None,
5265 internal::None, internal::None, internal::None, internal::None,
5266 internal::None, internal::None, internal::None, internal::None,
5267 internal::None, internal::None, internal::None, internal::None,
5268 internal::None, internal::None, internal::None, internal::None,
5269 internal::None, internal::None> {
5270 typedef internal::Types1<T1> type;
5272 template <typename T1, typename T2>
5273 struct Types<T1, T2, internal::None, internal::None, internal::None,
5274 internal::None, internal::None, internal::None, internal::None,
5275 internal::None, internal::None, internal::None, internal::None,
5276 internal::None, internal::None, internal::None, internal::None,
5277 internal::None, internal::None, internal::None, internal::None,
5278 internal::None, internal::None, internal::None, internal::None,
5279 internal::None, internal::None, internal::None, internal::None,
5280 internal::None, internal::None, internal::None, internal::None,
5281 internal::None, internal::None, internal::None, internal::None,
5282 internal::None, internal::None, internal::None, internal::None,
5283 internal::None, internal::None, internal::None, internal::None,
5284 internal::None, internal::None, internal::None, internal::None,
5286 typedef internal::Types2<T1, T2> type;
5288 template <typename T1, typename T2, typename T3>
5289 struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
5290 internal::None, internal::None, internal::None, internal::None,
5291 internal::None, internal::None, internal::None, internal::None,
5292 internal::None, internal::None, internal::None, internal::None,
5293 internal::None, internal::None, internal::None, internal::None,
5294 internal::None, internal::None, internal::None, internal::None,
5295 internal::None, internal::None, internal::None, internal::None,
5296 internal::None, internal::None, internal::None, internal::None,
5297 internal::None, internal::None, internal::None, internal::None,
5298 internal::None, internal::None, internal::None, internal::None,
5299 internal::None, internal::None, internal::None, internal::None,
5300 internal::None, internal::None, internal::None, internal::None> {
5301 typedef internal::Types3<T1, T2, T3> type;
5303 template <typename T1, typename T2, typename T3, typename T4>
5304 struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
5305 internal::None, internal::None, internal::None, internal::None,
5306 internal::None, internal::None, internal::None, internal::None,
5307 internal::None, internal::None, internal::None, internal::None,
5308 internal::None, internal::None, internal::None, internal::None,
5309 internal::None, internal::None, internal::None, internal::None,
5310 internal::None, internal::None, internal::None, internal::None,
5311 internal::None, internal::None, internal::None, internal::None,
5312 internal::None, internal::None, internal::None, internal::None,
5313 internal::None, internal::None, internal::None, internal::None,
5314 internal::None, internal::None, internal::None, internal::None,
5315 internal::None, internal::None, internal::None> {
5316 typedef internal::Types4<T1, T2, T3, T4> type;
5318 template <typename T1, typename T2, typename T3, typename T4, typename T5>
5319 struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
5320 internal::None, internal::None, internal::None, internal::None,
5321 internal::None, internal::None, internal::None, internal::None,
5322 internal::None, internal::None, internal::None, internal::None,
5323 internal::None, internal::None, internal::None, internal::None,
5324 internal::None, internal::None, internal::None, internal::None,
5325 internal::None, internal::None, internal::None, internal::None,
5326 internal::None, internal::None, internal::None, internal::None,
5327 internal::None, internal::None, internal::None, internal::None,
5328 internal::None, internal::None, internal::None, internal::None,
5329 internal::None, internal::None, internal::None, internal::None,
5330 internal::None, internal::None, internal::None> {
5331 typedef internal::Types5<T1, T2, T3, T4, T5> type;
5333 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5335 struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
5336 internal::None, internal::None, internal::None, internal::None,
5337 internal::None, internal::None, internal::None, internal::None,
5338 internal::None, internal::None, internal::None, internal::None,
5339 internal::None, internal::None, internal::None, internal::None,
5340 internal::None, internal::None, internal::None, internal::None,
5341 internal::None, internal::None, internal::None, internal::None,
5342 internal::None, internal::None, internal::None, internal::None,
5343 internal::None, internal::None, internal::None, internal::None,
5344 internal::None, internal::None, internal::None, internal::None,
5345 internal::None, internal::None, internal::None, internal::None,
5346 internal::None, internal::None> {
5347 typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
5349 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5350 typename T6, typename T7>
5351 struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
5352 internal::None, internal::None, internal::None, internal::None,
5353 internal::None, internal::None, internal::None, internal::None,
5354 internal::None, internal::None, internal::None, internal::None,
5355 internal::None, internal::None, internal::None, internal::None,
5356 internal::None, internal::None, internal::None, internal::None,
5357 internal::None, internal::None, internal::None, internal::None,
5358 internal::None, internal::None, internal::None, internal::None,
5359 internal::None, internal::None, internal::None, internal::None,
5360 internal::None, internal::None, internal::None, internal::None,
5361 internal::None, internal::None, internal::None, internal::None,
5363 typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
5365 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5366 typename T6, typename T7, typename T8>
5367 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
5368 internal::None, internal::None, internal::None, internal::None,
5369 internal::None, internal::None, internal::None, internal::None,
5370 internal::None, internal::None, internal::None, internal::None,
5371 internal::None, internal::None, internal::None, internal::None,
5372 internal::None, internal::None, internal::None, internal::None,
5373 internal::None, internal::None, internal::None, internal::None,
5374 internal::None, internal::None, internal::None, internal::None,
5375 internal::None, internal::None, internal::None, internal::None,
5376 internal::None, internal::None, internal::None, internal::None,
5377 internal::None, internal::None, internal::None, internal::None> {
5378 typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
5380 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5381 typename T6, typename T7, typename T8, typename T9>
5382 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
5383 internal::None, internal::None, internal::None, internal::None,
5384 internal::None, internal::None, internal::None, internal::None,
5385 internal::None, internal::None, internal::None, internal::None,
5386 internal::None, internal::None, internal::None, internal::None,
5387 internal::None, internal::None, internal::None, internal::None,
5388 internal::None, internal::None, internal::None, internal::None,
5389 internal::None, internal::None, internal::None, internal::None,
5390 internal::None, internal::None, internal::None, internal::None,
5391 internal::None, internal::None, internal::None, internal::None,
5392 internal::None, internal::None, internal::None, internal::None> {
5393 typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
5395 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5396 typename T6, typename T7, typename T8, typename T9, typename T10>
5397 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
5398 internal::None, internal::None, internal::None, internal::None,
5399 internal::None, internal::None, internal::None, internal::None,
5400 internal::None, internal::None, internal::None, internal::None,
5401 internal::None, internal::None, internal::None, internal::None,
5402 internal::None, internal::None, internal::None, internal::None,
5403 internal::None, internal::None, internal::None, internal::None,
5404 internal::None, internal::None, internal::None, internal::None,
5405 internal::None, internal::None, internal::None, internal::None,
5406 internal::None, internal::None, internal::None, internal::None,
5407 internal::None, internal::None, internal::None> {
5408 typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
5410 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5411 typename T6, typename T7, typename T8, typename T9, typename T10,
5413 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
5414 internal::None, internal::None, internal::None, internal::None,
5415 internal::None, internal::None, internal::None, internal::None,
5416 internal::None, internal::None, internal::None, internal::None,
5417 internal::None, internal::None, internal::None, internal::None,
5418 internal::None, internal::None, internal::None, internal::None,
5419 internal::None, internal::None, internal::None, internal::None,
5420 internal::None, internal::None, internal::None, internal::None,
5421 internal::None, internal::None, internal::None, internal::None,
5422 internal::None, internal::None, internal::None, internal::None,
5423 internal::None, internal::None> {
5424 typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
5426 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5427 typename T6, typename T7, typename T8, typename T9, typename T10,
5428 typename T11, typename T12>
5429 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
5430 internal::None, internal::None, internal::None, internal::None,
5431 internal::None, internal::None, internal::None, internal::None,
5432 internal::None, internal::None, internal::None, internal::None,
5433 internal::None, internal::None, internal::None, internal::None,
5434 internal::None, internal::None, internal::None, internal::None,
5435 internal::None, internal::None, internal::None, internal::None,
5436 internal::None, internal::None, internal::None, internal::None,
5437 internal::None, internal::None, internal::None, internal::None,
5438 internal::None, internal::None, internal::None, internal::None,
5440 typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
5443 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5444 typename T6, typename T7, typename T8, typename T9, typename T10,
5445 typename T11, typename T12, typename T13>
5446 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5447 internal::None, internal::None, internal::None, internal::None,
5448 internal::None, internal::None, internal::None, internal::None,
5449 internal::None, internal::None, internal::None, internal::None,
5450 internal::None, internal::None, internal::None, internal::None,
5451 internal::None, internal::None, internal::None, internal::None,
5452 internal::None, internal::None, internal::None, internal::None,
5453 internal::None, internal::None, internal::None, internal::None,
5454 internal::None, internal::None, internal::None, internal::None,
5455 internal::None, internal::None, internal::None, internal::None,
5457 typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5460 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5461 typename T6, typename T7, typename T8, typename T9, typename T10,
5462 typename T11, typename T12, typename T13, typename T14>
5463 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5464 internal::None, internal::None, internal::None, internal::None,
5465 internal::None, internal::None, internal::None, internal::None,
5466 internal::None, internal::None, internal::None, internal::None,
5467 internal::None, internal::None, internal::None, internal::None,
5468 internal::None, internal::None, internal::None, internal::None,
5469 internal::None, internal::None, internal::None, internal::None,
5470 internal::None, internal::None, internal::None, internal::None,
5471 internal::None, internal::None, internal::None, internal::None,
5472 internal::None, internal::None, internal::None, internal::None> {
5473 typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5476 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5477 typename T6, typename T7, typename T8, typename T9, typename T10,
5478 typename T11, typename T12, typename T13, typename T14, typename T15>
5479 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5480 internal::None, internal::None, internal::None, internal::None,
5481 internal::None, internal::None, internal::None, internal::None,
5482 internal::None, internal::None, internal::None, internal::None,
5483 internal::None, internal::None, internal::None, internal::None,
5484 internal::None, internal::None, internal::None, internal::None,
5485 internal::None, internal::None, internal::None, internal::None,
5486 internal::None, internal::None, internal::None, internal::None,
5487 internal::None, internal::None, internal::None, internal::None,
5488 internal::None, internal::None, internal::None> {
5489 typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5490 T13, T14, T15> type;
5492 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5493 typename T6, typename T7, typename T8, typename T9, typename T10,
5494 typename T11, typename T12, typename T13, typename T14, typename T15,
5496 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5497 T16, internal::None, internal::None, internal::None, internal::None,
5498 internal::None, internal::None, internal::None, internal::None,
5499 internal::None, internal::None, internal::None, internal::None,
5500 internal::None, internal::None, internal::None, internal::None,
5501 internal::None, internal::None, internal::None, internal::None,
5502 internal::None, internal::None, internal::None, internal::None,
5503 internal::None, internal::None, internal::None, internal::None,
5504 internal::None, internal::None, internal::None, internal::None,
5505 internal::None, internal::None> {
5506 typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5507 T13, T14, T15, T16> type;
5509 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5510 typename T6, typename T7, typename T8, typename T9, typename T10,
5511 typename T11, typename T12, typename T13, typename T14, typename T15,
5512 typename T16, typename T17>
5513 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5514 T16, T17, internal::None, internal::None, internal::None, internal::None,
5515 internal::None, internal::None, internal::None, internal::None,
5516 internal::None, internal::None, internal::None, internal::None,
5517 internal::None, internal::None, internal::None, internal::None,
5518 internal::None, internal::None, internal::None, internal::None,
5519 internal::None, internal::None, internal::None, internal::None,
5520 internal::None, internal::None, internal::None, internal::None,
5521 internal::None, internal::None, internal::None, internal::None,
5523 typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5524 T13, T14, T15, T16, T17> type;
5526 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5527 typename T6, typename T7, typename T8, typename T9, typename T10,
5528 typename T11, typename T12, typename T13, typename T14, typename T15,
5529 typename T16, typename T17, typename T18>
5530 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5531 T16, T17, T18, internal::None, internal::None, internal::None,
5532 internal::None, internal::None, internal::None, internal::None,
5533 internal::None, internal::None, internal::None, internal::None,
5534 internal::None, internal::None, internal::None, internal::None,
5535 internal::None, internal::None, internal::None, internal::None,
5536 internal::None, internal::None, internal::None, internal::None,
5537 internal::None, internal::None, internal::None, internal::None,
5538 internal::None, internal::None, internal::None, internal::None,
5540 typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5541 T13, T14, T15, T16, T17, T18> type;
5543 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5544 typename T6, typename T7, typename T8, typename T9, typename T10,
5545 typename T11, typename T12, typename T13, typename T14, typename T15,
5546 typename T16, typename T17, typename T18, typename T19>
5547 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5548 T16, T17, T18, T19, internal::None, internal::None, internal::None,
5549 internal::None, internal::None, internal::None, internal::None,
5550 internal::None, internal::None, internal::None, internal::None,
5551 internal::None, internal::None, internal::None, internal::None,
5552 internal::None, internal::None, internal::None, internal::None,
5553 internal::None, internal::None, internal::None, internal::None,
5554 internal::None, internal::None, internal::None, internal::None,
5555 internal::None, internal::None, internal::None, internal::None> {
5556 typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5557 T13, T14, T15, T16, T17, T18, T19> type;
5559 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5560 typename T6, typename T7, typename T8, typename T9, typename T10,
5561 typename T11, typename T12, typename T13, typename T14, typename T15,
5562 typename T16, typename T17, typename T18, typename T19, typename T20>
5563 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5564 T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
5565 internal::None, internal::None, internal::None, internal::None,
5566 internal::None, internal::None, internal::None, internal::None,
5567 internal::None, internal::None, internal::None, internal::None,
5568 internal::None, internal::None, internal::None, internal::None,
5569 internal::None, internal::None, internal::None, internal::None,
5570 internal::None, internal::None, internal::None, internal::None,
5571 internal::None, internal::None, internal::None> {
5572 typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5573 T13, T14, T15, T16, T17, T18, T19, T20> type;
5575 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5576 typename T6, typename T7, typename T8, typename T9, typename T10,
5577 typename T11, typename T12, typename T13, typename T14, typename T15,
5578 typename T16, typename T17, typename T18, typename T19, typename T20,
5580 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5581 T16, T17, T18, T19, T20, T21, internal::None, internal::None,
5582 internal::None, internal::None, internal::None, internal::None,
5583 internal::None, internal::None, internal::None, internal::None,
5584 internal::None, internal::None, internal::None, internal::None,
5585 internal::None, internal::None, internal::None, internal::None,
5586 internal::None, internal::None, internal::None, internal::None,
5587 internal::None, internal::None, internal::None, internal::None,
5588 internal::None, internal::None, internal::None> {
5589 typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5590 T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
5592 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5593 typename T6, typename T7, typename T8, typename T9, typename T10,
5594 typename T11, typename T12, typename T13, typename T14, typename T15,
5595 typename T16, typename T17, typename T18, typename T19, typename T20,
5596 typename T21, typename T22>
5597 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5598 T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
5599 internal::None, internal::None, internal::None, internal::None,
5600 internal::None, internal::None, internal::None, internal::None,
5601 internal::None, internal::None, internal::None, internal::None,
5602 internal::None, internal::None, internal::None, internal::None,
5603 internal::None, internal::None, internal::None, internal::None,
5604 internal::None, internal::None, internal::None, internal::None,
5605 internal::None, internal::None> {
5606 typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5607 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
5609 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5610 typename T6, typename T7, typename T8, typename T9, typename T10,
5611 typename T11, typename T12, typename T13, typename T14, typename T15,
5612 typename T16, typename T17, typename T18, typename T19, typename T20,
5613 typename T21, typename T22, typename T23>
5614 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5615 T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
5616 internal::None, internal::None, internal::None, internal::None,
5617 internal::None, internal::None, internal::None, internal::None,
5618 internal::None, internal::None, internal::None, internal::None,
5619 internal::None, internal::None, internal::None, internal::None,
5620 internal::None, internal::None, internal::None, internal::None,
5621 internal::None, internal::None, internal::None, internal::None,
5623 typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5624 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
5626 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5627 typename T6, typename T7, typename T8, typename T9, typename T10,
5628 typename T11, typename T12, typename T13, typename T14, typename T15,
5629 typename T16, typename T17, typename T18, typename T19, typename T20,
5630 typename T21, typename T22, typename T23, typename T24>
5631 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5632 T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
5633 internal::None, internal::None, internal::None, internal::None,
5634 internal::None, internal::None, internal::None, internal::None,
5635 internal::None, internal::None, internal::None, internal::None,
5636 internal::None, internal::None, internal::None, internal::None,
5637 internal::None, internal::None, internal::None, internal::None,
5638 internal::None, internal::None, internal::None, internal::None,
5640 typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5641 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
5643 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5644 typename T6, typename T7, typename T8, typename T9, typename T10,
5645 typename T11, typename T12, typename T13, typename T14, typename T15,
5646 typename T16, typename T17, typename T18, typename T19, typename T20,
5647 typename T21, typename T22, typename T23, typename T24, typename T25>
5648 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5649 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
5650 internal::None, internal::None, internal::None, internal::None,
5651 internal::None, internal::None, internal::None, internal::None,
5652 internal::None, internal::None, internal::None, internal::None,
5653 internal::None, internal::None, internal::None, internal::None,
5654 internal::None, internal::None, internal::None, internal::None,
5655 internal::None, internal::None, internal::None, internal::None> {
5656 typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5657 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
5659 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5660 typename T6, typename T7, typename T8, typename T9, typename T10,
5661 typename T11, typename T12, typename T13, typename T14, typename T15,
5662 typename T16, typename T17, typename T18, typename T19, typename T20,
5663 typename T21, typename T22, typename T23, typename T24, typename T25,
5665 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5666 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
5667 internal::None, internal::None, internal::None, internal::None,
5668 internal::None, internal::None, internal::None, internal::None,
5669 internal::None, internal::None, internal::None, internal::None,
5670 internal::None, internal::None, internal::None, internal::None,
5671 internal::None, internal::None, internal::None, internal::None,
5672 internal::None, internal::None, internal::None> {
5673 typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5674 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
5677 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5678 typename T6, typename T7, typename T8, typename T9, typename T10,
5679 typename T11, typename T12, typename T13, typename T14, typename T15,
5680 typename T16, typename T17, typename T18, typename T19, typename T20,
5681 typename T21, typename T22, typename T23, typename T24, typename T25,
5682 typename T26, typename T27>
5683 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5684 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
5685 internal::None, internal::None, internal::None, internal::None,
5686 internal::None, internal::None, internal::None, internal::None,
5687 internal::None, internal::None, internal::None, internal::None,
5688 internal::None, internal::None, internal::None, internal::None,
5689 internal::None, internal::None, internal::None, internal::None,
5690 internal::None, internal::None> {
5691 typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5692 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5695 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5696 typename T6, typename T7, typename T8, typename T9, typename T10,
5697 typename T11, typename T12, typename T13, typename T14, typename T15,
5698 typename T16, typename T17, typename T18, typename T19, typename T20,
5699 typename T21, typename T22, typename T23, typename T24, typename T25,
5700 typename T26, typename T27, typename T28>
5701 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5702 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5703 internal::None, internal::None, internal::None, internal::None,
5704 internal::None, internal::None, internal::None, internal::None,
5705 internal::None, internal::None, internal::None, internal::None,
5706 internal::None, internal::None, internal::None, internal::None,
5707 internal::None, internal::None, internal::None, internal::None,
5708 internal::None, internal::None> {
5709 typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5710 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5713 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5714 typename T6, typename T7, typename T8, typename T9, typename T10,
5715 typename T11, typename T12, typename T13, typename T14, typename T15,
5716 typename T16, typename T17, typename T18, typename T19, typename T20,
5717 typename T21, typename T22, typename T23, typename T24, typename T25,
5718 typename T26, typename T27, typename T28, typename T29>
5719 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5720 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5721 internal::None, internal::None, internal::None, internal::None,
5722 internal::None, internal::None, internal::None, internal::None,
5723 internal::None, internal::None, internal::None, internal::None,
5724 internal::None, internal::None, internal::None, internal::None,
5725 internal::None, internal::None, internal::None, internal::None,
5727 typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5728 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5729 T27, T28, T29> type;
5731 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5732 typename T6, typename T7, typename T8, typename T9, typename T10,
5733 typename T11, typename T12, typename T13, typename T14, typename T15,
5734 typename T16, typename T17, typename T18, typename T19, typename T20,
5735 typename T21, typename T22, typename T23, typename T24, typename T25,
5736 typename T26, typename T27, typename T28, typename T29, typename T30>
5737 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5738 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5739 internal::None, internal::None, internal::None, internal::None,
5740 internal::None, internal::None, internal::None, internal::None,
5741 internal::None, internal::None, internal::None, internal::None,
5742 internal::None, internal::None, internal::None, internal::None,
5743 internal::None, internal::None, internal::None, internal::None> {
5744 typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5745 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5746 T27, T28, T29, T30> type;
5748 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5749 typename T6, typename T7, typename T8, typename T9, typename T10,
5750 typename T11, typename T12, typename T13, typename T14, typename T15,
5751 typename T16, typename T17, typename T18, typename T19, typename T20,
5752 typename T21, typename T22, typename T23, typename T24, typename T25,
5753 typename T26, typename T27, typename T28, typename T29, typename T30,
5755 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5756 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5757 T31, internal::None, internal::None, internal::None, internal::None,
5758 internal::None, internal::None, internal::None, internal::None,
5759 internal::None, internal::None, internal::None, internal::None,
5760 internal::None, internal::None, internal::None, internal::None,
5761 internal::None, internal::None, internal::None> {
5762 typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5763 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5764 T27, T28, T29, T30, T31> type;
5766 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5767 typename T6, typename T7, typename T8, typename T9, typename T10,
5768 typename T11, typename T12, typename T13, typename T14, typename T15,
5769 typename T16, typename T17, typename T18, typename T19, typename T20,
5770 typename T21, typename T22, typename T23, typename T24, typename T25,
5771 typename T26, typename T27, typename T28, typename T29, typename T30,
5772 typename T31, typename T32>
5773 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5774 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5775 T31, T32, internal::None, internal::None, internal::None, internal::None,
5776 internal::None, internal::None, internal::None, internal::None,
5777 internal::None, internal::None, internal::None, internal::None,
5778 internal::None, internal::None, internal::None, internal::None,
5779 internal::None, internal::None> {
5780 typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5781 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5782 T27, T28, T29, T30, T31, T32> type;
5784 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5785 typename T6, typename T7, typename T8, typename T9, typename T10,
5786 typename T11, typename T12, typename T13, typename T14, typename T15,
5787 typename T16, typename T17, typename T18, typename T19, typename T20,
5788 typename T21, typename T22, typename T23, typename T24, typename T25,
5789 typename T26, typename T27, typename T28, typename T29, typename T30,
5790 typename T31, typename T32, typename T33>
5791 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5792 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5793 T31, T32, T33, internal::None, internal::None, internal::None,
5794 internal::None, internal::None, internal::None, internal::None,
5795 internal::None, internal::None, internal::None, internal::None,
5796 internal::None, internal::None, internal::None, internal::None,
5797 internal::None, internal::None> {
5798 typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5799 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5800 T27, T28, T29, T30, T31, T32, T33> type;
5802 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5803 typename T6, typename T7, typename T8, typename T9, typename T10,
5804 typename T11, typename T12, typename T13, typename T14, typename T15,
5805 typename T16, typename T17, typename T18, typename T19, typename T20,
5806 typename T21, typename T22, typename T23, typename T24, typename T25,
5807 typename T26, typename T27, typename T28, typename T29, typename T30,
5808 typename T31, typename T32, typename T33, typename T34>
5809 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5810 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5811 T31, T32, T33, T34, internal::None, internal::None, internal::None,
5812 internal::None, internal::None, internal::None, internal::None,
5813 internal::None, internal::None, internal::None, internal::None,
5814 internal::None, internal::None, internal::None, internal::None,
5816 typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5817 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5818 T27, T28, T29, T30, T31, T32, T33, T34> type;
5820 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5821 typename T6, typename T7, typename T8, typename T9, typename T10,
5822 typename T11, typename T12, typename T13, typename T14, typename T15,
5823 typename T16, typename T17, typename T18, typename T19, typename T20,
5824 typename T21, typename T22, typename T23, typename T24, typename T25,
5825 typename T26, typename T27, typename T28, typename T29, typename T30,
5826 typename T31, typename T32, typename T33, typename T34, typename T35>
5827 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5828 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5829 T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
5830 internal::None, internal::None, internal::None, internal::None,
5831 internal::None, internal::None, internal::None, internal::None,
5832 internal::None, internal::None, internal::None, internal::None> {
5833 typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5834 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5835 T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
5837 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5838 typename T6, typename T7, typename T8, typename T9, typename T10,
5839 typename T11, typename T12, typename T13, typename T14, typename T15,
5840 typename T16, typename T17, typename T18, typename T19, typename T20,
5841 typename T21, typename T22, typename T23, typename T24, typename T25,
5842 typename T26, typename T27, typename T28, typename T29, typename T30,
5843 typename T31, typename T32, typename T33, typename T34, typename T35,
5845 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5846 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5847 T31, T32, T33, T34, T35, T36, internal::None, internal::None,
5848 internal::None, internal::None, internal::None, internal::None,
5849 internal::None, internal::None, internal::None, internal::None,
5850 internal::None, internal::None, internal::None, internal::None> {
5851 typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5852 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5853 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
5855 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5856 typename T6, typename T7, typename T8, typename T9, typename T10,
5857 typename T11, typename T12, typename T13, typename T14, typename T15,
5858 typename T16, typename T17, typename T18, typename T19, typename T20,
5859 typename T21, typename T22, typename T23, typename T24, typename T25,
5860 typename T26, typename T27, typename T28, typename T29, typename T30,
5861 typename T31, typename T32, typename T33, typename T34, typename T35,
5862 typename T36, typename T37>
5863 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5864 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5865 T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
5866 internal::None, internal::None, internal::None, internal::None,
5867 internal::None, internal::None, internal::None, internal::None,
5868 internal::None, internal::None, internal::None> {
5869 typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5870 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5871 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
5873 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5874 typename T6, typename T7, typename T8, typename T9, typename T10,
5875 typename T11, typename T12, typename T13, typename T14, typename T15,
5876 typename T16, typename T17, typename T18, typename T19, typename T20,
5877 typename T21, typename T22, typename T23, typename T24, typename T25,
5878 typename T26, typename T27, typename T28, typename T29, typename T30,
5879 typename T31, typename T32, typename T33, typename T34, typename T35,
5880 typename T36, typename T37, typename T38>
5881 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5882 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5883 T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
5884 internal::None, internal::None, internal::None, internal::None,
5885 internal::None, internal::None, internal::None, internal::None,
5886 internal::None, internal::None> {
5887 typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5888 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5889 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
5891 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5892 typename T6, typename T7, typename T8, typename T9, typename T10,
5893 typename T11, typename T12, typename T13, typename T14, typename T15,
5894 typename T16, typename T17, typename T18, typename T19, typename T20,
5895 typename T21, typename T22, typename T23, typename T24, typename T25,
5896 typename T26, typename T27, typename T28, typename T29, typename T30,
5897 typename T31, typename T32, typename T33, typename T34, typename T35,
5898 typename T36, typename T37, typename T38, typename T39>
5899 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5900 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5901 T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
5902 internal::None, internal::None, internal::None, internal::None,
5903 internal::None, internal::None, internal::None, internal::None,
5904 internal::None, internal::None> {
5905 typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5906 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5907 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
5909 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5910 typename T6, typename T7, typename T8, typename T9, typename T10,
5911 typename T11, typename T12, typename T13, typename T14, typename T15,
5912 typename T16, typename T17, typename T18, typename T19, typename T20,
5913 typename T21, typename T22, typename T23, typename T24, typename T25,
5914 typename T26, typename T27, typename T28, typename T29, typename T30,
5915 typename T31, typename T32, typename T33, typename T34, typename T35,
5916 typename T36, typename T37, typename T38, typename T39, typename T40>
5917 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5918 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5919 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
5920 internal::None, internal::None, internal::None, internal::None,
5921 internal::None, internal::None, internal::None, internal::None,
5923 typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5924 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5925 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
5928 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5929 typename T6, typename T7, typename T8, typename T9, typename T10,
5930 typename T11, typename T12, typename T13, typename T14, typename T15,
5931 typename T16, typename T17, typename T18, typename T19, typename T20,
5932 typename T21, typename T22, typename T23, typename T24, typename T25,
5933 typename T26, typename T27, typename T28, typename T29, typename T30,
5934 typename T31, typename T32, typename T33, typename T34, typename T35,
5935 typename T36, typename T37, typename T38, typename T39, typename T40,
5937 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5938 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5939 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
5940 internal::None, internal::None, internal::None, internal::None,
5941 internal::None, internal::None, internal::None, internal::None> {
5942 typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5943 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5944 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5947 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5948 typename T6, typename T7, typename T8, typename T9, typename T10,
5949 typename T11, typename T12, typename T13, typename T14, typename T15,
5950 typename T16, typename T17, typename T18, typename T19, typename T20,
5951 typename T21, typename T22, typename T23, typename T24, typename T25,
5952 typename T26, typename T27, typename T28, typename T29, typename T30,
5953 typename T31, typename T32, typename T33, typename T34, typename T35,
5954 typename T36, typename T37, typename T38, typename T39, typename T40,
5955 typename T41, typename T42>
5956 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5957 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5958 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
5959 internal::None, internal::None, internal::None, internal::None,
5960 internal::None, internal::None, internal::None> {
5961 typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5962 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5963 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5966 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5967 typename T6, typename T7, typename T8, typename T9, typename T10,
5968 typename T11, typename T12, typename T13, typename T14, typename T15,
5969 typename T16, typename T17, typename T18, typename T19, typename T20,
5970 typename T21, typename T22, typename T23, typename T24, typename T25,
5971 typename T26, typename T27, typename T28, typename T29, typename T30,
5972 typename T31, typename T32, typename T33, typename T34, typename T35,
5973 typename T36, typename T37, typename T38, typename T39, typename T40,
5974 typename T41, typename T42, typename T43>
5975 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5976 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5977 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5978 internal::None, internal::None, internal::None, internal::None,
5979 internal::None, internal::None, internal::None> {
5980 typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5981 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5982 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5983 T41, T42, T43> type;
5985 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5986 typename T6, typename T7, typename T8, typename T9, typename T10,
5987 typename T11, typename T12, typename T13, typename T14, typename T15,
5988 typename T16, typename T17, typename T18, typename T19, typename T20,
5989 typename T21, typename T22, typename T23, typename T24, typename T25,
5990 typename T26, typename T27, typename T28, typename T29, typename T30,
5991 typename T31, typename T32, typename T33, typename T34, typename T35,
5992 typename T36, typename T37, typename T38, typename T39, typename T40,
5993 typename T41, typename T42, typename T43, typename T44>
5994 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5995 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5996 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
5997 internal::None, internal::None, internal::None, internal::None,
5998 internal::None, internal::None> {
5999 typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6000 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6001 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6002 T41, T42, T43, T44> type;
6004 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6005 typename T6, typename T7, typename T8, typename T9, typename T10,
6006 typename T11, typename T12, typename T13, typename T14, typename T15,
6007 typename T16, typename T17, typename T18, typename T19, typename T20,
6008 typename T21, typename T22, typename T23, typename T24, typename T25,
6009 typename T26, typename T27, typename T28, typename T29, typename T30,
6010 typename T31, typename T32, typename T33, typename T34, typename T35,
6011 typename T36, typename T37, typename T38, typename T39, typename T40,
6012 typename T41, typename T42, typename T43, typename T44, typename T45>
6013 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6014 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6015 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
6016 internal::None, internal::None, internal::None, internal::None,
6018 typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6019 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6020 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6021 T41, T42, T43, T44, T45> type;
6023 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6024 typename T6, typename T7, typename T8, typename T9, typename T10,
6025 typename T11, typename T12, typename T13, typename T14, typename T15,
6026 typename T16, typename T17, typename T18, typename T19, typename T20,
6027 typename T21, typename T22, typename T23, typename T24, typename T25,
6028 typename T26, typename T27, typename T28, typename T29, typename T30,
6029 typename T31, typename T32, typename T33, typename T34, typename T35,
6030 typename T36, typename T37, typename T38, typename T39, typename T40,
6031 typename T41, typename T42, typename T43, typename T44, typename T45,
6033 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6034 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6035 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
6036 T46, internal::None, internal::None, internal::None, internal::None> {
6037 typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6038 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6039 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6040 T41, T42, T43, T44, T45, T46> type;
6042 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6043 typename T6, typename T7, typename T8, typename T9, typename T10,
6044 typename T11, typename T12, typename T13, typename T14, typename T15,
6045 typename T16, typename T17, typename T18, typename T19, typename T20,
6046 typename T21, typename T22, typename T23, typename T24, typename T25,
6047 typename T26, typename T27, typename T28, typename T29, typename T30,
6048 typename T31, typename T32, typename T33, typename T34, typename T35,
6049 typename T36, typename T37, typename T38, typename T39, typename T40,
6050 typename T41, typename T42, typename T43, typename T44, typename T45,
6051 typename T46, typename T47>
6052 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6053 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6054 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
6055 T46, T47, internal::None, internal::None, internal::None> {
6056 typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6057 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6058 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6059 T41, T42, T43, T44, T45, T46, T47> type;
6061 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6062 typename T6, typename T7, typename T8, typename T9, typename T10,
6063 typename T11, typename T12, typename T13, typename T14, typename T15,
6064 typename T16, typename T17, typename T18, typename T19, typename T20,
6065 typename T21, typename T22, typename T23, typename T24, typename T25,
6066 typename T26, typename T27, typename T28, typename T29, typename T30,
6067 typename T31, typename T32, typename T33, typename T34, typename T35,
6068 typename T36, typename T37, typename T38, typename T39, typename T40,
6069 typename T41, typename T42, typename T43, typename T44, typename T45,
6070 typename T46, typename T47, typename T48>
6071 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6072 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6073 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
6074 T46, T47, T48, internal::None, internal::None> {
6075 typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6076 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6077 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6078 T41, T42, T43, T44, T45, T46, T47, T48> type;
6080 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6081 typename T6, typename T7, typename T8, typename T9, typename T10,
6082 typename T11, typename T12, typename T13, typename T14, typename T15,
6083 typename T16, typename T17, typename T18, typename T19, typename T20,
6084 typename T21, typename T22, typename T23, typename T24, typename T25,
6085 typename T26, typename T27, typename T28, typename T29, typename T30,
6086 typename T31, typename T32, typename T33, typename T34, typename T35,
6087 typename T36, typename T37, typename T38, typename T39, typename T40,
6088 typename T41, typename T42, typename T43, typename T44, typename T45,
6089 typename T46, typename T47, typename T48, typename T49>
6090 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
6091 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
6092 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
6093 T46, T47, T48, T49, internal::None> {
6094 typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6095 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6096 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6097 T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
6100 namespace internal {
6102 # define GTEST_TEMPLATE_ template <typename T> class
6104 // The template "selector" struct TemplateSel<Tmpl> is used to
6105 // represent Tmpl, which must be a class template with one type
6106 // parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined
6107 // as the type Tmpl<T>. This allows us to actually instantiate the
6108 // template "selected" by TemplateSel<Tmpl>.
6110 // This trick is necessary for simulating typedef for class templates,
6111 // which C++ doesn't support directly.
6112 template <GTEST_TEMPLATE_ Tmpl>
6113 struct TemplateSel {
6114 template <typename T>
6116 typedef Tmpl<T> type;
6120 # define GTEST_BIND_(TmplSel, T) \
6121 TmplSel::template Bind<T>::type
6123 // A unique struct template used as the default value for the
6124 // arguments of class template Templates. This allows us to simulate
6125 // variadic templates (e.g. Templates<int>, Templates<int, double>,
6126 // and etc), which C++ doesn't support directly.
6127 template <typename T>
6130 // The following family of struct and struct templates are used to
6131 // represent template lists. In particular, TemplatesN<T1, T2, ...,
6132 // TN> represents a list of N templates (T1, T2, ..., and TN). Except
6133 // for Templates0, every struct in the family has two member types:
6134 // Head for the selector of the first template in the list, and Tail
6135 // for the rest of the list.
6137 // The empty template list.
6138 struct Templates0 {};
6140 // Template lists of length 1, 2, 3, and so on.
6142 template <GTEST_TEMPLATE_ T1>
6144 typedef TemplateSel<T1> Head;
6145 typedef Templates0 Tail;
6147 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
6149 typedef TemplateSel<T1> Head;
6150 typedef Templates1<T2> Tail;
6153 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
6155 typedef TemplateSel<T1> Head;
6156 typedef Templates2<T2, T3> Tail;
6159 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6162 typedef TemplateSel<T1> Head;
6163 typedef Templates3<T2, T3, T4> Tail;
6166 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6167 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
6169 typedef TemplateSel<T1> Head;
6170 typedef Templates4<T2, T3, T4, T5> Tail;
6173 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6174 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
6176 typedef TemplateSel<T1> Head;
6177 typedef Templates5<T2, T3, T4, T5, T6> Tail;
6180 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6181 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6184 typedef TemplateSel<T1> Head;
6185 typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
6188 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6189 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6190 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
6192 typedef TemplateSel<T1> Head;
6193 typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
6196 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6197 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6198 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
6200 typedef TemplateSel<T1> Head;
6201 typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
6204 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6205 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6206 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6207 GTEST_TEMPLATE_ T10>
6208 struct Templates10 {
6209 typedef TemplateSel<T1> Head;
6210 typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
6213 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6214 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6215 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6216 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
6217 struct Templates11 {
6218 typedef TemplateSel<T1> Head;
6219 typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
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, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6225 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
6226 struct Templates12 {
6227 typedef TemplateSel<T1> Head;
6228 typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
6231 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6232 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6233 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6234 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6235 GTEST_TEMPLATE_ T13>
6236 struct Templates13 {
6237 typedef TemplateSel<T1> Head;
6238 typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
6241 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6242 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6243 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6244 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6245 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
6246 struct Templates14 {
6247 typedef TemplateSel<T1> Head;
6248 typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
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, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6256 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
6257 struct Templates15 {
6258 typedef TemplateSel<T1> Head;
6259 typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
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, GTEST_TEMPLATE_ T12,
6267 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6268 GTEST_TEMPLATE_ T16>
6269 struct Templates16 {
6270 typedef TemplateSel<T1> Head;
6271 typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6275 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6276 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6277 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6278 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6279 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6280 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
6281 struct Templates17 {
6282 typedef TemplateSel<T1> Head;
6283 typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6284 T15, T16, T17> Tail;
6287 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6288 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6289 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6290 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6291 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6292 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
6293 struct Templates18 {
6294 typedef TemplateSel<T1> Head;
6295 typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6296 T15, T16, T17, T18> Tail;
6299 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6300 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6301 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6302 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6303 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6304 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6305 GTEST_TEMPLATE_ T19>
6306 struct Templates19 {
6307 typedef TemplateSel<T1> Head;
6308 typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6309 T15, T16, T17, T18, T19> Tail;
6312 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6313 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6314 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6315 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6316 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6317 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6318 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
6319 struct Templates20 {
6320 typedef TemplateSel<T1> Head;
6321 typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6322 T15, T16, T17, T18, T19, T20> Tail;
6325 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6326 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6327 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6328 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6329 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6330 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6331 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
6332 struct Templates21 {
6333 typedef TemplateSel<T1> Head;
6334 typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6335 T15, T16, T17, T18, T19, T20, T21> Tail;
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, GTEST_TEMPLATE_ T18,
6344 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6345 GTEST_TEMPLATE_ T22>
6346 struct Templates22 {
6347 typedef TemplateSel<T1> Head;
6348 typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6349 T15, T16, T17, T18, T19, T20, T21, T22> Tail;
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 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6359 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
6360 struct Templates23 {
6361 typedef TemplateSel<T1> Head;
6362 typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6363 T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
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, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6373 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
6374 struct Templates24 {
6375 typedef TemplateSel<T1> Head;
6376 typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6377 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
6380 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6381 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6382 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6383 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6384 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6385 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6386 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6387 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6388 GTEST_TEMPLATE_ T25>
6389 struct Templates25 {
6390 typedef TemplateSel<T1> Head;
6391 typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6392 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
6395 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6396 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6397 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6398 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6399 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6400 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6401 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6402 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6403 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
6404 struct Templates26 {
6405 typedef TemplateSel<T1> Head;
6406 typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6407 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
6410 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6411 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6412 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6413 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6414 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6415 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6416 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6417 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6418 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
6419 struct Templates27 {
6420 typedef TemplateSel<T1> Head;
6421 typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6422 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
6425 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6426 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6427 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6428 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6429 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6430 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6431 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6432 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6433 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6434 GTEST_TEMPLATE_ T28>
6435 struct Templates28 {
6436 typedef TemplateSel<T1> Head;
6437 typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6438 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6442 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6443 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6444 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6445 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6446 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6447 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6448 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6449 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6450 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6451 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
6452 struct Templates29 {
6453 typedef TemplateSel<T1> Head;
6454 typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6455 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
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, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6468 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
6469 struct Templates30 {
6470 typedef TemplateSel<T1> Head;
6471 typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6472 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
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, GTEST_TEMPLATE_ T27,
6485 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6486 GTEST_TEMPLATE_ T31>
6487 struct Templates31 {
6488 typedef TemplateSel<T1> Head;
6489 typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6490 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6491 T29, T30, T31> Tail;
6494 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6495 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6496 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6497 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6498 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6499 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6500 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6501 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6502 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6503 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6504 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
6505 struct Templates32 {
6506 typedef TemplateSel<T1> Head;
6507 typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6508 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6509 T29, T30, T31, T32> Tail;
6512 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6513 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6514 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6515 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6516 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6517 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6518 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6519 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6520 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6521 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6522 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
6523 struct Templates33 {
6524 typedef TemplateSel<T1> Head;
6525 typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6526 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6527 T29, T30, T31, T32, T33> Tail;
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, GTEST_TEMPLATE_ T30,
6540 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6541 GTEST_TEMPLATE_ T34>
6542 struct Templates34 {
6543 typedef TemplateSel<T1> Head;
6544 typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6545 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6546 T29, T30, T31, T32, T33, T34> Tail;
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 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6560 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
6561 struct Templates35 {
6562 typedef TemplateSel<T1> Head;
6563 typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6564 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6565 T29, T30, T31, T32, T33, T34, T35> Tail;
6568 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6569 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6570 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6571 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6572 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6573 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6574 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6575 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6576 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6577 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6578 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6579 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
6580 struct Templates36 {
6581 typedef TemplateSel<T1> Head;
6582 typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6583 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6584 T29, T30, T31, T32, T33, T34, T35, T36> Tail;
6587 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6588 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6589 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6590 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6591 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6592 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6593 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6594 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6595 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6596 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6597 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6598 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6599 GTEST_TEMPLATE_ T37>
6600 struct Templates37 {
6601 typedef TemplateSel<T1> Head;
6602 typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6603 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6604 T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
6607 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6608 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6609 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6610 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6611 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6612 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6613 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6614 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6615 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6616 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6617 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6618 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6619 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
6620 struct Templates38 {
6621 typedef TemplateSel<T1> Head;
6622 typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6623 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6624 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
6627 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6628 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6629 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6630 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6631 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6632 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6633 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6634 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6635 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6636 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6637 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6638 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6639 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
6640 struct Templates39 {
6641 typedef TemplateSel<T1> Head;
6642 typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6643 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6644 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
6647 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6648 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6649 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6650 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6651 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6652 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6653 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6654 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6655 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6656 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6657 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6658 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6659 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6660 GTEST_TEMPLATE_ T40>
6661 struct Templates40 {
6662 typedef TemplateSel<T1> Head;
6663 typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6664 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6665 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
6668 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6669 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6670 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6671 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6672 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6673 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6674 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6675 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6676 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6677 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6678 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6679 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6680 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6681 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
6682 struct Templates41 {
6683 typedef TemplateSel<T1> Head;
6684 typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6685 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6686 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
6689 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6690 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6691 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6692 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6693 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6694 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6695 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6696 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6697 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6698 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6699 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6700 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6701 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6702 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
6703 struct Templates42 {
6704 typedef TemplateSel<T1> Head;
6705 typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6706 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6707 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6711 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6712 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6713 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6714 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6715 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6716 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6717 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6718 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6719 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6720 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6721 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6722 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6723 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6724 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6725 GTEST_TEMPLATE_ T43>
6726 struct Templates43 {
6727 typedef TemplateSel<T1> Head;
6728 typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6729 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6730 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6734 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6735 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6736 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6737 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6738 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6739 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6740 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6741 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6742 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6743 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6744 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6745 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6746 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6747 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6748 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
6749 struct Templates44 {
6750 typedef TemplateSel<T1> Head;
6751 typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6752 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6753 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6757 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6758 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6759 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6760 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6761 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6762 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6763 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6764 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6765 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6766 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6767 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6768 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6769 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6770 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6771 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
6772 struct Templates45 {
6773 typedef TemplateSel<T1> Head;
6774 typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6775 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6776 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6777 T43, T44, T45> Tail;
6780 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6781 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6782 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6783 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6784 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6785 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6786 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6787 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6788 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6789 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6790 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6791 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6792 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6793 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6794 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6795 GTEST_TEMPLATE_ T46>
6796 struct Templates46 {
6797 typedef TemplateSel<T1> Head;
6798 typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6799 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6800 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6801 T43, T44, T45, T46> Tail;
6804 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6805 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6806 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6807 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6808 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6809 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6810 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6811 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6812 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6813 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6814 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6815 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6816 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6817 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6818 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6819 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
6820 struct Templates47 {
6821 typedef TemplateSel<T1> Head;
6822 typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6823 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6824 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6825 T43, T44, T45, T46, T47> Tail;
6828 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6829 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6830 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6831 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6832 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6833 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6834 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6835 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6836 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6837 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6838 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6839 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6840 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6841 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6842 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6843 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
6844 struct Templates48 {
6845 typedef TemplateSel<T1> Head;
6846 typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6847 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6848 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6849 T43, T44, T45, T46, T47, T48> Tail;
6852 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6853 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6854 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6855 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6856 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6857 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6858 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6859 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6860 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6861 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6862 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6863 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6864 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6865 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6866 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6867 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
6868 GTEST_TEMPLATE_ T49>
6869 struct Templates49 {
6870 typedef TemplateSel<T1> Head;
6871 typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6872 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6873 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6874 T43, T44, T45, T46, T47, T48, T49> Tail;
6877 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6878 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6879 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6880 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6881 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6882 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6883 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6884 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6885 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6886 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6887 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6888 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6889 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6890 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6891 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6892 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
6893 GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
6894 struct Templates50 {
6895 typedef TemplateSel<T1> Head;
6896 typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6897 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6898 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6899 T43, T44, T45, T46, T47, T48, T49, T50> Tail;
6903 // We don't want to require the users to write TemplatesN<...> directly,
6904 // as that would require them to count the length. Templates<...> is much
6905 // easier to write, but generates horrible messages when there is a
6906 // compiler error, as gcc insists on printing out each template
6907 // argument, even if it has the default value (this means Templates<list>
6908 // will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
6911 // Our solution is to combine the best part of the two approaches: a
6912 // user would write Templates<T1, ..., TN>, and Google Test will translate
6913 // that to TemplatesN<T1, ..., TN> internally to make error messages
6914 // readable. The translation is done by the 'type' member of the
6915 // Templates template.
6916 template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
6917 GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
6918 GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
6919 GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
6920 GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
6921 GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
6922 GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
6923 GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
6924 GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
6925 GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
6926 GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
6927 GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
6928 GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
6929 GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
6930 GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
6931 GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
6932 GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
6933 GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
6934 GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
6935 GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
6936 GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
6937 GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
6938 GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
6939 GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
6940 GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
6942 typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6943 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6944 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6945 T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
6949 struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6950 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6951 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6952 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6953 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6955 typedef Templates0 type;
6957 template <GTEST_TEMPLATE_ T1>
6958 struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6959 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6960 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6961 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6962 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6964 typedef Templates1<T1> type;
6966 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
6967 struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6968 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6969 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6970 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6971 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6973 typedef Templates2<T1, T2> type;
6975 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
6976 struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6977 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6978 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6979 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6980 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6981 typedef Templates3<T1, T2, T3> type;
6983 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6985 struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6986 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6987 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6988 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6989 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6990 typedef Templates4<T1, T2, T3, T4> type;
6992 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6993 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
6994 struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6995 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6996 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6997 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6998 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6999 typedef Templates5<T1, T2, T3, T4, T5> type;
7001 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7002 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
7003 struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
7004 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7005 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7006 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7007 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7008 typedef Templates6<T1, T2, T3, T4, T5, T6> type;
7010 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7011 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7013 struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
7014 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7015 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7016 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7017 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7018 typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
7020 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7021 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7022 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
7023 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
7024 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7025 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7026 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7027 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7028 typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
7030 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7031 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7032 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
7033 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
7034 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7035 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7036 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7037 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7038 typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
7040 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7041 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7042 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7043 GTEST_TEMPLATE_ T10>
7044 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
7045 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7046 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7047 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7048 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7049 typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
7051 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7052 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7053 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7054 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
7055 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
7056 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7057 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7058 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7059 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7060 typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
7062 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7063 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7064 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7065 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
7066 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
7067 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7068 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7069 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7070 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7071 typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
7073 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7074 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7075 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7076 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7077 GTEST_TEMPLATE_ T13>
7078 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
7079 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7080 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7081 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7082 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7083 typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
7086 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7087 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7088 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7089 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7090 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
7091 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7092 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7093 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7094 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7095 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7096 typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7099 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7100 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7101 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7102 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7103 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
7104 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7105 T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7106 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7107 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7108 NoneT, NoneT, NoneT, NoneT, NoneT> {
7109 typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7112 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7113 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7114 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7115 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7116 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7117 GTEST_TEMPLATE_ T16>
7118 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7119 T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7120 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7121 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7122 NoneT, NoneT, NoneT, NoneT, NoneT> {
7123 typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7124 T14, T15, T16> type;
7126 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7127 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7128 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7129 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7130 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7131 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
7132 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7133 T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7134 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7135 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7136 NoneT, NoneT, NoneT, NoneT, NoneT> {
7137 typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7138 T14, T15, T16, T17> type;
7140 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7141 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7142 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7143 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7144 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7145 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
7146 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7147 T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7148 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7149 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7150 NoneT, NoneT, NoneT, NoneT> {
7151 typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7152 T14, T15, T16, T17, T18> type;
7154 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7155 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7156 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7157 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7158 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7159 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7160 GTEST_TEMPLATE_ T19>
7161 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7162 T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7163 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7164 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7165 NoneT, NoneT, NoneT, NoneT> {
7166 typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7167 T14, T15, T16, T17, T18, T19> type;
7169 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7170 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7171 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7172 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7173 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7174 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7175 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
7176 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7177 T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7178 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7179 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7180 NoneT, NoneT, NoneT, NoneT> {
7181 typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7182 T14, T15, T16, T17, T18, T19, T20> type;
7184 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7185 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7186 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7187 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7188 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7189 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7190 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
7191 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7192 T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
7193 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7194 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7195 NoneT, NoneT, NoneT, NoneT> {
7196 typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7197 T14, T15, T16, T17, T18, T19, T20, T21> type;
7199 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7200 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7201 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7202 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7203 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7204 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7205 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7206 GTEST_TEMPLATE_ T22>
7207 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7208 T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
7209 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7210 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7211 NoneT, NoneT, NoneT> {
7212 typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7213 T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
7215 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7216 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7217 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7218 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7219 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7220 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7221 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7222 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
7223 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7224 T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
7225 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7226 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7227 NoneT, NoneT, NoneT> {
7228 typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7229 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
7231 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7232 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7233 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7234 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7235 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7236 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7237 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7238 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
7239 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7240 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
7241 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7242 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7243 NoneT, NoneT, NoneT> {
7244 typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7245 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
7247 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7248 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7249 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7250 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7251 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7252 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7253 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7254 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7255 GTEST_TEMPLATE_ T25>
7256 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7257 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
7258 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7259 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7261 typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7262 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
7264 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7265 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7266 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7267 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7268 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7269 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7270 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7271 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7272 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
7273 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7274 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
7275 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7276 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7278 typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7279 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
7281 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7282 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7283 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7284 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7285 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7286 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7287 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7288 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7289 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
7290 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7291 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
7292 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7293 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7295 typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7296 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
7299 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7300 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7301 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7302 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7303 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7304 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7305 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7306 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7307 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7308 GTEST_TEMPLATE_ T28>
7309 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7310 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
7311 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7312 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7314 typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7315 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7318 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7319 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7320 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7321 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7322 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7323 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7324 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7325 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7326 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7327 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
7328 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7329 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7330 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7331 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7333 typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7334 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7337 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7338 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7339 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7340 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7341 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7342 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7343 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7344 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7345 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7346 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
7347 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7348 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7349 T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7350 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7351 typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7352 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7353 T28, T29, T30> type;
7355 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7356 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7357 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7358 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7359 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7360 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7361 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7362 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7363 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7364 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7365 GTEST_TEMPLATE_ T31>
7366 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7367 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7368 T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7369 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7370 typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7371 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7372 T28, T29, T30, T31> type;
7374 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7375 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7376 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7377 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7378 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7379 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7380 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7381 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7382 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7383 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7384 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
7385 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7386 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7387 T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7388 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7389 typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7390 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7391 T28, T29, T30, T31, T32> type;
7393 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7394 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7395 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7396 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7397 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7398 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7399 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7400 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7401 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7402 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7403 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
7404 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7405 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7406 T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7407 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7408 typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7409 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7410 T28, T29, T30, T31, T32, T33> type;
7412 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7413 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7414 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7415 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7416 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7417 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7418 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7419 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7420 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7421 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7422 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7423 GTEST_TEMPLATE_ T34>
7424 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7425 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7426 T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7427 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7428 typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7429 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7430 T28, T29, T30, T31, T32, T33, T34> type;
7432 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7433 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7434 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7435 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7436 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7437 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7438 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7439 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7440 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7441 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7442 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7443 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
7444 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7445 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7446 T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
7447 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7448 typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7449 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7450 T28, T29, T30, T31, T32, T33, T34, T35> type;
7452 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7453 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7454 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7455 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7456 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7457 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7458 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7459 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7460 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7461 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7462 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7463 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
7464 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7465 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7466 T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
7467 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7468 typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7469 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7470 T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
7472 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7473 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7474 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7475 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7476 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7477 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7478 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7479 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7480 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7481 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7482 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7483 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7484 GTEST_TEMPLATE_ T37>
7485 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7486 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7487 T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
7488 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7489 typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7490 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7491 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
7493 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7494 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7495 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7496 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7497 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7498 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7499 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7500 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7501 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7502 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7503 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7504 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7505 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
7506 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7507 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7508 T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
7509 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7510 typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7511 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7512 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
7514 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7515 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7516 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7517 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7518 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7519 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7520 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7521 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7522 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7523 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7524 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7525 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7526 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
7527 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7528 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7529 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
7530 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7531 typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7532 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7533 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
7535 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7536 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7537 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7538 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7539 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7540 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7541 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7542 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7543 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7544 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7545 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7546 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7547 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7548 GTEST_TEMPLATE_ T40>
7549 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7550 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7551 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
7552 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7553 typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7554 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7555 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
7557 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7558 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7559 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7560 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7561 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7562 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7563 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7564 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7565 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7566 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7567 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7568 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7569 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7570 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
7571 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7572 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7573 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
7574 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7575 typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7576 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7577 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
7580 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7581 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7582 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7583 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7584 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7585 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7586 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7587 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7588 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7589 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7590 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7591 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7592 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7593 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
7594 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7595 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7596 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
7597 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7598 typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7599 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7600 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7603 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7604 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7605 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7606 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7607 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7608 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7609 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7610 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7611 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7612 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7613 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7614 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7615 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7616 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7617 GTEST_TEMPLATE_ T43>
7618 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7619 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7620 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
7621 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7622 typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7623 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7624 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7627 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7628 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7629 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7630 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7631 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7632 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7633 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7634 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7635 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7636 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7637 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7638 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7639 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7640 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7641 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
7642 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7643 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7644 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7645 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
7646 typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7647 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7648 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7649 T42, T43, T44> type;
7651 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7652 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7653 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7654 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7655 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7656 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7657 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7658 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7659 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7660 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7661 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7662 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7663 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7664 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7665 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
7666 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7667 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7668 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7669 T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
7670 typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7671 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7672 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7673 T42, T43, T44, T45> type;
7675 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7676 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7677 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7678 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7679 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7680 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7681 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7682 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7683 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7684 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7685 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7686 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7687 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7688 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7689 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7690 GTEST_TEMPLATE_ T46>
7691 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7692 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7693 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7694 T45, T46, NoneT, NoneT, NoneT, NoneT> {
7695 typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7696 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7697 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7698 T42, T43, T44, T45, T46> type;
7700 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7701 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7702 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7703 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7704 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7705 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7706 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7707 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7708 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7709 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7710 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7711 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7712 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7713 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7714 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7715 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
7716 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7717 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7718 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7719 T45, T46, T47, NoneT, NoneT, NoneT> {
7720 typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7721 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7722 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7723 T42, T43, T44, T45, T46, T47> type;
7725 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7726 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7727 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7728 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7729 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7730 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7731 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7732 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7733 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7734 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7735 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7736 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7737 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7738 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7739 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7740 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
7741 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7742 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7743 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7744 T45, T46, T47, T48, NoneT, NoneT> {
7745 typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7746 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7747 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7748 T42, T43, T44, T45, T46, T47, T48> type;
7750 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7751 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7752 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7753 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7754 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7755 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7756 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7757 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7758 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7759 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7760 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7761 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7762 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7763 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7764 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7765 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
7766 GTEST_TEMPLATE_ T49>
7767 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7768 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7769 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7770 T45, T46, T47, T48, T49, NoneT> {
7771 typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7772 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7773 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7774 T42, T43, T44, T45, T46, T47, T48, T49> type;
7777 // The TypeList template makes it possible to use either a single type
7778 // or a Types<...> list in TYPED_TEST_CASE() and
7779 // INSTANTIATE_TYPED_TEST_CASE_P().
7781 template <typename T>
7783 typedef Types1<T> type;
7786 template <typename T1, typename T2, typename T3, typename T4, typename T5,
7787 typename T6, typename T7, typename T8, typename T9, typename T10,
7788 typename T11, typename T12, typename T13, typename T14, typename T15,
7789 typename T16, typename T17, typename T18, typename T19, typename T20,
7790 typename T21, typename T22, typename T23, typename T24, typename T25,
7791 typename T26, typename T27, typename T28, typename T29, typename T30,
7792 typename T31, typename T32, typename T33, typename T34, typename T35,
7793 typename T36, typename T37, typename T38, typename T39, typename T40,
7794 typename T41, typename T42, typename T43, typename T44, typename T45,
7795 typename T46, typename T47, typename T48, typename T49, typename T50>
7796 struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7797 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
7798 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
7799 T44, T45, T46, T47, T48, T49, T50> > {
7800 typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
7801 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
7802 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
7803 T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
7806 #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7808 } // namespace internal
7809 } // namespace testing
7811 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
7813 // Due to C++ preprocessor weirdness, we need double indirection to
7814 // concatenate two tokens when one of them is __LINE__. Writing
7818 // will result in the token foo__LINE__, instead of foo followed by
7819 // the current line number. For more details, see
7820 // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
7821 #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
7822 #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
7824 class ProtocolMessage;
7825 namespace proto2 { class Message; }
7829 // Forward declarations.
7831 class AssertionResult; // Result of an assertion.
7832 class Message; // Represents a failure message.
7833 class Test; // Represents a test.
7834 class TestInfo; // Information about a test.
7835 class TestPartResult; // Result of a test part.
7836 class UnitTest; // A collection of test cases.
7838 template <typename T>
7839 ::std::string PrintToString(const T& value);
7841 namespace internal {
7843 struct TraceInfo; // Information about a trace point.
7844 class ScopedTrace; // Implements scoped trace.
7845 class TestInfoImpl; // Opaque implementation of TestInfo
7846 class UnitTestImpl; // Opaque implementation of UnitTest
7848 // The text used in failure messages to indicate the start of the
7850 GTEST_API_ extern const char kStackTraceMarker[];
7852 // Two overloaded helpers for checking at compile time whether an
7853 // expression is a null pointer literal (i.e. NULL or any 0-valued
7854 // compile-time integral constant). Their return values have
7855 // different sizes, so we can use sizeof() to test which version is
7856 // picked by the compiler. These helpers have no implementations, as
7857 // we only need their signatures.
7859 // Given IsNullLiteralHelper(x), the compiler will pick the first
7860 // version if x can be implicitly converted to Secret*, and pick the
7861 // second version otherwise. Since Secret is a secret and incomplete
7862 // type, the only expression a user can write that has type Secret* is
7863 // a null pointer literal. Therefore, we know that x is a null
7864 // pointer literal if and only if the first version is picked by the
7866 char IsNullLiteralHelper(Secret* p);
7867 char (&IsNullLiteralHelper(...))[2]; // NOLINT
7869 // A compile-time bool constant that is true if and only if x is a
7870 // null pointer literal (i.e. NULL or any 0-valued compile-time
7871 // integral constant).
7872 #ifdef GTEST_ELLIPSIS_NEEDS_POD_
7873 // We lose support for NULL detection where the compiler doesn't like
7874 // passing non-POD classes through ellipsis (...).
7875 # define GTEST_IS_NULL_LITERAL_(x) false
7877 # define GTEST_IS_NULL_LITERAL_(x) \
7878 (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
7879 #endif // GTEST_ELLIPSIS_NEEDS_POD_
7881 // Appends the user-supplied message to the Google-Test-generated message.
7882 GTEST_API_ std::string AppendUserMessage(
7883 const std::string& gtest_msg, const Message& user_msg);
7885 #if GTEST_HAS_EXCEPTIONS
7887 // This exception is thrown by (and only by) a failed Google Test
7888 // assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
7889 // are enabled). We derive it from std::runtime_error, which is for
7890 // errors presumably detectable only at run time. Since
7891 // std::runtime_error inherits from std::exception, many testing
7892 // frameworks know how to extract and print the message inside it.
7893 class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
7895 explicit GoogleTestFailureException(const TestPartResult& failure);
7898 #endif // GTEST_HAS_EXCEPTIONS
7900 // A helper class for creating scoped traces in user programs.
7901 class GTEST_API_ ScopedTrace {
7903 // The c'tor pushes the given source file location and message onto
7904 // a trace stack maintained by Google Test.
7905 ScopedTrace(const char* file, int line, const Message& message);
7907 // The d'tor pops the info pushed by the c'tor.
7909 // Note that the d'tor is not virtual in order to be efficient.
7910 // Don't inherit from ScopedTrace!
7914 GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
7915 } GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its
7916 // c'tor and d'tor. Therefore it doesn't
7917 // need to be used otherwise.
7919 namespace edit_distance {
7920 // Returns the optimal edits to go from 'left' to 'right'.
7921 // All edits cost the same, with replace having lower priority than
7923 // Simple implementation of the Wagner–Fischer algorithm.
7924 // See http://en.wikipedia.org/wiki/Wagner-Fischer_algorithm
7925 enum EditType { kMatch, kAdd, kRemove, kReplace };
7926 GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
7927 const std::vector<size_t>& left, const std::vector<size_t>& right);
7929 // Same as above, but the input is represented as strings.
7930 GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
7931 const std::vector<std::string>& left,
7932 const std::vector<std::string>& right);
7934 // Create a diff of the input strings in Unified diff format.
7935 GTEST_API_ std::string CreateUnifiedDiff(const std::vector<std::string>& left,
7936 const std::vector<std::string>& right,
7937 size_t context = 2);
7939 } // namespace edit_distance
7941 // Calculate the diff between 'left' and 'right' and return it in unified diff
7943 // If not null, stores in 'total_line_count' the total number of lines found
7945 GTEST_API_ std::string DiffStrings(const std::string& left,
7946 const std::string& right,
7947 size_t* total_line_count);
7949 // Constructs and returns the message for an equality assertion
7950 // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
7952 // The first four parameters are the expressions used in the assertion
7953 // and their values, as strings. For example, for ASSERT_EQ(foo, bar)
7954 // where foo is 5 and bar is 6, we have:
7956 // expected_expression: "foo"
7957 // actual_expression: "bar"
7958 // expected_value: "5"
7959 // actual_value: "6"
7961 // The ignoring_case parameter is true iff the assertion is a
7962 // *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
7963 // be inserted into the message.
7964 GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
7965 const char* actual_expression,
7966 const std::string& expected_value,
7967 const std::string& actual_value,
7968 bool ignoring_case);
7970 // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
7971 GTEST_API_ std::string GetBoolAssertionFailureMessage(
7972 const AssertionResult& assertion_result,
7973 const char* expression_text,
7974 const char* actual_predicate_value,
7975 const char* expected_predicate_value);
7977 // This template class represents an IEEE floating-point number
7978 // (either single-precision or double-precision, depending on the
7979 // template parameters).
7981 // The purpose of this class is to do more sophisticated number
7982 // comparison. (Due to round-off error, etc, it's very unlikely that
7983 // two floating-points will be equal exactly. Hence a naive
7984 // comparison by the == operation often doesn't work.)
7986 // Format of IEEE floating-point:
7988 // The most-significant bit being the leftmost, an IEEE
7989 // floating-point looks like
7991 // sign_bit exponent_bits fraction_bits
7993 // Here, sign_bit is a single bit that designates the sign of the
7996 // For float, there are 8 exponent bits and 23 fraction bits.
7998 // For double, there are 11 exponent bits and 52 fraction bits.
8000 // More details can be found at
8001 // http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
8003 // Template parameter:
8005 // RawType: the raw floating-point type (either float or double)
8006 template <typename RawType>
8007 class FloatingPoint {
8009 // Defines the unsigned integer type that has the same size as the
8010 // floating point number.
8011 typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
8015 // # of bits in a number.
8016 static const size_t kBitCount = 8*sizeof(RawType);
8018 // # of fraction bits in a number.
8019 static const size_t kFractionBitCount =
8020 std::numeric_limits<RawType>::digits - 1;
8022 // # of exponent bits in a number.
8023 static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
8025 // The mask for the sign bit.
8026 static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
8028 // The mask for the fraction bits.
8029 static const Bits kFractionBitMask =
8030 ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
8032 // The mask for the exponent bits.
8033 static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
8035 // How many ULP's (Units in the Last Place) we want to tolerate when
8036 // comparing two numbers. The larger the value, the more error we
8037 // allow. A 0 value means that two numbers must be exactly the same
8038 // to be considered equal.
8040 // The maximum error of a single floating-point operation is 0.5
8041 // units in the last place. On Intel CPU's, all floating-point
8042 // calculations are done with 80-bit precision, while double has 64
8043 // bits. Therefore, 4 should be enough for ordinary use.
8045 // See the following article for more details on ULP:
8046 // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
8047 static const size_t kMaxUlps = 4;
8049 // Constructs a FloatingPoint from a raw floating-point number.
8051 // On an Intel CPU, passing a non-normalized NAN (Not a Number)
8052 // around may change its bits, although the new value is guaranteed
8053 // to be also a NAN. Therefore, don't expect this constructor to
8054 // preserve the bits in x when x is a NAN.
8055 explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
8059 // Reinterprets a bit pattern as a floating-point number.
8061 // This function is needed to test the AlmostEquals() method.
8062 static RawType ReinterpretBits(const Bits bits) {
8063 FloatingPoint fp(0);
8065 return fp.u_.value_;
8068 // Returns the floating-point number that represent positive infinity.
8069 static RawType Infinity() {
8070 return ReinterpretBits(kExponentBitMask);
8073 // Returns the maximum representable finite floating-point number.
8074 static RawType Max();
8076 // Non-static methods
8078 // Returns the bits that represents this number.
8079 const Bits &bits() const { return u_.bits_; }
8081 // Returns the exponent bits of this number.
8082 Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
8084 // Returns the fraction bits of this number.
8085 Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
8087 // Returns the sign bit of this number.
8088 Bits sign_bit() const { return kSignBitMask & u_.bits_; }
8090 // Returns true iff this is NAN (not a number).
8091 bool is_nan() const {
8092 // It's a NAN if the exponent bits are all ones and the fraction
8093 // bits are not entirely zeros.
8094 return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
8097 // Returns true iff this number is at most kMaxUlps ULP's away from
8098 // rhs. In particular, this function:
8100 // - returns false if either number is (or both are) NAN.
8101 // - treats really large numbers as almost equal to infinity.
8102 // - thinks +0.0 and -0.0 are 0 DLP's apart.
8103 bool AlmostEquals(const FloatingPoint& rhs) const {
8104 // The IEEE standard says that any comparison operation involving
8105 // a NAN must return false.
8106 if (is_nan() || rhs.is_nan()) return false;
8108 return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
8113 // The data type used to store the actual floating-point number.
8114 union FloatingPointUnion {
8115 RawType value_; // The raw floating-point number.
8116 Bits bits_; // The bits that represent the number.
8119 // Converts an integer from the sign-and-magnitude representation to
8120 // the biased representation. More precisely, let N be 2 to the
8121 // power of (kBitCount - 1), an integer x is represented by the
8122 // unsigned number x + N.
8126 // -N + 1 (the most negative number representable using
8127 // sign-and-magnitude) is represented by 1;
8128 // 0 is represented by N; and
8129 // N - 1 (the biggest number representable using
8130 // sign-and-magnitude) is represented by 2N - 1.
8132 // Read http://en.wikipedia.org/wiki/Signed_number_representations
8133 // for more details on signed number representations.
8134 static Bits SignAndMagnitudeToBiased(const Bits &sam) {
8135 if (kSignBitMask & sam) {
8136 // sam represents a negative number.
8139 // sam represents a positive number.
8140 return kSignBitMask | sam;
8144 // Given two numbers in the sign-and-magnitude representation,
8145 // returns the distance between them as an unsigned number.
8146 static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
8148 const Bits biased1 = SignAndMagnitudeToBiased(sam1);
8149 const Bits biased2 = SignAndMagnitudeToBiased(sam2);
8150 return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
8153 FloatingPointUnion u_;
8156 // We cannot use std::numeric_limits<T>::max() as it clashes with the max()
8157 // macro defined by <windows.h>.
8159 inline float FloatingPoint<float>::Max() { return FLT_MAX; }
8161 inline double FloatingPoint<double>::Max() { return DBL_MAX; }
8163 // Typedefs the instances of the FloatingPoint template class that we
8165 typedef FloatingPoint<float> Float;
8166 typedef FloatingPoint<double> Double;
8168 // In order to catch the mistake of putting tests that use different
8169 // test fixture classes in the same test case, we need to assign
8170 // unique IDs to fixture classes and compare them. The TypeId type is
8171 // used to hold such IDs. The user should treat TypeId as an opaque
8172 // type: the only operation allowed on TypeId values is to compare
8173 // them for equality using the == operator.
8174 typedef const void* TypeId;
8176 template <typename T>
8177 class TypeIdHelper {
8179 // dummy_ must not have a const type. Otherwise an overly eager
8180 // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
8181 // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
8185 template <typename T>
8186 bool TypeIdHelper<T>::dummy_ = false;
8188 // GetTypeId<T>() returns the ID of type T. Different values will be
8189 // returned for different types. Calling the function twice with the
8190 // same type argument is guaranteed to return the same ID.
8191 template <typename T>
8192 TypeId GetTypeId() {
8193 // The compiler is required to allocate a different
8194 // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
8195 // the template. Therefore, the address of dummy_ is guaranteed to
8197 return &(TypeIdHelper<T>::dummy_);
8200 // Returns the type ID of ::testing::Test. Always call this instead
8201 // of GetTypeId< ::testing::Test>() to get the type ID of
8202 // ::testing::Test, as the latter may give the wrong result due to a
8203 // suspected linker bug when compiling Google Test as a Mac OS X
8205 GTEST_API_ TypeId GetTestTypeId();
8207 // Defines the abstract factory interface that creates instances
8208 // of a Test object.
8209 class TestFactoryBase {
8211 virtual ~TestFactoryBase() {}
8213 // Creates a test instance to run. The instance is both created and destroyed
8214 // within TestInfoImpl::Run()
8215 virtual Test* CreateTest() = 0;
8218 TestFactoryBase() {}
8221 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
8224 // This class provides implementation of TeastFactoryBase interface.
8225 // It is used in TEST and TEST_F macros.
8226 template <class TestClass>
8227 class TestFactoryImpl : public TestFactoryBase {
8229 virtual Test* CreateTest() { return new TestClass; }
8232 #if GTEST_OS_WINDOWS
8234 // Predicate-formatters for implementing the HRESULT checking macros
8235 // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
8236 // We pass a long instead of HRESULT to avoid causing an
8237 // include dependency for the HRESULT type.
8238 GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
8240 GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
8243 #endif // GTEST_OS_WINDOWS
8245 // Types of SetUpTestCase() and TearDownTestCase() functions.
8246 typedef void (*SetUpTestCaseFunc)();
8247 typedef void (*TearDownTestCaseFunc)();
8249 struct CodeLocation {
8250 CodeLocation(const string& a_file, int a_line) : file(a_file), line(a_line) {}
8256 // Creates a new TestInfo object and registers it with Google Test;
8257 // returns the created object.
8261 // test_case_name: name of the test case
8262 // name: name of the test
8263 // type_param the name of the test's type parameter, or NULL if
8264 // this is not a typed or a type-parameterized test.
8265 // value_param text representation of the test's value parameter,
8266 // or NULL if this is not a type-parameterized test.
8267 // code_location: code location where the test is defined
8268 // fixture_class_id: ID of the test fixture class
8269 // set_up_tc: pointer to the function that sets up the test case
8270 // tear_down_tc: pointer to the function that tears down the test case
8271 // factory: pointer to the factory that creates a test object.
8272 // The newly created TestInfo instance will assume
8273 // ownership of the factory object.
8274 GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
8275 const char* test_case_name,
8277 const char* type_param,
8278 const char* value_param,
8279 CodeLocation code_location,
8280 TypeId fixture_class_id,
8281 SetUpTestCaseFunc set_up_tc,
8282 TearDownTestCaseFunc tear_down_tc,
8283 TestFactoryBase* factory);
8285 // If *pstr starts with the given prefix, modifies *pstr to be right
8286 // past the prefix and returns true; otherwise leaves *pstr unchanged
8287 // and returns false. None of pstr, *pstr, and prefix can be NULL.
8288 GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
8290 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
8292 // State of the definition of a type-parameterized test case.
8293 class GTEST_API_ TypedTestCasePState {
8295 TypedTestCasePState() : registered_(false) {}
8297 // Adds the given test name to defined_test_names_ and return true
8298 // if the test case hasn't been registered; otherwise aborts the
8300 bool AddTestName(const char* file, int line, const char* case_name,
8301 const char* test_name) {
8303 fprintf(stderr, "%s Test %s must be defined before "
8304 "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
8305 FormatFileLocation(file, line).c_str(), test_name, case_name);
8309 registered_tests_.insert(
8310 ::std::make_pair(test_name, CodeLocation(file, line)));
8314 bool TestExists(const std::string& test_name) const {
8315 return registered_tests_.count(test_name) > 0;
8318 const CodeLocation& GetCodeLocation(const std::string& test_name) const {
8319 RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name);
8320 GTEST_CHECK_(it != registered_tests_.end());
8324 // Verifies that registered_tests match the test names in
8325 // defined_test_names_; returns registered_tests if successful, or
8326 // aborts the program otherwise.
8327 const char* VerifyRegisteredTestNames(
8328 const char* file, int line, const char* registered_tests);
8331 typedef ::std::map<std::string, CodeLocation> RegisteredTestsMap;
8334 RegisteredTestsMap registered_tests_;
8337 // Skips to the first non-space char after the first comma in 'str';
8338 // returns NULL if no comma is found in 'str'.
8339 inline const char* SkipComma(const char* str) {
8340 const char* comma = strchr(str, ',');
8341 if (comma == NULL) {
8344 while (IsSpace(*(++comma))) {}
8348 // Returns the prefix of 'str' before the first comma in it; returns
8349 // the entire string if it contains no comma.
8350 inline std::string GetPrefixUntilComma(const char* str) {
8351 const char* comma = strchr(str, ',');
8352 return comma == NULL ? str : std::string(str, comma);
8355 // Splits a given string on a given delimiter, populating a given
8356 // vector with the fields.
8357 void SplitString(const ::std::string& str, char delimiter,
8358 ::std::vector< ::std::string>* dest);
8360 // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
8361 // registers a list of type-parameterized tests with Google Test. The
8362 // return value is insignificant - we just need to return something
8363 // such that we can call this function in a namespace scope.
8365 // Implementation note: The GTEST_TEMPLATE_ macro declares a template
8366 // template parameter. It's defined in gtest-type-util.h.
8367 template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
8368 class TypeParameterizedTest {
8370 // 'index' is the index of the test in the type list 'Types'
8371 // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
8372 // Types). Valid values for 'index' are [0, N - 1] where N is the
8374 static bool Register(const char* prefix,
8375 CodeLocation code_location,
8376 const char* case_name, const char* test_names,
8378 typedef typename Types::Head Type;
8379 typedef Fixture<Type> FixtureClass;
8380 typedef typename GTEST_BIND_(TestSel, Type) TestClass;
8382 // First, registers the first type-parameterized test in the type
8384 MakeAndRegisterTestInfo(
8385 (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
8386 + StreamableToString(index)).c_str(),
8387 StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
8388 GetTypeName<Type>().c_str(),
8389 NULL, // No value parameter.
8391 GetTypeId<FixtureClass>(),
8392 TestClass::SetUpTestCase,
8393 TestClass::TearDownTestCase,
8394 new TestFactoryImpl<TestClass>);
8396 // Next, recurses (at compile time) with the tail of the type list.
8397 return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
8398 ::Register(prefix, code_location, case_name, test_names, index + 1);
8402 // The base case for the compile time recursion.
8403 template <GTEST_TEMPLATE_ Fixture, class TestSel>
8404 class TypeParameterizedTest<Fixture, TestSel, Types0> {
8406 static bool Register(const char* /*prefix*/, CodeLocation,
8407 const char* /*case_name*/, const char* /*test_names*/,
8413 // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
8414 // registers *all combinations* of 'Tests' and 'Types' with Google
8415 // Test. The return value is insignificant - we just need to return
8416 // something such that we can call this function in a namespace scope.
8417 template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
8418 class TypeParameterizedTestCase {
8420 static bool Register(const char* prefix, CodeLocation code_location,
8421 const TypedTestCasePState* state,
8422 const char* case_name, const char* test_names) {
8423 std::string test_name = StripTrailingSpaces(
8424 GetPrefixUntilComma(test_names));
8425 if (!state->TestExists(test_name)) {
8426 fprintf(stderr, "Failed to get code location for test %s.%s at %s.",
8427 case_name, test_name.c_str(),
8428 FormatFileLocation(code_location.file.c_str(),
8429 code_location.line).c_str());
8433 const CodeLocation& test_location = state->GetCodeLocation(test_name);
8435 typedef typename Tests::Head Head;
8437 // First, register the first test in 'Test' for each type in 'Types'.
8438 TypeParameterizedTest<Fixture, Head, Types>::Register(
8439 prefix, test_location, case_name, test_names, 0);
8441 // Next, recurses (at compile time) with the tail of the test list.
8442 return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
8443 ::Register(prefix, code_location, state,
8444 case_name, SkipComma(test_names));
8448 // The base case for the compile time recursion.
8449 template <GTEST_TEMPLATE_ Fixture, typename Types>
8450 class TypeParameterizedTestCase<Fixture, Templates0, Types> {
8452 static bool Register(const char* /*prefix*/, CodeLocation,
8453 const TypedTestCasePState* /*state*/,
8454 const char* /*case_name*/, const char* /*test_names*/) {
8459 #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
8461 // Returns the current OS stack trace as an std::string.
8463 // The maximum number of stack frames to be included is specified by
8464 // the gtest_stack_trace_depth flag. The skip_count parameter
8465 // specifies the number of top frames to be skipped, which doesn't
8466 // count against the number of frames to be included.
8468 // For example, if Foo() calls Bar(), which in turn calls
8469 // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
8470 // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
8471 GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
8472 UnitTest* unit_test, int skip_count);
8474 // Helpers for suppressing warnings on unreachable code or constant
8477 // Always returns true.
8478 GTEST_API_ bool AlwaysTrue();
8480 // Always returns false.
8481 inline bool AlwaysFalse() { return !AlwaysTrue(); }
8483 // Helper for suppressing false warning from Clang on a const char*
8484 // variable declared in a conditional expression always being NULL in
8486 struct GTEST_API_ ConstCharPtr {
8487 ConstCharPtr(const char* str) : value(str) {}
8488 operator bool() const { return true; }
8492 // A simple Linear Congruential Generator for generating random
8493 // numbers with a uniform distribution. Unlike rand() and srand(), it
8494 // doesn't use global state (and therefore can't interfere with user
8495 // code). Unlike rand_r(), it's portable. An LCG isn't very random,
8496 // but it's good enough for our purposes.
8497 class GTEST_API_ Random {
8499 static const UInt32 kMaxRange = 1u << 31;
8501 explicit Random(UInt32 seed) : state_(seed) {}
8503 void Reseed(UInt32 seed) { state_ = seed; }
8505 // Generates a random number from [0, range). Crashes if 'range' is
8506 // 0 or greater than kMaxRange.
8507 UInt32 Generate(UInt32 range);
8511 GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
8514 // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
8515 // compiler error iff T1 and T2 are different types.
8516 template <typename T1, typename T2>
8517 struct CompileAssertTypesEqual;
8519 template <typename T>
8520 struct CompileAssertTypesEqual<T, T> {
8523 // Removes the reference from a type if it is a reference type,
8524 // otherwise leaves it unchanged. This is the same as
8525 // tr1::remove_reference, which is not widely available yet.
8526 template <typename T>
8527 struct RemoveReference { typedef T type; }; // NOLINT
8528 template <typename T>
8529 struct RemoveReference<T&> { typedef T type; }; // NOLINT
8531 // A handy wrapper around RemoveReference that works when the argument
8532 // T depends on template parameters.
8533 #define GTEST_REMOVE_REFERENCE_(T) \
8534 typename ::testing::internal::RemoveReference<T>::type
8536 // Removes const from a type if it is a const type, otherwise leaves
8537 // it unchanged. This is the same as tr1::remove_const, which is not
8538 // widely available yet.
8539 template <typename T>
8540 struct RemoveConst { typedef T type; }; // NOLINT
8541 template <typename T>
8542 struct RemoveConst<const T> { typedef T type; }; // NOLINT
8544 // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
8545 // definition to fail to remove the const in 'const int[3]' and 'const
8546 // char[3][4]'. The following specialization works around the bug.
8547 template <typename T, size_t N>
8548 struct RemoveConst<const T[N]> {
8549 typedef typename RemoveConst<T>::type type[N];
8552 #if defined(_MSC_VER) && _MSC_VER < 1400
8553 // This is the only specialization that allows VC++ 7.1 to remove const in
8554 // 'const int[3] and 'const int[3][4]'. However, it causes trouble with GCC
8555 // and thus needs to be conditionally compiled.
8556 template <typename T, size_t N>
8557 struct RemoveConst<T[N]> {
8558 typedef typename RemoveConst<T>::type type[N];
8562 // A handy wrapper around RemoveConst that works when the argument
8563 // T depends on template parameters.
8564 #define GTEST_REMOVE_CONST_(T) \
8565 typename ::testing::internal::RemoveConst<T>::type
8567 // Turns const U&, U&, const U, and U all into U.
8568 #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
8569 GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
8571 // Adds reference to a type if it is not a reference type,
8572 // otherwise leaves it unchanged. This is the same as
8573 // tr1::add_reference, which is not widely available yet.
8574 template <typename T>
8575 struct AddReference { typedef T& type; }; // NOLINT
8576 template <typename T>
8577 struct AddReference<T&> { typedef T& type; }; // NOLINT
8579 // A handy wrapper around AddReference that works when the argument T
8580 // depends on template parameters.
8581 #define GTEST_ADD_REFERENCE_(T) \
8582 typename ::testing::internal::AddReference<T>::type
8584 // Adds a reference to const on top of T as necessary. For example,
8587 // char ==> const char&
8588 // const char ==> const char&
8589 // char& ==> const char&
8590 // const char& ==> const char&
8592 // The argument T must depend on some template parameters.
8593 #define GTEST_REFERENCE_TO_CONST_(T) \
8594 GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
8596 // ImplicitlyConvertible<From, To>::value is a compile-time bool
8597 // constant that's true iff type From can be implicitly converted to
8599 template <typename From, typename To>
8600 class ImplicitlyConvertible {
8602 // We need the following helper functions only for their types.
8603 // They have no implementations.
8605 // MakeFrom() is an expression whose type is From. We cannot simply
8606 // use From(), as the type From may not have a public default
8608 static typename AddReference<From>::type MakeFrom();
8610 // These two functions are overloaded. Given an expression
8611 // Helper(x), the compiler will pick the first version if x can be
8612 // implicitly converted to type To; otherwise it will pick the
8615 // The first version returns a value of size 1, and the second
8616 // version returns a value of size 2. Therefore, by checking the
8617 // size of Helper(x), which can be done at compile time, we can tell
8618 // which version of Helper() is used, and hence whether x can be
8619 // implicitly converted to type To.
8620 static char Helper(To);
8621 static char (&Helper(...))[2]; // NOLINT
8623 // We have to put the 'public' section after the 'private' section,
8624 // or MSVC refuses to compile the code.
8626 #if defined(__BORLANDC__)
8627 // C++Builder cannot use member overload resolution during template
8628 // instantiation. The simplest workaround is to use its C++0x type traits
8629 // functions (C++Builder 2009 and above only).
8630 static const bool value = __is_convertible(From, To);
8632 // MSVC warns about implicitly converting from double to int for
8633 // possible loss of data, so we need to temporarily disable the
8635 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244)
8636 static const bool value =
8637 sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
8638 GTEST_DISABLE_MSC_WARNINGS_POP_()
8639 #endif // __BORLANDC__
8641 template <typename From, typename To>
8642 const bool ImplicitlyConvertible<From, To>::value;
8644 // IsAProtocolMessage<T>::value is a compile-time bool constant that's
8645 // true iff T is type ProtocolMessage, proto2::Message, or a subclass
8647 template <typename T>
8648 struct IsAProtocolMessage
8649 : public bool_constant<
8650 ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
8651 ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
8654 // When the compiler sees expression IsContainerTest<C>(0), if C is an
8655 // STL-style container class, the first overload of IsContainerTest
8656 // will be viable (since both C::iterator* and C::const_iterator* are
8657 // valid types and NULL can be implicitly converted to them). It will
8658 // be picked over the second overload as 'int' is a perfect match for
8659 // the type of argument 0. If C::iterator or C::const_iterator is not
8660 // a valid type, the first overload is not viable, and the second
8661 // overload will be picked. Therefore, we can determine whether C is
8662 // a container class by checking the type of IsContainerTest<C>(0).
8663 // The value of the expression is insignificant.
8665 // Note that we look for both C::iterator and C::const_iterator. The
8666 // reason is that C++ injects the name of a class as a member of the
8667 // class itself (e.g. you can refer to class iterator as either
8668 // 'iterator' or 'iterator::iterator'). If we look for C::iterator
8669 // only, for example, we would mistakenly think that a class named
8670 // iterator is an STL container.
8672 // Also note that the simpler approach of overloading
8673 // IsContainerTest(typename C::const_iterator*) and
8674 // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
8675 typedef int IsContainer;
8677 IsContainer IsContainerTest(int /* dummy */,
8678 typename C::iterator* /* it */ = NULL,
8679 typename C::const_iterator* /* const_it */ = NULL) {
8683 typedef char IsNotContainer;
8685 IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
8687 // EnableIf<condition>::type is void when 'Cond' is true, and
8688 // undefined when 'Cond' is false. To use SFINAE to make a function
8689 // overload only apply when a particular expression is true, add
8690 // "typename EnableIf<expression>::type* = 0" as the last parameter.
8691 template<bool> struct EnableIf;
8692 template<> struct EnableIf<true> { typedef void type; }; // NOLINT
8694 // Utilities for native arrays.
8696 // ArrayEq() compares two k-dimensional native arrays using the
8697 // elements' operator==, where k can be any integer >= 0. When k is
8698 // 0, ArrayEq() degenerates into comparing a single pair of values.
8700 template <typename T, typename U>
8701 bool ArrayEq(const T* lhs, size_t size, const U* rhs);
8703 // This generic version is used when k is 0.
8704 template <typename T, typename U>
8705 inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
8707 // This overload is used when k >= 1.
8708 template <typename T, typename U, size_t N>
8709 inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
8710 return internal::ArrayEq(lhs, N, rhs);
8713 // This helper reduces code bloat. If we instead put its logic inside
8714 // the previous ArrayEq() function, arrays with different sizes would
8715 // lead to different copies of the template code.
8716 template <typename T, typename U>
8717 bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
8718 for (size_t i = 0; i != size; i++) {
8719 if (!internal::ArrayEq(lhs[i], rhs[i]))
8725 // Finds the first element in the iterator range [begin, end) that
8726 // equals elem. Element may be a native array type itself.
8727 template <typename Iter, typename Element>
8728 Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
8729 for (Iter it = begin; it != end; ++it) {
8730 if (internal::ArrayEq(*it, elem))
8736 // CopyArray() copies a k-dimensional native array using the elements'
8737 // operator=, where k can be any integer >= 0. When k is 0,
8738 // CopyArray() degenerates into copying a single value.
8740 template <typename T, typename U>
8741 void CopyArray(const T* from, size_t size, U* to);
8743 // This generic version is used when k is 0.
8744 template <typename T, typename U>
8745 inline void CopyArray(const T& from, U* to) { *to = from; }
8747 // This overload is used when k >= 1.
8748 template <typename T, typename U, size_t N>
8749 inline void CopyArray(const T(&from)[N], U(*to)[N]) {
8750 internal::CopyArray(from, N, *to);
8753 // This helper reduces code bloat. If we instead put its logic inside
8754 // the previous CopyArray() function, arrays with different sizes
8755 // would lead to different copies of the template code.
8756 template <typename T, typename U>
8757 void CopyArray(const T* from, size_t size, U* to) {
8758 for (size_t i = 0; i != size; i++) {
8759 internal::CopyArray(from[i], to + i);
8763 // The relation between an NativeArray object (see below) and the
8764 // native array it represents.
8765 // We use 2 different structs to allow non-copyable types to be used, as long
8766 // as RelationToSourceReference() is passed.
8767 struct RelationToSourceReference {};
8768 struct RelationToSourceCopy {};
8770 // Adapts a native array to a read-only STL-style container. Instead
8771 // of the complete STL container concept, this adaptor only implements
8772 // members useful for Google Mock's container matchers. New members
8773 // should be added as needed. To simplify the implementation, we only
8774 // support Element being a raw type (i.e. having no top-level const or
8775 // reference modifier). It's the client's responsibility to satisfy
8776 // this requirement. Element can be an array type itself (hence
8777 // multi-dimensional arrays are supported).
8778 template <typename Element>
8781 // STL-style container typedefs.
8782 typedef Element value_type;
8783 typedef Element* iterator;
8784 typedef const Element* const_iterator;
8786 // Constructs from a native array. References the source.
8787 NativeArray(const Element* array, size_t count, RelationToSourceReference) {
8788 InitRef(array, count);
8791 // Constructs from a native array. Copies the source.
8792 NativeArray(const Element* array, size_t count, RelationToSourceCopy) {
8793 InitCopy(array, count);
8796 // Copy constructor.
8797 NativeArray(const NativeArray& rhs) {
8798 (this->*rhs.clone_)(rhs.array_, rhs.size_);
8802 if (clone_ != &NativeArray::InitRef)
8806 // STL-style container methods.
8807 size_t size() const { return size_; }
8808 const_iterator begin() const { return array_; }
8809 const_iterator end() const { return array_ + size_; }
8810 bool operator==(const NativeArray& rhs) const {
8811 return size() == rhs.size() &&
8812 ArrayEq(begin(), size(), rhs.begin());
8817 kCheckTypeIsNotConstOrAReference = StaticAssertTypeEqHelper<
8818 Element, GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>::value,
8821 // Initializes this object with a copy of the input.
8822 void InitCopy(const Element* array, size_t a_size) {
8823 Element* const copy = new Element[a_size];
8824 CopyArray(array, a_size, copy);
8827 clone_ = &NativeArray::InitCopy;
8830 // Initializes this object with a reference of the input.
8831 void InitRef(const Element* array, size_t a_size) {
8834 clone_ = &NativeArray::InitRef;
8837 const Element* array_;
8839 void (NativeArray::*clone_)(const Element*, size_t);
8841 GTEST_DISALLOW_ASSIGN_(NativeArray);
8844 } // namespace internal
8845 } // namespace testing
8847 #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
8848 ::testing::internal::AssertHelper(result_type, file, line, message) \
8849 = ::testing::Message()
8851 #define GTEST_MESSAGE_(message, result_type) \
8852 GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
8854 #define GTEST_FATAL_FAILURE_(message) \
8855 return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
8857 #define GTEST_NONFATAL_FAILURE_(message) \
8858 GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
8860 #define GTEST_SUCCESS_(message) \
8861 GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
8863 // Suppresses MSVC warnings 4072 (unreachable code) for the code following
8864 // statement if it returns or throws (or doesn't return or throw in some
8866 #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
8867 if (::testing::internal::AlwaysTrue()) { statement; }
8869 #define GTEST_TEST_THROW_(statement, expected_exception, fail) \
8870 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8871 if (::testing::internal::ConstCharPtr gtest_msg = "") { \
8872 bool gtest_caught_expected = false; \
8874 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8876 catch (expected_exception const&) { \
8877 gtest_caught_expected = true; \
8881 "Expected: " #statement " throws an exception of type " \
8882 #expected_exception ".\n Actual: it throws a different type."; \
8883 goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
8885 if (!gtest_caught_expected) { \
8887 "Expected: " #statement " throws an exception of type " \
8888 #expected_exception ".\n Actual: it throws nothing."; \
8889 goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
8892 GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
8893 fail(gtest_msg.value)
8895 #define GTEST_TEST_NO_THROW_(statement, fail) \
8896 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8897 if (::testing::internal::AlwaysTrue()) { \
8899 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8902 goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
8905 GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
8906 fail("Expected: " #statement " doesn't throw an exception.\n" \
8907 " Actual: it throws.")
8909 #define GTEST_TEST_ANY_THROW_(statement, fail) \
8910 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8911 if (::testing::internal::AlwaysTrue()) { \
8912 bool gtest_caught_any = false; \
8914 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8917 gtest_caught_any = true; \
8919 if (!gtest_caught_any) { \
8920 goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
8923 GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
8924 fail("Expected: " #statement " throws an exception.\n" \
8925 " Actual: it doesn't.")
8928 // Implements Boolean test assertions such as EXPECT_TRUE. expression can be
8929 // either a boolean expression or an AssertionResult. text is a textual
8930 // represenation of expression as it was passed into the EXPECT_TRUE.
8931 #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
8932 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8933 if (const ::testing::AssertionResult gtest_ar_ = \
8934 ::testing::AssertionResult(expression)) \
8937 fail(::testing::internal::GetBoolAssertionFailureMessage(\
8938 gtest_ar_, text, #actual, #expected).c_str())
8940 #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
8941 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8942 if (::testing::internal::AlwaysTrue()) { \
8943 ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
8944 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8945 if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
8946 goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
8949 GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
8950 fail("Expected: " #statement " doesn't generate new fatal " \
8951 "failures in the current thread.\n" \
8952 " Actual: it does.")
8954 // Expands to the name of the class that implements the given test.
8955 #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
8956 test_case_name##_##test_name##_Test
8958 // Helper macro for defining tests.
8959 #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
8960 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
8962 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
8964 virtual void TestBody();\
8965 static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
8966 GTEST_DISALLOW_COPY_AND_ASSIGN_(\
8967 GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
8970 ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
8972 ::testing::internal::MakeAndRegisterTestInfo(\
8973 #test_case_name, #test_name, NULL, NULL, \
8974 ::testing::internal::CodeLocation(__FILE__, __LINE__), \
8976 parent_class::SetUpTestCase, \
8977 parent_class::TearDownTestCase, \
8978 new ::testing::internal::TestFactoryImpl<\
8979 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
8980 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
8982 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
8984 // Copyright 2005, Google Inc.
8985 // All rights reserved.
8987 // Redistribution and use in source and binary forms, with or without
8988 // modification, are permitted provided that the following conditions are
8991 // * Redistributions of source code must retain the above copyright
8992 // notice, this list of conditions and the following disclaimer.
8993 // * Redistributions in binary form must reproduce the above
8994 // copyright notice, this list of conditions and the following disclaimer
8995 // in the documentation and/or other materials provided with the
8997 // * Neither the name of Google Inc. nor the names of its
8998 // contributors may be used to endorse or promote products derived from
8999 // this software without specific prior written permission.
9001 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9002 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9003 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9004 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9005 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9006 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9007 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9008 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9009 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9010 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9011 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9013 // Author: wan@google.com (Zhanyong Wan)
9015 // The Google C++ Testing Framework (Google Test)
9017 // This header file defines the public API for death tests. It is
9018 // #included by gtest.h so a user doesn't need to include this
9021 #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
9022 #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
9024 // Copyright 2005, Google Inc.
9025 // All rights reserved.
9027 // Redistribution and use in source and binary forms, with or without
9028 // modification, are permitted provided that the following conditions are
9031 // * Redistributions of source code must retain the above copyright
9032 // notice, this list of conditions and the following disclaimer.
9033 // * Redistributions in binary form must reproduce the above
9034 // copyright notice, this list of conditions and the following disclaimer
9035 // in the documentation and/or other materials provided with the
9037 // * Neither the name of Google Inc. nor the names of its
9038 // contributors may be used to endorse or promote products derived from
9039 // this software without specific prior written permission.
9041 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9042 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9043 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9044 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9045 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9046 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9047 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9048 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9049 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9050 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9051 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9053 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
9055 // The Google C++ Testing Framework (Google Test)
9057 // This header file defines internal utilities needed for implementing
9058 // death tests. They are subject to change without notice.
9060 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
9061 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
9067 namespace internal {
9069 GTEST_DECLARE_string_(internal_run_death_test);
9071 // Names of the flags (needed for parsing Google Test flags).
9072 const char kDeathTestStyleFlag[] = "death_test_style";
9073 const char kDeathTestUseFork[] = "death_test_use_fork";
9074 const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
9076 #if GTEST_HAS_DEATH_TEST
9078 // DeathTest is a class that hides much of the complexity of the
9079 // GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
9080 // returns a concrete class that depends on the prevailing death test
9081 // style, as defined by the --gtest_death_test_style and/or
9082 // --gtest_internal_run_death_test flags.
9084 // In describing the results of death tests, these terms are used with
9085 // the corresponding definitions:
9087 // exit status: The integer exit information in the format specified
9089 // exit code: The integer code passed to exit(3), _exit(2), or
9090 // returned from main()
9091 class GTEST_API_ DeathTest {
9093 // Create returns false if there was an error determining the
9094 // appropriate action to take for the current death test; for example,
9095 // if the gtest_death_test_style flag is set to an invalid value.
9096 // The LastMessage method will return a more detailed message in that
9097 // case. Otherwise, the DeathTest pointer pointed to by the "test"
9098 // argument is set. If the death test should be skipped, the pointer
9099 // is set to NULL; otherwise, it is set to the address of a new concrete
9100 // DeathTest object that controls the execution of the current test.
9101 static bool Create(const char* statement, const RE* regex,
9102 const char* file, int line, DeathTest** test);
9104 virtual ~DeathTest() { }
9106 // A helper class that aborts a death test when it's deleted.
9107 class ReturnSentinel {
9109 explicit ReturnSentinel(DeathTest* test) : test_(test) { }
9110 ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
9112 DeathTest* const test_;
9113 GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
9114 } GTEST_ATTRIBUTE_UNUSED_;
9116 // An enumeration of possible roles that may be taken when a death
9117 // test is encountered. EXECUTE means that the death test logic should
9118 // be executed immediately. OVERSEE means that the program should prepare
9119 // the appropriate environment for a child process to execute the death
9120 // test, then wait for it to complete.
9121 enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
9123 // An enumeration of the three reasons that a test might be aborted.
9125 TEST_ENCOUNTERED_RETURN_STATEMENT,
9126 TEST_THREW_EXCEPTION,
9130 // Assumes one of the above roles.
9131 virtual TestRole AssumeRole() = 0;
9133 // Waits for the death test to finish and returns its status.
9134 virtual int Wait() = 0;
9136 // Returns true if the death test passed; that is, the test process
9137 // exited during the test, its exit status matches a user-supplied
9138 // predicate, and its stderr output matches a user-supplied regular
9140 // The user-supplied predicate may be a macro expression rather
9141 // than a function pointer or functor, or else Wait and Passed could
9143 virtual bool Passed(bool exit_status_ok) = 0;
9145 // Signals that the death test did not die as expected.
9146 virtual void Abort(AbortReason reason) = 0;
9148 // Returns a human-readable outcome message regarding the outcome of
9149 // the last death test.
9150 static const char* LastMessage();
9152 static void set_last_death_test_message(const std::string& message);
9155 // A string containing a description of the outcome of the last death test.
9156 static std::string last_death_test_message_;
9158 GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
9161 // Factory interface for death tests. May be mocked out for testing.
9162 class DeathTestFactory {
9164 virtual ~DeathTestFactory() { }
9165 virtual bool Create(const char* statement, const RE* regex,
9166 const char* file, int line, DeathTest** test) = 0;
9169 // A concrete DeathTestFactory implementation for normal use.
9170 class DefaultDeathTestFactory : public DeathTestFactory {
9172 virtual bool Create(const char* statement, const RE* regex,
9173 const char* file, int line, DeathTest** test);
9176 // Returns true if exit_status describes a process that was terminated
9177 // by a signal, or exited normally with a nonzero exit code.
9178 GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
9180 // Traps C++ exceptions escaping statement and reports them as test
9181 // failures. Note that trapping SEH exceptions is not implemented here.
9182 # if GTEST_HAS_EXCEPTIONS
9183 # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
9185 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9186 } catch (const ::std::exception& gtest_exception) { \
9189 "\n%s: Caught std::exception-derived exception escaping the " \
9190 "death test statement. Exception message: %s\n", \
9191 ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
9192 gtest_exception.what()); \
9194 death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
9196 death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
9200 # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
9201 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
9205 // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
9206 // ASSERT_EXIT*, and EXPECT_EXIT*.
9207 # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
9208 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9209 if (::testing::internal::AlwaysTrue()) { \
9210 const ::testing::internal::RE& gtest_regex = (regex); \
9211 ::testing::internal::DeathTest* gtest_dt; \
9212 if (!::testing::internal::DeathTest::Create(#statement, >est_regex, \
9213 __FILE__, __LINE__, >est_dt)) { \
9214 goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
9216 if (gtest_dt != NULL) { \
9217 ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
9218 gtest_dt_ptr(gtest_dt); \
9219 switch (gtest_dt->AssumeRole()) { \
9220 case ::testing::internal::DeathTest::OVERSEE_TEST: \
9221 if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
9222 goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
9225 case ::testing::internal::DeathTest::EXECUTE_TEST: { \
9226 ::testing::internal::DeathTest::ReturnSentinel \
9227 gtest_sentinel(gtest_dt); \
9228 GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
9229 gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
9237 GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
9238 fail(::testing::internal::DeathTest::LastMessage())
9239 // The symbol "fail" here expands to something into which a message
9242 // This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
9243 // NDEBUG mode. In this case we need the statements to be executed, the regex is
9244 // ignored, and the macro must accept a streamed message even though the message
9245 // is never printed.
9246 # define GTEST_EXECUTE_STATEMENT_(statement, regex) \
9247 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9248 if (::testing::internal::AlwaysTrue()) { \
9249 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9251 ::testing::Message()
9253 // A class representing the parsed contents of the
9254 // --gtest_internal_run_death_test flag, as it existed when
9255 // RUN_ALL_TESTS was called.
9256 class InternalRunDeathTestFlag {
9258 InternalRunDeathTestFlag(const std::string& a_file,
9262 : file_(a_file), line_(a_line), index_(an_index),
9263 write_fd_(a_write_fd) {}
9265 ~InternalRunDeathTestFlag() {
9267 posix::Close(write_fd_);
9270 const std::string& file() const { return file_; }
9271 int line() const { return line_; }
9272 int index() const { return index_; }
9273 int write_fd() const { return write_fd_; }
9281 GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
9284 // Returns a newly created InternalRunDeathTestFlag object with fields
9285 // initialized from the GTEST_FLAG(internal_run_death_test) flag if
9286 // the flag is specified; otherwise returns NULL.
9287 InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
9289 #else // GTEST_HAS_DEATH_TEST
9291 // This macro is used for implementing macros such as
9292 // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
9293 // death tests are not supported. Those macros must compile on such systems
9294 // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
9295 // systems that support death tests. This allows one to write such a macro
9296 // on a system that does not support death tests and be sure that it will
9297 // compile on a death-test supporting system.
9300 // statement - A statement that a macro such as EXPECT_DEATH would test
9301 // for program termination. This macro has to make sure this
9302 // statement is compiled but not executed, to ensure that
9303 // EXPECT_DEATH_IF_SUPPORTED compiles with a certain
9304 // parameter iff EXPECT_DEATH compiles with it.
9305 // regex - A regex that a macro such as EXPECT_DEATH would use to test
9306 // the output of statement. This parameter has to be
9307 // compiled but not evaluated by this macro, to ensure that
9308 // this macro only accepts expressions that a macro such as
9309 // EXPECT_DEATH would accept.
9310 // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
9311 // and a return statement for ASSERT_DEATH_IF_SUPPORTED.
9312 // This ensures that ASSERT_DEATH_IF_SUPPORTED will not
9313 // compile inside functions where ASSERT_DEATH doesn't
9316 // The branch that has an always false condition is used to ensure that
9317 // statement and regex are compiled (and thus syntactically correct) but
9318 // never executed. The unreachable code macro protects the terminator
9319 // statement from generating an 'unreachable code' warning in case
9320 // statement unconditionally returns or throws. The Message constructor at
9321 // the end allows the syntax of streaming additional messages into the
9322 // macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
9323 # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
9324 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
9325 if (::testing::internal::AlwaysTrue()) { \
9326 GTEST_LOG_(WARNING) \
9327 << "Death tests are not supported on this platform.\n" \
9328 << "Statement '" #statement "' cannot be verified."; \
9329 } else if (::testing::internal::AlwaysFalse()) { \
9330 ::testing::internal::RE::PartialMatch(".*", (regex)); \
9331 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
9334 ::testing::Message()
9336 #endif // GTEST_HAS_DEATH_TEST
9338 } // namespace internal
9339 } // namespace testing
9341 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
9345 // This flag controls the style of death tests. Valid values are "threadsafe",
9346 // meaning that the death test child process will re-execute the test binary
9347 // from the start, running only a single death test, or "fast",
9348 // meaning that the child process will execute the test logic immediately
9350 GTEST_DECLARE_string_(death_test_style);
9352 #if GTEST_HAS_DEATH_TEST
9354 namespace internal {
9356 // Returns a Boolean value indicating whether the caller is currently
9357 // executing in the context of the death test child process. Tools such as
9358 // Valgrind heap checkers may need this to modify their behavior in death
9359 // tests. IMPORTANT: This is an internal utility. Using it may break the
9360 // implementation of death tests. User code MUST NOT use it.
9361 GTEST_API_ bool InDeathTestChild();
9363 } // namespace internal
9365 // The following macros are useful for writing death tests.
9367 // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
9370 // 1. It generates a warning if there is more than one active
9371 // thread. This is because it's safe to fork() or clone() only
9372 // when there is a single thread.
9374 // 2. The parent process clone()s a sub-process and runs the death
9375 // test in it; the sub-process exits with code 0 at the end of the
9376 // death test, if it hasn't exited already.
9378 // 3. The parent process waits for the sub-process to terminate.
9380 // 4. The parent process checks the exit code and error message of
9385 // ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
9386 // for (int i = 0; i < 5; i++) {
9387 // EXPECT_DEATH(server.ProcessRequest(i),
9388 // "Invalid request .* in ProcessRequest()")
9389 // << "Failed to die on request " << i;
9392 // ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
9394 // bool KilledBySIGHUP(int exit_code) {
9395 // return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
9398 // ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
9400 // On the regular expressions used in death tests:
9402 // On POSIX-compliant systems (*nix), we use the <regex.h> library,
9403 // which uses the POSIX extended regex syntax.
9405 // On other platforms (e.g. Windows), we only support a simple regex
9406 // syntax implemented as part of Google Test. This limited
9407 // implementation should be enough most of the time when writing
9408 // death tests; though it lacks many features you can find in PCRE
9409 // or POSIX extended regex syntax. For example, we don't support
9410 // union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
9411 // repetition count ("x{5,7}"), among others.
9413 // Below is the syntax that we do support. We chose it to be a
9414 // subset of both PCRE and POSIX extended regex, so it's easy to
9415 // learn wherever you come from. In the following: 'A' denotes a
9416 // literal character, period (.), or a single \\ escape sequence;
9417 // 'x' and 'y' denote regular expressions; 'm' and 'n' are for
9420 // c matches any literal character c
9421 // \\d matches any decimal digit
9422 // \\D matches any character that's not a decimal digit
9426 // \\s matches any ASCII whitespace, including \n
9427 // \\S matches any character that's not a whitespace
9430 // \\w matches any letter, _, or decimal digit
9431 // \\W matches any character that \\w doesn't match
9432 // \\c matches any literal character c, which must be a punctuation
9433 // . matches any single character except \n
9434 // A? matches 0 or 1 occurrences of A
9435 // A* matches 0 or many occurrences of A
9436 // A+ matches 1 or many occurrences of A
9437 // ^ matches the beginning of a string (not that of each line)
9438 // $ matches the end of a string (not that of each line)
9439 // xy matches x followed by y
9441 // If you accidentally use PCRE or POSIX extended regex features
9442 // not implemented by us, you will get a run-time failure. In that
9443 // case, please try to rewrite your regular expression within the
9446 // This implementation is *not* meant to be as highly tuned or robust
9447 // as a compiled regex library, but should perform well enough for a
9448 // death test, which already incurs significant overhead by launching
9453 // A "threadsafe" style death test obtains the path to the test
9454 // program from argv[0] and re-executes it in the sub-process. For
9455 // simplicity, the current implementation doesn't search the PATH
9456 // when launching the sub-process. This means that the user must
9457 // invoke the test program via a path that contains at least one
9458 // path separator (e.g. path/to/foo_test and
9459 // /absolute/path/to/bar_test are fine, but foo_test is not). This
9460 // is rarely a problem as people usually don't put the test binary
9461 // directory in PATH.
9463 // TODO(wan@google.com): make thread-safe death tests search the PATH.
9465 // Asserts that a given statement causes the program to exit, with an
9466 // integer exit status that satisfies predicate, and emitting error output
9467 // that matches regex.
9468 # define ASSERT_EXIT(statement, predicate, regex) \
9469 GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
9471 // Like ASSERT_EXIT, but continues on to successive tests in the
9472 // test case, if any:
9473 # define EXPECT_EXIT(statement, predicate, regex) \
9474 GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
9476 // Asserts that a given statement causes the program to exit, either by
9477 // explicitly exiting with a nonzero exit code or being killed by a
9478 // signal, and emitting error output that matches regex.
9479 # define ASSERT_DEATH(statement, regex) \
9480 ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
9482 // Like ASSERT_DEATH, but continues on to successive tests in the
9483 // test case, if any:
9484 # define EXPECT_DEATH(statement, regex) \
9485 EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
9487 // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
9489 // Tests that an exit code describes a normal exit with a given exit code.
9490 class GTEST_API_ ExitedWithCode {
9492 explicit ExitedWithCode(int exit_code);
9493 bool operator()(int exit_status) const;
9495 // No implementation - assignment is unsupported.
9496 void operator=(const ExitedWithCode& other);
9498 const int exit_code_;
9501 # if !GTEST_OS_WINDOWS
9502 // Tests that an exit code describes an exit due to termination by a
9504 class GTEST_API_ KilledBySignal {
9506 explicit KilledBySignal(int signum);
9507 bool operator()(int exit_status) const;
9511 # endif // !GTEST_OS_WINDOWS
9513 // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
9514 // The death testing framework causes this to have interesting semantics,
9515 // since the sideeffects of the call are only visible in opt mode, and not
9518 // In practice, this can be used to test functions that utilize the
9519 // LOG(DFATAL) macro using the following style:
9521 // int DieInDebugOr12(int* sideeffect) {
9522 // if (sideeffect) {
9523 // *sideeffect = 12;
9525 // LOG(DFATAL) << "death";
9529 // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
9530 // int sideeffect = 0;
9531 // // Only asserts in dbg.
9532 // EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
9535 // // opt-mode has sideeffect visible.
9536 // EXPECT_EQ(12, sideeffect);
9538 // // dbg-mode no visible sideeffect.
9539 // EXPECT_EQ(0, sideeffect);
9543 // This will assert that DieInDebugReturn12InOpt() crashes in debug
9544 // mode, usually due to a DCHECK or LOG(DFATAL), but returns the
9545 // appropriate fallback value (12 in this case) in opt mode. If you
9546 // need to test that a function has appropriate side-effects in opt
9547 // mode, include assertions against the side-effects. A general
9548 // pattern for this is:
9550 // EXPECT_DEBUG_DEATH({
9551 // // Side-effects here will have an effect after this statement in
9552 // // opt mode, but none in debug mode.
9553 // EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
9558 # define EXPECT_DEBUG_DEATH(statement, regex) \
9559 GTEST_EXECUTE_STATEMENT_(statement, regex)
9561 # define ASSERT_DEBUG_DEATH(statement, regex) \
9562 GTEST_EXECUTE_STATEMENT_(statement, regex)
9566 # define EXPECT_DEBUG_DEATH(statement, regex) \
9567 EXPECT_DEATH(statement, regex)
9569 # define ASSERT_DEBUG_DEATH(statement, regex) \
9570 ASSERT_DEATH(statement, regex)
9572 # endif // NDEBUG for EXPECT_DEBUG_DEATH
9573 #endif // GTEST_HAS_DEATH_TEST
9575 // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
9576 // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
9577 // death tests are supported; otherwise they just issue a warning. This is
9578 // useful when you are combining death test assertions with normal test
9579 // assertions in one test.
9580 #if GTEST_HAS_DEATH_TEST
9581 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
9582 EXPECT_DEATH(statement, regex)
9583 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
9584 ASSERT_DEATH(statement, regex)
9586 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
9587 GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
9588 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
9589 GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
9592 } // namespace testing
9594 #endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
9595 // This file was GENERATED by command:
9596 // pump.py gtest-param-test.h.pump
9597 // DO NOT EDIT BY HAND!!!
9599 // Copyright 2008, Google Inc.
9600 // All rights reserved.
9602 // Redistribution and use in source and binary forms, with or without
9603 // modification, are permitted provided that the following conditions are
9606 // * Redistributions of source code must retain the above copyright
9607 // notice, this list of conditions and the following disclaimer.
9608 // * Redistributions in binary form must reproduce the above
9609 // copyright notice, this list of conditions and the following disclaimer
9610 // in the documentation and/or other materials provided with the
9612 // * Neither the name of Google Inc. nor the names of its
9613 // contributors may be used to endorse or promote products derived from
9614 // this software without specific prior written permission.
9616 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9617 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9618 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9619 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9620 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9621 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9622 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9623 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9624 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9625 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9626 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9628 // Authors: vladl@google.com (Vlad Losev)
9630 // Macros and functions for implementing parameterized tests
9631 // in Google C++ Testing Framework (Google Test)
9633 // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
9635 #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
9636 #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
9639 // Value-parameterized tests allow you to test your code with different
9640 // parameters without writing multiple copies of the same test.
9642 // Here is how you use value-parameterized tests:
9646 // To write value-parameterized tests, first you should define a fixture
9647 // class. It is usually derived from testing::TestWithParam<T> (see below for
9648 // another inheritance scheme that's sometimes useful in more complicated
9649 // class hierarchies), where the type of your parameter values.
9650 // TestWithParam<T> is itself derived from testing::Test. T can be any
9651 // copyable type. If it's a raw pointer, you are responsible for managing the
9652 // lifespan of the pointed values.
9654 class FooTest : public ::testing::TestWithParam<const char*> {
9655 // You can implement all the usual class fixture members here.
9658 // Then, use the TEST_P macro to define as many parameterized tests
9659 // for this fixture as you want. The _P suffix is for "parameterized"
9660 // or "pattern", whichever you prefer to think.
9662 TEST_P(FooTest, DoesBlah) {
9663 // Inside a test, access the test parameter with the GetParam() method
9664 // of the TestWithParam<T> class:
9665 EXPECT_TRUE(foo.Blah(GetParam()));
9669 TEST_P(FooTest, HasBlahBlah) {
9673 // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
9674 // case with any set of parameters you want. Google Test defines a number
9675 // of functions for generating test parameters. They return what we call
9676 // (surprise!) parameter generators. Here is a summary of them, which
9677 // are all in the testing namespace:
9680 // Range(begin, end [, step]) - Yields values {begin, begin+step,
9681 // begin+step+step, ...}. The values do not
9682 // include end. step defaults to 1.
9683 // Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
9684 // ValuesIn(container) - Yields values from a C-style array, an STL
9685 // ValuesIn(begin,end) container, or an iterator range [begin, end).
9686 // Bool() - Yields sequence {false, true}.
9687 // Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
9688 // for the math savvy) of the values generated
9689 // by the N generators.
9691 // For more details, see comments at the definitions of these functions below
9694 // The following statement will instantiate tests from the FooTest test case
9695 // each with parameter values "meeny", "miny", and "moe".
9697 INSTANTIATE_TEST_CASE_P(InstantiationName,
9699 Values("meeny", "miny", "moe"));
9701 // To distinguish different instances of the pattern, (yes, you
9702 // can instantiate it more then once) the first argument to the
9703 // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
9704 // actual test case name. Remember to pick unique prefixes for different
9705 // instantiations. The tests from the instantiation above will have
9708 // * InstantiationName/FooTest.DoesBlah/0 for "meeny"
9709 // * InstantiationName/FooTest.DoesBlah/1 for "miny"
9710 // * InstantiationName/FooTest.DoesBlah/2 for "moe"
9711 // * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
9712 // * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
9713 // * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
9715 // You can use these names in --gtest_filter.
9717 // This statement will instantiate all tests from FooTest again, each
9718 // with parameter values "cat" and "dog":
9720 const char* pets[] = {"cat", "dog"};
9721 INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
9723 // The tests from the instantiation above will have these names:
9725 // * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
9726 // * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
9727 // * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
9728 // * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
9730 // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
9731 // in the given test case, whether their definitions come before or
9732 // AFTER the INSTANTIATE_TEST_CASE_P statement.
9734 // Please also note that generator expressions (including parameters to the
9735 // generators) are evaluated in InitGoogleTest(), after main() has started.
9736 // This allows the user on one hand, to adjust generator parameters in order
9737 // to dynamically determine a set of tests to run and on the other hand,
9738 // give the user a chance to inspect the generated tests with Google Test
9739 // reflection API before RUN_ALL_TESTS() is executed.
9741 // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
9742 // for more examples.
9744 // In the future, we plan to publish the API for defining new parameter
9745 // generators. But for now this interface remains part of the internal
9746 // implementation and is subject to change.
9749 // A parameterized test fixture must be derived from testing::Test and from
9750 // testing::WithParamInterface<T>, where T is the type of the parameter
9751 // values. Inheriting from TestWithParam<T> satisfies that requirement because
9752 // TestWithParam<T> inherits from both Test and WithParamInterface. In more
9753 // complicated hierarchies, however, it is occasionally useful to inherit
9754 // separately from Test and WithParamInterface. For example:
9756 class BaseTest : public ::testing::Test {
9757 // You can inherit all the usual members for a non-parameterized test
9761 class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
9762 // The usual test fixture members go here too.
9765 TEST_F(BaseTest, HasFoo) {
9766 // This is an ordinary non-parameterized test.
9769 TEST_P(DerivedTest, DoesBlah) {
9770 // GetParam works just the same here as if you inherit from TestWithParam.
9771 EXPECT_TRUE(foo.Blah(GetParam()));
9777 #if !GTEST_OS_SYMBIAN
9781 // scripts/fuse_gtest.py depends on gtest's own header being #included
9782 // *unconditionally*. Therefore these #includes cannot be moved
9783 // inside #if GTEST_HAS_PARAM_TEST.
9784 // Copyright 2008 Google Inc.
9785 // All Rights Reserved.
9787 // Redistribution and use in source and binary forms, with or without
9788 // modification, are permitted provided that the following conditions are
9791 // * Redistributions of source code must retain the above copyright
9792 // notice, this list of conditions and the following disclaimer.
9793 // * Redistributions in binary form must reproduce the above
9794 // copyright notice, this list of conditions and the following disclaimer
9795 // in the documentation and/or other materials provided with the
9797 // * Neither the name of Google Inc. nor the names of its
9798 // contributors may be used to endorse or promote products derived from
9799 // this software without specific prior written permission.
9801 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9802 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9803 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9804 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9805 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9806 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9807 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9808 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9809 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9810 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9811 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9813 // Author: vladl@google.com (Vlad Losev)
9815 // Type and function utilities for implementing parameterized tests.
9817 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
9818 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
9827 // scripts/fuse_gtest.py depends on gtest's own header being #included
9828 // *unconditionally*. Therefore these #includes cannot be moved
9829 // inside #if GTEST_HAS_PARAM_TEST.
9830 // Copyright 2003 Google Inc.
9831 // All rights reserved.
9833 // Redistribution and use in source and binary forms, with or without
9834 // modification, are permitted provided that the following conditions are
9837 // * Redistributions of source code must retain the above copyright
9838 // notice, this list of conditions and the following disclaimer.
9839 // * Redistributions in binary form must reproduce the above
9840 // copyright notice, this list of conditions and the following disclaimer
9841 // in the documentation and/or other materials provided with the
9843 // * Neither the name of Google Inc. nor the names of its
9844 // contributors may be used to endorse or promote products derived from
9845 // this software without specific prior written permission.
9847 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9848 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9849 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9850 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9851 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9852 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9853 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9854 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9855 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9856 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9857 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9859 // Authors: Dan Egnor (egnor@google.com)
9861 // A "smart" pointer type with reference tracking. Every pointer to a
9862 // particular object is kept on a circular linked list. When the last pointer
9863 // to an object is destroyed or reassigned, the object is deleted.
9865 // Used properly, this deletes the object when the last reference goes away.
9866 // There are several caveats:
9867 // - Like all reference counting schemes, cycles lead to leaks.
9868 // - Each smart pointer is actually two pointers (8 bytes instead of 4).
9869 // - Every time a pointer is assigned, the entire list of pointers to that
9870 // object is traversed. This class is therefore NOT SUITABLE when there
9871 // will often be more than two or three pointers to a particular object.
9872 // - References are only tracked as long as linked_ptr<> objects are copied.
9873 // If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
9874 // will happen (double deletion).
9876 // A good use of this class is storing object references in STL containers.
9877 // You can safely put linked_ptr<> in a vector<>.
9878 // Other uses may not be as good.
9880 // Note: If you use an incomplete type with linked_ptr<>, the class
9881 // *containing* linked_ptr<> must have a constructor and destructor (even
9882 // if they do nothing!).
9884 // Bill Gibbons suggested we use something like this.
9887 // Unlike other linked_ptr implementations, in this implementation
9888 // a linked_ptr object is thread-safe in the sense that:
9889 // - it's safe to copy linked_ptr objects concurrently,
9890 // - it's safe to copy *from* a linked_ptr and read its underlying
9891 // raw pointer (e.g. via get()) concurrently, and
9892 // - it's safe to write to two linked_ptrs that point to the same
9893 // shared object concurrently.
9894 // TODO(wan@google.com): rename this to safe_linked_ptr to avoid
9895 // confusion with normal linked_ptr.
9897 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9898 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9905 namespace internal {
9907 // Protects copying of all linked_ptr objects.
9908 GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
9910 // This is used internally by all instances of linked_ptr<>. It needs to be
9911 // a non-template class because different types of linked_ptr<> can refer to
9912 // the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
9913 // So, it needs to be possible for different types of linked_ptr to participate
9914 // in the same circular linked list, so we need a single class type here.
9916 // DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr<T>.
9917 class linked_ptr_internal {
9919 // Create a new circle that includes only this instance.
9924 // Many linked_ptr operations may change p.link_ for some linked_ptr
9925 // variable p in the same circle as this object. Therefore we need
9926 // to prevent two such operations from occurring concurrently.
9928 // Note that different types of linked_ptr objects can coexist in a
9929 // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
9930 // linked_ptr<Derived2>). Therefore we must use a single mutex to
9931 // protect all linked_ptr objects. This can create serious
9932 // contention in production code, but is acceptable in a testing
9935 // Join an existing circle.
9936 void join(linked_ptr_internal const* ptr)
9937 GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
9938 MutexLock lock(&g_linked_ptr_mutex);
9940 linked_ptr_internal const* p = ptr;
9941 while (p->next_ != ptr) {
9942 assert(p->next_ != this &&
9943 "Trying to join() a linked ring we are already in. "
9944 "Is GMock thread safety enabled?");
9951 // Leave whatever circle we're part of. Returns true if we were the
9952 // last member of the circle. Once this is done, you can join() another.
9954 GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
9955 MutexLock lock(&g_linked_ptr_mutex);
9957 if (next_ == this) return true;
9958 linked_ptr_internal const* p = next_;
9959 while (p->next_ != this) {
9960 assert(p->next_ != next_ &&
9961 "Trying to depart() a linked ring we are not in. "
9962 "Is GMock thread safety enabled?");
9970 mutable linked_ptr_internal const* next_;
9973 template <typename T>
9976 typedef T element_type;
9978 // Take over ownership of a raw pointer. This should happen as soon as
9979 // possible after the object is created.
9980 explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
9981 ~linked_ptr() { depart(); }
9983 // Copy an existing linked_ptr<>, adding ourselves to the list of references.
9984 template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
9985 linked_ptr(linked_ptr const& ptr) { // NOLINT
9986 assert(&ptr != this);
9990 // Assignment releases the old value and acquires the new.
9991 template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
9997 linked_ptr& operator=(linked_ptr const& ptr) {
10005 // Smart pointer members.
10006 void reset(T* ptr = NULL) {
10010 T* get() const { return value_; }
10011 T* operator->() const { return value_; }
10012 T& operator*() const { return *value_; }
10014 bool operator==(T* p) const { return value_ == p; }
10015 bool operator!=(T* p) const { return value_ != p; }
10016 template <typename U>
10017 bool operator==(linked_ptr<U> const& ptr) const {
10018 return value_ == ptr.get();
10020 template <typename U>
10021 bool operator!=(linked_ptr<U> const& ptr) const {
10022 return value_ != ptr.get();
10026 template <typename U>
10027 friend class linked_ptr;
10030 linked_ptr_internal link_;
10033 if (link_.depart()) delete value_;
10036 void capture(T* ptr) {
10041 template <typename U> void copy(linked_ptr<U> const* ptr) {
10042 value_ = ptr->get();
10044 link_.join(&ptr->link_);
10050 template<typename T> inline
10051 bool operator==(T* ptr, const linked_ptr<T>& x) {
10052 return ptr == x.get();
10055 template<typename T> inline
10056 bool operator!=(T* ptr, const linked_ptr<T>& x) {
10057 return ptr != x.get();
10060 // A function to convert T* into linked_ptr<T>
10061 // Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
10062 // for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
10063 template <typename T>
10064 linked_ptr<T> make_linked_ptr(T* ptr) {
10065 return linked_ptr<T>(ptr);
10068 } // namespace internal
10069 } // namespace testing
10071 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
10072 // Copyright 2007, Google Inc.
10073 // All rights reserved.
10075 // Redistribution and use in source and binary forms, with or without
10076 // modification, are permitted provided that the following conditions are
10079 // * Redistributions of source code must retain the above copyright
10080 // notice, this list of conditions and the following disclaimer.
10081 // * Redistributions in binary form must reproduce the above
10082 // copyright notice, this list of conditions and the following disclaimer
10083 // in the documentation and/or other materials provided with the
10085 // * Neither the name of Google Inc. nor the names of its
10086 // contributors may be used to endorse or promote products derived from
10087 // this software without specific prior written permission.
10089 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10090 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10091 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10092 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10093 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10094 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10095 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10096 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
10097 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10098 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
10099 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10101 // Author: wan@google.com (Zhanyong Wan)
10103 // Google Test - The Google C++ Testing Framework
10105 // This file implements a universal value printer that can print a
10106 // value of any type T:
10108 // void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
10110 // A user can teach this function how to print a class type T by
10111 // defining either operator<<() or PrintTo() in the namespace that
10112 // defines T. More specifically, the FIRST defined function in the
10113 // following list will be used (assuming T is defined in namespace
10116 // 1. foo::PrintTo(const T&, ostream*)
10117 // 2. operator<<(ostream&, const T&) defined in either foo or the
10118 // global namespace.
10120 // If none of the above is defined, it will print the debug string of
10121 // the value if it is a protocol buffer, or print the raw bytes in the
10122 // value otherwise.
10124 // To aid debugging: when T is a reference type, the address of the
10125 // value is also printed; when T is a (const) char pointer, both the
10126 // pointer value and the NUL-terminated string it points to are
10129 // We also provide some convenient wrappers:
10131 // // Prints a value to a string. For a (const or not) char
10132 // // pointer, the NUL-terminated string (but not the pointer) is
10134 // std::string ::testing::PrintToString(const T& value);
10136 // // Prints a value tersely: for a reference type, the referenced
10137 // // value (but not the address) is printed; for a (const or not) char
10138 // // pointer, the NUL-terminated string (but not the pointer) is
10140 // void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
10142 // // Prints value using the type inferred by the compiler. The difference
10143 // // from UniversalTersePrint() is that this function prints both the
10144 // // pointer and the NUL-terminated string for a (const or not) char pointer.
10145 // void ::testing::internal::UniversalPrint(const T& value, ostream*);
10147 // // Prints the fields of a tuple tersely to a string vector, one
10148 // // element for each field. Tuple support must be enabled in
10149 // // gtest-port.h.
10150 // std::vector<string> UniversalTersePrintTupleFieldsToStrings(
10151 // const Tuple& value);
10153 // Known limitation:
10155 // The print primitives print the elements of an STL-style container
10156 // using the compiler-inferred type of *iter where iter is a
10157 // const_iterator of the container. When const_iterator is an input
10158 // iterator but not a forward iterator, this inferred type may not
10159 // match value_type, and the print output may be incorrect. In
10160 // practice, this is rarely a problem as for most containers
10161 // const_iterator is a forward iterator. We'll fix this if there's an
10162 // actual need for it. Note that this fix cannot rely on value_type
10163 // being defined as many user-defined container types don't have
10166 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
10167 #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
10169 #include <ostream> // NOLINT
10175 #if GTEST_HAS_STD_TUPLE_
10179 namespace testing {
10181 // Definitions in the 'internal' and 'internal2' name spaces are
10182 // subject to change without notice. DO NOT USE THEM IN USER CODE!
10183 namespace internal2 {
10185 // Prints the given number of bytes in the given object to the given
10187 GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
10189 ::std::ostream* os);
10191 // For selecting which printer to use when a given type has neither <<
10194 kProtobuf, // a protobuf type
10195 kConvertibleToInteger, // a type implicitly convertible to BiggestInt
10196 // (e.g. a named or unnamed enum type)
10197 kOtherType // anything else
10200 // TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
10201 // by the universal printer to print a value of type T when neither
10202 // operator<< nor PrintTo() is defined for T, where kTypeKind is the
10203 // "kind" of T as defined by enum TypeKind.
10204 template <typename T, TypeKind kTypeKind>
10205 class TypeWithoutFormatter {
10207 // This default version is called when kTypeKind is kOtherType.
10208 static void PrintValue(const T& value, ::std::ostream* os) {
10209 PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
10210 sizeof(value), os);
10214 // We print a protobuf using its ShortDebugString() when the string
10215 // doesn't exceed this many characters; otherwise we print it using
10216 // DebugString() for better readability.
10217 const size_t kProtobufOneLinerMaxLength = 50;
10219 template <typename T>
10220 class TypeWithoutFormatter<T, kProtobuf> {
10222 static void PrintValue(const T& value, ::std::ostream* os) {
10223 const ::testing::internal::string short_str = value.ShortDebugString();
10224 const ::testing::internal::string pretty_str =
10225 short_str.length() <= kProtobufOneLinerMaxLength ?
10226 short_str : ("\n" + value.DebugString());
10227 *os << ("<" + pretty_str + ">");
10231 template <typename T>
10232 class TypeWithoutFormatter<T, kConvertibleToInteger> {
10234 // Since T has no << operator or PrintTo() but can be implicitly
10235 // converted to BiggestInt, we print it as a BiggestInt.
10237 // Most likely T is an enum type (either named or unnamed), in which
10238 // case printing it as an integer is the desired behavior. In case
10239 // T is not an enum, printing it as an integer is the best we can do
10240 // given that it has no user-defined printer.
10241 static void PrintValue(const T& value, ::std::ostream* os) {
10242 const internal::BiggestInt kBigInt = value;
10247 // Prints the given value to the given ostream. If the value is a
10248 // protocol message, its debug string is printed; if it's an enum or
10249 // of a type implicitly convertible to BiggestInt, it's printed as an
10250 // integer; otherwise the bytes in the value are printed. This is
10251 // what UniversalPrinter<T>::Print() does when it knows nothing about
10252 // type T and T has neither << operator nor PrintTo().
10254 // A user can override this behavior for a class type Foo by defining
10255 // a << operator in the namespace where Foo is defined.
10257 // We put this operator in namespace 'internal2' instead of 'internal'
10258 // to simplify the implementation, as much code in 'internal' needs to
10259 // use << in STL, which would conflict with our own << were it defined
10262 // Note that this operator<< takes a generic std::basic_ostream<Char,
10263 // CharTraits> type instead of the more restricted std::ostream. If
10264 // we define it to take an std::ostream instead, we'll get an
10265 // "ambiguous overloads" compiler error when trying to print a type
10266 // Foo that supports streaming to std::basic_ostream<Char,
10267 // CharTraits>, as the compiler cannot tell whether
10268 // operator<<(std::ostream&, const T&) or
10269 // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
10271 template <typename Char, typename CharTraits, typename T>
10272 ::std::basic_ostream<Char, CharTraits>& operator<<(
10273 ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
10274 TypeWithoutFormatter<T,
10275 (internal::IsAProtocolMessage<T>::value ? kProtobuf :
10276 internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
10277 kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
10281 } // namespace internal2
10282 } // namespace testing
10284 // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
10285 // magic needed for implementing UniversalPrinter won't work.
10286 namespace testing_internal {
10288 // Used to print a value that is not an STL-style container when the
10289 // user doesn't define PrintTo() for it.
10290 template <typename T>
10291 void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
10292 // With the following statement, during unqualified name lookup,
10293 // testing::internal2::operator<< appears as if it was declared in
10294 // the nearest enclosing namespace that contains both
10295 // ::testing_internal and ::testing::internal2, i.e. the global
10296 // namespace. For more details, refer to the C++ Standard section
10297 // 7.3.4-1 [namespace.udir]. This allows us to fall back onto
10298 // testing::internal2::operator<< in case T doesn't come with a <<
10301 // We cannot write 'using ::testing::internal2::operator<<;', which
10302 // gcc 3.3 fails to compile due to a compiler bug.
10303 using namespace ::testing::internal2; // NOLINT
10305 // Assuming T is defined in namespace foo, in the next statement,
10306 // the compiler will consider all of:
10308 // 1. foo::operator<< (thanks to Koenig look-up),
10309 // 2. ::operator<< (as the current namespace is enclosed in ::),
10310 // 3. testing::internal2::operator<< (thanks to the using statement above).
10312 // The operator<< whose type matches T best will be picked.
10314 // We deliberately allow #2 to be a candidate, as sometimes it's
10315 // impossible to define #1 (e.g. when foo is ::std, defining
10316 // anything in it is undefined behavior unless you are a compiler
10321 } // namespace testing_internal
10323 namespace testing {
10324 namespace internal {
10326 // FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
10327 // value of type ToPrint that is an operand of a comparison assertion
10328 // (e.g. ASSERT_EQ). OtherOperand is the type of the other operand in
10329 // the comparison, and is used to help determine the best way to
10330 // format the value. In particular, when the value is a C string
10331 // (char pointer) and the other operand is an STL string object, we
10332 // want to format the C string as a string, since we know it is
10333 // compared by value with the string object. If the value is a char
10334 // pointer but the other operand is not an STL string object, we don't
10335 // know whether the pointer is supposed to point to a NUL-terminated
10336 // string, and thus want to print it as a pointer to be safe.
10338 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
10340 // The default case.
10341 template <typename ToPrint, typename OtherOperand>
10342 class FormatForComparison {
10344 static ::std::string Format(const ToPrint& value) {
10345 return ::testing::PrintToString(value);
10350 template <typename ToPrint, size_t N, typename OtherOperand>
10351 class FormatForComparison<ToPrint[N], OtherOperand> {
10353 static ::std::string Format(const ToPrint* value) {
10354 return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
10358 // By default, print C string as pointers to be safe, as we don't know
10359 // whether they actually point to a NUL-terminated string.
10361 #define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \
10362 template <typename OtherOperand> \
10363 class FormatForComparison<CharType*, OtherOperand> { \
10365 static ::std::string Format(CharType* value) { \
10366 return ::testing::PrintToString(static_cast<const void*>(value)); \
10370 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
10371 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
10372 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
10373 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
10375 #undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
10377 // If a C string is compared with an STL string object, we know it's meant
10378 // to point to a NUL-terminated string, and thus can print it as a string.
10380 #define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
10382 class FormatForComparison<CharType*, OtherStringType> { \
10384 static ::std::string Format(CharType* value) { \
10385 return ::testing::PrintToString(value); \
10389 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
10390 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
10392 #if GTEST_HAS_GLOBAL_STRING
10393 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
10394 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
10397 #if GTEST_HAS_GLOBAL_WSTRING
10398 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
10399 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
10402 #if GTEST_HAS_STD_WSTRING
10403 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
10404 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
10407 #undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
10409 // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
10410 // operand to be used in a failure message. The type (but not value)
10411 // of the other operand may affect the format. This allows us to
10412 // print a char* as a raw pointer when it is compared against another
10413 // char* or void*, and print it as a C string when it is compared
10414 // against an std::string object, for example.
10416 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
10417 template <typename T1, typename T2>
10418 std::string FormatForComparisonFailureMessage(
10419 const T1& value, const T2& /* other_operand */) {
10420 return FormatForComparison<T1, T2>::Format(value);
10423 // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
10424 // value to the given ostream. The caller must ensure that
10425 // 'ostream_ptr' is not NULL, or the behavior is undefined.
10427 // We define UniversalPrinter as a class template (as opposed to a
10428 // function template), as we need to partially specialize it for
10429 // reference types, which cannot be done with function templates.
10430 template <typename T>
10431 class UniversalPrinter;
10433 template <typename T>
10434 void UniversalPrint(const T& value, ::std::ostream* os);
10436 // Used to print an STL-style container when the user doesn't define
10437 // a PrintTo() for it.
10438 template <typename C>
10439 void DefaultPrintTo(IsContainer /* dummy */,
10440 false_type /* is not a pointer */,
10441 const C& container, ::std::ostream* os) {
10442 const size_t kMaxCount = 32; // The maximum number of elements to print.
10445 for (typename C::const_iterator it = container.begin();
10446 it != container.end(); ++it, ++count) {
10449 if (count == kMaxCount) { // Enough has been printed.
10455 // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
10456 // handle *it being a native array.
10457 internal::UniversalPrint(*it, os);
10466 // Used to print a pointer that is neither a char pointer nor a member
10467 // pointer, when the user doesn't define PrintTo() for it. (A member
10468 // variable pointer or member function pointer doesn't really point to
10469 // a location in the address space. Their representation is
10470 // implementation-defined. Therefore they will be printed as raw
10472 template <typename T>
10473 void DefaultPrintTo(IsNotContainer /* dummy */,
10474 true_type /* is a pointer */,
10475 T* p, ::std::ostream* os) {
10479 // C++ doesn't allow casting from a function pointer to any object
10482 // IsTrue() silences warnings: "Condition is always true",
10483 // "unreachable code".
10484 if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
10485 // T is not a function type. We just call << to print p,
10486 // relying on ADL to pick up user-defined << for their pointer
10490 // T is a function type, so '*os << p' doesn't do what we want
10491 // (it just prints p as bool). We want to print p as a const
10492 // void*. However, we cannot cast it to const void* directly,
10493 // even using reinterpret_cast, as earlier versions of gcc
10494 // (e.g. 3.4.5) cannot compile the cast when p is a function
10495 // pointer. Casting to UInt64 first solves the problem.
10496 *os << reinterpret_cast<const void*>(
10497 reinterpret_cast<internal::UInt64>(p));
10502 // Used to print a non-container, non-pointer value when the user
10503 // doesn't define PrintTo() for it.
10504 template <typename T>
10505 void DefaultPrintTo(IsNotContainer /* dummy */,
10506 false_type /* is not a pointer */,
10507 const T& value, ::std::ostream* os) {
10508 ::testing_internal::DefaultPrintNonContainerTo(value, os);
10511 // Prints the given value using the << operator if it has one;
10512 // otherwise prints the bytes in it. This is what
10513 // UniversalPrinter<T>::Print() does when PrintTo() is not specialized
10514 // or overloaded for type T.
10516 // A user can override this behavior for a class type Foo by defining
10517 // an overload of PrintTo() in the namespace where Foo is defined. We
10518 // give the user this option as sometimes defining a << operator for
10519 // Foo is not desirable (e.g. the coding style may prevent doing it,
10520 // or there is already a << operator but it doesn't do what the user
10522 template <typename T>
10523 void PrintTo(const T& value, ::std::ostream* os) {
10524 // DefaultPrintTo() is overloaded. The type of its first two
10525 // arguments determine which version will be picked. If T is an
10526 // STL-style container, the version for container will be called; if
10527 // T is a pointer, the pointer version will be called; otherwise the
10528 // generic version will be called.
10530 // Note that we check for container types here, prior to we check
10531 // for protocol message types in our operator<<. The rationale is:
10533 // For protocol messages, we want to give people a chance to
10534 // override Google Mock's format by defining a PrintTo() or
10535 // operator<<. For STL containers, other formats can be
10536 // incompatible with Google Mock's format for the container
10537 // elements; therefore we check for container types here to ensure
10538 // that our format is used.
10540 // The second argument of DefaultPrintTo() is needed to bypass a bug
10541 // in Symbian's C++ compiler that prevents it from picking the right
10542 // overload between:
10544 // PrintTo(const T& x, ...);
10545 // PrintTo(T* x, ...);
10546 DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
10549 // The following list of PrintTo() overloads tells
10550 // UniversalPrinter<T>::Print() how to print standard types (built-in
10551 // types, strings, plain arrays, and pointers).
10553 // Overloads for various char types.
10554 GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
10555 GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
10556 inline void PrintTo(char c, ::std::ostream* os) {
10557 // When printing a plain char, we always treat it as unsigned. This
10558 // way, the output won't be affected by whether the compiler thinks
10559 // char is signed or not.
10560 PrintTo(static_cast<unsigned char>(c), os);
10563 // Overloads for other simple built-in types.
10564 inline void PrintTo(bool x, ::std::ostream* os) {
10565 *os << (x ? "true" : "false");
10568 // Overload for wchar_t type.
10569 // Prints a wchar_t as a symbol if it is printable or as its internal
10570 // code otherwise and also as its decimal code (except for L'\0').
10571 // The L'\0' char is printed as "L'\\0'". The decimal code is printed
10572 // as signed integer when wchar_t is implemented by the compiler
10573 // as a signed type and is printed as an unsigned integer when wchar_t
10574 // is implemented as an unsigned type.
10575 GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
10577 // Overloads for C strings.
10578 GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
10579 inline void PrintTo(char* s, ::std::ostream* os) {
10580 PrintTo(ImplicitCast_<const char*>(s), os);
10583 // signed/unsigned char is often used for representing binary data, so
10584 // we print pointers to it as void* to be safe.
10585 inline void PrintTo(const signed char* s, ::std::ostream* os) {
10586 PrintTo(ImplicitCast_<const void*>(s), os);
10588 inline void PrintTo(signed char* s, ::std::ostream* os) {
10589 PrintTo(ImplicitCast_<const void*>(s), os);
10591 inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
10592 PrintTo(ImplicitCast_<const void*>(s), os);
10594 inline void PrintTo(unsigned char* s, ::std::ostream* os) {
10595 PrintTo(ImplicitCast_<const void*>(s), os);
10598 // MSVC can be configured to define wchar_t as a typedef of unsigned
10599 // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
10600 // type. When wchar_t is a typedef, defining an overload for const
10601 // wchar_t* would cause unsigned short* be printed as a wide string,
10602 // possibly causing invalid memory accesses.
10603 #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
10604 // Overloads for wide C strings
10605 GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
10606 inline void PrintTo(wchar_t* s, ::std::ostream* os) {
10607 PrintTo(ImplicitCast_<const wchar_t*>(s), os);
10611 // Overload for C arrays. Multi-dimensional arrays are printed
10614 // Prints the given number of elements in an array, without printing
10615 // the curly braces.
10616 template <typename T>
10617 void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
10618 UniversalPrint(a[0], os);
10619 for (size_t i = 1; i != count; i++) {
10621 UniversalPrint(a[i], os);
10625 // Overloads for ::string and ::std::string.
10626 #if GTEST_HAS_GLOBAL_STRING
10627 GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
10628 inline void PrintTo(const ::string& s, ::std::ostream* os) {
10629 PrintStringTo(s, os);
10631 #endif // GTEST_HAS_GLOBAL_STRING
10633 GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
10634 inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
10635 PrintStringTo(s, os);
10638 // Overloads for ::wstring and ::std::wstring.
10639 #if GTEST_HAS_GLOBAL_WSTRING
10640 GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
10641 inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
10642 PrintWideStringTo(s, os);
10644 #endif // GTEST_HAS_GLOBAL_WSTRING
10646 #if GTEST_HAS_STD_WSTRING
10647 GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
10648 inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
10649 PrintWideStringTo(s, os);
10651 #endif // GTEST_HAS_STD_WSTRING
10653 #if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
10654 // Helper function for printing a tuple. T must be instantiated with
10656 template <typename T>
10657 void PrintTupleTo(const T& t, ::std::ostream* os);
10658 #endif // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
10660 #if GTEST_HAS_TR1_TUPLE
10661 // Overload for ::std::tr1::tuple. Needed for printing function arguments,
10662 // which are packed as tuples.
10664 // Overloaded PrintTo() for tuples of various arities. We support
10665 // tuples of up-to 10 fields. The following implementation works
10666 // regardless of whether tr1::tuple is implemented using the
10667 // non-standard variadic template feature or not.
10669 inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
10670 PrintTupleTo(t, os);
10673 template <typename T1>
10674 void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
10675 PrintTupleTo(t, os);
10678 template <typename T1, typename T2>
10679 void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
10680 PrintTupleTo(t, os);
10683 template <typename T1, typename T2, typename T3>
10684 void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
10685 PrintTupleTo(t, os);
10688 template <typename T1, typename T2, typename T3, typename T4>
10689 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
10690 PrintTupleTo(t, os);
10693 template <typename T1, typename T2, typename T3, typename T4, typename T5>
10694 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
10695 ::std::ostream* os) {
10696 PrintTupleTo(t, os);
10699 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10701 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
10702 ::std::ostream* os) {
10703 PrintTupleTo(t, os);
10706 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10707 typename T6, typename T7>
10708 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
10709 ::std::ostream* os) {
10710 PrintTupleTo(t, os);
10713 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10714 typename T6, typename T7, typename T8>
10715 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
10716 ::std::ostream* os) {
10717 PrintTupleTo(t, os);
10720 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10721 typename T6, typename T7, typename T8, typename T9>
10722 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
10723 ::std::ostream* os) {
10724 PrintTupleTo(t, os);
10727 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10728 typename T6, typename T7, typename T8, typename T9, typename T10>
10730 const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
10731 ::std::ostream* os) {
10732 PrintTupleTo(t, os);
10734 #endif // GTEST_HAS_TR1_TUPLE
10736 #if GTEST_HAS_STD_TUPLE_
10737 template <typename... Types>
10738 void PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) {
10739 PrintTupleTo(t, os);
10741 #endif // GTEST_HAS_STD_TUPLE_
10743 // Overload for std::pair.
10744 template <typename T1, typename T2>
10745 void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
10747 // We cannot use UniversalPrint(value.first, os) here, as T1 may be
10748 // a reference type. The same for printing value.second.
10749 UniversalPrinter<T1>::Print(value.first, os);
10751 UniversalPrinter<T2>::Print(value.second, os);
10755 // Implements printing a non-reference type T by letting the compiler
10756 // pick the right overload of PrintTo() for T.
10757 template <typename T>
10758 class UniversalPrinter {
10760 // MSVC warns about adding const to a function type, so we want to
10761 // disable the warning.
10762 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
10764 // Note: we deliberately don't call this PrintTo(), as that name
10765 // conflicts with ::testing::internal::PrintTo in the body of the
10767 static void Print(const T& value, ::std::ostream* os) {
10768 // By default, ::testing::internal::PrintTo() is used for printing
10771 // Thanks to Koenig look-up, if T is a class and has its own
10772 // PrintTo() function defined in its namespace, that function will
10773 // be visible here. Since it is more specific than the generic ones
10774 // in ::testing::internal, it will be picked by the compiler in the
10775 // following statement - exactly what we want.
10776 PrintTo(value, os);
10779 GTEST_DISABLE_MSC_WARNINGS_POP_()
10782 // UniversalPrintArray(begin, len, os) prints an array of 'len'
10783 // elements, starting at address 'begin'.
10784 template <typename T>
10785 void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
10790 const size_t kThreshold = 18;
10791 const size_t kChunkSize = 8;
10792 // If the array has more than kThreshold elements, we'll have to
10793 // omit some details by printing only the first and the last
10794 // kChunkSize elements.
10795 // TODO(wan@google.com): let the user control the threshold using a flag.
10796 if (len <= kThreshold) {
10797 PrintRawArrayTo(begin, len, os);
10799 PrintRawArrayTo(begin, kChunkSize, os);
10801 PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
10806 // This overload prints a (const) char array compactly.
10807 GTEST_API_ void UniversalPrintArray(
10808 const char* begin, size_t len, ::std::ostream* os);
10810 // This overload prints a (const) wchar_t array compactly.
10811 GTEST_API_ void UniversalPrintArray(
10812 const wchar_t* begin, size_t len, ::std::ostream* os);
10814 // Implements printing an array type T[N].
10815 template <typename T, size_t N>
10816 class UniversalPrinter<T[N]> {
10818 // Prints the given array, omitting some elements when there are too
10820 static void Print(const T (&a)[N], ::std::ostream* os) {
10821 UniversalPrintArray(a, N, os);
10825 // Implements printing a reference type T&.
10826 template <typename T>
10827 class UniversalPrinter<T&> {
10829 // MSVC warns about adding const to a function type, so we want to
10830 // disable the warning.
10831 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
10833 static void Print(const T& value, ::std::ostream* os) {
10834 // Prints the address of the value. We use reinterpret_cast here
10835 // as static_cast doesn't compile when T is a function type.
10836 *os << "@" << reinterpret_cast<const void*>(&value) << " ";
10838 // Then prints the value itself.
10839 UniversalPrint(value, os);
10842 GTEST_DISABLE_MSC_WARNINGS_POP_()
10845 // Prints a value tersely: for a reference type, the referenced value
10846 // (but not the address) is printed; for a (const) char pointer, the
10847 // NUL-terminated string (but not the pointer) is printed.
10849 template <typename T>
10850 class UniversalTersePrinter {
10852 static void Print(const T& value, ::std::ostream* os) {
10853 UniversalPrint(value, os);
10856 template <typename T>
10857 class UniversalTersePrinter<T&> {
10859 static void Print(const T& value, ::std::ostream* os) {
10860 UniversalPrint(value, os);
10863 template <typename T, size_t N>
10864 class UniversalTersePrinter<T[N]> {
10866 static void Print(const T (&value)[N], ::std::ostream* os) {
10867 UniversalPrinter<T[N]>::Print(value, os);
10871 class UniversalTersePrinter<const char*> {
10873 static void Print(const char* str, ::std::ostream* os) {
10877 UniversalPrint(string(str), os);
10882 class UniversalTersePrinter<char*> {
10884 static void Print(char* str, ::std::ostream* os) {
10885 UniversalTersePrinter<const char*>::Print(str, os);
10889 #if GTEST_HAS_STD_WSTRING
10891 class UniversalTersePrinter<const wchar_t*> {
10893 static void Print(const wchar_t* str, ::std::ostream* os) {
10897 UniversalPrint(::std::wstring(str), os);
10904 class UniversalTersePrinter<wchar_t*> {
10906 static void Print(wchar_t* str, ::std::ostream* os) {
10907 UniversalTersePrinter<const wchar_t*>::Print(str, os);
10911 template <typename T>
10912 void UniversalTersePrint(const T& value, ::std::ostream* os) {
10913 UniversalTersePrinter<T>::Print(value, os);
10916 // Prints a value using the type inferred by the compiler. The
10917 // difference between this and UniversalTersePrint() is that for a
10918 // (const) char pointer, this prints both the pointer and the
10919 // NUL-terminated string.
10920 template <typename T>
10921 void UniversalPrint(const T& value, ::std::ostream* os) {
10922 // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
10923 // UniversalPrinter with T directly.
10925 UniversalPrinter<T1>::Print(value, os);
10928 typedef ::std::vector<string> Strings;
10930 // TuplePolicy<TupleT> must provide:
10932 // size of tuple TupleT.
10933 // - get<size_t I>(const TupleT& t)
10934 // static function extracting element I of tuple TupleT.
10935 // - tuple_element<size_t I>::type
10936 // type of element I of tuple TupleT.
10937 template <typename TupleT>
10938 struct TuplePolicy;
10940 #if GTEST_HAS_TR1_TUPLE
10941 template <typename TupleT>
10942 struct TuplePolicy {
10943 typedef TupleT Tuple;
10944 static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;
10946 template <size_t I>
10947 struct tuple_element : ::std::tr1::tuple_element<I, Tuple> {};
10949 template <size_t I>
10950 static typename AddReference<
10951 const typename ::std::tr1::tuple_element<I, Tuple>::type>::type get(
10952 const Tuple& tuple) {
10953 return ::std::tr1::get<I>(tuple);
10956 template <typename TupleT>
10957 const size_t TuplePolicy<TupleT>::tuple_size;
10958 #endif // GTEST_HAS_TR1_TUPLE
10960 #if GTEST_HAS_STD_TUPLE_
10961 template <typename... Types>
10962 struct TuplePolicy< ::std::tuple<Types...> > {
10963 typedef ::std::tuple<Types...> Tuple;
10964 static const size_t tuple_size = ::std::tuple_size<Tuple>::value;
10966 template <size_t I>
10967 struct tuple_element : ::std::tuple_element<I, Tuple> {};
10969 template <size_t I>
10970 static const typename ::std::tuple_element<I, Tuple>::type& get(
10971 const Tuple& tuple) {
10972 return ::std::get<I>(tuple);
10975 template <typename... Types>
10976 const size_t TuplePolicy< ::std::tuple<Types...> >::tuple_size;
10977 #endif // GTEST_HAS_STD_TUPLE_
10979 #if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
10980 // This helper template allows PrintTo() for tuples and
10981 // UniversalTersePrintTupleFieldsToStrings() to be defined by
10982 // induction on the number of tuple fields. The idea is that
10983 // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
10984 // fields in tuple t, and can be defined in terms of
10985 // TuplePrefixPrinter<N - 1>.
10987 // The inductive case.
10988 template <size_t N>
10989 struct TuplePrefixPrinter {
10990 // Prints the first N fields of a tuple.
10991 template <typename Tuple>
10992 static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
10993 TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
10994 GTEST_INTENTIONAL_CONST_COND_PUSH_()
10996 GTEST_INTENTIONAL_CONST_COND_POP_()
11000 typename TuplePolicy<Tuple>::template tuple_element<N - 1>::type>
11001 ::Print(TuplePolicy<Tuple>::template get<N - 1>(t), os);
11004 // Tersely prints the first N fields of a tuple to a string vector,
11005 // one element for each field.
11006 template <typename Tuple>
11007 static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
11008 TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
11009 ::std::stringstream ss;
11010 UniversalTersePrint(TuplePolicy<Tuple>::template get<N - 1>(t), &ss);
11011 strings->push_back(ss.str());
11017 struct TuplePrefixPrinter<0> {
11018 template <typename Tuple>
11019 static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
11021 template <typename Tuple>
11022 static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
11025 // Helper function for printing a tuple.
11026 // Tuple must be either std::tr1::tuple or std::tuple type.
11027 template <typename Tuple>
11028 void PrintTupleTo(const Tuple& t, ::std::ostream* os) {
11030 TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::PrintPrefixTo(t, os);
11034 // Prints the fields of a tuple tersely to a string vector, one
11035 // element for each field. See the comment before
11036 // UniversalTersePrint() for how we define "tersely".
11037 template <typename Tuple>
11038 Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
11040 TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::
11041 TersePrintPrefixToStrings(value, &result);
11044 #endif // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
11046 } // namespace internal
11048 template <typename T>
11049 ::std::string PrintToString(const T& value) {
11050 ::std::stringstream ss;
11051 internal::UniversalTersePrinter<T>::Print(value, &ss);
11055 } // namespace testing
11057 // Include any custom printer added by the local installation.
11058 // We must include this header at the end to make sure it can use the
11059 // declarations from this file.
11060 // Copyright 2015, Google Inc.
11061 // All rights reserved.
11063 // Redistribution and use in source and binary forms, with or without
11064 // modification, are permitted provided that the following conditions are
11067 // * Redistributions of source code must retain the above copyright
11068 // notice, this list of conditions and the following disclaimer.
11069 // * Redistributions in binary form must reproduce the above
11070 // copyright notice, this list of conditions and the following disclaimer
11071 // in the documentation and/or other materials provided with the
11073 // * Neither the name of Google Inc. nor the names of its
11074 // contributors may be used to endorse or promote products derived from
11075 // this software without specific prior written permission.
11077 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
11078 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
11079 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
11080 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
11081 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
11082 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11083 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11084 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11085 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
11086 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
11087 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11089 // This file provides an injection point for custom printers in a local
11090 // installation of gTest.
11091 // It will be included from gtest-printers.h and the overrides in this file
11092 // will be visible to everyone.
11093 // See documentation at gtest/gtest-printers.h for details on how to define a
11096 // ** Custom implementation starts here **
11098 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
11099 #define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
11101 #endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
11103 #endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
11105 #if GTEST_HAS_PARAM_TEST
11107 namespace testing {
11109 // Input to a parameterized test name generator, describing a test parameter.
11110 // Consists of the parameter value and the integer parameter index.
11111 template <class ParamType>
11112 struct TestParamInfo {
11113 TestParamInfo(const ParamType& a_param, size_t an_index) :
11120 // A builtin parameterized test name generator which returns the result of
11121 // testing::PrintToString.
11122 struct PrintToStringParamName {
11123 template <class ParamType>
11124 std::string operator()(const TestParamInfo<ParamType>& info) const {
11125 return PrintToString(info.param);
11129 namespace internal {
11131 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11133 // Outputs a message explaining invalid registration of different
11134 // fixture class for the same test case. This may happen when
11135 // TEST_P macro is used to define two tests with the same name
11136 // but in different namespaces.
11137 GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
11138 CodeLocation code_location);
11140 template <typename> class ParamGeneratorInterface;
11141 template <typename> class ParamGenerator;
11143 // Interface for iterating over elements provided by an implementation
11144 // of ParamGeneratorInterface<T>.
11145 template <typename T>
11146 class ParamIteratorInterface {
11148 virtual ~ParamIteratorInterface() {}
11149 // A pointer to the base generator instance.
11150 // Used only for the purposes of iterator comparison
11151 // to make sure that two iterators belong to the same generator.
11152 virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
11153 // Advances iterator to point to the next element
11154 // provided by the generator. The caller is responsible
11155 // for not calling Advance() on an iterator equal to
11156 // BaseGenerator()->End().
11157 virtual void Advance() = 0;
11158 // Clones the iterator object. Used for implementing copy semantics
11159 // of ParamIterator<T>.
11160 virtual ParamIteratorInterface* Clone() const = 0;
11161 // Dereferences the current iterator and provides (read-only) access
11162 // to the pointed value. It is the caller's responsibility not to call
11163 // Current() on an iterator equal to BaseGenerator()->End().
11164 // Used for implementing ParamGenerator<T>::operator*().
11165 virtual const T* Current() const = 0;
11166 // Determines whether the given iterator and other point to the same
11167 // element in the sequence generated by the generator.
11168 // Used for implementing ParamGenerator<T>::operator==().
11169 virtual bool Equals(const ParamIteratorInterface& other) const = 0;
11172 // Class iterating over elements provided by an implementation of
11173 // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
11174 // and implements the const forward iterator concept.
11175 template <typename T>
11176 class ParamIterator {
11178 typedef T value_type;
11179 typedef const T& reference;
11180 typedef ptrdiff_t difference_type;
11182 // ParamIterator assumes ownership of the impl_ pointer.
11183 ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
11184 ParamIterator& operator=(const ParamIterator& other) {
11185 if (this != &other)
11186 impl_.reset(other.impl_->Clone());
11190 const T& operator*() const { return *impl_->Current(); }
11191 const T* operator->() const { return impl_->Current(); }
11192 // Prefix version of operator++.
11193 ParamIterator& operator++() {
11197 // Postfix version of operator++.
11198 ParamIterator operator++(int /*unused*/) {
11199 ParamIteratorInterface<T>* clone = impl_->Clone();
11201 return ParamIterator(clone);
11203 bool operator==(const ParamIterator& other) const {
11204 return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
11206 bool operator!=(const ParamIterator& other) const {
11207 return !(*this == other);
11211 friend class ParamGenerator<T>;
11212 explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
11213 scoped_ptr<ParamIteratorInterface<T> > impl_;
11216 // ParamGeneratorInterface<T> is the binary interface to access generators
11217 // defined in other translation units.
11218 template <typename T>
11219 class ParamGeneratorInterface {
11221 typedef T ParamType;
11223 virtual ~ParamGeneratorInterface() {}
11225 // Generator interface definition
11226 virtual ParamIteratorInterface<T>* Begin() const = 0;
11227 virtual ParamIteratorInterface<T>* End() const = 0;
11230 // Wraps ParamGeneratorInterface<T> and provides general generator syntax
11231 // compatible with the STL Container concept.
11232 // This class implements copy initialization semantics and the contained
11233 // ParamGeneratorInterface<T> instance is shared among all copies
11234 // of the original object. This is possible because that instance is immutable.
11235 template<typename T>
11236 class ParamGenerator {
11238 typedef ParamIterator<T> iterator;
11240 explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
11241 ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
11243 ParamGenerator& operator=(const ParamGenerator& other) {
11244 impl_ = other.impl_;
11248 iterator begin() const { return iterator(impl_->Begin()); }
11249 iterator end() const { return iterator(impl_->End()); }
11252 linked_ptr<const ParamGeneratorInterface<T> > impl_;
11255 // Generates values from a range of two comparable values. Can be used to
11256 // generate sequences of user-defined types that implement operator+() and
11258 // This class is used in the Range() function.
11259 template <typename T, typename IncrementT>
11260 class RangeGenerator : public ParamGeneratorInterface<T> {
11262 RangeGenerator(T begin, T end, IncrementT step)
11263 : begin_(begin), end_(end),
11264 step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
11265 virtual ~RangeGenerator() {}
11267 virtual ParamIteratorInterface<T>* Begin() const {
11268 return new Iterator(this, begin_, 0, step_);
11270 virtual ParamIteratorInterface<T>* End() const {
11271 return new Iterator(this, end_, end_index_, step_);
11275 class Iterator : public ParamIteratorInterface<T> {
11277 Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
11279 : base_(base), value_(value), index_(index), step_(step) {}
11280 virtual ~Iterator() {}
11282 virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
11285 virtual void Advance() {
11286 value_ = static_cast<T>(value_ + step_);
11289 virtual ParamIteratorInterface<T>* Clone() const {
11290 return new Iterator(*this);
11292 virtual const T* Current() const { return &value_; }
11293 virtual bool Equals(const ParamIteratorInterface<T>& other) const {
11294 // Having the same base generator guarantees that the other
11295 // iterator is of the same type and we can downcast.
11296 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
11297 << "The program attempted to compare iterators "
11298 << "from different generators." << std::endl;
11299 const int other_index =
11300 CheckedDowncastToActualType<const Iterator>(&other)->index_;
11301 return index_ == other_index;
11305 Iterator(const Iterator& other)
11306 : ParamIteratorInterface<T>(),
11307 base_(other.base_), value_(other.value_), index_(other.index_),
11308 step_(other.step_) {}
11310 // No implementation - assignment is unsupported.
11311 void operator=(const Iterator& other);
11313 const ParamGeneratorInterface<T>* const base_;
11316 const IncrementT step_;
11317 }; // class RangeGenerator::Iterator
11319 static int CalculateEndIndex(const T& begin,
11321 const IncrementT& step) {
11323 for (T i = begin; i < end; i = static_cast<T>(i + step))
11328 // No implementation - assignment is unsupported.
11329 void operator=(const RangeGenerator& other);
11333 const IncrementT step_;
11334 // The index for the end() iterator. All the elements in the generated
11335 // sequence are indexed (0-based) to aid iterator comparison.
11336 const int end_index_;
11337 }; // class RangeGenerator
11340 // Generates values from a pair of STL-style iterators. Used in the
11341 // ValuesIn() function. The elements are copied from the source range
11342 // since the source can be located on the stack, and the generator
11343 // is likely to persist beyond that stack frame.
11344 template <typename T>
11345 class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
11347 template <typename ForwardIterator>
11348 ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
11349 : container_(begin, end) {}
11350 virtual ~ValuesInIteratorRangeGenerator() {}
11352 virtual ParamIteratorInterface<T>* Begin() const {
11353 return new Iterator(this, container_.begin());
11355 virtual ParamIteratorInterface<T>* End() const {
11356 return new Iterator(this, container_.end());
11360 typedef typename ::std::vector<T> ContainerType;
11362 class Iterator : public ParamIteratorInterface<T> {
11364 Iterator(const ParamGeneratorInterface<T>* base,
11365 typename ContainerType::const_iterator iterator)
11366 : base_(base), iterator_(iterator) {}
11367 virtual ~Iterator() {}
11369 virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
11372 virtual void Advance() {
11376 virtual ParamIteratorInterface<T>* Clone() const {
11377 return new Iterator(*this);
11379 // We need to use cached value referenced by iterator_ because *iterator_
11380 // can return a temporary object (and of type other then T), so just
11381 // having "return &*iterator_;" doesn't work.
11382 // value_ is updated here and not in Advance() because Advance()
11383 // can advance iterator_ beyond the end of the range, and we cannot
11384 // detect that fact. The client code, on the other hand, is
11385 // responsible for not calling Current() on an out-of-range iterator.
11386 virtual const T* Current() const {
11387 if (value_.get() == NULL)
11388 value_.reset(new T(*iterator_));
11389 return value_.get();
11391 virtual bool Equals(const ParamIteratorInterface<T>& other) const {
11392 // Having the same base generator guarantees that the other
11393 // iterator is of the same type and we can downcast.
11394 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
11395 << "The program attempted to compare iterators "
11396 << "from different generators." << std::endl;
11397 return iterator_ ==
11398 CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
11402 Iterator(const Iterator& other)
11403 // The explicit constructor call suppresses a false warning
11404 // emitted by gcc when supplied with the -Wextra option.
11405 : ParamIteratorInterface<T>(),
11406 base_(other.base_),
11407 iterator_(other.iterator_) {}
11409 const ParamGeneratorInterface<T>* const base_;
11410 typename ContainerType::const_iterator iterator_;
11411 // A cached value of *iterator_. We keep it here to allow access by
11412 // pointer in the wrapping iterator's operator->().
11413 // value_ needs to be mutable to be accessed in Current().
11414 // Use of scoped_ptr helps manage cached value's lifetime,
11415 // which is bound by the lifespan of the iterator itself.
11416 mutable scoped_ptr<const T> value_;
11417 }; // class ValuesInIteratorRangeGenerator::Iterator
11419 // No implementation - assignment is unsupported.
11420 void operator=(const ValuesInIteratorRangeGenerator& other);
11422 const ContainerType container_;
11423 }; // class ValuesInIteratorRangeGenerator
11425 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11427 // Default parameterized test name generator, returns a string containing the
11428 // integer test parameter index.
11429 template <class ParamType>
11430 std::string DefaultParamName(const TestParamInfo<ParamType>& info) {
11431 Message name_stream;
11432 name_stream << info.index;
11433 return name_stream.GetString();
11436 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11438 // Parameterized test name overload helpers, which help the
11439 // INSTANTIATE_TEST_CASE_P macro choose between the default parameterized
11440 // test name generator and user param name generator.
11441 template <class ParamType, class ParamNameGenFunctor>
11442 ParamNameGenFunctor GetParamNameGen(ParamNameGenFunctor func) {
11446 template <class ParamType>
11447 struct ParamNameGenFunc {
11448 typedef std::string Type(const TestParamInfo<ParamType>&);
11451 template <class ParamType>
11452 typename ParamNameGenFunc<ParamType>::Type *GetParamNameGen() {
11453 return DefaultParamName;
11456 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11458 // Stores a parameter value and later creates tests parameterized with that
11460 template <class TestClass>
11461 class ParameterizedTestFactory : public TestFactoryBase {
11463 typedef typename TestClass::ParamType ParamType;
11464 explicit ParameterizedTestFactory(ParamType parameter) :
11465 parameter_(parameter) {}
11466 virtual Test* CreateTest() {
11467 TestClass::SetParam(¶meter_);
11468 return new TestClass();
11472 const ParamType parameter_;
11474 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
11477 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11479 // TestMetaFactoryBase is a base class for meta-factories that create
11480 // test factories for passing into MakeAndRegisterTestInfo function.
11481 template <class ParamType>
11482 class TestMetaFactoryBase {
11484 virtual ~TestMetaFactoryBase() {}
11486 virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
11489 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11491 // TestMetaFactory creates test factories for passing into
11492 // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
11493 // ownership of test factory pointer, same factory object cannot be passed
11494 // into that method twice. But ParameterizedTestCaseInfo is going to call
11495 // it for each Test/Parameter value combination. Thus it needs meta factory
11497 template <class TestCase>
11498 class TestMetaFactory
11499 : public TestMetaFactoryBase<typename TestCase::ParamType> {
11501 typedef typename TestCase::ParamType ParamType;
11503 TestMetaFactory() {}
11505 virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
11506 return new ParameterizedTestFactory<TestCase>(parameter);
11510 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
11513 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11515 // ParameterizedTestCaseInfoBase is a generic interface
11516 // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
11517 // accumulates test information provided by TEST_P macro invocations
11518 // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
11519 // and uses that information to register all resulting test instances
11520 // in RegisterTests method. The ParameterizeTestCaseRegistry class holds
11521 // a collection of pointers to the ParameterizedTestCaseInfo objects
11522 // and calls RegisterTests() on each of them when asked.
11523 class ParameterizedTestCaseInfoBase {
11525 virtual ~ParameterizedTestCaseInfoBase() {}
11527 // Base part of test case name for display purposes.
11528 virtual const string& GetTestCaseName() const = 0;
11529 // Test case id to verify identity.
11530 virtual TypeId GetTestCaseTypeId() const = 0;
11531 // UnitTest class invokes this method to register tests in this
11532 // test case right before running them in RUN_ALL_TESTS macro.
11533 // This method should not be called more then once on any single
11534 // instance of a ParameterizedTestCaseInfoBase derived class.
11535 virtual void RegisterTests() = 0;
11538 ParameterizedTestCaseInfoBase() {}
11541 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
11544 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11546 // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
11547 // macro invocations for a particular test case and generators
11548 // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
11549 // test case. It registers tests with all values generated by all
11550 // generators when asked.
11551 template <class TestCase>
11552 class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
11554 // ParamType and GeneratorCreationFunc are private types but are required
11555 // for declarations of public methods AddTestPattern() and
11556 // AddTestCaseInstantiation().
11557 typedef typename TestCase::ParamType ParamType;
11558 // A function that returns an instance of appropriate generator type.
11559 typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
11560 typedef typename ParamNameGenFunc<ParamType>::Type ParamNameGeneratorFunc;
11562 explicit ParameterizedTestCaseInfo(
11563 const char* name, CodeLocation code_location)
11564 : test_case_name_(name), code_location_(code_location) {}
11566 // Test case base name for display purposes.
11567 virtual const string& GetTestCaseName() const { return test_case_name_; }
11568 // Test case id to verify identity.
11569 virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
11570 // TEST_P macro uses AddTestPattern() to record information
11571 // about a single test in a LocalTestInfo structure.
11572 // test_case_name is the base name of the test case (without invocation
11573 // prefix). test_base_name is the name of an individual test without
11574 // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
11575 // test case base name and DoBar is test base name.
11576 void AddTestPattern(const char* test_case_name,
11577 const char* test_base_name,
11578 TestMetaFactoryBase<ParamType>* meta_factory) {
11579 tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
11583 // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
11584 // about a generator.
11585 int AddTestCaseInstantiation(const string& instantiation_name,
11586 GeneratorCreationFunc* func,
11587 ParamNameGeneratorFunc* name_func,
11590 instantiations_.push_back(
11591 InstantiationInfo(instantiation_name, func, name_func, file, line));
11592 return 0; // Return value used only to run this method in namespace scope.
11594 // UnitTest class invokes this method to register tests in this test case
11595 // test cases right before running tests in RUN_ALL_TESTS macro.
11596 // This method should not be called more then once on any single
11597 // instance of a ParameterizedTestCaseInfoBase derived class.
11598 // UnitTest has a guard to prevent from calling this method more then once.
11599 virtual void RegisterTests() {
11600 for (typename TestInfoContainer::iterator test_it = tests_.begin();
11601 test_it != tests_.end(); ++test_it) {
11602 linked_ptr<TestInfo> test_info = *test_it;
11603 for (typename InstantiationContainer::iterator gen_it =
11604 instantiations_.begin(); gen_it != instantiations_.end();
11606 const string& instantiation_name = gen_it->name;
11607 ParamGenerator<ParamType> generator((*gen_it->generator)());
11608 ParamNameGeneratorFunc* name_func = gen_it->name_func;
11609 const char* file = gen_it->file;
11610 int line = gen_it->line;
11612 string test_case_name;
11613 if ( !instantiation_name.empty() )
11614 test_case_name = instantiation_name + "/";
11615 test_case_name += test_info->test_case_base_name;
11618 std::set<std::string> test_param_names;
11619 for (typename ParamGenerator<ParamType>::iterator param_it =
11621 param_it != generator.end(); ++param_it, ++i) {
11622 Message test_name_stream;
11624 std::string param_name = name_func(
11625 TestParamInfo<ParamType>(*param_it, i));
11627 GTEST_CHECK_(IsValidParamName(param_name))
11628 << "Parameterized test name '" << param_name
11629 << "' is invalid, in " << file
11630 << " line " << line << std::endl;
11632 GTEST_CHECK_(test_param_names.count(param_name) == 0)
11633 << "Duplicate parameterized test name '" << param_name
11634 << "', in " << file << " line " << line << std::endl;
11636 test_param_names.insert(param_name);
11638 test_name_stream << test_info->test_base_name << "/" << param_name;
11639 MakeAndRegisterTestInfo(
11640 test_case_name.c_str(),
11641 test_name_stream.GetString().c_str(),
11642 NULL, // No type parameter.
11643 PrintToString(*param_it).c_str(),
11645 GetTestCaseTypeId(),
11646 TestCase::SetUpTestCase,
11647 TestCase::TearDownTestCase,
11648 test_info->test_meta_factory->CreateTestFactory(*param_it));
11655 // LocalTestInfo structure keeps information about a single test registered
11656 // with TEST_P macro.
11658 TestInfo(const char* a_test_case_base_name,
11659 const char* a_test_base_name,
11660 TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
11661 test_case_base_name(a_test_case_base_name),
11662 test_base_name(a_test_base_name),
11663 test_meta_factory(a_test_meta_factory) {}
11665 const string test_case_base_name;
11666 const string test_base_name;
11667 const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
11669 typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
11670 // Records data received from INSTANTIATE_TEST_CASE_P macros:
11671 // <Instantiation name, Sequence generator creation function,
11672 // Name generator function, Source file, Source line>
11673 struct InstantiationInfo {
11674 InstantiationInfo(const std::string &name_in,
11675 GeneratorCreationFunc* generator_in,
11676 ParamNameGeneratorFunc* name_func_in,
11677 const char* file_in,
11680 generator(generator_in),
11681 name_func(name_func_in),
11686 GeneratorCreationFunc* generator;
11687 ParamNameGeneratorFunc* name_func;
11691 typedef ::std::vector<InstantiationInfo> InstantiationContainer;
11693 static bool IsValidParamName(const std::string& name) {
11694 // Check for empty string
11698 // Check for invalid characters
11699 for (std::string::size_type index = 0; index < name.size(); ++index) {
11700 if (!isalnum(name[index]) && name[index] != '_')
11707 const string test_case_name_;
11708 CodeLocation code_location_;
11709 TestInfoContainer tests_;
11710 InstantiationContainer instantiations_;
11712 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
11713 }; // class ParameterizedTestCaseInfo
11715 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11717 // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
11718 // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
11719 // macros use it to locate their corresponding ParameterizedTestCaseInfo
11721 class ParameterizedTestCaseRegistry {
11723 ParameterizedTestCaseRegistry() {}
11724 ~ParameterizedTestCaseRegistry() {
11725 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
11726 it != test_case_infos_.end(); ++it) {
11731 // Looks up or creates and returns a structure containing information about
11732 // tests and instantiations of a particular test case.
11733 template <class TestCase>
11734 ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
11735 const char* test_case_name,
11736 CodeLocation code_location) {
11737 ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
11738 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
11739 it != test_case_infos_.end(); ++it) {
11740 if ((*it)->GetTestCaseName() == test_case_name) {
11741 if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
11742 // Complain about incorrect usage of Google Test facilities
11743 // and terminate the program since we cannot guaranty correct
11744 // test case setup and tear-down in this case.
11745 ReportInvalidTestCaseType(test_case_name, code_location);
11748 // At this point we are sure that the object we found is of the same
11749 // type we are looking for, so we downcast it to that type
11750 // without further checks.
11751 typed_test_info = CheckedDowncastToActualType<
11752 ParameterizedTestCaseInfo<TestCase> >(*it);
11757 if (typed_test_info == NULL) {
11758 typed_test_info = new ParameterizedTestCaseInfo<TestCase>(
11759 test_case_name, code_location);
11760 test_case_infos_.push_back(typed_test_info);
11762 return typed_test_info;
11764 void RegisterTests() {
11765 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
11766 it != test_case_infos_.end(); ++it) {
11767 (*it)->RegisterTests();
11772 typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
11774 TestCaseInfoContainer test_case_infos_;
11776 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
11779 } // namespace internal
11780 } // namespace testing
11782 #endif // GTEST_HAS_PARAM_TEST
11784 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
11785 // This file was GENERATED by command:
11786 // pump.py gtest-param-util-generated.h.pump
11787 // DO NOT EDIT BY HAND!!!
11789 // Copyright 2008 Google Inc.
11790 // All Rights Reserved.
11792 // Redistribution and use in source and binary forms, with or without
11793 // modification, are permitted provided that the following conditions are
11796 // * Redistributions of source code must retain the above copyright
11797 // notice, this list of conditions and the following disclaimer.
11798 // * Redistributions in binary form must reproduce the above
11799 // copyright notice, this list of conditions and the following disclaimer
11800 // in the documentation and/or other materials provided with the
11802 // * Neither the name of Google Inc. nor the names of its
11803 // contributors may be used to endorse or promote products derived from
11804 // this software without specific prior written permission.
11806 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
11807 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
11808 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
11809 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
11810 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
11811 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11812 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11813 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11814 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
11815 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
11816 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11818 // Author: vladl@google.com (Vlad Losev)
11820 // Type and function utilities for implementing parameterized tests.
11821 // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
11823 // Currently Google Test supports at most 50 arguments in Values,
11824 // and at most 10 arguments in Combine. Please contact
11825 // googletestframework@googlegroups.com if you need more.
11826 // Please note that the number of arguments to Combine is limited
11827 // by the maximum arity of the implementation of tuple which is
11828 // currently set at 10.
11830 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
11831 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
11833 // scripts/fuse_gtest.py depends on gtest's own header being #included
11834 // *unconditionally*. Therefore these #includes cannot be moved
11835 // inside #if GTEST_HAS_PARAM_TEST.
11837 #if GTEST_HAS_PARAM_TEST
11839 namespace testing {
11841 // Forward declarations of ValuesIn(), which is implemented in
11842 // include/gtest/gtest-param-test.h.
11843 template <typename ForwardIterator>
11844 internal::ParamGenerator<
11845 typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
11846 ValuesIn(ForwardIterator begin, ForwardIterator end);
11848 template <typename T, size_t N>
11849 internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
11851 template <class Container>
11852 internal::ParamGenerator<typename Container::value_type> ValuesIn(
11853 const Container& container);
11855 namespace internal {
11857 // Used in the Values() function to provide polymorphic capabilities.
11858 template <typename T1>
11859 class ValueArray1 {
11861 explicit ValueArray1(T1 v1) : v1_(v1) {}
11863 template <typename T>
11864 operator ParamGenerator<T>() const {
11865 const T array[] = {static_cast<T>(v1_)};
11866 return ValuesIn(array);
11870 // No implementation - assignment is unsupported.
11871 void operator=(const ValueArray1& other);
11876 template <typename T1, typename T2>
11877 class ValueArray2 {
11879 ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
11881 template <typename T>
11882 operator ParamGenerator<T>() const {
11883 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};
11884 return ValuesIn(array);
11888 // No implementation - assignment is unsupported.
11889 void operator=(const ValueArray2& other);
11895 template <typename T1, typename T2, typename T3>
11896 class ValueArray3 {
11898 ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
11900 template <typename T>
11901 operator ParamGenerator<T>() const {
11902 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11903 static_cast<T>(v3_)};
11904 return ValuesIn(array);
11908 // No implementation - assignment is unsupported.
11909 void operator=(const ValueArray3& other);
11916 template <typename T1, typename T2, typename T3, typename T4>
11917 class ValueArray4 {
11919 ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
11922 template <typename T>
11923 operator ParamGenerator<T>() const {
11924 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11925 static_cast<T>(v3_), static_cast<T>(v4_)};
11926 return ValuesIn(array);
11930 // No implementation - assignment is unsupported.
11931 void operator=(const ValueArray4& other);
11939 template <typename T1, typename T2, typename T3, typename T4, typename T5>
11940 class ValueArray5 {
11942 ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
11943 v4_(v4), v5_(v5) {}
11945 template <typename T>
11946 operator ParamGenerator<T>() const {
11947 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11948 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};
11949 return ValuesIn(array);
11953 // No implementation - assignment is unsupported.
11954 void operator=(const ValueArray5& other);
11963 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11965 class ValueArray6 {
11967 ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
11968 v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
11970 template <typename T>
11971 operator ParamGenerator<T>() const {
11972 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11973 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11974 static_cast<T>(v6_)};
11975 return ValuesIn(array);
11979 // No implementation - assignment is unsupported.
11980 void operator=(const ValueArray6& other);
11990 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11991 typename T6, typename T7>
11992 class ValueArray7 {
11994 ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
11995 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
11997 template <typename T>
11998 operator ParamGenerator<T>() const {
11999 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12000 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12001 static_cast<T>(v6_), static_cast<T>(v7_)};
12002 return ValuesIn(array);
12006 // No implementation - assignment is unsupported.
12007 void operator=(const ValueArray7& other);
12018 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12019 typename T6, typename T7, typename T8>
12020 class ValueArray8 {
12022 ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
12023 T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12026 template <typename T>
12027 operator ParamGenerator<T>() const {
12028 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12029 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12030 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};
12031 return ValuesIn(array);
12035 // No implementation - assignment is unsupported.
12036 void operator=(const ValueArray8& other);
12048 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12049 typename T6, typename T7, typename T8, typename T9>
12050 class ValueArray9 {
12052 ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
12053 T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12054 v8_(v8), v9_(v9) {}
12056 template <typename T>
12057 operator ParamGenerator<T>() const {
12058 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12059 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12060 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12061 static_cast<T>(v9_)};
12062 return ValuesIn(array);
12066 // No implementation - assignment is unsupported.
12067 void operator=(const ValueArray9& other);
12080 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12081 typename T6, typename T7, typename T8, typename T9, typename T10>
12082 class ValueArray10 {
12084 ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12085 T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12086 v8_(v8), v9_(v9), v10_(v10) {}
12088 template <typename T>
12089 operator ParamGenerator<T>() const {
12090 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12091 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12092 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12093 static_cast<T>(v9_), static_cast<T>(v10_)};
12094 return ValuesIn(array);
12098 // No implementation - assignment is unsupported.
12099 void operator=(const ValueArray10& other);
12113 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12114 typename T6, typename T7, typename T8, typename T9, typename T10,
12116 class ValueArray11 {
12118 ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12119 T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12120 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
12122 template <typename T>
12123 operator ParamGenerator<T>() const {
12124 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12125 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12126 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12127 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};
12128 return ValuesIn(array);
12132 // No implementation - assignment is unsupported.
12133 void operator=(const ValueArray11& other);
12148 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12149 typename T6, typename T7, typename T8, typename T9, typename T10,
12150 typename T11, typename T12>
12151 class ValueArray12 {
12153 ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12154 T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
12155 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
12157 template <typename T>
12158 operator ParamGenerator<T>() const {
12159 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12160 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12161 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12162 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12163 static_cast<T>(v12_)};
12164 return ValuesIn(array);
12168 // No implementation - assignment is unsupported.
12169 void operator=(const ValueArray12& other);
12185 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12186 typename T6, typename T7, typename T8, typename T9, typename T10,
12187 typename T11, typename T12, typename T13>
12188 class ValueArray13 {
12190 ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12191 T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
12192 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
12193 v12_(v12), v13_(v13) {}
12195 template <typename T>
12196 operator ParamGenerator<T>() const {
12197 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12198 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12199 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12200 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12201 static_cast<T>(v12_), static_cast<T>(v13_)};
12202 return ValuesIn(array);
12206 // No implementation - assignment is unsupported.
12207 void operator=(const ValueArray13& other);
12224 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12225 typename T6, typename T7, typename T8, typename T9, typename T10,
12226 typename T11, typename T12, typename T13, typename T14>
12227 class ValueArray14 {
12229 ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12230 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
12231 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12232 v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
12234 template <typename T>
12235 operator ParamGenerator<T>() const {
12236 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12237 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12238 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12239 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12240 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};
12241 return ValuesIn(array);
12245 // No implementation - assignment is unsupported.
12246 void operator=(const ValueArray14& other);
12264 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12265 typename T6, typename T7, typename T8, typename T9, typename T10,
12266 typename T11, typename T12, typename T13, typename T14, typename T15>
12267 class ValueArray15 {
12269 ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12270 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
12271 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12272 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
12274 template <typename T>
12275 operator ParamGenerator<T>() const {
12276 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12277 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12278 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12279 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12280 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12281 static_cast<T>(v15_)};
12282 return ValuesIn(array);
12286 // No implementation - assignment is unsupported.
12287 void operator=(const ValueArray15& other);
12306 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12307 typename T6, typename T7, typename T8, typename T9, typename T10,
12308 typename T11, typename T12, typename T13, typename T14, typename T15,
12310 class ValueArray16 {
12312 ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12313 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
12314 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12315 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12318 template <typename T>
12319 operator ParamGenerator<T>() const {
12320 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12321 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12322 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12323 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12324 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12325 static_cast<T>(v15_), static_cast<T>(v16_)};
12326 return ValuesIn(array);
12330 // No implementation - assignment is unsupported.
12331 void operator=(const ValueArray16& other);
12351 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12352 typename T6, typename T7, typename T8, typename T9, typename T10,
12353 typename T11, typename T12, typename T13, typename T14, typename T15,
12354 typename T16, typename T17>
12355 class ValueArray17 {
12357 ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12358 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
12359 T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12360 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12361 v15_(v15), v16_(v16), v17_(v17) {}
12363 template <typename T>
12364 operator ParamGenerator<T>() const {
12365 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12366 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12367 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12368 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12369 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12370 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};
12371 return ValuesIn(array);
12375 // No implementation - assignment is unsupported.
12376 void operator=(const ValueArray17& other);
12397 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12398 typename T6, typename T7, typename T8, typename T9, typename T10,
12399 typename T11, typename T12, typename T13, typename T14, typename T15,
12400 typename T16, typename T17, typename T18>
12401 class ValueArray18 {
12403 ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12404 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12405 T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12406 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12407 v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
12409 template <typename T>
12410 operator ParamGenerator<T>() const {
12411 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12412 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12413 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12414 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12415 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12416 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12417 static_cast<T>(v18_)};
12418 return ValuesIn(array);
12422 // No implementation - assignment is unsupported.
12423 void operator=(const ValueArray18& other);
12445 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12446 typename T6, typename T7, typename T8, typename T9, typename T10,
12447 typename T11, typename T12, typename T13, typename T14, typename T15,
12448 typename T16, typename T17, typename T18, typename T19>
12449 class ValueArray19 {
12451 ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12452 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12453 T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12454 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12455 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
12457 template <typename T>
12458 operator ParamGenerator<T>() const {
12459 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12460 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12461 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12462 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12463 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12464 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12465 static_cast<T>(v18_), static_cast<T>(v19_)};
12466 return ValuesIn(array);
12470 // No implementation - assignment is unsupported.
12471 void operator=(const ValueArray19& other);
12494 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12495 typename T6, typename T7, typename T8, typename T9, typename T10,
12496 typename T11, typename T12, typename T13, typename T14, typename T15,
12497 typename T16, typename T17, typename T18, typename T19, typename T20>
12498 class ValueArray20 {
12500 ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12501 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12502 T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
12503 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
12504 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
12505 v19_(v19), v20_(v20) {}
12507 template <typename T>
12508 operator ParamGenerator<T>() const {
12509 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12510 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12511 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12512 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12513 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12514 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12515 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};
12516 return ValuesIn(array);
12520 // No implementation - assignment is unsupported.
12521 void operator=(const ValueArray20& other);
12545 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12546 typename T6, typename T7, typename T8, typename T9, typename T10,
12547 typename T11, typename T12, typename T13, typename T14, typename T15,
12548 typename T16, typename T17, typename T18, typename T19, typename T20,
12550 class ValueArray21 {
12552 ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12553 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12554 T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
12555 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
12556 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
12557 v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
12559 template <typename T>
12560 operator ParamGenerator<T>() const {
12561 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12562 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12563 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12564 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12565 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12566 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12567 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12568 static_cast<T>(v21_)};
12569 return ValuesIn(array);
12573 // No implementation - assignment is unsupported.
12574 void operator=(const ValueArray21& other);
12599 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12600 typename T6, typename T7, typename T8, typename T9, typename T10,
12601 typename T11, typename T12, typename T13, typename T14, typename T15,
12602 typename T16, typename T17, typename T18, typename T19, typename T20,
12603 typename T21, typename T22>
12604 class ValueArray22 {
12606 ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12607 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12608 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
12609 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12610 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12611 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
12613 template <typename T>
12614 operator ParamGenerator<T>() const {
12615 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12616 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12617 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12618 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12619 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12620 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12621 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12622 static_cast<T>(v21_), static_cast<T>(v22_)};
12623 return ValuesIn(array);
12627 // No implementation - assignment is unsupported.
12628 void operator=(const ValueArray22& other);
12654 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12655 typename T6, typename T7, typename T8, typename T9, typename T10,
12656 typename T11, typename T12, typename T13, typename T14, typename T15,
12657 typename T16, typename T17, typename T18, typename T19, typename T20,
12658 typename T21, typename T22, typename T23>
12659 class ValueArray23 {
12661 ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12662 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12663 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
12664 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12665 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12666 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12669 template <typename T>
12670 operator ParamGenerator<T>() const {
12671 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12672 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12673 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12674 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12675 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12676 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12677 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12678 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};
12679 return ValuesIn(array);
12683 // No implementation - assignment is unsupported.
12684 void operator=(const ValueArray23& other);
12711 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12712 typename T6, typename T7, typename T8, typename T9, typename T10,
12713 typename T11, typename T12, typename T13, typename T14, typename T15,
12714 typename T16, typename T17, typename T18, typename T19, typename T20,
12715 typename T21, typename T22, typename T23, typename T24>
12716 class ValueArray24 {
12718 ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12719 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12720 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
12721 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12722 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12723 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
12724 v22_(v22), v23_(v23), v24_(v24) {}
12726 template <typename T>
12727 operator ParamGenerator<T>() const {
12728 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12729 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12730 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12731 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12732 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12733 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12734 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12735 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12736 static_cast<T>(v24_)};
12737 return ValuesIn(array);
12741 // No implementation - assignment is unsupported.
12742 void operator=(const ValueArray24& other);
12770 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12771 typename T6, typename T7, typename T8, typename T9, typename T10,
12772 typename T11, typename T12, typename T13, typename T14, typename T15,
12773 typename T16, typename T17, typename T18, typename T19, typename T20,
12774 typename T21, typename T22, typename T23, typename T24, typename T25>
12775 class ValueArray25 {
12777 ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12778 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12779 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
12780 T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12781 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12782 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12783 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
12785 template <typename T>
12786 operator ParamGenerator<T>() const {
12787 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12788 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12789 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12790 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12791 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12792 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12793 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12794 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12795 static_cast<T>(v24_), static_cast<T>(v25_)};
12796 return ValuesIn(array);
12800 // No implementation - assignment is unsupported.
12801 void operator=(const ValueArray25& other);
12830 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12831 typename T6, typename T7, typename T8, typename T9, typename T10,
12832 typename T11, typename T12, typename T13, typename T14, typename T15,
12833 typename T16, typename T17, typename T18, typename T19, typename T20,
12834 typename T21, typename T22, typename T23, typename T24, typename T25,
12836 class ValueArray26 {
12838 ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12839 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12840 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12841 T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12842 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12843 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12844 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
12846 template <typename T>
12847 operator ParamGenerator<T>() const {
12848 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12849 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12850 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12851 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12852 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12853 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12854 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12855 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12856 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};
12857 return ValuesIn(array);
12861 // No implementation - assignment is unsupported.
12862 void operator=(const ValueArray26& other);
12892 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12893 typename T6, typename T7, typename T8, typename T9, typename T10,
12894 typename T11, typename T12, typename T13, typename T14, typename T15,
12895 typename T16, typename T17, typename T18, typename T19, typename T20,
12896 typename T21, typename T22, typename T23, typename T24, typename T25,
12897 typename T26, typename T27>
12898 class ValueArray27 {
12900 ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12901 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12902 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12903 T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12904 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12905 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
12906 v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
12907 v26_(v26), v27_(v27) {}
12909 template <typename T>
12910 operator ParamGenerator<T>() const {
12911 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12912 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12913 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12914 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12915 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12916 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12917 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12918 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12919 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12920 static_cast<T>(v27_)};
12921 return ValuesIn(array);
12925 // No implementation - assignment is unsupported.
12926 void operator=(const ValueArray27& other);
12957 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12958 typename T6, typename T7, typename T8, typename T9, typename T10,
12959 typename T11, typename T12, typename T13, typename T14, typename T15,
12960 typename T16, typename T17, typename T18, typename T19, typename T20,
12961 typename T21, typename T22, typename T23, typename T24, typename T25,
12962 typename T26, typename T27, typename T28>
12963 class ValueArray28 {
12965 ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12966 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12967 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12968 T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
12969 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
12970 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
12971 v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
12972 v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
12974 template <typename T>
12975 operator ParamGenerator<T>() const {
12976 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12977 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12978 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12979 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12980 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12981 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12982 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12983 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12984 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12985 static_cast<T>(v27_), static_cast<T>(v28_)};
12986 return ValuesIn(array);
12990 // No implementation - assignment is unsupported.
12991 void operator=(const ValueArray28& other);
13023 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13024 typename T6, typename T7, typename T8, typename T9, typename T10,
13025 typename T11, typename T12, typename T13, typename T14, typename T15,
13026 typename T16, typename T17, typename T18, typename T19, typename T20,
13027 typename T21, typename T22, typename T23, typename T24, typename T25,
13028 typename T26, typename T27, typename T28, typename T29>
13029 class ValueArray29 {
13031 ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13032 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13033 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13034 T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
13035 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
13036 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
13037 v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
13038 v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
13040 template <typename T>
13041 operator ParamGenerator<T>() const {
13042 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13043 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13044 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13045 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13046 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13047 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13048 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13049 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13050 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13051 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};
13052 return ValuesIn(array);
13056 // No implementation - assignment is unsupported.
13057 void operator=(const ValueArray29& other);
13090 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13091 typename T6, typename T7, typename T8, typename T9, typename T10,
13092 typename T11, typename T12, typename T13, typename T14, typename T15,
13093 typename T16, typename T17, typename T18, typename T19, typename T20,
13094 typename T21, typename T22, typename T23, typename T24, typename T25,
13095 typename T26, typename T27, typename T28, typename T29, typename T30>
13096 class ValueArray30 {
13098 ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13099 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13100 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13101 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
13102 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13103 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13104 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13105 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13106 v29_(v29), v30_(v30) {}
13108 template <typename T>
13109 operator ParamGenerator<T>() const {
13110 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13111 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13112 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13113 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13114 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13115 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13116 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13117 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13118 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13119 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13120 static_cast<T>(v30_)};
13121 return ValuesIn(array);
13125 // No implementation - assignment is unsupported.
13126 void operator=(const ValueArray30& other);
13160 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13161 typename T6, typename T7, typename T8, typename T9, typename T10,
13162 typename T11, typename T12, typename T13, typename T14, typename T15,
13163 typename T16, typename T17, typename T18, typename T19, typename T20,
13164 typename T21, typename T22, typename T23, typename T24, typename T25,
13165 typename T26, typename T27, typename T28, typename T29, typename T30,
13167 class ValueArray31 {
13169 ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13170 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13171 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13172 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
13173 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13174 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13175 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13176 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13177 v29_(v29), v30_(v30), v31_(v31) {}
13179 template <typename T>
13180 operator ParamGenerator<T>() const {
13181 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13182 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13183 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13184 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13185 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13186 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13187 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13188 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13189 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13190 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13191 static_cast<T>(v30_), static_cast<T>(v31_)};
13192 return ValuesIn(array);
13196 // No implementation - assignment is unsupported.
13197 void operator=(const ValueArray31& other);
13232 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13233 typename T6, typename T7, typename T8, typename T9, typename T10,
13234 typename T11, typename T12, typename T13, typename T14, typename T15,
13235 typename T16, typename T17, typename T18, typename T19, typename T20,
13236 typename T21, typename T22, typename T23, typename T24, typename T25,
13237 typename T26, typename T27, typename T28, typename T29, typename T30,
13238 typename T31, typename T32>
13239 class ValueArray32 {
13241 ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13242 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13243 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13244 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
13245 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
13246 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
13247 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
13248 v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
13249 v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
13251 template <typename T>
13252 operator ParamGenerator<T>() const {
13253 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13254 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13255 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13256 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13257 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13258 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13259 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13260 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13261 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13262 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13263 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};
13264 return ValuesIn(array);
13268 // No implementation - assignment is unsupported.
13269 void operator=(const ValueArray32& other);
13305 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13306 typename T6, typename T7, typename T8, typename T9, typename T10,
13307 typename T11, typename T12, typename T13, typename T14, typename T15,
13308 typename T16, typename T17, typename T18, typename T19, typename T20,
13309 typename T21, typename T22, typename T23, typename T24, typename T25,
13310 typename T26, typename T27, typename T28, typename T29, typename T30,
13311 typename T31, typename T32, typename T33>
13312 class ValueArray33 {
13314 ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13315 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13316 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13317 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
13318 T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13319 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13320 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13321 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13322 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13325 template <typename T>
13326 operator ParamGenerator<T>() const {
13327 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13328 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13329 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13330 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13331 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13332 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13333 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13334 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13335 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13336 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13337 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13338 static_cast<T>(v33_)};
13339 return ValuesIn(array);
13343 // No implementation - assignment is unsupported.
13344 void operator=(const ValueArray33& other);
13381 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13382 typename T6, typename T7, typename T8, typename T9, typename T10,
13383 typename T11, typename T12, typename T13, typename T14, typename T15,
13384 typename T16, typename T17, typename T18, typename T19, typename T20,
13385 typename T21, typename T22, typename T23, typename T24, typename T25,
13386 typename T26, typename T27, typename T28, typename T29, typename T30,
13387 typename T31, typename T32, typename T33, typename T34>
13388 class ValueArray34 {
13390 ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13391 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13392 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13393 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13394 T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13395 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13396 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13397 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13398 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13399 v33_(v33), v34_(v34) {}
13401 template <typename T>
13402 operator ParamGenerator<T>() const {
13403 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13404 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13405 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13406 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13407 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13408 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13409 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13410 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13411 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13412 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13413 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13414 static_cast<T>(v33_), static_cast<T>(v34_)};
13415 return ValuesIn(array);
13419 // No implementation - assignment is unsupported.
13420 void operator=(const ValueArray34& other);
13458 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13459 typename T6, typename T7, typename T8, typename T9, typename T10,
13460 typename T11, typename T12, typename T13, typename T14, typename T15,
13461 typename T16, typename T17, typename T18, typename T19, typename T20,
13462 typename T21, typename T22, typename T23, typename T24, typename T25,
13463 typename T26, typename T27, typename T28, typename T29, typename T30,
13464 typename T31, typename T32, typename T33, typename T34, typename T35>
13465 class ValueArray35 {
13467 ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13468 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13469 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13470 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13471 T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
13472 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
13473 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
13474 v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
13475 v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
13476 v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
13478 template <typename T>
13479 operator ParamGenerator<T>() const {
13480 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13481 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13482 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13483 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13484 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13485 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13486 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13487 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13488 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13489 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13490 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13491 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};
13492 return ValuesIn(array);
13496 // No implementation - assignment is unsupported.
13497 void operator=(const ValueArray35& other);
13536 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13537 typename T6, typename T7, typename T8, typename T9, typename T10,
13538 typename T11, typename T12, typename T13, typename T14, typename T15,
13539 typename T16, typename T17, typename T18, typename T19, typename T20,
13540 typename T21, typename T22, typename T23, typename T24, typename T25,
13541 typename T26, typename T27, typename T28, typename T29, typename T30,
13542 typename T31, typename T32, typename T33, typename T34, typename T35,
13544 class ValueArray36 {
13546 ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13547 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13548 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13549 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13550 T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
13551 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
13552 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
13553 v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
13554 v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
13555 v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
13557 template <typename T>
13558 operator ParamGenerator<T>() const {
13559 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13560 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13561 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13562 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13563 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13564 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13565 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13566 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13567 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13568 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13569 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13570 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13571 static_cast<T>(v36_)};
13572 return ValuesIn(array);
13576 // No implementation - assignment is unsupported.
13577 void operator=(const ValueArray36& other);
13617 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13618 typename T6, typename T7, typename T8, typename T9, typename T10,
13619 typename T11, typename T12, typename T13, typename T14, typename T15,
13620 typename T16, typename T17, typename T18, typename T19, typename T20,
13621 typename T21, typename T22, typename T23, typename T24, typename T25,
13622 typename T26, typename T27, typename T28, typename T29, typename T30,
13623 typename T31, typename T32, typename T33, typename T34, typename T35,
13624 typename T36, typename T37>
13625 class ValueArray37 {
13627 ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13628 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13629 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13630 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13631 T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
13632 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
13633 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
13634 v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
13635 v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
13636 v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
13637 v36_(v36), v37_(v37) {}
13639 template <typename T>
13640 operator ParamGenerator<T>() const {
13641 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13642 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13643 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13644 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13645 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13646 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13647 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13648 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13649 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13650 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13651 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13652 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13653 static_cast<T>(v36_), static_cast<T>(v37_)};
13654 return ValuesIn(array);
13658 // No implementation - assignment is unsupported.
13659 void operator=(const ValueArray37& other);
13700 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13701 typename T6, typename T7, typename T8, typename T9, typename T10,
13702 typename T11, typename T12, typename T13, typename T14, typename T15,
13703 typename T16, typename T17, typename T18, typename T19, typename T20,
13704 typename T21, typename T22, typename T23, typename T24, typename T25,
13705 typename T26, typename T27, typename T28, typename T29, typename T30,
13706 typename T31, typename T32, typename T33, typename T34, typename T35,
13707 typename T36, typename T37, typename T38>
13708 class ValueArray38 {
13710 ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13711 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13712 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13713 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13714 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
13715 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13716 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13717 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13718 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13719 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13720 v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
13722 template <typename T>
13723 operator ParamGenerator<T>() const {
13724 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13725 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13726 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13727 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13728 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13729 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13730 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13731 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13732 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13733 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13734 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13735 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13736 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};
13737 return ValuesIn(array);
13741 // No implementation - assignment is unsupported.
13742 void operator=(const ValueArray38& other);
13784 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13785 typename T6, typename T7, typename T8, typename T9, typename T10,
13786 typename T11, typename T12, typename T13, typename T14, typename T15,
13787 typename T16, typename T17, typename T18, typename T19, typename T20,
13788 typename T21, typename T22, typename T23, typename T24, typename T25,
13789 typename T26, typename T27, typename T28, typename T29, typename T30,
13790 typename T31, typename T32, typename T33, typename T34, typename T35,
13791 typename T36, typename T37, typename T38, typename T39>
13792 class ValueArray39 {
13794 ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13795 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13796 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13797 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13798 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
13799 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13800 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13801 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13802 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13803 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13804 v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
13806 template <typename T>
13807 operator ParamGenerator<T>() const {
13808 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13809 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13810 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13811 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13812 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13813 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13814 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13815 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13816 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13817 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13818 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13819 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13820 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13821 static_cast<T>(v39_)};
13822 return ValuesIn(array);
13826 // No implementation - assignment is unsupported.
13827 void operator=(const ValueArray39& other);
13870 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13871 typename T6, typename T7, typename T8, typename T9, typename T10,
13872 typename T11, typename T12, typename T13, typename T14, typename T15,
13873 typename T16, typename T17, typename T18, typename T19, typename T20,
13874 typename T21, typename T22, typename T23, typename T24, typename T25,
13875 typename T26, typename T27, typename T28, typename T29, typename T30,
13876 typename T31, typename T32, typename T33, typename T34, typename T35,
13877 typename T36, typename T37, typename T38, typename T39, typename T40>
13878 class ValueArray40 {
13880 ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13881 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13882 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13883 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13884 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
13885 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
13886 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
13887 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
13888 v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
13889 v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
13890 v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
13893 template <typename T>
13894 operator ParamGenerator<T>() const {
13895 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13896 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13897 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13898 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13899 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13900 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13901 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13902 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13903 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13904 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13905 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13906 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13907 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13908 static_cast<T>(v39_), static_cast<T>(v40_)};
13909 return ValuesIn(array);
13913 // No implementation - assignment is unsupported.
13914 void operator=(const ValueArray40& other);
13958 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13959 typename T6, typename T7, typename T8, typename T9, typename T10,
13960 typename T11, typename T12, typename T13, typename T14, typename T15,
13961 typename T16, typename T17, typename T18, typename T19, typename T20,
13962 typename T21, typename T22, typename T23, typename T24, typename T25,
13963 typename T26, typename T27, typename T28, typename T29, typename T30,
13964 typename T31, typename T32, typename T33, typename T34, typename T35,
13965 typename T36, typename T37, typename T38, typename T39, typename T40,
13967 class ValueArray41 {
13969 ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13970 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13971 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13972 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13973 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
13974 T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13975 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13976 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13977 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13978 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13979 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13980 v39_(v39), v40_(v40), v41_(v41) {}
13982 template <typename T>
13983 operator ParamGenerator<T>() const {
13984 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13985 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13986 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13987 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13988 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13989 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13990 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13991 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13992 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13993 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13994 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13995 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13996 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13997 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};
13998 return ValuesIn(array);
14002 // No implementation - assignment is unsupported.
14003 void operator=(const ValueArray41& other);
14048 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14049 typename T6, typename T7, typename T8, typename T9, typename T10,
14050 typename T11, typename T12, typename T13, typename T14, typename T15,
14051 typename T16, typename T17, typename T18, typename T19, typename T20,
14052 typename T21, typename T22, typename T23, typename T24, typename T25,
14053 typename T26, typename T27, typename T28, typename T29, typename T30,
14054 typename T31, typename T32, typename T33, typename T34, typename T35,
14055 typename T36, typename T37, typename T38, typename T39, typename T40,
14056 typename T41, typename T42>
14057 class ValueArray42 {
14059 ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14060 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14061 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14062 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14063 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14064 T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
14065 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
14066 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
14067 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
14068 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
14069 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
14070 v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
14072 template <typename T>
14073 operator ParamGenerator<T>() const {
14074 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14075 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14076 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14077 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14078 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14079 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14080 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14081 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14082 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14083 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14084 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14085 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14086 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14087 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
14088 static_cast<T>(v42_)};
14089 return ValuesIn(array);
14093 // No implementation - assignment is unsupported.
14094 void operator=(const ValueArray42& other);
14140 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14141 typename T6, typename T7, typename T8, typename T9, typename T10,
14142 typename T11, typename T12, typename T13, typename T14, typename T15,
14143 typename T16, typename T17, typename T18, typename T19, typename T20,
14144 typename T21, typename T22, typename T23, typename T24, typename T25,
14145 typename T26, typename T27, typename T28, typename T29, typename T30,
14146 typename T31, typename T32, typename T33, typename T34, typename T35,
14147 typename T36, typename T37, typename T38, typename T39, typename T40,
14148 typename T41, typename T42, typename T43>
14149 class ValueArray43 {
14151 ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14152 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14153 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14154 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14155 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14156 T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
14157 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
14158 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
14159 v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
14160 v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
14161 v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
14162 v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
14164 template <typename T>
14165 operator ParamGenerator<T>() const {
14166 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14167 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14168 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14169 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14170 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14171 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14172 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14173 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14174 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14175 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14176 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14177 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14178 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14179 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
14180 static_cast<T>(v42_), static_cast<T>(v43_)};
14181 return ValuesIn(array);
14185 // No implementation - assignment is unsupported.
14186 void operator=(const ValueArray43& other);
14233 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14234 typename T6, typename T7, typename T8, typename T9, typename T10,
14235 typename T11, typename T12, typename T13, typename T14, typename T15,
14236 typename T16, typename T17, typename T18, typename T19, typename T20,
14237 typename T21, typename T22, typename T23, typename T24, typename T25,
14238 typename T26, typename T27, typename T28, typename T29, typename T30,
14239 typename T31, typename T32, typename T33, typename T34, typename T35,
14240 typename T36, typename T37, typename T38, typename T39, typename T40,
14241 typename T41, typename T42, typename T43, typename T44>
14242 class ValueArray44 {
14244 ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14245 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14246 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14247 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14248 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14249 T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
14250 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
14251 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
14252 v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
14253 v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
14254 v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
14255 v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
14256 v43_(v43), v44_(v44) {}
14258 template <typename T>
14259 operator ParamGenerator<T>() const {
14260 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14261 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14262 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14263 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14264 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14265 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14266 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14267 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14268 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14269 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14270 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14271 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14272 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14273 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
14274 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};
14275 return ValuesIn(array);
14279 // No implementation - assignment is unsupported.
14280 void operator=(const ValueArray44& other);
14328 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14329 typename T6, typename T7, typename T8, typename T9, typename T10,
14330 typename T11, typename T12, typename T13, typename T14, typename T15,
14331 typename T16, typename T17, typename T18, typename T19, typename T20,
14332 typename T21, typename T22, typename T23, typename T24, typename T25,
14333 typename T26, typename T27, typename T28, typename T29, typename T30,
14334 typename T31, typename T32, typename T33, typename T34, typename T35,
14335 typename T36, typename T37, typename T38, typename T39, typename T40,
14336 typename T41, typename T42, typename T43, typename T44, typename T45>
14337 class ValueArray45 {
14339 ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14340 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14341 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14342 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14343 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14344 T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
14345 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
14346 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
14347 v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
14348 v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
14349 v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
14350 v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
14351 v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
14353 template <typename T>
14354 operator ParamGenerator<T>() const {
14355 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14356 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14357 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14358 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14359 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14360 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14361 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14362 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14363 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14364 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14365 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14366 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14367 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14368 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
14369 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
14370 static_cast<T>(v45_)};
14371 return ValuesIn(array);
14375 // No implementation - assignment is unsupported.
14376 void operator=(const ValueArray45& other);
14425 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14426 typename T6, typename T7, typename T8, typename T9, typename T10,
14427 typename T11, typename T12, typename T13, typename T14, typename T15,
14428 typename T16, typename T17, typename T18, typename T19, typename T20,
14429 typename T21, typename T22, typename T23, typename T24, typename T25,
14430 typename T26, typename T27, typename T28, typename T29, typename T30,
14431 typename T31, typename T32, typename T33, typename T34, typename T35,
14432 typename T36, typename T37, typename T38, typename T39, typename T40,
14433 typename T41, typename T42, typename T43, typename T44, typename T45,
14435 class ValueArray46 {
14437 ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14438 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14439 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14440 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14441 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14442 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
14443 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
14444 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
14445 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
14446 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
14447 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
14448 v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
14449 v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
14451 template <typename T>
14452 operator ParamGenerator<T>() const {
14453 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14454 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14455 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14456 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14457 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14458 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14459 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14460 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14461 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14462 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14463 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14464 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14465 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14466 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
14467 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
14468 static_cast<T>(v45_), static_cast<T>(v46_)};
14469 return ValuesIn(array);
14473 // No implementation - assignment is unsupported.
14474 void operator=(const ValueArray46& other);
14524 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14525 typename T6, typename T7, typename T8, typename T9, typename T10,
14526 typename T11, typename T12, typename T13, typename T14, typename T15,
14527 typename T16, typename T17, typename T18, typename T19, typename T20,
14528 typename T21, typename T22, typename T23, typename T24, typename T25,
14529 typename T26, typename T27, typename T28, typename T29, typename T30,
14530 typename T31, typename T32, typename T33, typename T34, typename T35,
14531 typename T36, typename T37, typename T38, typename T39, typename T40,
14532 typename T41, typename T42, typename T43, typename T44, typename T45,
14533 typename T46, typename T47>
14534 class ValueArray47 {
14536 ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14537 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14538 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14539 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14540 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14541 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
14542 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
14543 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
14544 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
14545 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
14546 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
14547 v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
14548 v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
14551 template <typename T>
14552 operator ParamGenerator<T>() const {
14553 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14554 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14555 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14556 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14557 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14558 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14559 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14560 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14561 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14562 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14563 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14564 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14565 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14566 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
14567 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
14568 static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};
14569 return ValuesIn(array);
14573 // No implementation - assignment is unsupported.
14574 void operator=(const ValueArray47& other);
14625 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14626 typename T6, typename T7, typename T8, typename T9, typename T10,
14627 typename T11, typename T12, typename T13, typename T14, typename T15,
14628 typename T16, typename T17, typename T18, typename T19, typename T20,
14629 typename T21, typename T22, typename T23, typename T24, typename T25,
14630 typename T26, typename T27, typename T28, typename T29, typename T30,
14631 typename T31, typename T32, typename T33, typename T34, typename T35,
14632 typename T36, typename T37, typename T38, typename T39, typename T40,
14633 typename T41, typename T42, typename T43, typename T44, typename T45,
14634 typename T46, typename T47, typename T48>
14635 class ValueArray48 {
14637 ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14638 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14639 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14640 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14641 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14642 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
14643 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
14644 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
14645 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
14646 v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
14647 v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
14648 v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
14649 v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
14650 v46_(v46), v47_(v47), v48_(v48) {}
14652 template <typename T>
14653 operator ParamGenerator<T>() const {
14654 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14655 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14656 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14657 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14658 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14659 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14660 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14661 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14662 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14663 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14664 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14665 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14666 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14667 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
14668 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
14669 static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
14670 static_cast<T>(v48_)};
14671 return ValuesIn(array);
14675 // No implementation - assignment is unsupported.
14676 void operator=(const ValueArray48& other);
14728 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14729 typename T6, typename T7, typename T8, typename T9, typename T10,
14730 typename T11, typename T12, typename T13, typename T14, typename T15,
14731 typename T16, typename T17, typename T18, typename T19, typename T20,
14732 typename T21, typename T22, typename T23, typename T24, typename T25,
14733 typename T26, typename T27, typename T28, typename T29, typename T30,
14734 typename T31, typename T32, typename T33, typename T34, typename T35,
14735 typename T36, typename T37, typename T38, typename T39, typename T40,
14736 typename T41, typename T42, typename T43, typename T44, typename T45,
14737 typename T46, typename T47, typename T48, typename T49>
14738 class ValueArray49 {
14740 ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14741 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14742 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14743 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14744 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14745 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
14746 T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
14747 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
14748 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
14749 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
14750 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
14751 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
14752 v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
14753 v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
14755 template <typename T>
14756 operator ParamGenerator<T>() const {
14757 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14758 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14759 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14760 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14761 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14762 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14763 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14764 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14765 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14766 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14767 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14768 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14769 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14770 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
14771 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
14772 static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
14773 static_cast<T>(v48_), static_cast<T>(v49_)};
14774 return ValuesIn(array);
14778 // No implementation - assignment is unsupported.
14779 void operator=(const ValueArray49& other);
14832 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14833 typename T6, typename T7, typename T8, typename T9, typename T10,
14834 typename T11, typename T12, typename T13, typename T14, typename T15,
14835 typename T16, typename T17, typename T18, typename T19, typename T20,
14836 typename T21, typename T22, typename T23, typename T24, typename T25,
14837 typename T26, typename T27, typename T28, typename T29, typename T30,
14838 typename T31, typename T32, typename T33, typename T34, typename T35,
14839 typename T36, typename T37, typename T38, typename T39, typename T40,
14840 typename T41, typename T42, typename T43, typename T44, typename T45,
14841 typename T46, typename T47, typename T48, typename T49, typename T50>
14842 class ValueArray50 {
14844 ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14845 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14846 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14847 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14848 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14849 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
14850 T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
14851 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
14852 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
14853 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
14854 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
14855 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
14856 v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
14857 v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
14859 template <typename T>
14860 operator ParamGenerator<T>() const {
14861 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
14862 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
14863 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
14864 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
14865 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
14866 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
14867 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
14868 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
14869 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
14870 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
14871 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
14872 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
14873 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
14874 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
14875 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
14876 static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
14877 static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};
14878 return ValuesIn(array);
14882 // No implementation - assignment is unsupported.
14883 void operator=(const ValueArray50& other);
14937 # if GTEST_HAS_COMBINE
14938 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
14940 // Generates values from the Cartesian product of values produced
14941 // by the argument generators.
14943 template <typename T1, typename T2>
14944 class CartesianProductGenerator2
14945 : public ParamGeneratorInterface< ::testing::tuple<T1, T2> > {
14947 typedef ::testing::tuple<T1, T2> ParamType;
14949 CartesianProductGenerator2(const ParamGenerator<T1>& g1,
14950 const ParamGenerator<T2>& g2)
14951 : g1_(g1), g2_(g2) {}
14952 virtual ~CartesianProductGenerator2() {}
14954 virtual ParamIteratorInterface<ParamType>* Begin() const {
14955 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
14957 virtual ParamIteratorInterface<ParamType>* End() const {
14958 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
14962 class Iterator : public ParamIteratorInterface<ParamType> {
14964 Iterator(const ParamGeneratorInterface<ParamType>* base,
14965 const ParamGenerator<T1>& g1,
14966 const typename ParamGenerator<T1>::iterator& current1,
14967 const ParamGenerator<T2>& g2,
14968 const typename ParamGenerator<T2>::iterator& current2)
14970 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14971 begin2_(g2.begin()), end2_(g2.end()), current2_(current2) {
14972 ComputeCurrentValue();
14974 virtual ~Iterator() {}
14976 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14979 // Advance should not be called on beyond-of-range iterators
14980 // so no component iterators must be beyond end of range, either.
14981 virtual void Advance() {
14984 if (current2_ == end2_) {
14985 current2_ = begin2_;
14988 ComputeCurrentValue();
14990 virtual ParamIteratorInterface<ParamType>* Clone() const {
14991 return new Iterator(*this);
14993 virtual const ParamType* Current() const { return ¤t_value_; }
14994 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14995 // Having the same base generator guarantees that the other
14996 // iterator is of the same type and we can downcast.
14997 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14998 << "The program attempted to compare iterators "
14999 << "from different generators." << std::endl;
15000 const Iterator* typed_other =
15001 CheckedDowncastToActualType<const Iterator>(&other);
15002 // We must report iterators equal if they both point beyond their
15003 // respective ranges. That can happen in a variety of fashions,
15004 // so we have to consult AtEnd().
15005 return (AtEnd() && typed_other->AtEnd()) ||
15007 current1_ == typed_other->current1_ &&
15008 current2_ == typed_other->current2_);
15012 Iterator(const Iterator& other)
15013 : base_(other.base_),
15014 begin1_(other.begin1_),
15015 end1_(other.end1_),
15016 current1_(other.current1_),
15017 begin2_(other.begin2_),
15018 end2_(other.end2_),
15019 current2_(other.current2_) {
15020 ComputeCurrentValue();
15023 void ComputeCurrentValue() {
15025 current_value_ = ParamType(*current1_, *current2_);
15027 bool AtEnd() const {
15028 // We must report iterator past the end of the range when either of the
15029 // component iterators has reached the end of its range.
15031 current1_ == end1_ ||
15032 current2_ == end2_;
15035 // No implementation - assignment is unsupported.
15036 void operator=(const Iterator& other);
15038 const ParamGeneratorInterface<ParamType>* const base_;
15039 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15040 // current[i]_ is the actual traversing iterator.
15041 const typename ParamGenerator<T1>::iterator begin1_;
15042 const typename ParamGenerator<T1>::iterator end1_;
15043 typename ParamGenerator<T1>::iterator current1_;
15044 const typename ParamGenerator<T2>::iterator begin2_;
15045 const typename ParamGenerator<T2>::iterator end2_;
15046 typename ParamGenerator<T2>::iterator current2_;
15047 ParamType current_value_;
15048 }; // class CartesianProductGenerator2::Iterator
15050 // No implementation - assignment is unsupported.
15051 void operator=(const CartesianProductGenerator2& other);
15053 const ParamGenerator<T1> g1_;
15054 const ParamGenerator<T2> g2_;
15055 }; // class CartesianProductGenerator2
15058 template <typename T1, typename T2, typename T3>
15059 class CartesianProductGenerator3
15060 : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3> > {
15062 typedef ::testing::tuple<T1, T2, T3> ParamType;
15064 CartesianProductGenerator3(const ParamGenerator<T1>& g1,
15065 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
15066 : g1_(g1), g2_(g2), g3_(g3) {}
15067 virtual ~CartesianProductGenerator3() {}
15069 virtual ParamIteratorInterface<ParamType>* Begin() const {
15070 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15073 virtual ParamIteratorInterface<ParamType>* End() const {
15074 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
15078 class Iterator : public ParamIteratorInterface<ParamType> {
15080 Iterator(const ParamGeneratorInterface<ParamType>* base,
15081 const ParamGenerator<T1>& g1,
15082 const typename ParamGenerator<T1>::iterator& current1,
15083 const ParamGenerator<T2>& g2,
15084 const typename ParamGenerator<T2>::iterator& current2,
15085 const ParamGenerator<T3>& g3,
15086 const typename ParamGenerator<T3>::iterator& current3)
15088 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15089 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15090 begin3_(g3.begin()), end3_(g3.end()), current3_(current3) {
15091 ComputeCurrentValue();
15093 virtual ~Iterator() {}
15095 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15098 // Advance should not be called on beyond-of-range iterators
15099 // so no component iterators must be beyond end of range, either.
15100 virtual void Advance() {
15103 if (current3_ == end3_) {
15104 current3_ = begin3_;
15107 if (current2_ == end2_) {
15108 current2_ = begin2_;
15111 ComputeCurrentValue();
15113 virtual ParamIteratorInterface<ParamType>* Clone() const {
15114 return new Iterator(*this);
15116 virtual const ParamType* Current() const { return ¤t_value_; }
15117 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15118 // Having the same base generator guarantees that the other
15119 // iterator is of the same type and we can downcast.
15120 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15121 << "The program attempted to compare iterators "
15122 << "from different generators." << std::endl;
15123 const Iterator* typed_other =
15124 CheckedDowncastToActualType<const Iterator>(&other);
15125 // We must report iterators equal if they both point beyond their
15126 // respective ranges. That can happen in a variety of fashions,
15127 // so we have to consult AtEnd().
15128 return (AtEnd() && typed_other->AtEnd()) ||
15130 current1_ == typed_other->current1_ &&
15131 current2_ == typed_other->current2_ &&
15132 current3_ == typed_other->current3_);
15136 Iterator(const Iterator& other)
15137 : base_(other.base_),
15138 begin1_(other.begin1_),
15139 end1_(other.end1_),
15140 current1_(other.current1_),
15141 begin2_(other.begin2_),
15142 end2_(other.end2_),
15143 current2_(other.current2_),
15144 begin3_(other.begin3_),
15145 end3_(other.end3_),
15146 current3_(other.current3_) {
15147 ComputeCurrentValue();
15150 void ComputeCurrentValue() {
15152 current_value_ = ParamType(*current1_, *current2_, *current3_);
15154 bool AtEnd() const {
15155 // We must report iterator past the end of the range when either of the
15156 // component iterators has reached the end of its range.
15158 current1_ == end1_ ||
15159 current2_ == end2_ ||
15160 current3_ == end3_;
15163 // No implementation - assignment is unsupported.
15164 void operator=(const Iterator& other);
15166 const ParamGeneratorInterface<ParamType>* const base_;
15167 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15168 // current[i]_ is the actual traversing iterator.
15169 const typename ParamGenerator<T1>::iterator begin1_;
15170 const typename ParamGenerator<T1>::iterator end1_;
15171 typename ParamGenerator<T1>::iterator current1_;
15172 const typename ParamGenerator<T2>::iterator begin2_;
15173 const typename ParamGenerator<T2>::iterator end2_;
15174 typename ParamGenerator<T2>::iterator current2_;
15175 const typename ParamGenerator<T3>::iterator begin3_;
15176 const typename ParamGenerator<T3>::iterator end3_;
15177 typename ParamGenerator<T3>::iterator current3_;
15178 ParamType current_value_;
15179 }; // class CartesianProductGenerator3::Iterator
15181 // No implementation - assignment is unsupported.
15182 void operator=(const CartesianProductGenerator3& other);
15184 const ParamGenerator<T1> g1_;
15185 const ParamGenerator<T2> g2_;
15186 const ParamGenerator<T3> g3_;
15187 }; // class CartesianProductGenerator3
15190 template <typename T1, typename T2, typename T3, typename T4>
15191 class CartesianProductGenerator4
15192 : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4> > {
15194 typedef ::testing::tuple<T1, T2, T3, T4> ParamType;
15196 CartesianProductGenerator4(const ParamGenerator<T1>& g1,
15197 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15198 const ParamGenerator<T4>& g4)
15199 : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
15200 virtual ~CartesianProductGenerator4() {}
15202 virtual ParamIteratorInterface<ParamType>* Begin() const {
15203 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15204 g3_.begin(), g4_, g4_.begin());
15206 virtual ParamIteratorInterface<ParamType>* End() const {
15207 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15212 class Iterator : public ParamIteratorInterface<ParamType> {
15214 Iterator(const ParamGeneratorInterface<ParamType>* base,
15215 const ParamGenerator<T1>& g1,
15216 const typename ParamGenerator<T1>::iterator& current1,
15217 const ParamGenerator<T2>& g2,
15218 const typename ParamGenerator<T2>::iterator& current2,
15219 const ParamGenerator<T3>& g3,
15220 const typename ParamGenerator<T3>::iterator& current3,
15221 const ParamGenerator<T4>& g4,
15222 const typename ParamGenerator<T4>::iterator& current4)
15224 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15225 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15226 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15227 begin4_(g4.begin()), end4_(g4.end()), current4_(current4) {
15228 ComputeCurrentValue();
15230 virtual ~Iterator() {}
15232 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15235 // Advance should not be called on beyond-of-range iterators
15236 // so no component iterators must be beyond end of range, either.
15237 virtual void Advance() {
15240 if (current4_ == end4_) {
15241 current4_ = begin4_;
15244 if (current3_ == end3_) {
15245 current3_ = begin3_;
15248 if (current2_ == end2_) {
15249 current2_ = begin2_;
15252 ComputeCurrentValue();
15254 virtual ParamIteratorInterface<ParamType>* Clone() const {
15255 return new Iterator(*this);
15257 virtual const ParamType* Current() const { return ¤t_value_; }
15258 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15259 // Having the same base generator guarantees that the other
15260 // iterator is of the same type and we can downcast.
15261 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15262 << "The program attempted to compare iterators "
15263 << "from different generators." << std::endl;
15264 const Iterator* typed_other =
15265 CheckedDowncastToActualType<const Iterator>(&other);
15266 // We must report iterators equal if they both point beyond their
15267 // respective ranges. That can happen in a variety of fashions,
15268 // so we have to consult AtEnd().
15269 return (AtEnd() && typed_other->AtEnd()) ||
15271 current1_ == typed_other->current1_ &&
15272 current2_ == typed_other->current2_ &&
15273 current3_ == typed_other->current3_ &&
15274 current4_ == typed_other->current4_);
15278 Iterator(const Iterator& other)
15279 : base_(other.base_),
15280 begin1_(other.begin1_),
15281 end1_(other.end1_),
15282 current1_(other.current1_),
15283 begin2_(other.begin2_),
15284 end2_(other.end2_),
15285 current2_(other.current2_),
15286 begin3_(other.begin3_),
15287 end3_(other.end3_),
15288 current3_(other.current3_),
15289 begin4_(other.begin4_),
15290 end4_(other.end4_),
15291 current4_(other.current4_) {
15292 ComputeCurrentValue();
15295 void ComputeCurrentValue() {
15297 current_value_ = ParamType(*current1_, *current2_, *current3_,
15300 bool AtEnd() const {
15301 // We must report iterator past the end of the range when either of the
15302 // component iterators has reached the end of its range.
15304 current1_ == end1_ ||
15305 current2_ == end2_ ||
15306 current3_ == end3_ ||
15307 current4_ == end4_;
15310 // No implementation - assignment is unsupported.
15311 void operator=(const Iterator& other);
15313 const ParamGeneratorInterface<ParamType>* const base_;
15314 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15315 // current[i]_ is the actual traversing iterator.
15316 const typename ParamGenerator<T1>::iterator begin1_;
15317 const typename ParamGenerator<T1>::iterator end1_;
15318 typename ParamGenerator<T1>::iterator current1_;
15319 const typename ParamGenerator<T2>::iterator begin2_;
15320 const typename ParamGenerator<T2>::iterator end2_;
15321 typename ParamGenerator<T2>::iterator current2_;
15322 const typename ParamGenerator<T3>::iterator begin3_;
15323 const typename ParamGenerator<T3>::iterator end3_;
15324 typename ParamGenerator<T3>::iterator current3_;
15325 const typename ParamGenerator<T4>::iterator begin4_;
15326 const typename ParamGenerator<T4>::iterator end4_;
15327 typename ParamGenerator<T4>::iterator current4_;
15328 ParamType current_value_;
15329 }; // class CartesianProductGenerator4::Iterator
15331 // No implementation - assignment is unsupported.
15332 void operator=(const CartesianProductGenerator4& other);
15334 const ParamGenerator<T1> g1_;
15335 const ParamGenerator<T2> g2_;
15336 const ParamGenerator<T3> g3_;
15337 const ParamGenerator<T4> g4_;
15338 }; // class CartesianProductGenerator4
15341 template <typename T1, typename T2, typename T3, typename T4, typename T5>
15342 class CartesianProductGenerator5
15343 : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5> > {
15345 typedef ::testing::tuple<T1, T2, T3, T4, T5> ParamType;
15347 CartesianProductGenerator5(const ParamGenerator<T1>& g1,
15348 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15349 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
15350 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
15351 virtual ~CartesianProductGenerator5() {}
15353 virtual ParamIteratorInterface<ParamType>* Begin() const {
15354 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15355 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
15357 virtual ParamIteratorInterface<ParamType>* End() const {
15358 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15359 g4_, g4_.end(), g5_, g5_.end());
15363 class Iterator : public ParamIteratorInterface<ParamType> {
15365 Iterator(const ParamGeneratorInterface<ParamType>* base,
15366 const ParamGenerator<T1>& g1,
15367 const typename ParamGenerator<T1>::iterator& current1,
15368 const ParamGenerator<T2>& g2,
15369 const typename ParamGenerator<T2>::iterator& current2,
15370 const ParamGenerator<T3>& g3,
15371 const typename ParamGenerator<T3>::iterator& current3,
15372 const ParamGenerator<T4>& g4,
15373 const typename ParamGenerator<T4>::iterator& current4,
15374 const ParamGenerator<T5>& g5,
15375 const typename ParamGenerator<T5>::iterator& current5)
15377 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15378 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15379 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15380 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15381 begin5_(g5.begin()), end5_(g5.end()), current5_(current5) {
15382 ComputeCurrentValue();
15384 virtual ~Iterator() {}
15386 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15389 // Advance should not be called on beyond-of-range iterators
15390 // so no component iterators must be beyond end of range, either.
15391 virtual void Advance() {
15394 if (current5_ == end5_) {
15395 current5_ = begin5_;
15398 if (current4_ == end4_) {
15399 current4_ = begin4_;
15402 if (current3_ == end3_) {
15403 current3_ = begin3_;
15406 if (current2_ == end2_) {
15407 current2_ = begin2_;
15410 ComputeCurrentValue();
15412 virtual ParamIteratorInterface<ParamType>* Clone() const {
15413 return new Iterator(*this);
15415 virtual const ParamType* Current() const { return ¤t_value_; }
15416 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15417 // Having the same base generator guarantees that the other
15418 // iterator is of the same type and we can downcast.
15419 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15420 << "The program attempted to compare iterators "
15421 << "from different generators." << std::endl;
15422 const Iterator* typed_other =
15423 CheckedDowncastToActualType<const Iterator>(&other);
15424 // We must report iterators equal if they both point beyond their
15425 // respective ranges. That can happen in a variety of fashions,
15426 // so we have to consult AtEnd().
15427 return (AtEnd() && typed_other->AtEnd()) ||
15429 current1_ == typed_other->current1_ &&
15430 current2_ == typed_other->current2_ &&
15431 current3_ == typed_other->current3_ &&
15432 current4_ == typed_other->current4_ &&
15433 current5_ == typed_other->current5_);
15437 Iterator(const Iterator& other)
15438 : base_(other.base_),
15439 begin1_(other.begin1_),
15440 end1_(other.end1_),
15441 current1_(other.current1_),
15442 begin2_(other.begin2_),
15443 end2_(other.end2_),
15444 current2_(other.current2_),
15445 begin3_(other.begin3_),
15446 end3_(other.end3_),
15447 current3_(other.current3_),
15448 begin4_(other.begin4_),
15449 end4_(other.end4_),
15450 current4_(other.current4_),
15451 begin5_(other.begin5_),
15452 end5_(other.end5_),
15453 current5_(other.current5_) {
15454 ComputeCurrentValue();
15457 void ComputeCurrentValue() {
15459 current_value_ = ParamType(*current1_, *current2_, *current3_,
15460 *current4_, *current5_);
15462 bool AtEnd() const {
15463 // We must report iterator past the end of the range when either of the
15464 // component iterators has reached the end of its range.
15466 current1_ == end1_ ||
15467 current2_ == end2_ ||
15468 current3_ == end3_ ||
15469 current4_ == end4_ ||
15470 current5_ == end5_;
15473 // No implementation - assignment is unsupported.
15474 void operator=(const Iterator& other);
15476 const ParamGeneratorInterface<ParamType>* const base_;
15477 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15478 // current[i]_ is the actual traversing iterator.
15479 const typename ParamGenerator<T1>::iterator begin1_;
15480 const typename ParamGenerator<T1>::iterator end1_;
15481 typename ParamGenerator<T1>::iterator current1_;
15482 const typename ParamGenerator<T2>::iterator begin2_;
15483 const typename ParamGenerator<T2>::iterator end2_;
15484 typename ParamGenerator<T2>::iterator current2_;
15485 const typename ParamGenerator<T3>::iterator begin3_;
15486 const typename ParamGenerator<T3>::iterator end3_;
15487 typename ParamGenerator<T3>::iterator current3_;
15488 const typename ParamGenerator<T4>::iterator begin4_;
15489 const typename ParamGenerator<T4>::iterator end4_;
15490 typename ParamGenerator<T4>::iterator current4_;
15491 const typename ParamGenerator<T5>::iterator begin5_;
15492 const typename ParamGenerator<T5>::iterator end5_;
15493 typename ParamGenerator<T5>::iterator current5_;
15494 ParamType current_value_;
15495 }; // class CartesianProductGenerator5::Iterator
15497 // No implementation - assignment is unsupported.
15498 void operator=(const CartesianProductGenerator5& other);
15500 const ParamGenerator<T1> g1_;
15501 const ParamGenerator<T2> g2_;
15502 const ParamGenerator<T3> g3_;
15503 const ParamGenerator<T4> g4_;
15504 const ParamGenerator<T5> g5_;
15505 }; // class CartesianProductGenerator5
15508 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15510 class CartesianProductGenerator6
15511 : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5,
15514 typedef ::testing::tuple<T1, T2, T3, T4, T5, T6> ParamType;
15516 CartesianProductGenerator6(const ParamGenerator<T1>& g1,
15517 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15518 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
15519 const ParamGenerator<T6>& g6)
15520 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
15521 virtual ~CartesianProductGenerator6() {}
15523 virtual ParamIteratorInterface<ParamType>* Begin() const {
15524 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15525 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
15527 virtual ParamIteratorInterface<ParamType>* End() const {
15528 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15529 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
15533 class Iterator : public ParamIteratorInterface<ParamType> {
15535 Iterator(const ParamGeneratorInterface<ParamType>* base,
15536 const ParamGenerator<T1>& g1,
15537 const typename ParamGenerator<T1>::iterator& current1,
15538 const ParamGenerator<T2>& g2,
15539 const typename ParamGenerator<T2>::iterator& current2,
15540 const ParamGenerator<T3>& g3,
15541 const typename ParamGenerator<T3>::iterator& current3,
15542 const ParamGenerator<T4>& g4,
15543 const typename ParamGenerator<T4>::iterator& current4,
15544 const ParamGenerator<T5>& g5,
15545 const typename ParamGenerator<T5>::iterator& current5,
15546 const ParamGenerator<T6>& g6,
15547 const typename ParamGenerator<T6>::iterator& current6)
15549 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15550 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15551 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15552 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15553 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15554 begin6_(g6.begin()), end6_(g6.end()), current6_(current6) {
15555 ComputeCurrentValue();
15557 virtual ~Iterator() {}
15559 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15562 // Advance should not be called on beyond-of-range iterators
15563 // so no component iterators must be beyond end of range, either.
15564 virtual void Advance() {
15567 if (current6_ == end6_) {
15568 current6_ = begin6_;
15571 if (current5_ == end5_) {
15572 current5_ = begin5_;
15575 if (current4_ == end4_) {
15576 current4_ = begin4_;
15579 if (current3_ == end3_) {
15580 current3_ = begin3_;
15583 if (current2_ == end2_) {
15584 current2_ = begin2_;
15587 ComputeCurrentValue();
15589 virtual ParamIteratorInterface<ParamType>* Clone() const {
15590 return new Iterator(*this);
15592 virtual const ParamType* Current() const { return ¤t_value_; }
15593 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15594 // Having the same base generator guarantees that the other
15595 // iterator is of the same type and we can downcast.
15596 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15597 << "The program attempted to compare iterators "
15598 << "from different generators." << std::endl;
15599 const Iterator* typed_other =
15600 CheckedDowncastToActualType<const Iterator>(&other);
15601 // We must report iterators equal if they both point beyond their
15602 // respective ranges. That can happen in a variety of fashions,
15603 // so we have to consult AtEnd().
15604 return (AtEnd() && typed_other->AtEnd()) ||
15606 current1_ == typed_other->current1_ &&
15607 current2_ == typed_other->current2_ &&
15608 current3_ == typed_other->current3_ &&
15609 current4_ == typed_other->current4_ &&
15610 current5_ == typed_other->current5_ &&
15611 current6_ == typed_other->current6_);
15615 Iterator(const Iterator& other)
15616 : base_(other.base_),
15617 begin1_(other.begin1_),
15618 end1_(other.end1_),
15619 current1_(other.current1_),
15620 begin2_(other.begin2_),
15621 end2_(other.end2_),
15622 current2_(other.current2_),
15623 begin3_(other.begin3_),
15624 end3_(other.end3_),
15625 current3_(other.current3_),
15626 begin4_(other.begin4_),
15627 end4_(other.end4_),
15628 current4_(other.current4_),
15629 begin5_(other.begin5_),
15630 end5_(other.end5_),
15631 current5_(other.current5_),
15632 begin6_(other.begin6_),
15633 end6_(other.end6_),
15634 current6_(other.current6_) {
15635 ComputeCurrentValue();
15638 void ComputeCurrentValue() {
15640 current_value_ = ParamType(*current1_, *current2_, *current3_,
15641 *current4_, *current5_, *current6_);
15643 bool AtEnd() const {
15644 // We must report iterator past the end of the range when either of the
15645 // component iterators has reached the end of its range.
15647 current1_ == end1_ ||
15648 current2_ == end2_ ||
15649 current3_ == end3_ ||
15650 current4_ == end4_ ||
15651 current5_ == end5_ ||
15652 current6_ == end6_;
15655 // No implementation - assignment is unsupported.
15656 void operator=(const Iterator& other);
15658 const ParamGeneratorInterface<ParamType>* const base_;
15659 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15660 // current[i]_ is the actual traversing iterator.
15661 const typename ParamGenerator<T1>::iterator begin1_;
15662 const typename ParamGenerator<T1>::iterator end1_;
15663 typename ParamGenerator<T1>::iterator current1_;
15664 const typename ParamGenerator<T2>::iterator begin2_;
15665 const typename ParamGenerator<T2>::iterator end2_;
15666 typename ParamGenerator<T2>::iterator current2_;
15667 const typename ParamGenerator<T3>::iterator begin3_;
15668 const typename ParamGenerator<T3>::iterator end3_;
15669 typename ParamGenerator<T3>::iterator current3_;
15670 const typename ParamGenerator<T4>::iterator begin4_;
15671 const typename ParamGenerator<T4>::iterator end4_;
15672 typename ParamGenerator<T4>::iterator current4_;
15673 const typename ParamGenerator<T5>::iterator begin5_;
15674 const typename ParamGenerator<T5>::iterator end5_;
15675 typename ParamGenerator<T5>::iterator current5_;
15676 const typename ParamGenerator<T6>::iterator begin6_;
15677 const typename ParamGenerator<T6>::iterator end6_;
15678 typename ParamGenerator<T6>::iterator current6_;
15679 ParamType current_value_;
15680 }; // class CartesianProductGenerator6::Iterator
15682 // No implementation - assignment is unsupported.
15683 void operator=(const CartesianProductGenerator6& other);
15685 const ParamGenerator<T1> g1_;
15686 const ParamGenerator<T2> g2_;
15687 const ParamGenerator<T3> g3_;
15688 const ParamGenerator<T4> g4_;
15689 const ParamGenerator<T5> g5_;
15690 const ParamGenerator<T6> g6_;
15691 }; // class CartesianProductGenerator6
15694 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15695 typename T6, typename T7>
15696 class CartesianProductGenerator7
15697 : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
15700 typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
15702 CartesianProductGenerator7(const ParamGenerator<T1>& g1,
15703 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15704 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
15705 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
15706 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
15707 virtual ~CartesianProductGenerator7() {}
15709 virtual ParamIteratorInterface<ParamType>* Begin() const {
15710 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15711 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
15714 virtual ParamIteratorInterface<ParamType>* End() const {
15715 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15716 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
15720 class Iterator : public ParamIteratorInterface<ParamType> {
15722 Iterator(const ParamGeneratorInterface<ParamType>* base,
15723 const ParamGenerator<T1>& g1,
15724 const typename ParamGenerator<T1>::iterator& current1,
15725 const ParamGenerator<T2>& g2,
15726 const typename ParamGenerator<T2>::iterator& current2,
15727 const ParamGenerator<T3>& g3,
15728 const typename ParamGenerator<T3>::iterator& current3,
15729 const ParamGenerator<T4>& g4,
15730 const typename ParamGenerator<T4>::iterator& current4,
15731 const ParamGenerator<T5>& g5,
15732 const typename ParamGenerator<T5>::iterator& current5,
15733 const ParamGenerator<T6>& g6,
15734 const typename ParamGenerator<T6>::iterator& current6,
15735 const ParamGenerator<T7>& g7,
15736 const typename ParamGenerator<T7>::iterator& current7)
15738 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15739 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15740 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15741 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15742 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15743 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
15744 begin7_(g7.begin()), end7_(g7.end()), current7_(current7) {
15745 ComputeCurrentValue();
15747 virtual ~Iterator() {}
15749 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15752 // Advance should not be called on beyond-of-range iterators
15753 // so no component iterators must be beyond end of range, either.
15754 virtual void Advance() {
15757 if (current7_ == end7_) {
15758 current7_ = begin7_;
15761 if (current6_ == end6_) {
15762 current6_ = begin6_;
15765 if (current5_ == end5_) {
15766 current5_ = begin5_;
15769 if (current4_ == end4_) {
15770 current4_ = begin4_;
15773 if (current3_ == end3_) {
15774 current3_ = begin3_;
15777 if (current2_ == end2_) {
15778 current2_ = begin2_;
15781 ComputeCurrentValue();
15783 virtual ParamIteratorInterface<ParamType>* Clone() const {
15784 return new Iterator(*this);
15786 virtual const ParamType* Current() const { return ¤t_value_; }
15787 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15788 // Having the same base generator guarantees that the other
15789 // iterator is of the same type and we can downcast.
15790 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15791 << "The program attempted to compare iterators "
15792 << "from different generators." << std::endl;
15793 const Iterator* typed_other =
15794 CheckedDowncastToActualType<const Iterator>(&other);
15795 // We must report iterators equal if they both point beyond their
15796 // respective ranges. That can happen in a variety of fashions,
15797 // so we have to consult AtEnd().
15798 return (AtEnd() && typed_other->AtEnd()) ||
15800 current1_ == typed_other->current1_ &&
15801 current2_ == typed_other->current2_ &&
15802 current3_ == typed_other->current3_ &&
15803 current4_ == typed_other->current4_ &&
15804 current5_ == typed_other->current5_ &&
15805 current6_ == typed_other->current6_ &&
15806 current7_ == typed_other->current7_);
15810 Iterator(const Iterator& other)
15811 : base_(other.base_),
15812 begin1_(other.begin1_),
15813 end1_(other.end1_),
15814 current1_(other.current1_),
15815 begin2_(other.begin2_),
15816 end2_(other.end2_),
15817 current2_(other.current2_),
15818 begin3_(other.begin3_),
15819 end3_(other.end3_),
15820 current3_(other.current3_),
15821 begin4_(other.begin4_),
15822 end4_(other.end4_),
15823 current4_(other.current4_),
15824 begin5_(other.begin5_),
15825 end5_(other.end5_),
15826 current5_(other.current5_),
15827 begin6_(other.begin6_),
15828 end6_(other.end6_),
15829 current6_(other.current6_),
15830 begin7_(other.begin7_),
15831 end7_(other.end7_),
15832 current7_(other.current7_) {
15833 ComputeCurrentValue();
15836 void ComputeCurrentValue() {
15838 current_value_ = ParamType(*current1_, *current2_, *current3_,
15839 *current4_, *current5_, *current6_, *current7_);
15841 bool AtEnd() const {
15842 // We must report iterator past the end of the range when either of the
15843 // component iterators has reached the end of its range.
15845 current1_ == end1_ ||
15846 current2_ == end2_ ||
15847 current3_ == end3_ ||
15848 current4_ == end4_ ||
15849 current5_ == end5_ ||
15850 current6_ == end6_ ||
15851 current7_ == end7_;
15854 // No implementation - assignment is unsupported.
15855 void operator=(const Iterator& other);
15857 const ParamGeneratorInterface<ParamType>* const base_;
15858 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15859 // current[i]_ is the actual traversing iterator.
15860 const typename ParamGenerator<T1>::iterator begin1_;
15861 const typename ParamGenerator<T1>::iterator end1_;
15862 typename ParamGenerator<T1>::iterator current1_;
15863 const typename ParamGenerator<T2>::iterator begin2_;
15864 const typename ParamGenerator<T2>::iterator end2_;
15865 typename ParamGenerator<T2>::iterator current2_;
15866 const typename ParamGenerator<T3>::iterator begin3_;
15867 const typename ParamGenerator<T3>::iterator end3_;
15868 typename ParamGenerator<T3>::iterator current3_;
15869 const typename ParamGenerator<T4>::iterator begin4_;
15870 const typename ParamGenerator<T4>::iterator end4_;
15871 typename ParamGenerator<T4>::iterator current4_;
15872 const typename ParamGenerator<T5>::iterator begin5_;
15873 const typename ParamGenerator<T5>::iterator end5_;
15874 typename ParamGenerator<T5>::iterator current5_;
15875 const typename ParamGenerator<T6>::iterator begin6_;
15876 const typename ParamGenerator<T6>::iterator end6_;
15877 typename ParamGenerator<T6>::iterator current6_;
15878 const typename ParamGenerator<T7>::iterator begin7_;
15879 const typename ParamGenerator<T7>::iterator end7_;
15880 typename ParamGenerator<T7>::iterator current7_;
15881 ParamType current_value_;
15882 }; // class CartesianProductGenerator7::Iterator
15884 // No implementation - assignment is unsupported.
15885 void operator=(const CartesianProductGenerator7& other);
15887 const ParamGenerator<T1> g1_;
15888 const ParamGenerator<T2> g2_;
15889 const ParamGenerator<T3> g3_;
15890 const ParamGenerator<T4> g4_;
15891 const ParamGenerator<T5> g5_;
15892 const ParamGenerator<T6> g6_;
15893 const ParamGenerator<T7> g7_;
15894 }; // class CartesianProductGenerator7
15897 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15898 typename T6, typename T7, typename T8>
15899 class CartesianProductGenerator8
15900 : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
15903 typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
15905 CartesianProductGenerator8(const ParamGenerator<T1>& g1,
15906 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15907 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
15908 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
15909 const ParamGenerator<T8>& g8)
15910 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
15912 virtual ~CartesianProductGenerator8() {}
15914 virtual ParamIteratorInterface<ParamType>* Begin() const {
15915 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15916 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
15917 g7_.begin(), g8_, g8_.begin());
15919 virtual ParamIteratorInterface<ParamType>* End() const {
15920 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15921 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
15926 class Iterator : public ParamIteratorInterface<ParamType> {
15928 Iterator(const ParamGeneratorInterface<ParamType>* base,
15929 const ParamGenerator<T1>& g1,
15930 const typename ParamGenerator<T1>::iterator& current1,
15931 const ParamGenerator<T2>& g2,
15932 const typename ParamGenerator<T2>::iterator& current2,
15933 const ParamGenerator<T3>& g3,
15934 const typename ParamGenerator<T3>::iterator& current3,
15935 const ParamGenerator<T4>& g4,
15936 const typename ParamGenerator<T4>::iterator& current4,
15937 const ParamGenerator<T5>& g5,
15938 const typename ParamGenerator<T5>::iterator& current5,
15939 const ParamGenerator<T6>& g6,
15940 const typename ParamGenerator<T6>::iterator& current6,
15941 const ParamGenerator<T7>& g7,
15942 const typename ParamGenerator<T7>::iterator& current7,
15943 const ParamGenerator<T8>& g8,
15944 const typename ParamGenerator<T8>::iterator& current8)
15946 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15947 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15948 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15949 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15950 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15951 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
15952 begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
15953 begin8_(g8.begin()), end8_(g8.end()), current8_(current8) {
15954 ComputeCurrentValue();
15956 virtual ~Iterator() {}
15958 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15961 // Advance should not be called on beyond-of-range iterators
15962 // so no component iterators must be beyond end of range, either.
15963 virtual void Advance() {
15966 if (current8_ == end8_) {
15967 current8_ = begin8_;
15970 if (current7_ == end7_) {
15971 current7_ = begin7_;
15974 if (current6_ == end6_) {
15975 current6_ = begin6_;
15978 if (current5_ == end5_) {
15979 current5_ = begin5_;
15982 if (current4_ == end4_) {
15983 current4_ = begin4_;
15986 if (current3_ == end3_) {
15987 current3_ = begin3_;
15990 if (current2_ == end2_) {
15991 current2_ = begin2_;
15994 ComputeCurrentValue();
15996 virtual ParamIteratorInterface<ParamType>* Clone() const {
15997 return new Iterator(*this);
15999 virtual const ParamType* Current() const { return ¤t_value_; }
16000 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
16001 // Having the same base generator guarantees that the other
16002 // iterator is of the same type and we can downcast.
16003 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
16004 << "The program attempted to compare iterators "
16005 << "from different generators." << std::endl;
16006 const Iterator* typed_other =
16007 CheckedDowncastToActualType<const Iterator>(&other);
16008 // We must report iterators equal if they both point beyond their
16009 // respective ranges. That can happen in a variety of fashions,
16010 // so we have to consult AtEnd().
16011 return (AtEnd() && typed_other->AtEnd()) ||
16013 current1_ == typed_other->current1_ &&
16014 current2_ == typed_other->current2_ &&
16015 current3_ == typed_other->current3_ &&
16016 current4_ == typed_other->current4_ &&
16017 current5_ == typed_other->current5_ &&
16018 current6_ == typed_other->current6_ &&
16019 current7_ == typed_other->current7_ &&
16020 current8_ == typed_other->current8_);
16024 Iterator(const Iterator& other)
16025 : base_(other.base_),
16026 begin1_(other.begin1_),
16027 end1_(other.end1_),
16028 current1_(other.current1_),
16029 begin2_(other.begin2_),
16030 end2_(other.end2_),
16031 current2_(other.current2_),
16032 begin3_(other.begin3_),
16033 end3_(other.end3_),
16034 current3_(other.current3_),
16035 begin4_(other.begin4_),
16036 end4_(other.end4_),
16037 current4_(other.current4_),
16038 begin5_(other.begin5_),
16039 end5_(other.end5_),
16040 current5_(other.current5_),
16041 begin6_(other.begin6_),
16042 end6_(other.end6_),
16043 current6_(other.current6_),
16044 begin7_(other.begin7_),
16045 end7_(other.end7_),
16046 current7_(other.current7_),
16047 begin8_(other.begin8_),
16048 end8_(other.end8_),
16049 current8_(other.current8_) {
16050 ComputeCurrentValue();
16053 void ComputeCurrentValue() {
16055 current_value_ = ParamType(*current1_, *current2_, *current3_,
16056 *current4_, *current5_, *current6_, *current7_, *current8_);
16058 bool AtEnd() const {
16059 // We must report iterator past the end of the range when either of the
16060 // component iterators has reached the end of its range.
16062 current1_ == end1_ ||
16063 current2_ == end2_ ||
16064 current3_ == end3_ ||
16065 current4_ == end4_ ||
16066 current5_ == end5_ ||
16067 current6_ == end6_ ||
16068 current7_ == end7_ ||
16069 current8_ == end8_;
16072 // No implementation - assignment is unsupported.
16073 void operator=(const Iterator& other);
16075 const ParamGeneratorInterface<ParamType>* const base_;
16076 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
16077 // current[i]_ is the actual traversing iterator.
16078 const typename ParamGenerator<T1>::iterator begin1_;
16079 const typename ParamGenerator<T1>::iterator end1_;
16080 typename ParamGenerator<T1>::iterator current1_;
16081 const typename ParamGenerator<T2>::iterator begin2_;
16082 const typename ParamGenerator<T2>::iterator end2_;
16083 typename ParamGenerator<T2>::iterator current2_;
16084 const typename ParamGenerator<T3>::iterator begin3_;
16085 const typename ParamGenerator<T3>::iterator end3_;
16086 typename ParamGenerator<T3>::iterator current3_;
16087 const typename ParamGenerator<T4>::iterator begin4_;
16088 const typename ParamGenerator<T4>::iterator end4_;
16089 typename ParamGenerator<T4>::iterator current4_;
16090 const typename ParamGenerator<T5>::iterator begin5_;
16091 const typename ParamGenerator<T5>::iterator end5_;
16092 typename ParamGenerator<T5>::iterator current5_;
16093 const typename ParamGenerator<T6>::iterator begin6_;
16094 const typename ParamGenerator<T6>::iterator end6_;
16095 typename ParamGenerator<T6>::iterator current6_;
16096 const typename ParamGenerator<T7>::iterator begin7_;
16097 const typename ParamGenerator<T7>::iterator end7_;
16098 typename ParamGenerator<T7>::iterator current7_;
16099 const typename ParamGenerator<T8>::iterator begin8_;
16100 const typename ParamGenerator<T8>::iterator end8_;
16101 typename ParamGenerator<T8>::iterator current8_;
16102 ParamType current_value_;
16103 }; // class CartesianProductGenerator8::Iterator
16105 // No implementation - assignment is unsupported.
16106 void operator=(const CartesianProductGenerator8& other);
16108 const ParamGenerator<T1> g1_;
16109 const ParamGenerator<T2> g2_;
16110 const ParamGenerator<T3> g3_;
16111 const ParamGenerator<T4> g4_;
16112 const ParamGenerator<T5> g5_;
16113 const ParamGenerator<T6> g6_;
16114 const ParamGenerator<T7> g7_;
16115 const ParamGenerator<T8> g8_;
16116 }; // class CartesianProductGenerator8
16119 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16120 typename T6, typename T7, typename T8, typename T9>
16121 class CartesianProductGenerator9
16122 : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
16125 typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
16127 CartesianProductGenerator9(const ParamGenerator<T1>& g1,
16128 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
16129 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
16130 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
16131 const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
16132 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
16134 virtual ~CartesianProductGenerator9() {}
16136 virtual ParamIteratorInterface<ParamType>* Begin() const {
16137 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
16138 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
16139 g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
16141 virtual ParamIteratorInterface<ParamType>* End() const {
16142 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
16143 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
16144 g8_.end(), g9_, g9_.end());
16148 class Iterator : public ParamIteratorInterface<ParamType> {
16150 Iterator(const ParamGeneratorInterface<ParamType>* base,
16151 const ParamGenerator<T1>& g1,
16152 const typename ParamGenerator<T1>::iterator& current1,
16153 const ParamGenerator<T2>& g2,
16154 const typename ParamGenerator<T2>::iterator& current2,
16155 const ParamGenerator<T3>& g3,
16156 const typename ParamGenerator<T3>::iterator& current3,
16157 const ParamGenerator<T4>& g4,
16158 const typename ParamGenerator<T4>::iterator& current4,
16159 const ParamGenerator<T5>& g5,
16160 const typename ParamGenerator<T5>::iterator& current5,
16161 const ParamGenerator<T6>& g6,
16162 const typename ParamGenerator<T6>::iterator& current6,
16163 const ParamGenerator<T7>& g7,
16164 const typename ParamGenerator<T7>::iterator& current7,
16165 const ParamGenerator<T8>& g8,
16166 const typename ParamGenerator<T8>::iterator& current8,
16167 const ParamGenerator<T9>& g9,
16168 const typename ParamGenerator<T9>::iterator& current9)
16170 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
16171 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
16172 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
16173 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
16174 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
16175 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
16176 begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
16177 begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
16178 begin9_(g9.begin()), end9_(g9.end()), current9_(current9) {
16179 ComputeCurrentValue();
16181 virtual ~Iterator() {}
16183 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
16186 // Advance should not be called on beyond-of-range iterators
16187 // so no component iterators must be beyond end of range, either.
16188 virtual void Advance() {
16191 if (current9_ == end9_) {
16192 current9_ = begin9_;
16195 if (current8_ == end8_) {
16196 current8_ = begin8_;
16199 if (current7_ == end7_) {
16200 current7_ = begin7_;
16203 if (current6_ == end6_) {
16204 current6_ = begin6_;
16207 if (current5_ == end5_) {
16208 current5_ = begin5_;
16211 if (current4_ == end4_) {
16212 current4_ = begin4_;
16215 if (current3_ == end3_) {
16216 current3_ = begin3_;
16219 if (current2_ == end2_) {
16220 current2_ = begin2_;
16223 ComputeCurrentValue();
16225 virtual ParamIteratorInterface<ParamType>* Clone() const {
16226 return new Iterator(*this);
16228 virtual const ParamType* Current() const { return ¤t_value_; }
16229 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
16230 // Having the same base generator guarantees that the other
16231 // iterator is of the same type and we can downcast.
16232 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
16233 << "The program attempted to compare iterators "
16234 << "from different generators." << std::endl;
16235 const Iterator* typed_other =
16236 CheckedDowncastToActualType<const Iterator>(&other);
16237 // We must report iterators equal if they both point beyond their
16238 // respective ranges. That can happen in a variety of fashions,
16239 // so we have to consult AtEnd().
16240 return (AtEnd() && typed_other->AtEnd()) ||
16242 current1_ == typed_other->current1_ &&
16243 current2_ == typed_other->current2_ &&
16244 current3_ == typed_other->current3_ &&
16245 current4_ == typed_other->current4_ &&
16246 current5_ == typed_other->current5_ &&
16247 current6_ == typed_other->current6_ &&
16248 current7_ == typed_other->current7_ &&
16249 current8_ == typed_other->current8_ &&
16250 current9_ == typed_other->current9_);
16254 Iterator(const Iterator& other)
16255 : base_(other.base_),
16256 begin1_(other.begin1_),
16257 end1_(other.end1_),
16258 current1_(other.current1_),
16259 begin2_(other.begin2_),
16260 end2_(other.end2_),
16261 current2_(other.current2_),
16262 begin3_(other.begin3_),
16263 end3_(other.end3_),
16264 current3_(other.current3_),
16265 begin4_(other.begin4_),
16266 end4_(other.end4_),
16267 current4_(other.current4_),
16268 begin5_(other.begin5_),
16269 end5_(other.end5_),
16270 current5_(other.current5_),
16271 begin6_(other.begin6_),
16272 end6_(other.end6_),
16273 current6_(other.current6_),
16274 begin7_(other.begin7_),
16275 end7_(other.end7_),
16276 current7_(other.current7_),
16277 begin8_(other.begin8_),
16278 end8_(other.end8_),
16279 current8_(other.current8_),
16280 begin9_(other.begin9_),
16281 end9_(other.end9_),
16282 current9_(other.current9_) {
16283 ComputeCurrentValue();
16286 void ComputeCurrentValue() {
16288 current_value_ = ParamType(*current1_, *current2_, *current3_,
16289 *current4_, *current5_, *current6_, *current7_, *current8_,
16292 bool AtEnd() const {
16293 // We must report iterator past the end of the range when either of the
16294 // component iterators has reached the end of its range.
16296 current1_ == end1_ ||
16297 current2_ == end2_ ||
16298 current3_ == end3_ ||
16299 current4_ == end4_ ||
16300 current5_ == end5_ ||
16301 current6_ == end6_ ||
16302 current7_ == end7_ ||
16303 current8_ == end8_ ||
16304 current9_ == end9_;
16307 // No implementation - assignment is unsupported.
16308 void operator=(const Iterator& other);
16310 const ParamGeneratorInterface<ParamType>* const base_;
16311 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
16312 // current[i]_ is the actual traversing iterator.
16313 const typename ParamGenerator<T1>::iterator begin1_;
16314 const typename ParamGenerator<T1>::iterator end1_;
16315 typename ParamGenerator<T1>::iterator current1_;
16316 const typename ParamGenerator<T2>::iterator begin2_;
16317 const typename ParamGenerator<T2>::iterator end2_;
16318 typename ParamGenerator<T2>::iterator current2_;
16319 const typename ParamGenerator<T3>::iterator begin3_;
16320 const typename ParamGenerator<T3>::iterator end3_;
16321 typename ParamGenerator<T3>::iterator current3_;
16322 const typename ParamGenerator<T4>::iterator begin4_;
16323 const typename ParamGenerator<T4>::iterator end4_;
16324 typename ParamGenerator<T4>::iterator current4_;
16325 const typename ParamGenerator<T5>::iterator begin5_;
16326 const typename ParamGenerator<T5>::iterator end5_;
16327 typename ParamGenerator<T5>::iterator current5_;
16328 const typename ParamGenerator<T6>::iterator begin6_;
16329 const typename ParamGenerator<T6>::iterator end6_;
16330 typename ParamGenerator<T6>::iterator current6_;
16331 const typename ParamGenerator<T7>::iterator begin7_;
16332 const typename ParamGenerator<T7>::iterator end7_;
16333 typename ParamGenerator<T7>::iterator current7_;
16334 const typename ParamGenerator<T8>::iterator begin8_;
16335 const typename ParamGenerator<T8>::iterator end8_;
16336 typename ParamGenerator<T8>::iterator current8_;
16337 const typename ParamGenerator<T9>::iterator begin9_;
16338 const typename ParamGenerator<T9>::iterator end9_;
16339 typename ParamGenerator<T9>::iterator current9_;
16340 ParamType current_value_;
16341 }; // class CartesianProductGenerator9::Iterator
16343 // No implementation - assignment is unsupported.
16344 void operator=(const CartesianProductGenerator9& other);
16346 const ParamGenerator<T1> g1_;
16347 const ParamGenerator<T2> g2_;
16348 const ParamGenerator<T3> g3_;
16349 const ParamGenerator<T4> g4_;
16350 const ParamGenerator<T5> g5_;
16351 const ParamGenerator<T6> g6_;
16352 const ParamGenerator<T7> g7_;
16353 const ParamGenerator<T8> g8_;
16354 const ParamGenerator<T9> g9_;
16355 }; // class CartesianProductGenerator9
16358 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16359 typename T6, typename T7, typename T8, typename T9, typename T10>
16360 class CartesianProductGenerator10
16361 : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
16362 T7, T8, T9, T10> > {
16364 typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
16366 CartesianProductGenerator10(const ParamGenerator<T1>& g1,
16367 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
16368 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
16369 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
16370 const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
16371 const ParamGenerator<T10>& g10)
16372 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
16373 g9_(g9), g10_(g10) {}
16374 virtual ~CartesianProductGenerator10() {}
16376 virtual ParamIteratorInterface<ParamType>* Begin() const {
16377 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
16378 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
16379 g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
16381 virtual ParamIteratorInterface<ParamType>* End() const {
16382 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
16383 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
16384 g8_.end(), g9_, g9_.end(), g10_, g10_.end());
16388 class Iterator : public ParamIteratorInterface<ParamType> {
16390 Iterator(const ParamGeneratorInterface<ParamType>* base,
16391 const ParamGenerator<T1>& g1,
16392 const typename ParamGenerator<T1>::iterator& current1,
16393 const ParamGenerator<T2>& g2,
16394 const typename ParamGenerator<T2>::iterator& current2,
16395 const ParamGenerator<T3>& g3,
16396 const typename ParamGenerator<T3>::iterator& current3,
16397 const ParamGenerator<T4>& g4,
16398 const typename ParamGenerator<T4>::iterator& current4,
16399 const ParamGenerator<T5>& g5,
16400 const typename ParamGenerator<T5>::iterator& current5,
16401 const ParamGenerator<T6>& g6,
16402 const typename ParamGenerator<T6>::iterator& current6,
16403 const ParamGenerator<T7>& g7,
16404 const typename ParamGenerator<T7>::iterator& current7,
16405 const ParamGenerator<T8>& g8,
16406 const typename ParamGenerator<T8>::iterator& current8,
16407 const ParamGenerator<T9>& g9,
16408 const typename ParamGenerator<T9>::iterator& current9,
16409 const ParamGenerator<T10>& g10,
16410 const typename ParamGenerator<T10>::iterator& current10)
16412 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
16413 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
16414 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
16415 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
16416 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
16417 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
16418 begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
16419 begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
16420 begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
16421 begin10_(g10.begin()), end10_(g10.end()), current10_(current10) {
16422 ComputeCurrentValue();
16424 virtual ~Iterator() {}
16426 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
16429 // Advance should not be called on beyond-of-range iterators
16430 // so no component iterators must be beyond end of range, either.
16431 virtual void Advance() {
16434 if (current10_ == end10_) {
16435 current10_ = begin10_;
16438 if (current9_ == end9_) {
16439 current9_ = begin9_;
16442 if (current8_ == end8_) {
16443 current8_ = begin8_;
16446 if (current7_ == end7_) {
16447 current7_ = begin7_;
16450 if (current6_ == end6_) {
16451 current6_ = begin6_;
16454 if (current5_ == end5_) {
16455 current5_ = begin5_;
16458 if (current4_ == end4_) {
16459 current4_ = begin4_;
16462 if (current3_ == end3_) {
16463 current3_ = begin3_;
16466 if (current2_ == end2_) {
16467 current2_ = begin2_;
16470 ComputeCurrentValue();
16472 virtual ParamIteratorInterface<ParamType>* Clone() const {
16473 return new Iterator(*this);
16475 virtual const ParamType* Current() const { return ¤t_value_; }
16476 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
16477 // Having the same base generator guarantees that the other
16478 // iterator is of the same type and we can downcast.
16479 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
16480 << "The program attempted to compare iterators "
16481 << "from different generators." << std::endl;
16482 const Iterator* typed_other =
16483 CheckedDowncastToActualType<const Iterator>(&other);
16484 // We must report iterators equal if they both point beyond their
16485 // respective ranges. That can happen in a variety of fashions,
16486 // so we have to consult AtEnd().
16487 return (AtEnd() && typed_other->AtEnd()) ||
16489 current1_ == typed_other->current1_ &&
16490 current2_ == typed_other->current2_ &&
16491 current3_ == typed_other->current3_ &&
16492 current4_ == typed_other->current4_ &&
16493 current5_ == typed_other->current5_ &&
16494 current6_ == typed_other->current6_ &&
16495 current7_ == typed_other->current7_ &&
16496 current8_ == typed_other->current8_ &&
16497 current9_ == typed_other->current9_ &&
16498 current10_ == typed_other->current10_);
16502 Iterator(const Iterator& other)
16503 : base_(other.base_),
16504 begin1_(other.begin1_),
16505 end1_(other.end1_),
16506 current1_(other.current1_),
16507 begin2_(other.begin2_),
16508 end2_(other.end2_),
16509 current2_(other.current2_),
16510 begin3_(other.begin3_),
16511 end3_(other.end3_),
16512 current3_(other.current3_),
16513 begin4_(other.begin4_),
16514 end4_(other.end4_),
16515 current4_(other.current4_),
16516 begin5_(other.begin5_),
16517 end5_(other.end5_),
16518 current5_(other.current5_),
16519 begin6_(other.begin6_),
16520 end6_(other.end6_),
16521 current6_(other.current6_),
16522 begin7_(other.begin7_),
16523 end7_(other.end7_),
16524 current7_(other.current7_),
16525 begin8_(other.begin8_),
16526 end8_(other.end8_),
16527 current8_(other.current8_),
16528 begin9_(other.begin9_),
16529 end9_(other.end9_),
16530 current9_(other.current9_),
16531 begin10_(other.begin10_),
16532 end10_(other.end10_),
16533 current10_(other.current10_) {
16534 ComputeCurrentValue();
16537 void ComputeCurrentValue() {
16539 current_value_ = ParamType(*current1_, *current2_, *current3_,
16540 *current4_, *current5_, *current6_, *current7_, *current8_,
16541 *current9_, *current10_);
16543 bool AtEnd() const {
16544 // We must report iterator past the end of the range when either of the
16545 // component iterators has reached the end of its range.
16547 current1_ == end1_ ||
16548 current2_ == end2_ ||
16549 current3_ == end3_ ||
16550 current4_ == end4_ ||
16551 current5_ == end5_ ||
16552 current6_ == end6_ ||
16553 current7_ == end7_ ||
16554 current8_ == end8_ ||
16555 current9_ == end9_ ||
16556 current10_ == end10_;
16559 // No implementation - assignment is unsupported.
16560 void operator=(const Iterator& other);
16562 const ParamGeneratorInterface<ParamType>* const base_;
16563 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
16564 // current[i]_ is the actual traversing iterator.
16565 const typename ParamGenerator<T1>::iterator begin1_;
16566 const typename ParamGenerator<T1>::iterator end1_;
16567 typename ParamGenerator<T1>::iterator current1_;
16568 const typename ParamGenerator<T2>::iterator begin2_;
16569 const typename ParamGenerator<T2>::iterator end2_;
16570 typename ParamGenerator<T2>::iterator current2_;
16571 const typename ParamGenerator<T3>::iterator begin3_;
16572 const typename ParamGenerator<T3>::iterator end3_;
16573 typename ParamGenerator<T3>::iterator current3_;
16574 const typename ParamGenerator<T4>::iterator begin4_;
16575 const typename ParamGenerator<T4>::iterator end4_;
16576 typename ParamGenerator<T4>::iterator current4_;
16577 const typename ParamGenerator<T5>::iterator begin5_;
16578 const typename ParamGenerator<T5>::iterator end5_;
16579 typename ParamGenerator<T5>::iterator current5_;
16580 const typename ParamGenerator<T6>::iterator begin6_;
16581 const typename ParamGenerator<T6>::iterator end6_;
16582 typename ParamGenerator<T6>::iterator current6_;
16583 const typename ParamGenerator<T7>::iterator begin7_;
16584 const typename ParamGenerator<T7>::iterator end7_;
16585 typename ParamGenerator<T7>::iterator current7_;
16586 const typename ParamGenerator<T8>::iterator begin8_;
16587 const typename ParamGenerator<T8>::iterator end8_;
16588 typename ParamGenerator<T8>::iterator current8_;
16589 const typename ParamGenerator<T9>::iterator begin9_;
16590 const typename ParamGenerator<T9>::iterator end9_;
16591 typename ParamGenerator<T9>::iterator current9_;
16592 const typename ParamGenerator<T10>::iterator begin10_;
16593 const typename ParamGenerator<T10>::iterator end10_;
16594 typename ParamGenerator<T10>::iterator current10_;
16595 ParamType current_value_;
16596 }; // class CartesianProductGenerator10::Iterator
16598 // No implementation - assignment is unsupported.
16599 void operator=(const CartesianProductGenerator10& other);
16601 const ParamGenerator<T1> g1_;
16602 const ParamGenerator<T2> g2_;
16603 const ParamGenerator<T3> g3_;
16604 const ParamGenerator<T4> g4_;
16605 const ParamGenerator<T5> g5_;
16606 const ParamGenerator<T6> g6_;
16607 const ParamGenerator<T7> g7_;
16608 const ParamGenerator<T8> g8_;
16609 const ParamGenerator<T9> g9_;
16610 const ParamGenerator<T10> g10_;
16611 }; // class CartesianProductGenerator10
16614 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
16616 // Helper classes providing Combine() with polymorphic features. They allow
16617 // casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
16618 // convertible to U.
16620 template <class Generator1, class Generator2>
16621 class CartesianProductHolder2 {
16623 CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
16624 : g1_(g1), g2_(g2) {}
16625 template <typename T1, typename T2>
16626 operator ParamGenerator< ::testing::tuple<T1, T2> >() const {
16627 return ParamGenerator< ::testing::tuple<T1, T2> >(
16628 new CartesianProductGenerator2<T1, T2>(
16629 static_cast<ParamGenerator<T1> >(g1_),
16630 static_cast<ParamGenerator<T2> >(g2_)));
16634 // No implementation - assignment is unsupported.
16635 void operator=(const CartesianProductHolder2& other);
16637 const Generator1 g1_;
16638 const Generator2 g2_;
16639 }; // class CartesianProductHolder2
16641 template <class Generator1, class Generator2, class Generator3>
16642 class CartesianProductHolder3 {
16644 CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
16645 const Generator3& g3)
16646 : g1_(g1), g2_(g2), g3_(g3) {}
16647 template <typename T1, typename T2, typename T3>
16648 operator ParamGenerator< ::testing::tuple<T1, T2, T3> >() const {
16649 return ParamGenerator< ::testing::tuple<T1, T2, T3> >(
16650 new CartesianProductGenerator3<T1, T2, T3>(
16651 static_cast<ParamGenerator<T1> >(g1_),
16652 static_cast<ParamGenerator<T2> >(g2_),
16653 static_cast<ParamGenerator<T3> >(g3_)));
16657 // No implementation - assignment is unsupported.
16658 void operator=(const CartesianProductHolder3& other);
16660 const Generator1 g1_;
16661 const Generator2 g2_;
16662 const Generator3 g3_;
16663 }; // class CartesianProductHolder3
16665 template <class Generator1, class Generator2, class Generator3,
16667 class CartesianProductHolder4 {
16669 CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
16670 const Generator3& g3, const Generator4& g4)
16671 : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
16672 template <typename T1, typename T2, typename T3, typename T4>
16673 operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >() const {
16674 return ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >(
16675 new CartesianProductGenerator4<T1, T2, T3, T4>(
16676 static_cast<ParamGenerator<T1> >(g1_),
16677 static_cast<ParamGenerator<T2> >(g2_),
16678 static_cast<ParamGenerator<T3> >(g3_),
16679 static_cast<ParamGenerator<T4> >(g4_)));
16683 // No implementation - assignment is unsupported.
16684 void operator=(const CartesianProductHolder4& other);
16686 const Generator1 g1_;
16687 const Generator2 g2_;
16688 const Generator3 g3_;
16689 const Generator4 g4_;
16690 }; // class CartesianProductHolder4
16692 template <class Generator1, class Generator2, class Generator3,
16693 class Generator4, class Generator5>
16694 class CartesianProductHolder5 {
16696 CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
16697 const Generator3& g3, const Generator4& g4, const Generator5& g5)
16698 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
16699 template <typename T1, typename T2, typename T3, typename T4, typename T5>
16700 operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >() const {
16701 return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >(
16702 new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
16703 static_cast<ParamGenerator<T1> >(g1_),
16704 static_cast<ParamGenerator<T2> >(g2_),
16705 static_cast<ParamGenerator<T3> >(g3_),
16706 static_cast<ParamGenerator<T4> >(g4_),
16707 static_cast<ParamGenerator<T5> >(g5_)));
16711 // No implementation - assignment is unsupported.
16712 void operator=(const CartesianProductHolder5& other);
16714 const Generator1 g1_;
16715 const Generator2 g2_;
16716 const Generator3 g3_;
16717 const Generator4 g4_;
16718 const Generator5 g5_;
16719 }; // class CartesianProductHolder5
16721 template <class Generator1, class Generator2, class Generator3,
16722 class Generator4, class Generator5, class Generator6>
16723 class CartesianProductHolder6 {
16725 CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
16726 const Generator3& g3, const Generator4& g4, const Generator5& g5,
16727 const Generator6& g6)
16728 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
16729 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16731 operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >() const {
16732 return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >(
16733 new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
16734 static_cast<ParamGenerator<T1> >(g1_),
16735 static_cast<ParamGenerator<T2> >(g2_),
16736 static_cast<ParamGenerator<T3> >(g3_),
16737 static_cast<ParamGenerator<T4> >(g4_),
16738 static_cast<ParamGenerator<T5> >(g5_),
16739 static_cast<ParamGenerator<T6> >(g6_)));
16743 // No implementation - assignment is unsupported.
16744 void operator=(const CartesianProductHolder6& other);
16746 const Generator1 g1_;
16747 const Generator2 g2_;
16748 const Generator3 g3_;
16749 const Generator4 g4_;
16750 const Generator5 g5_;
16751 const Generator6 g6_;
16752 }; // class CartesianProductHolder6
16754 template <class Generator1, class Generator2, class Generator3,
16755 class Generator4, class Generator5, class Generator6, class Generator7>
16756 class CartesianProductHolder7 {
16758 CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
16759 const Generator3& g3, const Generator4& g4, const Generator5& g5,
16760 const Generator6& g6, const Generator7& g7)
16761 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
16762 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16763 typename T6, typename T7>
16764 operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6,
16766 return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> >(
16767 new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
16768 static_cast<ParamGenerator<T1> >(g1_),
16769 static_cast<ParamGenerator<T2> >(g2_),
16770 static_cast<ParamGenerator<T3> >(g3_),
16771 static_cast<ParamGenerator<T4> >(g4_),
16772 static_cast<ParamGenerator<T5> >(g5_),
16773 static_cast<ParamGenerator<T6> >(g6_),
16774 static_cast<ParamGenerator<T7> >(g7_)));
16778 // No implementation - assignment is unsupported.
16779 void operator=(const CartesianProductHolder7& other);
16781 const Generator1 g1_;
16782 const Generator2 g2_;
16783 const Generator3 g3_;
16784 const Generator4 g4_;
16785 const Generator5 g5_;
16786 const Generator6 g6_;
16787 const Generator7 g7_;
16788 }; // class CartesianProductHolder7
16790 template <class Generator1, class Generator2, class Generator3,
16791 class Generator4, class Generator5, class Generator6, class Generator7,
16793 class CartesianProductHolder8 {
16795 CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
16796 const Generator3& g3, const Generator4& g4, const Generator5& g5,
16797 const Generator6& g6, const Generator7& g7, const Generator8& g8)
16798 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
16800 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16801 typename T6, typename T7, typename T8>
16802 operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7,
16804 return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
16805 new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
16806 static_cast<ParamGenerator<T1> >(g1_),
16807 static_cast<ParamGenerator<T2> >(g2_),
16808 static_cast<ParamGenerator<T3> >(g3_),
16809 static_cast<ParamGenerator<T4> >(g4_),
16810 static_cast<ParamGenerator<T5> >(g5_),
16811 static_cast<ParamGenerator<T6> >(g6_),
16812 static_cast<ParamGenerator<T7> >(g7_),
16813 static_cast<ParamGenerator<T8> >(g8_)));
16817 // No implementation - assignment is unsupported.
16818 void operator=(const CartesianProductHolder8& other);
16820 const Generator1 g1_;
16821 const Generator2 g2_;
16822 const Generator3 g3_;
16823 const Generator4 g4_;
16824 const Generator5 g5_;
16825 const Generator6 g6_;
16826 const Generator7 g7_;
16827 const Generator8 g8_;
16828 }; // class CartesianProductHolder8
16830 template <class Generator1, class Generator2, class Generator3,
16831 class Generator4, class Generator5, class Generator6, class Generator7,
16832 class Generator8, class Generator9>
16833 class CartesianProductHolder9 {
16835 CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
16836 const Generator3& g3, const Generator4& g4, const Generator5& g5,
16837 const Generator6& g6, const Generator7& g7, const Generator8& g8,
16838 const Generator9& g9)
16839 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
16841 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16842 typename T6, typename T7, typename T8, typename T9>
16843 operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
16845 return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
16847 new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
16848 static_cast<ParamGenerator<T1> >(g1_),
16849 static_cast<ParamGenerator<T2> >(g2_),
16850 static_cast<ParamGenerator<T3> >(g3_),
16851 static_cast<ParamGenerator<T4> >(g4_),
16852 static_cast<ParamGenerator<T5> >(g5_),
16853 static_cast<ParamGenerator<T6> >(g6_),
16854 static_cast<ParamGenerator<T7> >(g7_),
16855 static_cast<ParamGenerator<T8> >(g8_),
16856 static_cast<ParamGenerator<T9> >(g9_)));
16860 // No implementation - assignment is unsupported.
16861 void operator=(const CartesianProductHolder9& other);
16863 const Generator1 g1_;
16864 const Generator2 g2_;
16865 const Generator3 g3_;
16866 const Generator4 g4_;
16867 const Generator5 g5_;
16868 const Generator6 g6_;
16869 const Generator7 g7_;
16870 const Generator8 g8_;
16871 const Generator9 g9_;
16872 }; // class CartesianProductHolder9
16874 template <class Generator1, class Generator2, class Generator3,
16875 class Generator4, class Generator5, class Generator6, class Generator7,
16876 class Generator8, class Generator9, class Generator10>
16877 class CartesianProductHolder10 {
16879 CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
16880 const Generator3& g3, const Generator4& g4, const Generator5& g5,
16881 const Generator6& g6, const Generator7& g7, const Generator8& g8,
16882 const Generator9& g9, const Generator10& g10)
16883 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
16884 g9_(g9), g10_(g10) {}
16885 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16886 typename T6, typename T7, typename T8, typename T9, typename T10>
16887 operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
16889 return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
16891 new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
16893 static_cast<ParamGenerator<T1> >(g1_),
16894 static_cast<ParamGenerator<T2> >(g2_),
16895 static_cast<ParamGenerator<T3> >(g3_),
16896 static_cast<ParamGenerator<T4> >(g4_),
16897 static_cast<ParamGenerator<T5> >(g5_),
16898 static_cast<ParamGenerator<T6> >(g6_),
16899 static_cast<ParamGenerator<T7> >(g7_),
16900 static_cast<ParamGenerator<T8> >(g8_),
16901 static_cast<ParamGenerator<T9> >(g9_),
16902 static_cast<ParamGenerator<T10> >(g10_)));
16906 // No implementation - assignment is unsupported.
16907 void operator=(const CartesianProductHolder10& other);
16909 const Generator1 g1_;
16910 const Generator2 g2_;
16911 const Generator3 g3_;
16912 const Generator4 g4_;
16913 const Generator5 g5_;
16914 const Generator6 g6_;
16915 const Generator7 g7_;
16916 const Generator8 g8_;
16917 const Generator9 g9_;
16918 const Generator10 g10_;
16919 }; // class CartesianProductHolder10
16921 # endif // GTEST_HAS_COMBINE
16923 } // namespace internal
16924 } // namespace testing
16926 #endif // GTEST_HAS_PARAM_TEST
16928 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
16930 #if GTEST_HAS_PARAM_TEST
16932 namespace testing {
16934 // Functions producing parameter generators.
16936 // Google Test uses these generators to produce parameters for value-
16937 // parameterized tests. When a parameterized test case is instantiated
16938 // with a particular generator, Google Test creates and runs tests
16939 // for each element in the sequence produced by the generator.
16941 // In the following sample, tests from test case FooTest are instantiated
16942 // each three times with parameter values 3, 5, and 8:
16944 // class FooTest : public TestWithParam<int> { ... };
16946 // TEST_P(FooTest, TestThis) {
16948 // TEST_P(FooTest, TestThat) {
16950 // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
16953 // Range() returns generators providing sequences of values in a range.
16956 // Range(start, end)
16957 // - returns a generator producing a sequence of values {start, start+1,
16958 // start+2, ..., }.
16959 // Range(start, end, step)
16960 // - returns a generator producing a sequence of values {start, start+step,
16961 // start+step+step, ..., }.
16963 // * The generated sequences never include end. For example, Range(1, 5)
16964 // returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
16965 // returns a generator producing {1, 3, 5, 7}.
16966 // * start and end must have the same type. That type may be any integral or
16967 // floating-point type or a user defined type satisfying these conditions:
16968 // * It must be assignable (have operator=() defined).
16969 // * It must have operator+() (operator+(int-compatible type) for
16970 // two-operand version).
16971 // * It must have operator<() defined.
16972 // Elements in the resulting sequences will also have that type.
16973 // * Condition start < end must be satisfied in order for resulting sequences
16974 // to contain any elements.
16976 template <typename T, typename IncrementT>
16977 internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
16978 return internal::ParamGenerator<T>(
16979 new internal::RangeGenerator<T, IncrementT>(start, end, step));
16982 template <typename T>
16983 internal::ParamGenerator<T> Range(T start, T end) {
16984 return Range(start, end, 1);
16987 // ValuesIn() function allows generation of tests with parameters coming from
16991 // ValuesIn(const T (&array)[N])
16992 // - returns a generator producing sequences with elements from
16993 // a C-style array.
16994 // ValuesIn(const Container& container)
16995 // - returns a generator producing sequences with elements from
16996 // an STL-style container.
16997 // ValuesIn(Iterator begin, Iterator end)
16998 // - returns a generator producing sequences with elements from
16999 // a range [begin, end) defined by a pair of STL-style iterators. These
17000 // iterators can also be plain C pointers.
17002 // Please note that ValuesIn copies the values from the containers
17003 // passed in and keeps them to generate tests in RUN_ALL_TESTS().
17007 // This instantiates tests from test case StringTest
17008 // each with C-string values of "foo", "bar", and "baz":
17010 // const char* strings[] = {"foo", "bar", "baz"};
17011 // INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
17013 // This instantiates tests from test case StlStringTest
17014 // each with STL strings with values "a" and "b":
17016 // ::std::vector< ::std::string> GetParameterStrings() {
17017 // ::std::vector< ::std::string> v;
17018 // v.push_back("a");
17019 // v.push_back("b");
17023 // INSTANTIATE_TEST_CASE_P(CharSequence,
17025 // ValuesIn(GetParameterStrings()));
17028 // This will also instantiate tests from CharTest
17029 // each with parameter values 'a' and 'b':
17031 // ::std::list<char> GetParameterChars() {
17032 // ::std::list<char> list;
17033 // list.push_back('a');
17034 // list.push_back('b');
17037 // ::std::list<char> l = GetParameterChars();
17038 // INSTANTIATE_TEST_CASE_P(CharSequence2,
17040 // ValuesIn(l.begin(), l.end()));
17042 template <typename ForwardIterator>
17043 internal::ParamGenerator<
17044 typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
17045 ValuesIn(ForwardIterator begin, ForwardIterator end) {
17046 typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
17047 ::value_type ParamType;
17048 return internal::ParamGenerator<ParamType>(
17049 new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
17052 template <typename T, size_t N>
17053 internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
17054 return ValuesIn(array, array + N);
17057 template <class Container>
17058 internal::ParamGenerator<typename Container::value_type> ValuesIn(
17059 const Container& container) {
17060 return ValuesIn(container.begin(), container.end());
17063 // Values() allows generating tests from explicitly specified list of
17067 // Values(T v1, T v2, ..., T vN)
17068 // - returns a generator producing sequences with elements v1, v2, ..., vN.
17070 // For example, this instantiates tests from test case BarTest each
17071 // with values "one", "two", and "three":
17073 // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
17075 // This instantiates tests from test case BazTest each with values 1, 2, 3.5.
17076 // The exact type of values will depend on the type of parameter in BazTest.
17078 // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
17080 // Currently, Values() supports from 1 to 50 parameters.
17082 template <typename T1>
17083 internal::ValueArray1<T1> Values(T1 v1) {
17084 return internal::ValueArray1<T1>(v1);
17087 template <typename T1, typename T2>
17088 internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
17089 return internal::ValueArray2<T1, T2>(v1, v2);
17092 template <typename T1, typename T2, typename T3>
17093 internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
17094 return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
17097 template <typename T1, typename T2, typename T3, typename T4>
17098 internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
17099 return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
17102 template <typename T1, typename T2, typename T3, typename T4, typename T5>
17103 internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
17105 return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
17108 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17110 internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
17111 T4 v4, T5 v5, T6 v6) {
17112 return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
17115 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17116 typename T6, typename T7>
17117 internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
17118 T4 v4, T5 v5, T6 v6, T7 v7) {
17119 return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
17123 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17124 typename T6, typename T7, typename T8>
17125 internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
17126 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
17127 return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
17131 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17132 typename T6, typename T7, typename T8, typename T9>
17133 internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
17134 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
17135 return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
17136 v4, v5, v6, v7, v8, v9);
17139 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17140 typename T6, typename T7, typename T8, typename T9, typename T10>
17141 internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
17142 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
17143 return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
17144 v2, v3, v4, v5, v6, v7, v8, v9, v10);
17147 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17148 typename T6, typename T7, typename T8, typename T9, typename T10,
17150 internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
17151 T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17152 T10 v10, T11 v11) {
17153 return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
17154 T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
17157 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17158 typename T6, typename T7, typename T8, typename T9, typename T10,
17159 typename T11, typename T12>
17160 internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17161 T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17162 T10 v10, T11 v11, T12 v12) {
17163 return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17164 T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
17167 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17168 typename T6, typename T7, typename T8, typename T9, typename T10,
17169 typename T11, typename T12, typename T13>
17170 internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
17171 T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17172 T10 v10, T11 v11, T12 v12, T13 v13) {
17173 return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17174 T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
17177 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17178 typename T6, typename T7, typename T8, typename T9, typename T10,
17179 typename T11, typename T12, typename T13, typename T14>
17180 internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17181 T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17182 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
17183 return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17184 T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
17188 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17189 typename T6, typename T7, typename T8, typename T9, typename T10,
17190 typename T11, typename T12, typename T13, typename T14, typename T15>
17191 internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17192 T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
17193 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
17194 return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17195 T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
17199 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17200 typename T6, typename T7, typename T8, typename T9, typename T10,
17201 typename T11, typename T12, typename T13, typename T14, typename T15,
17203 internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17204 T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
17205 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
17207 return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17208 T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
17209 v12, v13, v14, v15, v16);
17212 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17213 typename T6, typename T7, typename T8, typename T9, typename T10,
17214 typename T11, typename T12, typename T13, typename T14, typename T15,
17215 typename T16, typename T17>
17216 internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17217 T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
17218 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
17219 T16 v16, T17 v17) {
17220 return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17221 T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
17222 v11, v12, v13, v14, v15, v16, v17);
17225 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17226 typename T6, typename T7, typename T8, typename T9, typename T10,
17227 typename T11, typename T12, typename T13, typename T14, typename T15,
17228 typename T16, typename T17, typename T18>
17229 internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17230 T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
17231 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
17232 T16 v16, T17 v17, T18 v18) {
17233 return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17234 T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
17235 v10, v11, v12, v13, v14, v15, v16, v17, v18);
17238 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17239 typename T6, typename T7, typename T8, typename T9, typename T10,
17240 typename T11, typename T12, typename T13, typename T14, typename T15,
17241 typename T16, typename T17, typename T18, typename T19>
17242 internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17243 T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
17244 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
17245 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
17246 return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17247 T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
17248 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
17251 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17252 typename T6, typename T7, typename T8, typename T9, typename T10,
17253 typename T11, typename T12, typename T13, typename T14, typename T15,
17254 typename T16, typename T17, typename T18, typename T19, typename T20>
17255 internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17256 T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
17257 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
17258 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
17259 return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17260 T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
17261 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
17264 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17265 typename T6, typename T7, typename T8, typename T9, typename T10,
17266 typename T11, typename T12, typename T13, typename T14, typename T15,
17267 typename T16, typename T17, typename T18, typename T19, typename T20,
17269 internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17270 T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
17271 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
17272 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
17273 return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17274 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
17275 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
17278 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17279 typename T6, typename T7, typename T8, typename T9, typename T10,
17280 typename T11, typename T12, typename T13, typename T14, typename T15,
17281 typename T16, typename T17, typename T18, typename T19, typename T20,
17282 typename T21, typename T22>
17283 internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17284 T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
17285 T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
17286 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
17287 T21 v21, T22 v22) {
17288 return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17289 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
17290 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
17294 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17295 typename T6, typename T7, typename T8, typename T9, typename T10,
17296 typename T11, typename T12, typename T13, typename T14, typename T15,
17297 typename T16, typename T17, typename T18, typename T19, typename T20,
17298 typename T21, typename T22, typename T23>
17299 internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17300 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
17301 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
17302 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
17303 T21 v21, T22 v22, T23 v23) {
17304 return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17305 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
17306 v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
17307 v20, v21, v22, v23);
17310 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17311 typename T6, typename T7, typename T8, typename T9, typename T10,
17312 typename T11, typename T12, typename T13, typename T14, typename T15,
17313 typename T16, typename T17, typename T18, typename T19, typename T20,
17314 typename T21, typename T22, typename T23, typename T24>
17315 internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17316 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
17317 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
17318 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
17319 T21 v21, T22 v22, T23 v23, T24 v24) {
17320 return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17321 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
17322 v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
17323 v19, v20, v21, v22, v23, v24);
17326 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17327 typename T6, typename T7, typename T8, typename T9, typename T10,
17328 typename T11, typename T12, typename T13, typename T14, typename T15,
17329 typename T16, typename T17, typename T18, typename T19, typename T20,
17330 typename T21, typename T22, typename T23, typename T24, typename T25>
17331 internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17332 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
17333 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
17334 T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
17335 T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
17336 return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17337 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
17338 v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
17339 v18, v19, v20, v21, v22, v23, v24, v25);
17342 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17343 typename T6, typename T7, typename T8, typename T9, typename T10,
17344 typename T11, typename T12, typename T13, typename T14, typename T15,
17345 typename T16, typename T17, typename T18, typename T19, typename T20,
17346 typename T21, typename T22, typename T23, typename T24, typename T25,
17348 internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17349 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17350 T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17351 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
17352 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
17354 return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17355 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17356 T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
17357 v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
17360 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17361 typename T6, typename T7, typename T8, typename T9, typename T10,
17362 typename T11, typename T12, typename T13, typename T14, typename T15,
17363 typename T16, typename T17, typename T18, typename T19, typename T20,
17364 typename T21, typename T22, typename T23, typename T24, typename T25,
17365 typename T26, typename T27>
17366 internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17367 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
17368 T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17369 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
17370 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
17371 T26 v26, T27 v27) {
17372 return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17373 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17374 T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
17375 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
17378 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17379 typename T6, typename T7, typename T8, typename T9, typename T10,
17380 typename T11, typename T12, typename T13, typename T14, typename T15,
17381 typename T16, typename T17, typename T18, typename T19, typename T20,
17382 typename T21, typename T22, typename T23, typename T24, typename T25,
17383 typename T26, typename T27, typename T28>
17384 internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17385 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
17386 T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17387 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
17388 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
17389 T26 v26, T27 v27, T28 v28) {
17390 return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17391 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17392 T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
17393 v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
17397 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17398 typename T6, typename T7, typename T8, typename T9, typename T10,
17399 typename T11, typename T12, typename T13, typename T14, typename T15,
17400 typename T16, typename T17, typename T18, typename T19, typename T20,
17401 typename T21, typename T22, typename T23, typename T24, typename T25,
17402 typename T26, typename T27, typename T28, typename T29>
17403 internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17404 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17405 T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17406 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
17407 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
17408 T26 v26, T27 v27, T28 v28, T29 v29) {
17409 return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17410 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17411 T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
17412 v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
17416 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17417 typename T6, typename T7, typename T8, typename T9, typename T10,
17418 typename T11, typename T12, typename T13, typename T14, typename T15,
17419 typename T16, typename T17, typename T18, typename T19, typename T20,
17420 typename T21, typename T22, typename T23, typename T24, typename T25,
17421 typename T26, typename T27, typename T28, typename T29, typename T30>
17422 internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17423 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17424 T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
17425 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
17426 T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
17427 T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
17428 return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17429 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17430 T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
17431 v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
17432 v26, v27, v28, v29, v30);
17435 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17436 typename T6, typename T7, typename T8, typename T9, typename T10,
17437 typename T11, typename T12, typename T13, typename T14, typename T15,
17438 typename T16, typename T17, typename T18, typename T19, typename T20,
17439 typename T21, typename T22, typename T23, typename T24, typename T25,
17440 typename T26, typename T27, typename T28, typename T29, typename T30,
17442 internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17443 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17444 T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
17445 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
17446 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
17447 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
17448 return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17449 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17450 T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
17451 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
17452 v25, v26, v27, v28, v29, v30, v31);
17455 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17456 typename T6, typename T7, typename T8, typename T9, typename T10,
17457 typename T11, typename T12, typename T13, typename T14, typename T15,
17458 typename T16, typename T17, typename T18, typename T19, typename T20,
17459 typename T21, typename T22, typename T23, typename T24, typename T25,
17460 typename T26, typename T27, typename T28, typename T29, typename T30,
17461 typename T31, typename T32>
17462 internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17463 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17464 T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
17465 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
17466 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
17467 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
17469 return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17470 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17471 T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
17472 v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
17473 v24, v25, v26, v27, v28, v29, v30, v31, v32);
17476 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17477 typename T6, typename T7, typename T8, typename T9, typename T10,
17478 typename T11, typename T12, typename T13, typename T14, typename T15,
17479 typename T16, typename T17, typename T18, typename T19, typename T20,
17480 typename T21, typename T22, typename T23, typename T24, typename T25,
17481 typename T26, typename T27, typename T28, typename T29, typename T30,
17482 typename T31, typename T32, typename T33>
17483 internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17484 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17485 T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
17486 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
17487 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
17488 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
17489 T32 v32, T33 v33) {
17490 return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17491 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17492 T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
17493 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
17494 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
17497 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17498 typename T6, typename T7, typename T8, typename T9, typename T10,
17499 typename T11, typename T12, typename T13, typename T14, typename T15,
17500 typename T16, typename T17, typename T18, typename T19, typename T20,
17501 typename T21, typename T22, typename T23, typename T24, typename T25,
17502 typename T26, typename T27, typename T28, typename T29, typename T30,
17503 typename T31, typename T32, typename T33, typename T34>
17504 internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17505 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17506 T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
17507 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
17508 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
17509 T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
17510 T31 v31, T32 v32, T33 v33, T34 v34) {
17511 return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17512 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17513 T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
17514 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
17515 v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
17518 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17519 typename T6, typename T7, typename T8, typename T9, typename T10,
17520 typename T11, typename T12, typename T13, typename T14, typename T15,
17521 typename T16, typename T17, typename T18, typename T19, typename T20,
17522 typename T21, typename T22, typename T23, typename T24, typename T25,
17523 typename T26, typename T27, typename T28, typename T29, typename T30,
17524 typename T31, typename T32, typename T33, typename T34, typename T35>
17525 internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17526 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17527 T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
17528 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
17529 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
17530 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
17531 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
17532 return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17533 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17534 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
17535 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
17536 v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
17539 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17540 typename T6, typename T7, typename T8, typename T9, typename T10,
17541 typename T11, typename T12, typename T13, typename T14, typename T15,
17542 typename T16, typename T17, typename T18, typename T19, typename T20,
17543 typename T21, typename T22, typename T23, typename T24, typename T25,
17544 typename T26, typename T27, typename T28, typename T29, typename T30,
17545 typename T31, typename T32, typename T33, typename T34, typename T35,
17547 internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17548 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17549 T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
17550 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
17551 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
17552 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
17553 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
17554 return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17555 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17556 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
17557 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
17558 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
17562 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17563 typename T6, typename T7, typename T8, typename T9, typename T10,
17564 typename T11, typename T12, typename T13, typename T14, typename T15,
17565 typename T16, typename T17, typename T18, typename T19, typename T20,
17566 typename T21, typename T22, typename T23, typename T24, typename T25,
17567 typename T26, typename T27, typename T28, typename T29, typename T30,
17568 typename T31, typename T32, typename T33, typename T34, typename T35,
17569 typename T36, typename T37>
17570 internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17571 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17572 T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
17573 T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
17574 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
17575 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
17576 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
17578 return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17579 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17580 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
17581 v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
17582 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
17583 v34, v35, v36, v37);
17586 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17587 typename T6, typename T7, typename T8, typename T9, typename T10,
17588 typename T11, typename T12, typename T13, typename T14, typename T15,
17589 typename T16, typename T17, typename T18, typename T19, typename T20,
17590 typename T21, typename T22, typename T23, typename T24, typename T25,
17591 typename T26, typename T27, typename T28, typename T29, typename T30,
17592 typename T31, typename T32, typename T33, typename T34, typename T35,
17593 typename T36, typename T37, typename T38>
17594 internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17595 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17596 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
17597 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
17598 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
17599 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
17600 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
17601 T37 v37, T38 v38) {
17602 return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17603 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17604 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
17605 v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
17606 v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
17607 v33, v34, v35, v36, v37, v38);
17610 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17611 typename T6, typename T7, typename T8, typename T9, typename T10,
17612 typename T11, typename T12, typename T13, typename T14, typename T15,
17613 typename T16, typename T17, typename T18, typename T19, typename T20,
17614 typename T21, typename T22, typename T23, typename T24, typename T25,
17615 typename T26, typename T27, typename T28, typename T29, typename T30,
17616 typename T31, typename T32, typename T33, typename T34, typename T35,
17617 typename T36, typename T37, typename T38, typename T39>
17618 internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17619 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17620 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
17621 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
17622 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
17623 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
17624 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
17625 T37 v37, T38 v38, T39 v39) {
17626 return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17627 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17628 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
17629 v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
17630 v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
17631 v32, v33, v34, v35, v36, v37, v38, v39);
17634 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17635 typename T6, typename T7, typename T8, typename T9, typename T10,
17636 typename T11, typename T12, typename T13, typename T14, typename T15,
17637 typename T16, typename T17, typename T18, typename T19, typename T20,
17638 typename T21, typename T22, typename T23, typename T24, typename T25,
17639 typename T26, typename T27, typename T28, typename T29, typename T30,
17640 typename T31, typename T32, typename T33, typename T34, typename T35,
17641 typename T36, typename T37, typename T38, typename T39, typename T40>
17642 internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17643 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17644 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
17645 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
17646 T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
17647 T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
17648 T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
17649 T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
17650 return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17651 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17652 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
17653 T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
17654 v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
17655 v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
17658 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17659 typename T6, typename T7, typename T8, typename T9, typename T10,
17660 typename T11, typename T12, typename T13, typename T14, typename T15,
17661 typename T16, typename T17, typename T18, typename T19, typename T20,
17662 typename T21, typename T22, typename T23, typename T24, typename T25,
17663 typename T26, typename T27, typename T28, typename T29, typename T30,
17664 typename T31, typename T32, typename T33, typename T34, typename T35,
17665 typename T36, typename T37, typename T38, typename T39, typename T40,
17667 internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17668 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17669 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
17670 T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17671 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
17672 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
17673 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
17674 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
17675 return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17676 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17677 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
17678 T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
17679 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
17680 v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
17683 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17684 typename T6, typename T7, typename T8, typename T9, typename T10,
17685 typename T11, typename T12, typename T13, typename T14, typename T15,
17686 typename T16, typename T17, typename T18, typename T19, typename T20,
17687 typename T21, typename T22, typename T23, typename T24, typename T25,
17688 typename T26, typename T27, typename T28, typename T29, typename T30,
17689 typename T31, typename T32, typename T33, typename T34, typename T35,
17690 typename T36, typename T37, typename T38, typename T39, typename T40,
17691 typename T41, typename T42>
17692 internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17693 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17694 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
17695 T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17696 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
17697 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
17698 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
17699 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
17701 return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17702 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17703 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
17704 T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
17705 v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
17706 v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
17710 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17711 typename T6, typename T7, typename T8, typename T9, typename T10,
17712 typename T11, typename T12, typename T13, typename T14, typename T15,
17713 typename T16, typename T17, typename T18, typename T19, typename T20,
17714 typename T21, typename T22, typename T23, typename T24, typename T25,
17715 typename T26, typename T27, typename T28, typename T29, typename T30,
17716 typename T31, typename T32, typename T33, typename T34, typename T35,
17717 typename T36, typename T37, typename T38, typename T39, typename T40,
17718 typename T41, typename T42, typename T43>
17719 internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17720 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17721 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
17722 T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17723 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
17724 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
17725 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
17726 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
17727 T42 v42, T43 v43) {
17728 return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17729 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17730 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
17731 T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
17732 v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
17733 v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
17737 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17738 typename T6, typename T7, typename T8, typename T9, typename T10,
17739 typename T11, typename T12, typename T13, typename T14, typename T15,
17740 typename T16, typename T17, typename T18, typename T19, typename T20,
17741 typename T21, typename T22, typename T23, typename T24, typename T25,
17742 typename T26, typename T27, typename T28, typename T29, typename T30,
17743 typename T31, typename T32, typename T33, typename T34, typename T35,
17744 typename T36, typename T37, typename T38, typename T39, typename T40,
17745 typename T41, typename T42, typename T43, typename T44>
17746 internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17747 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17748 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
17749 T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
17750 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
17751 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
17752 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
17753 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
17754 T42 v42, T43 v43, T44 v44) {
17755 return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17756 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17757 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
17758 T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
17759 v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
17760 v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
17761 v40, v41, v42, v43, v44);
17764 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17765 typename T6, typename T7, typename T8, typename T9, typename T10,
17766 typename T11, typename T12, typename T13, typename T14, typename T15,
17767 typename T16, typename T17, typename T18, typename T19, typename T20,
17768 typename T21, typename T22, typename T23, typename T24, typename T25,
17769 typename T26, typename T27, typename T28, typename T29, typename T30,
17770 typename T31, typename T32, typename T33, typename T34, typename T35,
17771 typename T36, typename T37, typename T38, typename T39, typename T40,
17772 typename T41, typename T42, typename T43, typename T44, typename T45>
17773 internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17774 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17775 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
17776 T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
17777 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
17778 T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
17779 T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
17780 T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
17781 T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
17782 return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17783 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17784 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
17785 T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
17786 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
17787 v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
17788 v39, v40, v41, v42, v43, v44, v45);
17791 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17792 typename T6, typename T7, typename T8, typename T9, typename T10,
17793 typename T11, typename T12, typename T13, typename T14, typename T15,
17794 typename T16, typename T17, typename T18, typename T19, typename T20,
17795 typename T21, typename T22, typename T23, typename T24, typename T25,
17796 typename T26, typename T27, typename T28, typename T29, typename T30,
17797 typename T31, typename T32, typename T33, typename T34, typename T35,
17798 typename T36, typename T37, typename T38, typename T39, typename T40,
17799 typename T41, typename T42, typename T43, typename T44, typename T45,
17801 internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17802 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17803 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
17804 T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
17805 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
17806 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
17807 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
17808 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
17809 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
17810 return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17811 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17812 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
17813 T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
17814 v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
17815 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
17816 v38, v39, v40, v41, v42, v43, v44, v45, v46);
17819 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17820 typename T6, typename T7, typename T8, typename T9, typename T10,
17821 typename T11, typename T12, typename T13, typename T14, typename T15,
17822 typename T16, typename T17, typename T18, typename T19, typename T20,
17823 typename T21, typename T22, typename T23, typename T24, typename T25,
17824 typename T26, typename T27, typename T28, typename T29, typename T30,
17825 typename T31, typename T32, typename T33, typename T34, typename T35,
17826 typename T36, typename T37, typename T38, typename T39, typename T40,
17827 typename T41, typename T42, typename T43, typename T44, typename T45,
17828 typename T46, typename T47>
17829 internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17830 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17831 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
17832 T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
17833 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
17834 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
17835 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
17836 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
17837 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
17838 return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17839 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17840 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
17841 T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
17842 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
17843 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
17844 v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
17847 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17848 typename T6, typename T7, typename T8, typename T9, typename T10,
17849 typename T11, typename T12, typename T13, typename T14, typename T15,
17850 typename T16, typename T17, typename T18, typename T19, typename T20,
17851 typename T21, typename T22, typename T23, typename T24, typename T25,
17852 typename T26, typename T27, typename T28, typename T29, typename T30,
17853 typename T31, typename T32, typename T33, typename T34, typename T35,
17854 typename T36, typename T37, typename T38, typename T39, typename T40,
17855 typename T41, typename T42, typename T43, typename T44, typename T45,
17856 typename T46, typename T47, typename T48>
17857 internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17858 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17859 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
17860 T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
17861 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
17862 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
17863 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
17864 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
17865 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
17867 return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17868 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17869 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
17870 T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
17871 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
17872 v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
17873 v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
17876 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17877 typename T6, typename T7, typename T8, typename T9, typename T10,
17878 typename T11, typename T12, typename T13, typename T14, typename T15,
17879 typename T16, typename T17, typename T18, typename T19, typename T20,
17880 typename T21, typename T22, typename T23, typename T24, typename T25,
17881 typename T26, typename T27, typename T28, typename T29, typename T30,
17882 typename T31, typename T32, typename T33, typename T34, typename T35,
17883 typename T36, typename T37, typename T38, typename T39, typename T40,
17884 typename T41, typename T42, typename T43, typename T44, typename T45,
17885 typename T46, typename T47, typename T48, typename T49>
17886 internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17887 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17888 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
17889 T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
17890 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
17891 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
17892 T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
17893 T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
17894 T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
17895 T47 v47, T48 v48, T49 v49) {
17896 return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17897 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17898 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
17899 T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
17900 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
17901 v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
17902 v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
17905 template <typename T1, typename T2, typename T3, typename T4, typename T5,
17906 typename T6, typename T7, typename T8, typename T9, typename T10,
17907 typename T11, typename T12, typename T13, typename T14, typename T15,
17908 typename T16, typename T17, typename T18, typename T19, typename T20,
17909 typename T21, typename T22, typename T23, typename T24, typename T25,
17910 typename T26, typename T27, typename T28, typename T29, typename T30,
17911 typename T31, typename T32, typename T33, typename T34, typename T35,
17912 typename T36, typename T37, typename T38, typename T39, typename T40,
17913 typename T41, typename T42, typename T43, typename T44, typename T45,
17914 typename T46, typename T47, typename T48, typename T49, typename T50>
17915 internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
17916 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
17917 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
17918 T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
17919 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
17920 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
17921 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
17922 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
17923 T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
17924 T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
17925 return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
17926 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
17927 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
17928 T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
17929 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
17930 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
17931 v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
17935 // Bool() allows generating tests with parameters in a set of (false, true).
17939 // - returns a generator producing sequences with elements {false, true}.
17941 // It is useful when testing code that depends on Boolean flags. Combinations
17942 // of multiple flags can be tested when several Bool()'s are combined using
17943 // Combine() function.
17945 // In the following example all tests in the test case FlagDependentTest
17946 // will be instantiated twice with parameters false and true.
17948 // class FlagDependentTest : public testing::TestWithParam<bool> {
17949 // virtual void SetUp() {
17950 // external_flag = GetParam();
17953 // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
17955 inline internal::ParamGenerator<bool> Bool() {
17956 return Values(false, true);
17959 # if GTEST_HAS_COMBINE
17960 // Combine() allows the user to combine two or more sequences to produce
17961 // values of a Cartesian product of those sequences' elements.
17964 // Combine(gen1, gen2, ..., genN)
17965 // - returns a generator producing sequences with elements coming from
17966 // the Cartesian product of elements from the sequences generated by
17967 // gen1, gen2, ..., genN. The sequence elements will have a type of
17968 // tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
17969 // of elements from sequences produces by gen1, gen2, ..., genN.
17971 // Combine can have up to 10 arguments. This number is currently limited
17972 // by the maximum number of elements in the tuple implementation used by Google
17977 // This will instantiate tests in test case AnimalTest each one with
17978 // the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
17979 // tuple("dog", BLACK), and tuple("dog", WHITE):
17981 // enum Color { BLACK, GRAY, WHITE };
17982 // class AnimalTest
17983 // : public testing::TestWithParam<tuple<const char*, Color> > {...};
17985 // TEST_P(AnimalTest, AnimalLooksNice) {...}
17987 // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
17988 // Combine(Values("cat", "dog"),
17989 // Values(BLACK, WHITE)));
17991 // This will instantiate tests in FlagDependentTest with all variations of two
17994 // class FlagDependentTest
17995 // : public testing::TestWithParam<tuple<bool, bool> > {
17996 // virtual void SetUp() {
17997 // // Assigns external_flag_1 and external_flag_2 values from the tuple.
17998 // tie(external_flag_1, external_flag_2) = GetParam();
18002 // TEST_P(FlagDependentTest, TestFeature1) {
18003 // // Test your code using external_flag_1 and external_flag_2 here.
18005 // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
18006 // Combine(Bool(), Bool()));
18008 template <typename Generator1, typename Generator2>
18009 internal::CartesianProductHolder2<Generator1, Generator2> Combine(
18010 const Generator1& g1, const Generator2& g2) {
18011 return internal::CartesianProductHolder2<Generator1, Generator2>(
18015 template <typename Generator1, typename Generator2, typename Generator3>
18016 internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
18017 const Generator1& g1, const Generator2& g2, const Generator3& g3) {
18018 return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
18022 template <typename Generator1, typename Generator2, typename Generator3,
18023 typename Generator4>
18024 internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
18025 Generator4> Combine(
18026 const Generator1& g1, const Generator2& g2, const Generator3& g3,
18027 const Generator4& g4) {
18028 return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
18033 template <typename Generator1, typename Generator2, typename Generator3,
18034 typename Generator4, typename Generator5>
18035 internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
18036 Generator4, Generator5> Combine(
18037 const Generator1& g1, const Generator2& g2, const Generator3& g3,
18038 const Generator4& g4, const Generator5& g5) {
18039 return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
18040 Generator4, Generator5>(
18041 g1, g2, g3, g4, g5);
18044 template <typename Generator1, typename Generator2, typename Generator3,
18045 typename Generator4, typename Generator5, typename Generator6>
18046 internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
18047 Generator4, Generator5, Generator6> Combine(
18048 const Generator1& g1, const Generator2& g2, const Generator3& g3,
18049 const Generator4& g4, const Generator5& g5, const Generator6& g6) {
18050 return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
18051 Generator4, Generator5, Generator6>(
18052 g1, g2, g3, g4, g5, g6);
18055 template <typename Generator1, typename Generator2, typename Generator3,
18056 typename Generator4, typename Generator5, typename Generator6,
18057 typename Generator7>
18058 internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
18059 Generator4, Generator5, Generator6, Generator7> Combine(
18060 const Generator1& g1, const Generator2& g2, const Generator3& g3,
18061 const Generator4& g4, const Generator5& g5, const Generator6& g6,
18062 const Generator7& g7) {
18063 return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
18064 Generator4, Generator5, Generator6, Generator7>(
18065 g1, g2, g3, g4, g5, g6, g7);
18068 template <typename Generator1, typename Generator2, typename Generator3,
18069 typename Generator4, typename Generator5, typename Generator6,
18070 typename Generator7, typename Generator8>
18071 internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
18072 Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
18073 const Generator1& g1, const Generator2& g2, const Generator3& g3,
18074 const Generator4& g4, const Generator5& g5, const Generator6& g6,
18075 const Generator7& g7, const Generator8& g8) {
18076 return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
18077 Generator4, Generator5, Generator6, Generator7, Generator8>(
18078 g1, g2, g3, g4, g5, g6, g7, g8);
18081 template <typename Generator1, typename Generator2, typename Generator3,
18082 typename Generator4, typename Generator5, typename Generator6,
18083 typename Generator7, typename Generator8, typename Generator9>
18084 internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
18085 Generator4, Generator5, Generator6, Generator7, Generator8,
18086 Generator9> Combine(
18087 const Generator1& g1, const Generator2& g2, const Generator3& g3,
18088 const Generator4& g4, const Generator5& g5, const Generator6& g6,
18089 const Generator7& g7, const Generator8& g8, const Generator9& g9) {
18090 return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
18091 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
18092 g1, g2, g3, g4, g5, g6, g7, g8, g9);
18095 template <typename Generator1, typename Generator2, typename Generator3,
18096 typename Generator4, typename Generator5, typename Generator6,
18097 typename Generator7, typename Generator8, typename Generator9,
18098 typename Generator10>
18099 internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
18100 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
18101 Generator10> Combine(
18102 const Generator1& g1, const Generator2& g2, const Generator3& g3,
18103 const Generator4& g4, const Generator5& g5, const Generator6& g6,
18104 const Generator7& g7, const Generator8& g8, const Generator9& g9,
18105 const Generator10& g10) {
18106 return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
18107 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
18109 g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
18111 # endif // GTEST_HAS_COMBINE
18115 # define TEST_P(test_case_name, test_name) \
18116 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
18117 : public test_case_name { \
18119 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
18120 virtual void TestBody(); \
18122 static int AddToRegistry() { \
18123 ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
18124 GetTestCasePatternHolder<test_case_name>(\
18126 ::testing::internal::CodeLocation(\
18127 __FILE__, __LINE__))->AddTestPattern(\
18130 new ::testing::internal::TestMetaFactory< \
18131 GTEST_TEST_CLASS_NAME_(\
18132 test_case_name, test_name)>()); \
18135 static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \
18136 GTEST_DISALLOW_COPY_AND_ASSIGN_(\
18137 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
18139 int GTEST_TEST_CLASS_NAME_(test_case_name, \
18140 test_name)::gtest_registering_dummy_ = \
18141 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
18142 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
18144 // The optional last argument to INSTANTIATE_TEST_CASE_P allows the user
18145 // to specify a function or functor that generates custom test name suffixes
18146 // based on the test parameters. The function should accept one argument of
18147 // type testing::TestParamInfo<class ParamType>, and return std::string.
18149 // testing::PrintToStringParamName is a builtin test suffix generator that
18150 // returns the value of testing::PrintToString(GetParam()). It does not work
18151 // for std::string or C strings.
18153 // Note: test names must be non-empty, unique, and may only contain ASCII
18154 // alphanumeric characters or underscore.
18156 # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
18157 ::testing::internal::ParamGenerator<test_case_name::ParamType> \
18158 gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
18159 ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
18160 const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
18161 return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \
18162 (__VA_ARGS__)(info); \
18164 int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
18165 ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
18166 GetTestCasePatternHolder<test_case_name>(\
18168 ::testing::internal::CodeLocation(\
18169 __FILE__, __LINE__))->AddTestCaseInstantiation(\
18171 >est_##prefix##test_case_name##_EvalGenerator_, \
18172 >est_##prefix##test_case_name##_EvalGenerateName_, \
18173 __FILE__, __LINE__)
18175 } // namespace testing
18177 #endif // GTEST_HAS_PARAM_TEST
18179 #endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
18180 // Copyright 2006, Google Inc.
18181 // All rights reserved.
18183 // Redistribution and use in source and binary forms, with or without
18184 // modification, are permitted provided that the following conditions are
18187 // * Redistributions of source code must retain the above copyright
18188 // notice, this list of conditions and the following disclaimer.
18189 // * Redistributions in binary form must reproduce the above
18190 // copyright notice, this list of conditions and the following disclaimer
18191 // in the documentation and/or other materials provided with the
18193 // * Neither the name of Google Inc. nor the names of its
18194 // contributors may be used to endorse or promote products derived from
18195 // this software without specific prior written permission.
18197 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18198 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18199 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18200 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18201 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18202 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
18203 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
18204 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
18205 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
18206 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
18207 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18209 // Author: wan@google.com (Zhanyong Wan)
18211 // Google C++ Testing Framework definitions useful in production code.
18213 #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
18214 #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
18216 // When you need to test the private or protected members of a class,
18217 // use the FRIEND_TEST macro to declare your tests as friends of the
18218 // class. For example:
18222 // void MyMethod();
18223 // FRIEND_TEST(MyClassTest, MyMethod);
18226 // class MyClassTest : public testing::Test {
18230 // TEST_F(MyClassTest, MyMethod) {
18231 // // Can call MyClass::MyMethod() here.
18234 #define FRIEND_TEST(test_case_name, test_name)\
18235 friend class test_case_name##_##test_name##_Test
18237 #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
18238 // Copyright 2008, Google Inc.
18239 // All rights reserved.
18241 // Redistribution and use in source and binary forms, with or without
18242 // modification, are permitted provided that the following conditions are
18245 // * Redistributions of source code must retain the above copyright
18246 // notice, this list of conditions and the following disclaimer.
18247 // * Redistributions in binary form must reproduce the above
18248 // copyright notice, this list of conditions and the following disclaimer
18249 // in the documentation and/or other materials provided with the
18251 // * Neither the name of Google Inc. nor the names of its
18252 // contributors may be used to endorse or promote products derived from
18253 // this software without specific prior written permission.
18255 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18256 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18257 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18258 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18259 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18260 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
18261 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
18262 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
18263 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
18264 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
18265 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18267 // Author: mheule@google.com (Markus Heule)
18270 #ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
18271 #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
18276 namespace testing {
18278 // A copyable object representing the result of a test part (i.e. an
18279 // assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
18281 // Don't inherit from TestPartResult as its destructor is not virtual.
18282 class GTEST_API_ TestPartResult {
18284 // The possible outcomes of a test part (i.e. an assertion or an
18285 // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
18287 kSuccess, // Succeeded.
18288 kNonFatalFailure, // Failed but the test can continue.
18289 kFatalFailure // Failed and the test should be terminated.
18292 // C'tor. TestPartResult does NOT have a default constructor.
18293 // Always use this constructor (with parameters) to create a
18294 // TestPartResult object.
18295 TestPartResult(Type a_type,
18296 const char* a_file_name,
18298 const char* a_message)
18300 file_name_(a_file_name == NULL ? "" : a_file_name),
18301 line_number_(a_line_number),
18302 summary_(ExtractSummary(a_message)),
18303 message_(a_message) {
18306 // Gets the outcome of the test part.
18307 Type type() const { return type_; }
18309 // Gets the name of the source file where the test part took place, or
18310 // NULL if it's unknown.
18311 const char* file_name() const {
18312 return file_name_.empty() ? NULL : file_name_.c_str();
18315 // Gets the line in the source file where the test part took place,
18316 // or -1 if it's unknown.
18317 int line_number() const { return line_number_; }
18319 // Gets the summary of the failure message.
18320 const char* summary() const { return summary_.c_str(); }
18322 // Gets the message associated with the test part.
18323 const char* message() const { return message_.c_str(); }
18325 // Returns true iff the test part passed.
18326 bool passed() const { return type_ == kSuccess; }
18328 // Returns true iff the test part failed.
18329 bool failed() const { return type_ != kSuccess; }
18331 // Returns true iff the test part non-fatally failed.
18332 bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
18334 // Returns true iff the test part fatally failed.
18335 bool fatally_failed() const { return type_ == kFatalFailure; }
18340 // Gets the summary of the failure message by omitting the stack
18342 static std::string ExtractSummary(const char* message);
18344 // The name of the source file where the test part took place, or
18345 // "" if the source file is unknown.
18346 std::string file_name_;
18347 // The line in the source file where the test part took place, or -1
18348 // if the line number is unknown.
18350 std::string summary_; // The test failure summary.
18351 std::string message_; // The test failure message.
18354 // Prints a TestPartResult object.
18355 std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
18357 // An array of TestPartResult objects.
18359 // Don't inherit from TestPartResultArray as its destructor is not
18361 class GTEST_API_ TestPartResultArray {
18363 TestPartResultArray() {}
18365 // Appends the given TestPartResult to the array.
18366 void Append(const TestPartResult& result);
18368 // Returns the TestPartResult at the given index (0-based).
18369 const TestPartResult& GetTestPartResult(int index) const;
18371 // Returns the number of TestPartResult objects in the array.
18375 std::vector<TestPartResult> array_;
18377 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
18380 // This interface knows how to report a test part result.
18381 class TestPartResultReporterInterface {
18383 virtual ~TestPartResultReporterInterface() {}
18385 virtual void ReportTestPartResult(const TestPartResult& result) = 0;
18388 namespace internal {
18390 // This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
18391 // statement generates new fatal failures. To do so it registers itself as the
18392 // current test part result reporter. Besides checking if fatal failures were
18393 // reported, it only delegates the reporting to the former result reporter.
18394 // The original result reporter is restored in the destructor.
18395 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18396 class GTEST_API_ HasNewFatalFailureHelper
18397 : public TestPartResultReporterInterface {
18399 HasNewFatalFailureHelper();
18400 virtual ~HasNewFatalFailureHelper();
18401 virtual void ReportTestPartResult(const TestPartResult& result);
18402 bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
18404 bool has_new_fatal_failure_;
18405 TestPartResultReporterInterface* original_reporter_;
18407 GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
18410 } // namespace internal
18412 } // namespace testing
18414 #endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
18415 // Copyright 2008 Google Inc.
18416 // All Rights Reserved.
18418 // Redistribution and use in source and binary forms, with or without
18419 // modification, are permitted provided that the following conditions are
18422 // * Redistributions of source code must retain the above copyright
18423 // notice, this list of conditions and the following disclaimer.
18424 // * Redistributions in binary form must reproduce the above
18425 // copyright notice, this list of conditions and the following disclaimer
18426 // in the documentation and/or other materials provided with the
18428 // * Neither the name of Google Inc. nor the names of its
18429 // contributors may be used to endorse or promote products derived from
18430 // this software without specific prior written permission.
18432 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18433 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18434 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18435 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18436 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18437 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
18438 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
18439 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
18440 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
18441 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
18442 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18444 // Author: wan@google.com (Zhanyong Wan)
18446 #ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
18447 #define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
18449 // This header implements typed tests and type-parameterized tests.
18451 // Typed (aka type-driven) tests repeat the same test for types in a
18452 // list. You must know which types you want to test with when writing
18453 // typed tests. Here's how you do it:
18457 // First, define a fixture class template. It should be parameterized
18458 // by a type. Remember to derive it from testing::Test.
18459 template <typename T>
18460 class FooTest : public testing::Test {
18463 typedef std::list<T> List;
18468 // Next, associate a list of types with the test case, which will be
18469 // repeated for each type in the list. The typedef is necessary for
18470 // the macro to parse correctly.
18471 typedef testing::Types<char, int, unsigned int> MyTypes;
18472 TYPED_TEST_CASE(FooTest, MyTypes);
18474 // If the type list contains only one type, you can write that type
18475 // directly without Types<...>:
18476 // TYPED_TEST_CASE(FooTest, int);
18478 // Then, use TYPED_TEST() instead of TEST_F() to define as many typed
18479 // tests for this test case as you want.
18480 TYPED_TEST(FooTest, DoesBlah) {
18481 // Inside a test, refer to TypeParam to get the type parameter.
18482 // Since we are inside a derived class template, C++ requires use to
18483 // visit the members of FooTest via 'this'.
18484 TypeParam n = this->value_;
18486 // To visit static members of the fixture, add the TestFixture::
18488 n += TestFixture::shared_;
18490 // To refer to typedefs in the fixture, add the "typename
18491 // TestFixture::" prefix.
18492 typename TestFixture::List values;
18493 values.push_back(n);
18497 TYPED_TEST(FooTest, HasPropertyA) { ... }
18501 // Type-parameterized tests are abstract test patterns parameterized
18502 // by a type. Compared with typed tests, type-parameterized tests
18503 // allow you to define the test pattern without knowing what the type
18504 // parameters are. The defined pattern can be instantiated with
18505 // different types any number of times, in any number of translation
18508 // If you are designing an interface or concept, you can define a
18509 // suite of type-parameterized tests to verify properties that any
18510 // valid implementation of the interface/concept should have. Then,
18511 // each implementation can easily instantiate the test suite to verify
18512 // that it conforms to the requirements, without having to write
18513 // similar tests repeatedly. Here's an example:
18517 // First, define a fixture class template. It should be parameterized
18518 // by a type. Remember to derive it from testing::Test.
18519 template <typename T>
18520 class FooTest : public testing::Test {
18524 // Next, declare that you will define a type-parameterized test case
18525 // (the _P suffix is for "parameterized" or "pattern", whichever you
18527 TYPED_TEST_CASE_P(FooTest);
18529 // Then, use TYPED_TEST_P() to define as many type-parameterized tests
18530 // for this type-parameterized test case as you want.
18531 TYPED_TEST_P(FooTest, DoesBlah) {
18532 // Inside a test, refer to TypeParam to get the type parameter.
18537 TYPED_TEST_P(FooTest, HasPropertyA) { ... }
18539 // Now the tricky part: you need to register all test patterns before
18540 // you can instantiate them. The first argument of the macro is the
18541 // test case name; the rest are the names of the tests in this test
18543 REGISTER_TYPED_TEST_CASE_P(FooTest,
18544 DoesBlah, HasPropertyA);
18546 // Finally, you are free to instantiate the pattern with the types you
18547 // want. If you put the above code in a header file, you can #include
18548 // it in multiple C++ source files and instantiate it multiple times.
18550 // To distinguish different instances of the pattern, the first
18551 // argument to the INSTANTIATE_* macro is a prefix that will be added
18552 // to the actual test case name. Remember to pick unique prefixes for
18553 // different instances.
18554 typedef testing::Types<char, int, unsigned int> MyTypes;
18555 INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
18557 // If the type list contains only one type, you can write that type
18558 // directly without Types<...>:
18559 // INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
18564 // Implements typed tests.
18566 #if GTEST_HAS_TYPED_TEST
18568 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
18570 // Expands to the name of the typedef for the type parameters of the
18571 // given test case.
18572 # define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
18574 // The 'Types' template argument below must have spaces around it
18575 // since some compilers may choke on '>>' when passing a template
18576 // instance (e.g. Types<int>)
18577 # define TYPED_TEST_CASE(CaseName, Types) \
18578 typedef ::testing::internal::TypeList< Types >::type \
18579 GTEST_TYPE_PARAMS_(CaseName)
18581 # define TYPED_TEST(CaseName, TestName) \
18582 template <typename gtest_TypeParam_> \
18583 class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
18584 : public CaseName<gtest_TypeParam_> { \
18586 typedef CaseName<gtest_TypeParam_> TestFixture; \
18587 typedef gtest_TypeParam_ TypeParam; \
18588 virtual void TestBody(); \
18590 bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
18591 ::testing::internal::TypeParameterizedTest< \
18593 ::testing::internal::TemplateSel< \
18594 GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
18595 GTEST_TYPE_PARAMS_(CaseName)>::Register(\
18596 "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \
18597 #CaseName, #TestName, 0); \
18598 template <typename gtest_TypeParam_> \
18599 void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
18601 #endif // GTEST_HAS_TYPED_TEST
18603 // Implements type-parameterized tests.
18605 #if GTEST_HAS_TYPED_TEST_P
18607 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
18609 // Expands to the namespace name that the type-parameterized tests for
18610 // the given type-parameterized test case are defined in. The exact
18611 // name of the namespace is subject to change without notice.
18612 # define GTEST_CASE_NAMESPACE_(TestCaseName) \
18613 gtest_case_##TestCaseName##_
18615 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
18617 // Expands to the name of the variable used to remember the names of
18618 // the defined tests in the given test case.
18619 # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
18620 gtest_typed_test_case_p_state_##TestCaseName##_
18622 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
18624 // Expands to the name of the variable used to remember the names of
18625 // the registered tests in the given test case.
18626 # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
18627 gtest_registered_test_names_##TestCaseName##_
18629 // The variables defined in the type-parameterized test macros are
18630 // static as typically these macros are used in a .h file that can be
18631 // #included in multiple translation units linked together.
18632 # define TYPED_TEST_CASE_P(CaseName) \
18633 static ::testing::internal::TypedTestCasePState \
18634 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
18636 # define TYPED_TEST_P(CaseName, TestName) \
18637 namespace GTEST_CASE_NAMESPACE_(CaseName) { \
18638 template <typename gtest_TypeParam_> \
18639 class TestName : public CaseName<gtest_TypeParam_> { \
18641 typedef CaseName<gtest_TypeParam_> TestFixture; \
18642 typedef gtest_TypeParam_ TypeParam; \
18643 virtual void TestBody(); \
18645 static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
18646 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
18647 __FILE__, __LINE__, #CaseName, #TestName); \
18649 template <typename gtest_TypeParam_> \
18650 void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
18652 # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
18653 namespace GTEST_CASE_NAMESPACE_(CaseName) { \
18654 typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
18656 static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
18657 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
18658 __FILE__, __LINE__, #__VA_ARGS__)
18660 // The 'Types' template argument below must have spaces around it
18661 // since some compilers may choke on '>>' when passing a template
18662 // instance (e.g. Types<int>)
18663 # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
18664 bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
18665 ::testing::internal::TypeParameterizedTestCase<CaseName, \
18666 GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
18667 ::testing::internal::TypeList< Types >::type>::Register(\
18669 ::testing::internal::CodeLocation(__FILE__, __LINE__), \
18670 >EST_TYPED_TEST_CASE_P_STATE_(CaseName), \
18671 #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
18673 #endif // GTEST_HAS_TYPED_TEST_P
18675 #endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
18677 // Depending on the platform, different string classes are available.
18678 // On Linux, in addition to ::std::string, Google also makes use of
18679 // class ::string, which has the same interface as ::std::string, but
18680 // has a different implementation.
18682 // You can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
18683 // ::string is available AND is a distinct type to ::std::string, or
18684 // define it to 0 to indicate otherwise.
18686 // If ::std::string and ::string are the same class on your platform
18687 // due to aliasing, you should define GTEST_HAS_GLOBAL_STRING to 0.
18689 // If you do not define GTEST_HAS_GLOBAL_STRING, it is defined
18692 namespace testing {
18694 // Declares the flags.
18696 // This flag temporary enables the disabled tests.
18697 GTEST_DECLARE_bool_(also_run_disabled_tests);
18699 // This flag brings the debugger on an assertion failure.
18700 GTEST_DECLARE_bool_(break_on_failure);
18702 // This flag controls whether Google Test catches all test-thrown exceptions
18703 // and logs them as failures.
18704 GTEST_DECLARE_bool_(catch_exceptions);
18706 // This flag enables using colors in terminal output. Available values are
18707 // "yes" to enable colors, "no" (disable colors), or "auto" (the default)
18708 // to let Google Test decide.
18709 GTEST_DECLARE_string_(color);
18711 // This flag sets up the filter to select by name using a glob pattern
18712 // the tests to run. If the filter is not given all tests are executed.
18713 GTEST_DECLARE_string_(filter);
18715 // This flag causes the Google Test to list tests. None of the tests listed
18716 // are actually run if the flag is provided.
18717 GTEST_DECLARE_bool_(list_tests);
18719 // This flag controls whether Google Test emits a detailed XML report to a file
18720 // in addition to its normal textual output.
18721 GTEST_DECLARE_string_(output);
18723 // This flags control whether Google Test prints the elapsed time for each
18725 GTEST_DECLARE_bool_(print_time);
18727 // This flag specifies the random number seed.
18728 GTEST_DECLARE_int32_(random_seed);
18730 // This flag sets how many times the tests are repeated. The default value
18731 // is 1. If the value is -1 the tests are repeating forever.
18732 GTEST_DECLARE_int32_(repeat);
18734 // This flag controls whether Google Test includes Google Test internal
18735 // stack frames in failure stack traces.
18736 GTEST_DECLARE_bool_(show_internal_stack_frames);
18738 // When this flag is specified, tests' order is randomized on every iteration.
18739 GTEST_DECLARE_bool_(shuffle);
18741 // This flag specifies the maximum number of stack frames to be
18742 // printed in a failure message.
18743 GTEST_DECLARE_int32_(stack_trace_depth);
18745 // When this flag is specified, a failed assertion will throw an
18746 // exception if exceptions are enabled, or exit the program with a
18747 // non-zero code otherwise.
18748 GTEST_DECLARE_bool_(throw_on_failure);
18750 // When this flag is set with a "host:port" string, on supported
18751 // platforms test results are streamed to the specified port on
18752 // the specified host machine.
18753 GTEST_DECLARE_string_(stream_result_to);
18755 // The upper limit for valid stack trace depths.
18756 const int kMaxStackTraceDepth = 100;
18758 namespace internal {
18760 class AssertHelper;
18761 class DefaultGlobalTestPartResultReporter;
18762 class ExecDeathTest;
18763 class NoExecDeathTest;
18764 class FinalSuccessChecker;
18765 class GTestFlagSaver;
18766 class StreamingListenerTest;
18767 class TestResultAccessor;
18768 class TestEventListenersAccessor;
18769 class TestEventRepeater;
18770 class UnitTestRecordPropertyTestHelper;
18771 class WindowsDeathTest;
18772 class UnitTestImpl* GetUnitTestImpl();
18773 void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
18774 const std::string& message);
18776 } // namespace internal
18778 // The friend relationship of some of these classes is cyclic.
18779 // If we don't forward declare them the compiler might confuse the classes
18780 // in friendship clauses with same named classes on the scope.
18786 // A class for indicating whether an assertion was successful. When
18787 // the assertion wasn't successful, the AssertionResult object
18788 // remembers a non-empty message that describes how it failed.
18790 // To create an instance of this class, use one of the factory functions
18791 // (AssertionSuccess() and AssertionFailure()).
18793 // This class is useful for two purposes:
18794 // 1. Defining predicate functions to be used with Boolean test assertions
18795 // EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
18796 // 2. Defining predicate-format functions to be
18797 // used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
18799 // For example, if you define IsEven predicate:
18801 // testing::AssertionResult IsEven(int n) {
18802 // if ((n % 2) == 0)
18803 // return testing::AssertionSuccess();
18805 // return testing::AssertionFailure() << n << " is odd";
18808 // Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
18809 // will print the message
18811 // Value of: IsEven(Fib(5))
18812 // Actual: false (5 is odd)
18815 // instead of a more opaque
18817 // Value of: IsEven(Fib(5))
18821 // in case IsEven is a simple Boolean predicate.
18823 // If you expect your predicate to be reused and want to support informative
18824 // messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
18825 // about half as often as positive ones in our tests), supply messages for
18826 // both success and failure cases:
18828 // testing::AssertionResult IsEven(int n) {
18829 // if ((n % 2) == 0)
18830 // return testing::AssertionSuccess() << n << " is even";
18832 // return testing::AssertionFailure() << n << " is odd";
18835 // Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
18837 // Value of: IsEven(Fib(6))
18838 // Actual: true (8 is even)
18841 // NB: Predicates that support negative Boolean assertions have reduced
18842 // performance in positive ones so be careful not to use them in tests
18843 // that have lots (tens of thousands) of positive Boolean assertions.
18845 // To use this class with EXPECT_PRED_FORMAT assertions such as:
18847 // // Verifies that Foo() returns an even number.
18848 // EXPECT_PRED_FORMAT1(IsEven, Foo());
18850 // you need to define:
18852 // testing::AssertionResult IsEven(const char* expr, int n) {
18853 // if ((n % 2) == 0)
18854 // return testing::AssertionSuccess();
18856 // return testing::AssertionFailure()
18857 // << "Expected: " << expr << " is even\n Actual: it's " << n;
18860 // If Foo() returns 5, you will see the following message:
18862 // Expected: Foo() is even
18865 class GTEST_API_ AssertionResult {
18867 // Copy constructor.
18868 // Used in EXPECT_TRUE/FALSE(assertion_result).
18869 AssertionResult(const AssertionResult& other);
18871 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 /* forcing value to bool */)
18873 // Used in the EXPECT_TRUE/FALSE(bool_expression).
18875 // T must be contextually convertible to bool.
18877 // The second parameter prevents this overload from being considered if
18878 // the argument is implicitly convertible to AssertionResult. In that case
18879 // we want AssertionResult's copy constructor to be used.
18880 template <typename T>
18881 explicit AssertionResult(
18883 typename internal::EnableIf<
18884 !internal::ImplicitlyConvertible<T, AssertionResult>::value>::type*
18885 /*enabler*/ = NULL)
18886 : success_(success) {}
18888 GTEST_DISABLE_MSC_WARNINGS_POP_()
18890 // Assignment operator.
18891 AssertionResult& operator=(AssertionResult other) {
18896 // Returns true iff the assertion succeeded.
18897 operator bool() const { return success_; } // NOLINT
18899 // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
18900 AssertionResult operator!() const;
18902 // Returns the text streamed into this AssertionResult. Test assertions
18903 // use it when they fail (i.e., the predicate's outcome doesn't match the
18904 // assertion's expectation). When nothing has been streamed into the
18905 // object, returns an empty string.
18906 const char* message() const {
18907 return message_.get() != NULL ? message_->c_str() : "";
18909 // TODO(vladl@google.com): Remove this after making sure no clients use it.
18910 // Deprecated; please use message() instead.
18911 const char* failure_message() const { return message(); }
18913 // Streams a custom failure message into this object.
18914 template <typename T> AssertionResult& operator<<(const T& value) {
18915 AppendMessage(Message() << value);
18919 // Allows streaming basic output manipulators such as endl or flush into
18921 AssertionResult& operator<<(
18922 ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
18923 AppendMessage(Message() << basic_manipulator);
18928 // Appends the contents of message to message_.
18929 void AppendMessage(const Message& a_message) {
18930 if (message_.get() == NULL)
18931 message_.reset(new ::std::string);
18932 message_->append(a_message.GetString().c_str());
18935 // Swap the contents of this AssertionResult with other.
18936 void swap(AssertionResult& other);
18938 // Stores result of the assertion predicate.
18940 // Stores the message describing the condition in case the expectation
18941 // construct is not satisfied with the predicate's outcome.
18942 // Referenced via a pointer to avoid taking too much stack frame space
18943 // with test assertions.
18944 internal::scoped_ptr< ::std::string> message_;
18947 // Makes a successful assertion result.
18948 GTEST_API_ AssertionResult AssertionSuccess();
18950 // Makes a failed assertion result.
18951 GTEST_API_ AssertionResult AssertionFailure();
18953 // Makes a failed assertion result with the given failure message.
18954 // Deprecated; use AssertionFailure() << msg.
18955 GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
18957 // The abstract class that all tests inherit from.
18959 // In Google Test, a unit test program contains one or many TestCases, and
18960 // each TestCase contains one or many Tests.
18962 // When you define a test using the TEST macro, you don't need to
18963 // explicitly derive from Test - the TEST macro automatically does
18966 // The only time you derive from Test is when defining a test fixture
18967 // to be used a TEST_F. For example:
18969 // class FooTest : public testing::Test {
18971 // void SetUp() override { ... }
18972 // void TearDown() override { ... }
18976 // TEST_F(FooTest, Bar) { ... }
18977 // TEST_F(FooTest, Baz) { ... }
18979 // Test is not copyable.
18980 class GTEST_API_ Test {
18982 friend class TestInfo;
18984 // Defines types for pointers to functions that set up and tear down
18986 typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
18987 typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
18989 // The d'tor is virtual as we intend to inherit from Test.
18992 // Sets up the stuff shared by all tests in this test case.
18994 // Google Test will call Foo::SetUpTestCase() before running the first
18995 // test in test case Foo. Hence a sub-class can define its own
18996 // SetUpTestCase() method to shadow the one defined in the super
18998 static void SetUpTestCase() {}
19000 // Tears down the stuff shared by all tests in this test case.
19002 // Google Test will call Foo::TearDownTestCase() after running the last
19003 // test in test case Foo. Hence a sub-class can define its own
19004 // TearDownTestCase() method to shadow the one defined in the super
19006 static void TearDownTestCase() {}
19008 // Returns true iff the current test has a fatal failure.
19009 static bool HasFatalFailure();
19011 // Returns true iff the current test has a non-fatal failure.
19012 static bool HasNonfatalFailure();
19014 // Returns true iff the current test has a (either fatal or
19015 // non-fatal) failure.
19016 static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
19018 // Logs a property for the current test, test case, or for the entire
19019 // invocation of the test program when used outside of the context of a
19020 // test case. Only the last value for a given key is remembered. These
19021 // are public static so they can be called from utility functions that are
19022 // not members of the test fixture. Calls to RecordProperty made during
19023 // lifespan of the test (from the moment its constructor starts to the
19024 // moment its destructor finishes) will be output in XML as attributes of
19025 // the <testcase> element. Properties recorded from fixture's
19026 // SetUpTestCase or TearDownTestCase are logged as attributes of the
19027 // corresponding <testsuite> element. Calls to RecordProperty made in the
19028 // global context (before or after invocation of RUN_ALL_TESTS and from
19029 // SetUp/TearDown method of Environment objects registered with Google
19030 // Test) will be output as attributes of the <testsuites> element.
19031 static void RecordProperty(const std::string& key, const std::string& value);
19032 static void RecordProperty(const std::string& key, int value);
19035 // Creates a Test object.
19038 // Sets up the test fixture.
19039 virtual void SetUp();
19041 // Tears down the test fixture.
19042 virtual void TearDown();
19045 // Returns true iff the current test has the same fixture class as
19046 // the first test in the current test case.
19047 static bool HasSameFixtureClass();
19049 // Runs the test after the test fixture has been set up.
19051 // A sub-class must implement this to define the test logic.
19053 // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
19054 // Instead, use the TEST or TEST_F macro.
19055 virtual void TestBody() = 0;
19057 // Sets up, executes, and tears down the test.
19060 // Deletes self. We deliberately pick an unusual name for this
19061 // internal method to avoid clashing with names used in user TESTs.
19062 void DeleteSelf_() { delete this; }
19064 const internal::scoped_ptr< GTEST_FLAG_SAVER_ > gtest_flag_saver_;
19066 // Often a user misspells SetUp() as Setup() and spends a long time
19067 // wondering why it is never called by Google Test. The declaration of
19068 // the following method is solely for catching such an error at
19071 // - The return type is deliberately chosen to be not void, so it
19072 // will be a conflict if void Setup() is declared in the user's
19075 // - This method is private, so it will be another compiler error
19076 // if the method is called from the user's test fixture.
19078 // DO NOT OVERRIDE THIS FUNCTION.
19080 // If you see an error about overriding the following function or
19081 // about it being private, you have mis-spelled SetUp() as Setup().
19082 struct Setup_should_be_spelled_SetUp {};
19083 virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
19085 // We disallow copying Tests.
19086 GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
19089 typedef internal::TimeInMillis TimeInMillis;
19091 // A copyable object representing a user specified test property which can be
19092 // output as a key/value string pair.
19094 // Don't inherit from TestProperty as its destructor is not virtual.
19095 class TestProperty {
19097 // C'tor. TestProperty does NOT have a default constructor.
19098 // Always use this constructor (with parameters) to create a
19099 // TestProperty object.
19100 TestProperty(const std::string& a_key, const std::string& a_value) :
19101 key_(a_key), value_(a_value) {
19104 // Gets the user supplied key.
19105 const char* key() const {
19106 return key_.c_str();
19109 // Gets the user supplied value.
19110 const char* value() const {
19111 return value_.c_str();
19114 // Sets a new value, overriding the one supplied in the constructor.
19115 void SetValue(const std::string& new_value) {
19116 value_ = new_value;
19120 // The key supplied by the user.
19122 // The value supplied by the user.
19123 std::string value_;
19126 // The result of a single Test. This includes a list of
19127 // TestPartResults, a list of TestProperties, a count of how many
19128 // death tests there are in the Test, and how much time it took to run
19131 // TestResult is not copyable.
19132 class GTEST_API_ TestResult {
19134 // Creates an empty TestResult.
19137 // D'tor. Do not inherit from TestResult.
19140 // Gets the number of all test parts. This is the sum of the number
19141 // of successful test parts and the number of failed test parts.
19142 int total_part_count() const;
19144 // Returns the number of the test properties.
19145 int test_property_count() const;
19147 // Returns true iff the test passed (i.e. no test part failed).
19148 bool Passed() const { return !Failed(); }
19150 // Returns true iff the test failed.
19151 bool Failed() const;
19153 // Returns true iff the test fatally failed.
19154 bool HasFatalFailure() const;
19156 // Returns true iff the test has a non-fatal failure.
19157 bool HasNonfatalFailure() const;
19159 // Returns the elapsed time, in milliseconds.
19160 TimeInMillis elapsed_time() const { return elapsed_time_; }
19162 // Returns the i-th test part result among all the results. i can range
19163 // from 0 to test_property_count() - 1. If i is not in that range, aborts
19165 const TestPartResult& GetTestPartResult(int i) const;
19167 // Returns the i-th test property. i can range from 0 to
19168 // test_property_count() - 1. If i is not in that range, aborts the
19170 const TestProperty& GetTestProperty(int i) const;
19173 friend class TestInfo;
19174 friend class TestCase;
19175 friend class UnitTest;
19176 friend class internal::DefaultGlobalTestPartResultReporter;
19177 friend class internal::ExecDeathTest;
19178 friend class internal::TestResultAccessor;
19179 friend class internal::UnitTestImpl;
19180 friend class internal::WindowsDeathTest;
19182 // Gets the vector of TestPartResults.
19183 const std::vector<TestPartResult>& test_part_results() const {
19184 return test_part_results_;
19187 // Gets the vector of TestProperties.
19188 const std::vector<TestProperty>& test_properties() const {
19189 return test_properties_;
19192 // Sets the elapsed time.
19193 void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
19195 // Adds a test property to the list. The property is validated and may add
19196 // a non-fatal failure if invalid (e.g., if it conflicts with reserved
19197 // key names). If a property is already recorded for the same key, the
19198 // value will be updated, rather than storing multiple values for the same
19199 // key. xml_element specifies the element for which the property is being
19200 // recorded and is used for validation.
19201 void RecordProperty(const std::string& xml_element,
19202 const TestProperty& test_property);
19204 // Adds a failure if the key is a reserved attribute of Google Test
19205 // testcase tags. Returns true if the property is valid.
19206 // TODO(russr): Validate attribute names are legal and human readable.
19207 static bool ValidateTestProperty(const std::string& xml_element,
19208 const TestProperty& test_property);
19210 // Adds a test part result to the list.
19211 void AddTestPartResult(const TestPartResult& test_part_result);
19213 // Returns the death test count.
19214 int death_test_count() const { return death_test_count_; }
19216 // Increments the death test count, returning the new count.
19217 int increment_death_test_count() { return ++death_test_count_; }
19219 // Clears the test part results.
19220 void ClearTestPartResults();
19222 // Clears the object.
19225 // Protects mutable state of the property vector and of owned
19226 // properties, whose values may be updated.
19227 internal::Mutex test_properites_mutex_;
19229 // The vector of TestPartResults
19230 std::vector<TestPartResult> test_part_results_;
19231 // The vector of TestProperties
19232 std::vector<TestProperty> test_properties_;
19233 // Running count of death tests.
19234 int death_test_count_;
19235 // The elapsed time, in milliseconds.
19236 TimeInMillis elapsed_time_;
19238 // We disallow copying TestResult.
19239 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
19240 }; // class TestResult
19242 // A TestInfo object stores the following information about a test:
19246 // Whether the test should be run
19247 // A function pointer that creates the test object when invoked
19250 // The constructor of TestInfo registers itself with the UnitTest
19251 // singleton such that the RUN_ALL_TESTS() macro knows which tests to
19253 class GTEST_API_ TestInfo {
19255 // Destructs a TestInfo object. This function is not virtual, so
19256 // don't inherit from TestInfo.
19259 // Returns the test case name.
19260 const char* test_case_name() const { return test_case_name_.c_str(); }
19262 // Returns the test name.
19263 const char* name() const { return name_.c_str(); }
19265 // Returns the name of the parameter type, or NULL if this is not a typed
19266 // or a type-parameterized test.
19267 const char* type_param() const {
19268 if (type_param_.get() != NULL)
19269 return type_param_->c_str();
19273 // Returns the text representation of the value parameter, or NULL if this
19274 // is not a value-parameterized test.
19275 const char* value_param() const {
19276 if (value_param_.get() != NULL)
19277 return value_param_->c_str();
19281 // Returns the file name where this test is defined.
19282 const char* file() const { return location_.file.c_str(); }
19284 // Returns the line where this test is defined.
19285 int line() const { return location_.line; }
19287 // Returns true if this test should run, that is if the test is not
19288 // disabled (or it is disabled but the also_run_disabled_tests flag has
19289 // been specified) and its full name matches the user-specified filter.
19291 // Google Test allows the user to filter the tests by their full names.
19292 // The full name of a test Bar in test case Foo is defined as
19293 // "Foo.Bar". Only the tests that match the filter will run.
19295 // A filter is a colon-separated list of glob (not regex) patterns,
19296 // optionally followed by a '-' and a colon-separated list of
19297 // negative patterns (tests to exclude). A test is run if it
19298 // matches one of the positive patterns and does not match any of
19299 // the negative patterns.
19301 // For example, *A*:Foo.* is a filter that matches any string that
19302 // contains the character 'A' or starts with "Foo.".
19303 bool should_run() const { return should_run_; }
19305 // Returns true iff this test will appear in the XML report.
19306 bool is_reportable() const {
19307 // For now, the XML report includes all tests matching the filter.
19308 // In the future, we may trim tests that are excluded because of
19310 return matches_filter_;
19313 // Returns the result of the test.
19314 const TestResult* result() const { return &result_; }
19317 #if GTEST_HAS_DEATH_TEST
19318 friend class internal::DefaultDeathTestFactory;
19319 #endif // GTEST_HAS_DEATH_TEST
19321 friend class TestCase;
19322 friend class internal::UnitTestImpl;
19323 friend class internal::StreamingListenerTest;
19324 friend TestInfo* internal::MakeAndRegisterTestInfo(
19325 const char* test_case_name,
19327 const char* type_param,
19328 const char* value_param,
19329 internal::CodeLocation code_location,
19330 internal::TypeId fixture_class_id,
19331 Test::SetUpTestCaseFunc set_up_tc,
19332 Test::TearDownTestCaseFunc tear_down_tc,
19333 internal::TestFactoryBase* factory);
19335 // Constructs a TestInfo object. The newly constructed instance assumes
19336 // ownership of the factory object.
19337 TestInfo(const std::string& test_case_name,
19338 const std::string& name,
19339 const char* a_type_param, // NULL if not a type-parameterized test
19340 const char* a_value_param, // NULL if not a value-parameterized test
19341 internal::CodeLocation a_code_location,
19342 internal::TypeId fixture_class_id,
19343 internal::TestFactoryBase* factory);
19345 // Increments the number of death tests encountered in this test so
19347 int increment_death_test_count() {
19348 return result_.increment_death_test_count();
19351 // Creates the test object, runs it, records its result, and then
19355 static void ClearTestResult(TestInfo* test_info) {
19356 test_info->result_.Clear();
19359 // These fields are immutable properties of the test.
19360 const std::string test_case_name_; // Test case name
19361 const std::string name_; // Test name
19362 // Name of the parameter type, or NULL if this is not a typed or a
19363 // type-parameterized test.
19364 const internal::scoped_ptr<const ::std::string> type_param_;
19365 // Text representation of the value parameter, or NULL if this is not a
19366 // value-parameterized test.
19367 const internal::scoped_ptr<const ::std::string> value_param_;
19368 internal::CodeLocation location_;
19369 const internal::TypeId fixture_class_id_; // ID of the test fixture class
19370 bool should_run_; // True iff this test should run
19371 bool is_disabled_; // True iff this test is disabled
19372 bool matches_filter_; // True if this test matches the
19373 // user-specified filter.
19374 internal::TestFactoryBase* const factory_; // The factory that creates
19377 // This field is mutable and needs to be reset before running the
19378 // test for the second time.
19379 TestResult result_;
19381 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
19384 // A test case, which consists of a vector of TestInfos.
19386 // TestCase is not copyable.
19387 class GTEST_API_ TestCase {
19389 // Creates a TestCase with the given name.
19391 // TestCase does NOT have a default constructor. Always use this
19392 // constructor to create a TestCase object.
19396 // name: name of the test case
19397 // a_type_param: the name of the test's type parameter, or NULL if
19398 // this is not a type-parameterized test.
19399 // set_up_tc: pointer to the function that sets up the test case
19400 // tear_down_tc: pointer to the function that tears down the test case
19401 TestCase(const char* name, const char* a_type_param,
19402 Test::SetUpTestCaseFunc set_up_tc,
19403 Test::TearDownTestCaseFunc tear_down_tc);
19405 // Destructor of TestCase.
19406 virtual ~TestCase();
19408 // Gets the name of the TestCase.
19409 const char* name() const { return name_.c_str(); }
19411 // Returns the name of the parameter type, or NULL if this is not a
19412 // type-parameterized test case.
19413 const char* type_param() const {
19414 if (type_param_.get() != NULL)
19415 return type_param_->c_str();
19419 // Returns true if any test in this test case should run.
19420 bool should_run() const { return should_run_; }
19422 // Gets the number of successful tests in this test case.
19423 int successful_test_count() const;
19425 // Gets the number of failed tests in this test case.
19426 int failed_test_count() const;
19428 // Gets the number of disabled tests that will be reported in the XML report.
19429 int reportable_disabled_test_count() const;
19431 // Gets the number of disabled tests in this test case.
19432 int disabled_test_count() const;
19434 // Gets the number of tests to be printed in the XML report.
19435 int reportable_test_count() const;
19437 // Get the number of tests in this test case that should run.
19438 int test_to_run_count() const;
19440 // Gets the number of all tests in this test case.
19441 int total_test_count() const;
19443 // Returns true iff the test case passed.
19444 bool Passed() const { return !Failed(); }
19446 // Returns true iff the test case failed.
19447 bool Failed() const { return failed_test_count() > 0; }
19449 // Returns the elapsed time, in milliseconds.
19450 TimeInMillis elapsed_time() const { return elapsed_time_; }
19452 // Returns the i-th test among all the tests. i can range from 0 to
19453 // total_test_count() - 1. If i is not in that range, returns NULL.
19454 const TestInfo* GetTestInfo(int i) const;
19456 // Returns the TestResult that holds test properties recorded during
19457 // execution of SetUpTestCase and TearDownTestCase.
19458 const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
19462 friend class internal::UnitTestImpl;
19464 // Gets the (mutable) vector of TestInfos in this TestCase.
19465 std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
19467 // Gets the (immutable) vector of TestInfos in this TestCase.
19468 const std::vector<TestInfo*>& test_info_list() const {
19469 return test_info_list_;
19472 // Returns the i-th test among all the tests. i can range from 0 to
19473 // total_test_count() - 1. If i is not in that range, returns NULL.
19474 TestInfo* GetMutableTestInfo(int i);
19476 // Sets the should_run member.
19477 void set_should_run(bool should) { should_run_ = should; }
19479 // Adds a TestInfo to this test case. Will delete the TestInfo upon
19480 // destruction of the TestCase object.
19481 void AddTestInfo(TestInfo * test_info);
19483 // Clears the results of all tests in this test case.
19484 void ClearResult();
19486 // Clears the results of all tests in the given test case.
19487 static void ClearTestCaseResult(TestCase* test_case) {
19488 test_case->ClearResult();
19491 // Runs every test in this TestCase.
19494 // Runs SetUpTestCase() for this TestCase. This wrapper is needed
19495 // for catching exceptions thrown from SetUpTestCase().
19496 void RunSetUpTestCase() { (*set_up_tc_)(); }
19498 // Runs TearDownTestCase() for this TestCase. This wrapper is
19499 // needed for catching exceptions thrown from TearDownTestCase().
19500 void RunTearDownTestCase() { (*tear_down_tc_)(); }
19502 // Returns true iff test passed.
19503 static bool TestPassed(const TestInfo* test_info) {
19504 return test_info->should_run() && test_info->result()->Passed();
19507 // Returns true iff test failed.
19508 static bool TestFailed(const TestInfo* test_info) {
19509 return test_info->should_run() && test_info->result()->Failed();
19512 // Returns true iff the test is disabled and will be reported in the XML
19514 static bool TestReportableDisabled(const TestInfo* test_info) {
19515 return test_info->is_reportable() && test_info->is_disabled_;
19518 // Returns true iff test is disabled.
19519 static bool TestDisabled(const TestInfo* test_info) {
19520 return test_info->is_disabled_;
19523 // Returns true iff this test will appear in the XML report.
19524 static bool TestReportable(const TestInfo* test_info) {
19525 return test_info->is_reportable();
19528 // Returns true if the given test should run.
19529 static bool ShouldRunTest(const TestInfo* test_info) {
19530 return test_info->should_run();
19533 // Shuffles the tests in this test case.
19534 void ShuffleTests(internal::Random* random);
19536 // Restores the test order to before the first shuffle.
19537 void UnshuffleTests();
19539 // Name of the test case.
19541 // Name of the parameter type, or NULL if this is not a typed or a
19542 // type-parameterized test.
19543 const internal::scoped_ptr<const ::std::string> type_param_;
19544 // The vector of TestInfos in their original order. It owns the
19545 // elements in the vector.
19546 std::vector<TestInfo*> test_info_list_;
19547 // Provides a level of indirection for the test list to allow easy
19548 // shuffling and restoring the test order. The i-th element in this
19549 // vector is the index of the i-th test in the shuffled test list.
19550 std::vector<int> test_indices_;
19551 // Pointer to the function that sets up the test case.
19552 Test::SetUpTestCaseFunc set_up_tc_;
19553 // Pointer to the function that tears down the test case.
19554 Test::TearDownTestCaseFunc tear_down_tc_;
19555 // True iff any test in this test case should run.
19557 // Elapsed time, in milliseconds.
19558 TimeInMillis elapsed_time_;
19559 // Holds test properties recorded during execution of SetUpTestCase and
19560 // TearDownTestCase.
19561 TestResult ad_hoc_test_result_;
19563 // We disallow copying TestCases.
19564 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
19567 // An Environment object is capable of setting up and tearing down an
19568 // environment. You should subclass this to define your own
19571 // An Environment object does the set-up and tear-down in virtual
19572 // methods SetUp() and TearDown() instead of the constructor and the
19575 // 1. You cannot safely throw from a destructor. This is a problem
19576 // as in some cases Google Test is used where exceptions are enabled, and
19577 // we may want to implement ASSERT_* using exceptions where they are
19579 // 2. You cannot use ASSERT_* directly in a constructor or
19581 class Environment {
19583 // The d'tor is virtual as we need to subclass Environment.
19584 virtual ~Environment() {}
19586 // Override this to define how to set up the environment.
19587 virtual void SetUp() {}
19589 // Override this to define how to tear down the environment.
19590 virtual void TearDown() {}
19592 // If you see an error about overriding the following function or
19593 // about it being private, you have mis-spelled SetUp() as Setup().
19594 struct Setup_should_be_spelled_SetUp {};
19595 virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
19598 // The interface for tracing execution of tests. The methods are organized in
19599 // the order the corresponding events are fired.
19600 class TestEventListener {
19602 virtual ~TestEventListener() {}
19604 // Fired before any test activity starts.
19605 virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
19607 // Fired before each iteration of tests starts. There may be more than
19608 // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
19609 // index, starting from 0.
19610 virtual void OnTestIterationStart(const UnitTest& unit_test,
19611 int iteration) = 0;
19613 // Fired before environment set-up for each iteration of tests starts.
19614 virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
19616 // Fired after environment set-up for each iteration of tests ends.
19617 virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
19619 // Fired before the test case starts.
19620 virtual void OnTestCaseStart(const TestCase& test_case) = 0;
19622 // Fired before the test starts.
19623 virtual void OnTestStart(const TestInfo& test_info) = 0;
19625 // Fired after a failed assertion or a SUCCEED() invocation.
19626 virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
19628 // Fired after the test ends.
19629 virtual void OnTestEnd(const TestInfo& test_info) = 0;
19631 // Fired after the test case ends.
19632 virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
19634 // Fired before environment tear-down for each iteration of tests starts.
19635 virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
19637 // Fired after environment tear-down for each iteration of tests ends.
19638 virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
19640 // Fired after each iteration of tests finishes.
19641 virtual void OnTestIterationEnd(const UnitTest& unit_test,
19642 int iteration) = 0;
19644 // Fired after all test activities have ended.
19645 virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
19648 // The convenience class for users who need to override just one or two
19649 // methods and are not concerned that a possible change to a signature of
19650 // the methods they override will not be caught during the build. For
19651 // comments about each method please see the definition of TestEventListener
19653 class EmptyTestEventListener : public TestEventListener {
19655 virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
19656 virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
19657 int /*iteration*/) {}
19658 virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
19659 virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
19660 virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
19661 virtual void OnTestStart(const TestInfo& /*test_info*/) {}
19662 virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
19663 virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
19664 virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
19665 virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
19666 virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
19667 virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
19668 int /*iteration*/) {}
19669 virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
19672 // TestEventListeners lets users add listeners to track events in Google Test.
19673 class GTEST_API_ TestEventListeners {
19675 TestEventListeners();
19676 ~TestEventListeners();
19678 // Appends an event listener to the end of the list. Google Test assumes
19679 // the ownership of the listener (i.e. it will delete the listener when
19680 // the test program finishes).
19681 void Append(TestEventListener* listener);
19683 // Removes the given event listener from the list and returns it. It then
19684 // becomes the caller's responsibility to delete the listener. Returns
19685 // NULL if the listener is not found in the list.
19686 TestEventListener* Release(TestEventListener* listener);
19688 // Returns the standard listener responsible for the default console
19689 // output. Can be removed from the listeners list to shut down default
19690 // console output. Note that removing this object from the listener list
19691 // with Release transfers its ownership to the caller and makes this
19692 // function return NULL the next time.
19693 TestEventListener* default_result_printer() const {
19694 return default_result_printer_;
19697 // Returns the standard listener responsible for the default XML output
19698 // controlled by the --gtest_output=xml flag. Can be removed from the
19699 // listeners list by users who want to shut down the default XML output
19700 // controlled by this flag and substitute it with custom one. Note that
19701 // removing this object from the listener list with Release transfers its
19702 // ownership to the caller and makes this function return NULL the next
19704 TestEventListener* default_xml_generator() const {
19705 return default_xml_generator_;
19709 friend class TestCase;
19710 friend class TestInfo;
19711 friend class internal::DefaultGlobalTestPartResultReporter;
19712 friend class internal::NoExecDeathTest;
19713 friend class internal::TestEventListenersAccessor;
19714 friend class internal::UnitTestImpl;
19716 // Returns repeater that broadcasts the TestEventListener events to all
19718 TestEventListener* repeater();
19720 // Sets the default_result_printer attribute to the provided listener.
19721 // The listener is also added to the listener list and previous
19722 // default_result_printer is removed from it and deleted. The listener can
19723 // also be NULL in which case it will not be added to the list. Does
19724 // nothing if the previous and the current listener objects are the same.
19725 void SetDefaultResultPrinter(TestEventListener* listener);
19727 // Sets the default_xml_generator attribute to the provided listener. The
19728 // listener is also added to the listener list and previous
19729 // default_xml_generator is removed from it and deleted. The listener can
19730 // also be NULL in which case it will not be added to the list. Does
19731 // nothing if the previous and the current listener objects are the same.
19732 void SetDefaultXmlGenerator(TestEventListener* listener);
19734 // Controls whether events will be forwarded by the repeater to the
19735 // listeners in the list.
19736 bool EventForwardingEnabled() const;
19737 void SuppressEventForwarding();
19739 // The actual list of listeners.
19740 internal::TestEventRepeater* repeater_;
19741 // Listener responsible for the standard result output.
19742 TestEventListener* default_result_printer_;
19743 // Listener responsible for the creation of the XML output file.
19744 TestEventListener* default_xml_generator_;
19746 // We disallow copying TestEventListeners.
19747 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
19750 // A UnitTest consists of a vector of TestCases.
19752 // This is a singleton class. The only instance of UnitTest is
19753 // created when UnitTest::GetInstance() is first called. This
19754 // instance is never deleted.
19756 // UnitTest is not copyable.
19758 // This class is thread-safe as long as the methods are called
19759 // according to their specification.
19760 class GTEST_API_ UnitTest {
19762 // Gets the singleton UnitTest object. The first time this method
19763 // is called, a UnitTest object is constructed and returned.
19764 // Consecutive calls will return the same object.
19765 static UnitTest* GetInstance();
19767 // Runs all tests in this UnitTest object and prints the result.
19768 // Returns 0 if successful, or 1 otherwise.
19770 // This method can only be called from the main thread.
19772 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19773 int Run() GTEST_MUST_USE_RESULT_;
19775 // Returns the working directory when the first TEST() or TEST_F()
19776 // was executed. The UnitTest object owns the string.
19777 const char* original_working_dir() const;
19779 // Returns the TestCase object for the test that's currently running,
19780 // or NULL if no test is running.
19781 const TestCase* current_test_case() const
19782 GTEST_LOCK_EXCLUDED_(mutex_);
19784 // Returns the TestInfo object for the test that's currently running,
19785 // or NULL if no test is running.
19786 const TestInfo* current_test_info() const
19787 GTEST_LOCK_EXCLUDED_(mutex_);
19789 // Returns the random seed used at the start of the current test run.
19790 int random_seed() const;
19792 #if GTEST_HAS_PARAM_TEST
19793 // Returns the ParameterizedTestCaseRegistry object used to keep track of
19794 // value-parameterized tests and instantiate and register them.
19796 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19797 internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
19798 GTEST_LOCK_EXCLUDED_(mutex_);
19799 #endif // GTEST_HAS_PARAM_TEST
19801 // Gets the number of successful test cases.
19802 int successful_test_case_count() const;
19804 // Gets the number of failed test cases.
19805 int failed_test_case_count() const;
19807 // Gets the number of all test cases.
19808 int total_test_case_count() const;
19810 // Gets the number of all test cases that contain at least one test
19811 // that should run.
19812 int test_case_to_run_count() const;
19814 // Gets the number of successful tests.
19815 int successful_test_count() const;
19817 // Gets the number of failed tests.
19818 int failed_test_count() const;
19820 // Gets the number of disabled tests that will be reported in the XML report.
19821 int reportable_disabled_test_count() const;
19823 // Gets the number of disabled tests.
19824 int disabled_test_count() const;
19826 // Gets the number of tests to be printed in the XML report.
19827 int reportable_test_count() const;
19829 // Gets the number of all tests.
19830 int total_test_count() const;
19832 // Gets the number of tests that should run.
19833 int test_to_run_count() const;
19835 // Gets the time of the test program start, in ms from the start of the
19837 TimeInMillis start_timestamp() const;
19839 // Gets the elapsed time, in milliseconds.
19840 TimeInMillis elapsed_time() const;
19842 // Returns true iff the unit test passed (i.e. all test cases passed).
19843 bool Passed() const;
19845 // Returns true iff the unit test failed (i.e. some test case failed
19846 // or something outside of all tests failed).
19847 bool Failed() const;
19849 // Gets the i-th test case among all the test cases. i can range from 0 to
19850 // total_test_case_count() - 1. If i is not in that range, returns NULL.
19851 const TestCase* GetTestCase(int i) const;
19853 // Returns the TestResult containing information on test failures and
19854 // properties logged outside of individual test cases.
19855 const TestResult& ad_hoc_test_result() const;
19857 // Returns the list of event listeners that can be used to track events
19858 // inside Google Test.
19859 TestEventListeners& listeners();
19862 // Registers and returns a global test environment. When a test
19863 // program is run, all global test environments will be set-up in
19864 // the order they were registered. After all tests in the program
19865 // have finished, all global test environments will be torn-down in
19866 // the *reverse* order they were registered.
19868 // The UnitTest object takes ownership of the given environment.
19870 // This method can only be called from the main thread.
19871 Environment* AddEnvironment(Environment* env);
19873 // Adds a TestPartResult to the current TestResult object. All
19874 // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
19875 // eventually call this to report their results. The user code
19876 // should use the assertion macros instead of calling this directly.
19877 void AddTestPartResult(TestPartResult::Type result_type,
19878 const char* file_name,
19880 const std::string& message,
19881 const std::string& os_stack_trace)
19882 GTEST_LOCK_EXCLUDED_(mutex_);
19884 // Adds a TestProperty to the current TestResult object when invoked from
19885 // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
19886 // from SetUpTestCase or TearDownTestCase, or to the global property set
19887 // when invoked elsewhere. If the result already contains a property with
19888 // the same key, the value will be updated.
19889 void RecordProperty(const std::string& key, const std::string& value);
19891 // Gets the i-th test case among all the test cases. i can range from 0 to
19892 // total_test_case_count() - 1. If i is not in that range, returns NULL.
19893 TestCase* GetMutableTestCase(int i);
19895 // Accessors for the implementation object.
19896 internal::UnitTestImpl* impl() { return impl_; }
19897 const internal::UnitTestImpl* impl() const { return impl_; }
19899 // These classes and funcions are friends as they need to access private
19900 // members of UnitTest.
19902 friend class internal::AssertHelper;
19903 friend class internal::ScopedTrace;
19904 friend class internal::StreamingListenerTest;
19905 friend class internal::UnitTestRecordPropertyTestHelper;
19906 friend Environment* AddGlobalTestEnvironment(Environment* env);
19907 friend internal::UnitTestImpl* internal::GetUnitTestImpl();
19908 friend void internal::ReportFailureInUnknownLocation(
19909 TestPartResult::Type result_type,
19910 const std::string& message);
19912 // Creates an empty UnitTest.
19916 virtual ~UnitTest();
19918 // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
19919 // Google Test trace stack.
19920 void PushGTestTrace(const internal::TraceInfo& trace)
19921 GTEST_LOCK_EXCLUDED_(mutex_);
19923 // Pops a trace from the per-thread Google Test trace stack.
19924 void PopGTestTrace()
19925 GTEST_LOCK_EXCLUDED_(mutex_);
19927 // Protects mutable state in *impl_. This is mutable as some const
19928 // methods need to lock it too.
19929 mutable internal::Mutex mutex_;
19931 // Opaque implementation object. This field is never changed once
19932 // the object is constructed. We don't mark it as const here, as
19933 // doing so will cause a warning in the constructor of UnitTest.
19934 // Mutable state in *impl_ is protected by mutex_.
19935 internal::UnitTestImpl* impl_;
19937 // We disallow copying UnitTest.
19938 GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
19941 // A convenient wrapper for adding an environment for the test
19944 // You should call this before RUN_ALL_TESTS() is called, probably in
19945 // main(). If you use gtest_main, you need to call this before main()
19946 // starts for it to take effect. For example, you can define a global
19947 // variable like this:
19949 // testing::Environment* const foo_env =
19950 // testing::AddGlobalTestEnvironment(new FooEnvironment);
19952 // However, we strongly recommend you to write your own main() and
19953 // call AddGlobalTestEnvironment() there, as relying on initialization
19954 // of global variables makes the code harder to read and may cause
19955 // problems when you register multiple environments from different
19956 // translation units and the environments have dependencies among them
19957 // (remember that the compiler doesn't guarantee the order in which
19958 // global variables from different translation units are initialized).
19959 inline Environment* AddGlobalTestEnvironment(Environment* env) {
19960 return UnitTest::GetInstance()->AddEnvironment(env);
19963 // Initializes Google Test. This must be called before calling
19964 // RUN_ALL_TESTS(). In particular, it parses a command line for the
19965 // flags that Google Test recognizes. Whenever a Google Test flag is
19966 // seen, it is removed from argv, and *argc is decremented.
19968 // No value is returned. Instead, the Google Test flag variables are
19971 // Calling the function for the second time has no user-visible effect.
19972 GTEST_API_ void InitGoogleTest(int* argc, char** argv);
19974 // This overloaded version can be used in Windows programs compiled in
19976 GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
19978 namespace internal {
19980 // Separate the error generating code from the code path to reduce the stack
19981 // frame size of CmpHelperEQ. This helps reduce the overhead of some sanitizers
19982 // when calling EXPECT_* in a tight loop.
19983 template <typename T1, typename T2>
19984 AssertionResult CmpHelperEQFailure(const char* lhs_expression,
19985 const char* rhs_expression,
19986 const T1& lhs, const T2& rhs) {
19987 return EqFailure(lhs_expression,
19989 FormatForComparisonFailureMessage(lhs, rhs),
19990 FormatForComparisonFailureMessage(rhs, lhs),
19994 // The helper function for {ASSERT|EXPECT}_EQ.
19995 template <typename T1, typename T2>
19996 AssertionResult CmpHelperEQ(const char* lhs_expression,
19997 const char* rhs_expression,
20000 GTEST_DISABLE_MSC_WARNINGS_PUSH_(4389 /* signed/unsigned mismatch */)
20002 return AssertionSuccess();
20004 GTEST_DISABLE_MSC_WARNINGS_POP_()
20006 return CmpHelperEQFailure(lhs_expression, rhs_expression, lhs, rhs);
20009 // With this overloaded version, we allow anonymous enums to be used
20010 // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
20011 // can be implicitly cast to BiggestInt.
20012 GTEST_API_ AssertionResult CmpHelperEQ(const char* lhs_expression,
20013 const char* rhs_expression,
20017 // The helper class for {ASSERT|EXPECT}_EQ. The template argument
20018 // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
20019 // is a null pointer literal. The following default implementation is
20020 // for lhs_is_null_literal being false.
20021 template <bool lhs_is_null_literal>
20024 // This templatized version is for the general case.
20025 template <typename T1, typename T2>
20026 static AssertionResult Compare(const char* lhs_expression,
20027 const char* rhs_expression,
20030 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
20033 // With this overloaded version, we allow anonymous enums to be used
20034 // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
20035 // enums can be implicitly cast to BiggestInt.
20037 // Even though its body looks the same as the above version, we
20038 // cannot merge the two, as it will make anonymous enums unhappy.
20039 static AssertionResult Compare(const char* lhs_expression,
20040 const char* rhs_expression,
20043 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
20047 // This specialization is used when the first argument to ASSERT_EQ()
20048 // is a null pointer literal, like NULL, false, or 0.
20050 class EqHelper<true> {
20052 // We define two overloaded versions of Compare(). The first
20053 // version will be picked when the second argument to ASSERT_EQ() is
20054 // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
20055 // EXPECT_EQ(false, a_bool).
20056 template <typename T1, typename T2>
20057 static AssertionResult Compare(
20058 const char* lhs_expression,
20059 const char* rhs_expression,
20062 // The following line prevents this overload from being considered if T2
20063 // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr)
20064 // expands to Compare("", "", NULL, my_ptr), which requires a conversion
20065 // to match the Secret* in the other overload, which would otherwise make
20066 // this template match better.
20067 typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
20068 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
20071 // This version will be picked when the second argument to ASSERT_EQ() is a
20072 // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
20073 template <typename T>
20074 static AssertionResult Compare(
20075 const char* lhs_expression,
20076 const char* rhs_expression,
20077 // We used to have a second template parameter instead of Secret*. That
20078 // template parameter would deduce to 'long', making this a better match
20079 // than the first overload even without the first overload's EnableIf.
20080 // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
20081 // non-pointer argument" (even a deduced integral argument), so the old
20082 // implementation caused warnings in user code.
20083 Secret* /* lhs (NULL) */,
20085 // We already know that 'lhs' is a null pointer.
20086 return CmpHelperEQ(lhs_expression, rhs_expression,
20087 static_cast<T*>(NULL), rhs);
20091 // Separate the error generating code from the code path to reduce the stack
20092 // frame size of CmpHelperOP. This helps reduce the overhead of some sanitizers
20093 // when calling EXPECT_OP in a tight loop.
20094 template <typename T1, typename T2>
20095 AssertionResult CmpHelperOpFailure(const char* expr1, const char* expr2,
20096 const T1& val1, const T2& val2,
20098 return AssertionFailure()
20099 << "Expected: (" << expr1 << ") " << op << " (" << expr2
20100 << "), actual: " << FormatForComparisonFailureMessage(val1, val2)
20101 << " vs " << FormatForComparisonFailureMessage(val2, val1);
20104 // A macro for implementing the helper functions needed to implement
20105 // ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
20106 // of similar code.
20108 // For each templatized helper function, we also define an overloaded
20109 // version for BiggestInt in order to reduce code bloat and allow
20110 // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
20113 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
20115 #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
20116 template <typename T1, typename T2>\
20117 AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
20118 const T1& val1, const T2& val2) {\
20119 if (val1 op val2) {\
20120 return AssertionSuccess();\
20122 return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
20125 GTEST_API_ AssertionResult CmpHelper##op_name(\
20126 const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
20128 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
20130 // Implements the helper function for {ASSERT|EXPECT}_NE
20131 GTEST_IMPL_CMP_HELPER_(NE, !=);
20132 // Implements the helper function for {ASSERT|EXPECT}_LE
20133 GTEST_IMPL_CMP_HELPER_(LE, <=);
20134 // Implements the helper function for {ASSERT|EXPECT}_LT
20135 GTEST_IMPL_CMP_HELPER_(LT, <);
20136 // Implements the helper function for {ASSERT|EXPECT}_GE
20137 GTEST_IMPL_CMP_HELPER_(GE, >=);
20138 // Implements the helper function for {ASSERT|EXPECT}_GT
20139 GTEST_IMPL_CMP_HELPER_(GT, >);
20141 #undef GTEST_IMPL_CMP_HELPER_
20143 // The helper function for {ASSERT|EXPECT}_STREQ.
20145 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
20146 GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
20147 const char* s2_expression,
20151 // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
20153 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
20154 GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression,
20155 const char* s2_expression,
20159 // The helper function for {ASSERT|EXPECT}_STRNE.
20161 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
20162 GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
20163 const char* s2_expression,
20167 // The helper function for {ASSERT|EXPECT}_STRCASENE.
20169 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
20170 GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
20171 const char* s2_expression,
20176 // Helper function for *_STREQ on wide strings.
20178 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
20179 GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
20180 const char* s2_expression,
20182 const wchar_t* s2);
20184 // Helper function for *_STRNE on wide strings.
20186 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
20187 GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
20188 const char* s2_expression,
20190 const wchar_t* s2);
20192 } // namespace internal
20194 // IsSubstring() and IsNotSubstring() are intended to be used as the
20195 // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
20196 // themselves. They check whether needle is a substring of haystack
20197 // (NULL is considered a substring of itself only), and return an
20198 // appropriate error message when they fail.
20200 // The {needle,haystack}_expr arguments are the stringified
20201 // expressions that generated the two real arguments.
20202 GTEST_API_ AssertionResult IsSubstring(
20203 const char* needle_expr, const char* haystack_expr,
20204 const char* needle, const char* haystack);
20205 GTEST_API_ AssertionResult IsSubstring(
20206 const char* needle_expr, const char* haystack_expr,
20207 const wchar_t* needle, const wchar_t* haystack);
20208 GTEST_API_ AssertionResult IsNotSubstring(
20209 const char* needle_expr, const char* haystack_expr,
20210 const char* needle, const char* haystack);
20211 GTEST_API_ AssertionResult IsNotSubstring(
20212 const char* needle_expr, const char* haystack_expr,
20213 const wchar_t* needle, const wchar_t* haystack);
20214 GTEST_API_ AssertionResult IsSubstring(
20215 const char* needle_expr, const char* haystack_expr,
20216 const ::std::string& needle, const ::std::string& haystack);
20217 GTEST_API_ AssertionResult IsNotSubstring(
20218 const char* needle_expr, const char* haystack_expr,
20219 const ::std::string& needle, const ::std::string& haystack);
20221 #if GTEST_HAS_STD_WSTRING
20222 GTEST_API_ AssertionResult IsSubstring(
20223 const char* needle_expr, const char* haystack_expr,
20224 const ::std::wstring& needle, const ::std::wstring& haystack);
20225 GTEST_API_ AssertionResult IsNotSubstring(
20226 const char* needle_expr, const char* haystack_expr,
20227 const ::std::wstring& needle, const ::std::wstring& haystack);
20228 #endif // GTEST_HAS_STD_WSTRING
20230 namespace internal {
20232 // Helper template function for comparing floating-points.
20234 // Template parameter:
20236 // RawType: the raw floating-point type (either float or double)
20238 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
20239 template <typename RawType>
20240 AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression,
20241 const char* rhs_expression,
20243 RawType rhs_value) {
20244 const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value);
20246 if (lhs.AlmostEquals(rhs)) {
20247 return AssertionSuccess();
20250 ::std::stringstream lhs_ss;
20251 lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
20254 ::std::stringstream rhs_ss;
20255 rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
20258 return EqFailure(lhs_expression,
20260 StringStreamToString(&lhs_ss),
20261 StringStreamToString(&rhs_ss),
20265 // Helper function for implementing ASSERT_NEAR.
20267 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
20268 GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
20270 const char* abs_error_expr,
20275 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
20276 // A class that enables one to stream messages to assertion macros
20277 class GTEST_API_ AssertHelper {
20280 AssertHelper(TestPartResult::Type type,
20283 const char* message);
20286 // Message assignment is a semantic trick to enable assertion
20287 // streaming; see the GTEST_MESSAGE_ macro below.
20288 void operator=(const Message& message) const;
20291 // We put our data in a struct so that the size of the AssertHelper class can
20292 // be as small as possible. This is important because gcc is incapable of
20293 // re-using stack space even for temporary variables, so every EXPECT_EQ
20294 // reserves stack space for another AssertHelper.
20295 struct AssertHelperData {
20296 AssertHelperData(TestPartResult::Type t,
20297 const char* srcfile,
20300 : type(t), file(srcfile), line(line_num), message(msg) { }
20302 TestPartResult::Type const type;
20303 const char* const file;
20305 std::string const message;
20308 GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
20311 AssertHelperData* const data_;
20313 GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
20316 } // namespace internal
20318 #if GTEST_HAS_PARAM_TEST
20319 // The pure interface class that all value-parameterized tests inherit from.
20320 // A value-parameterized class must inherit from both ::testing::Test and
20321 // ::testing::WithParamInterface. In most cases that just means inheriting
20322 // from ::testing::TestWithParam, but more complicated test hierarchies
20323 // may need to inherit from Test and WithParamInterface at different levels.
20325 // This interface has support for accessing the test parameter value via
20326 // the GetParam() method.
20328 // Use it with one of the parameter generator defining functions, like Range(),
20329 // Values(), ValuesIn(), Bool(), and Combine().
20331 // class FooTest : public ::testing::TestWithParam<int> {
20334 // // Can use GetParam() here.
20336 // virtual ~FooTest() {
20337 // // Can use GetParam() here.
20339 // virtual void SetUp() {
20340 // // Can use GetParam() here.
20342 // virtual void TearDown {
20343 // // Can use GetParam() here.
20346 // TEST_P(FooTest, DoesBar) {
20347 // // Can use GetParam() method here.
20349 // ASSERT_TRUE(foo.DoesBar(GetParam()));
20351 // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
20353 template <typename T>
20354 class WithParamInterface {
20356 typedef T ParamType;
20357 virtual ~WithParamInterface() {}
20359 // The current parameter value. Is also available in the test fixture's
20360 // constructor. This member function is non-static, even though it only
20361 // references static data, to reduce the opportunity for incorrect uses
20362 // like writing 'WithParamInterface<bool>::GetParam()' for a test that
20363 // uses a fixture whose parameter type is int.
20364 const ParamType& GetParam() const {
20365 GTEST_CHECK_(parameter_ != NULL)
20366 << "GetParam() can only be called inside a value-parameterized test "
20367 << "-- did you intend to write TEST_P instead of TEST_F?";
20368 return *parameter_;
20372 // Sets parameter value. The caller is responsible for making sure the value
20373 // remains alive and unchanged throughout the current test.
20374 static void SetParam(const ParamType* parameter) {
20375 parameter_ = parameter;
20378 // Static value used for accessing parameter during a test lifetime.
20379 static const ParamType* parameter_;
20381 // TestClass must be a subclass of WithParamInterface<T> and Test.
20382 template <class TestClass> friend class internal::ParameterizedTestFactory;
20385 template <typename T>
20386 const T* WithParamInterface<T>::parameter_ = NULL;
20388 // Most value-parameterized classes can ignore the existence of
20389 // WithParamInterface, and can just inherit from ::testing::TestWithParam.
20391 template <typename T>
20392 class TestWithParam : public Test, public WithParamInterface<T> {
20395 #endif // GTEST_HAS_PARAM_TEST
20397 // Macros for indicating success/failure in test code.
20399 // ADD_FAILURE unconditionally adds a failure to the current test.
20400 // SUCCEED generates a success - it doesn't automatically make the
20401 // current test successful, as a test is only successful when it has
20404 // EXPECT_* verifies that a certain condition is satisfied. If not,
20405 // it behaves like ADD_FAILURE. In particular:
20407 // EXPECT_TRUE verifies that a Boolean condition is true.
20408 // EXPECT_FALSE verifies that a Boolean condition is false.
20410 // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
20411 // that they will also abort the current function on failure. People
20412 // usually want the fail-fast behavior of FAIL and ASSERT_*, but those
20413 // writing data-driven tests often find themselves using ADD_FAILURE
20414 // and EXPECT_* more.
20416 // Generates a nonfatal failure with a generic message.
20417 #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
20419 // Generates a nonfatal failure at the given source file location with
20420 // a generic message.
20421 #define ADD_FAILURE_AT(file, line) \
20422 GTEST_MESSAGE_AT_(file, line, "Failed", \
20423 ::testing::TestPartResult::kNonFatalFailure)
20425 // Generates a fatal failure with a generic message.
20426 #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
20428 // Define this macro to 1 to omit the definition of FAIL(), which is a
20429 // generic name and clashes with some other libraries.
20430 #if !GTEST_DONT_DEFINE_FAIL
20431 # define FAIL() GTEST_FAIL()
20434 // Generates a success with a generic message.
20435 #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
20437 // Define this macro to 1 to omit the definition of SUCCEED(), which
20438 // is a generic name and clashes with some other libraries.
20439 #if !GTEST_DONT_DEFINE_SUCCEED
20440 # define SUCCEED() GTEST_SUCCEED()
20443 // Macros for testing exceptions.
20445 // * {ASSERT|EXPECT}_THROW(statement, expected_exception):
20446 // Tests that the statement throws the expected exception.
20447 // * {ASSERT|EXPECT}_NO_THROW(statement):
20448 // Tests that the statement doesn't throw any exception.
20449 // * {ASSERT|EXPECT}_ANY_THROW(statement):
20450 // Tests that the statement throws an exception.
20452 #define EXPECT_THROW(statement, expected_exception) \
20453 GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
20454 #define EXPECT_NO_THROW(statement) \
20455 GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
20456 #define EXPECT_ANY_THROW(statement) \
20457 GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
20458 #define ASSERT_THROW(statement, expected_exception) \
20459 GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
20460 #define ASSERT_NO_THROW(statement) \
20461 GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
20462 #define ASSERT_ANY_THROW(statement) \
20463 GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
20465 // Boolean assertions. Condition can be either a Boolean expression or an
20466 // AssertionResult. For more information on how to use AssertionResult with
20467 // these macros see comments on that class.
20468 #define EXPECT_TRUE(condition) \
20469 GTEST_TEST_BOOLEAN_((condition), #condition, false, true, \
20470 GTEST_NONFATAL_FAILURE_)
20471 #define EXPECT_FALSE(condition) \
20472 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
20473 GTEST_NONFATAL_FAILURE_)
20474 #define ASSERT_TRUE(condition) \
20475 GTEST_TEST_BOOLEAN_((condition), #condition, false, true, \
20476 GTEST_FATAL_FAILURE_)
20477 #define ASSERT_FALSE(condition) \
20478 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
20479 GTEST_FATAL_FAILURE_)
20481 // Includes the auto-generated header that implements a family of
20482 // generic predicate assertion macros.
20483 // Copyright 2006, Google Inc.
20484 // All rights reserved.
20486 // Redistribution and use in source and binary forms, with or without
20487 // modification, are permitted provided that the following conditions are
20490 // * Redistributions of source code must retain the above copyright
20491 // notice, this list of conditions and the following disclaimer.
20492 // * Redistributions in binary form must reproduce the above
20493 // copyright notice, this list of conditions and the following disclaimer
20494 // in the documentation and/or other materials provided with the
20496 // * Neither the name of Google Inc. nor the names of its
20497 // contributors may be used to endorse or promote products derived from
20498 // this software without specific prior written permission.
20500 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20501 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20502 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20503 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20504 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20505 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20506 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20507 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20508 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20509 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
20510 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20512 // This file is AUTOMATICALLY GENERATED on 10/31/2011 by command
20513 // 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
20515 // Implements a family of generic predicate assertion macros.
20517 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
20518 #define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
20520 // Makes sure this header is not included before gtest.h.
20521 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
20522 # error Do not include gtest_pred_impl.h directly. Include gtest.h instead.
20523 #endif // GTEST_INCLUDE_GTEST_GTEST_H_
20525 // This header implements a family of generic predicate assertion
20528 // ASSERT_PRED_FORMAT1(pred_format, v1)
20529 // ASSERT_PRED_FORMAT2(pred_format, v1, v2)
20532 // where pred_format is a function or functor that takes n (in the
20533 // case of ASSERT_PRED_FORMATn) values and their source expression
20534 // text, and returns a testing::AssertionResult. See the definition
20535 // of ASSERT_EQ in gtest.h for an example.
20537 // If you don't care about formatting, you can use the more
20538 // restrictive version:
20540 // ASSERT_PRED1(pred, v1)
20541 // ASSERT_PRED2(pred, v1, v2)
20544 // where pred is an n-ary function or functor that returns bool,
20545 // and the values v1, v2, ..., must support the << operator for
20546 // streaming to std::ostream.
20548 // We also define the EXPECT_* variations.
20550 // For now we only support predicates whose arity is at most 5.
20551 // Please email googletestframework@googlegroups.com if you need
20552 // support for higher arities.
20554 // GTEST_ASSERT_ is the basic statement to which all of the assertions
20555 // in this file reduce. Don't use this in your code.
20557 #define GTEST_ASSERT_(expression, on_failure) \
20558 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
20559 if (const ::testing::AssertionResult gtest_ar = (expression)) \
20562 on_failure(gtest_ar.failure_message())
20565 // Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use
20566 // this in your code.
20567 template <typename Pred,
20569 AssertionResult AssertPred1Helper(const char* pred_text,
20573 if (pred(v1)) return AssertionSuccess();
20575 return AssertionFailure() << pred_text << "("
20576 << e1 << ") evaluates to false, where"
20577 << "\n" << e1 << " evaluates to " << v1;
20580 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
20581 // Don't use this in your code.
20582 #define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
20583 GTEST_ASSERT_(pred_format(#v1, v1), \
20586 // Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use
20587 // this in your code.
20588 #define GTEST_PRED1_(pred, v1, on_failure)\
20589 GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
20594 // Unary predicate assertion macros.
20595 #define EXPECT_PRED_FORMAT1(pred_format, v1) \
20596 GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
20597 #define EXPECT_PRED1(pred, v1) \
20598 GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
20599 #define ASSERT_PRED_FORMAT1(pred_format, v1) \
20600 GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
20601 #define ASSERT_PRED1(pred, v1) \
20602 GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
20606 // Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use
20607 // this in your code.
20608 template <typename Pred,
20611 AssertionResult AssertPred2Helper(const char* pred_text,
20617 if (pred(v1, v2)) return AssertionSuccess();
20619 return AssertionFailure() << pred_text << "("
20621 << e2 << ") evaluates to false, where"
20622 << "\n" << e1 << " evaluates to " << v1
20623 << "\n" << e2 << " evaluates to " << v2;
20626 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
20627 // Don't use this in your code.
20628 #define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
20629 GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
20632 // Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use
20633 // this in your code.
20634 #define GTEST_PRED2_(pred, v1, v2, on_failure)\
20635 GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
20642 // Binary predicate assertion macros.
20643 #define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
20644 GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
20645 #define EXPECT_PRED2(pred, v1, v2) \
20646 GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
20647 #define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
20648 GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
20649 #define ASSERT_PRED2(pred, v1, v2) \
20650 GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
20654 // Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use
20655 // this in your code.
20656 template <typename Pred,
20660 AssertionResult AssertPred3Helper(const char* pred_text,
20668 if (pred(v1, v2, v3)) return AssertionSuccess();
20670 return AssertionFailure() << pred_text << "("
20673 << e3 << ") evaluates to false, where"
20674 << "\n" << e1 << " evaluates to " << v1
20675 << "\n" << e2 << " evaluates to " << v2
20676 << "\n" << e3 << " evaluates to " << v3;
20679 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
20680 // Don't use this in your code.
20681 #define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
20682 GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
20685 // Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use
20686 // this in your code.
20687 #define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
20688 GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
20697 // Ternary predicate assertion macros.
20698 #define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
20699 GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
20700 #define EXPECT_PRED3(pred, v1, v2, v3) \
20701 GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
20702 #define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
20703 GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
20704 #define ASSERT_PRED3(pred, v1, v2, v3) \
20705 GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
20709 // Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use
20710 // this in your code.
20711 template <typename Pred,
20716 AssertionResult AssertPred4Helper(const char* pred_text,
20726 if (pred(v1, v2, v3, v4)) return AssertionSuccess();
20728 return AssertionFailure() << pred_text << "("
20732 << e4 << ") evaluates to false, where"
20733 << "\n" << e1 << " evaluates to " << v1
20734 << "\n" << e2 << " evaluates to " << v2
20735 << "\n" << e3 << " evaluates to " << v3
20736 << "\n" << e4 << " evaluates to " << v4;
20739 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
20740 // Don't use this in your code.
20741 #define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
20742 GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
20745 // Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use
20746 // this in your code.
20747 #define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
20748 GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
20759 // 4-ary predicate assertion macros.
20760 #define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
20761 GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
20762 #define EXPECT_PRED4(pred, v1, v2, v3, v4) \
20763 GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
20764 #define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
20765 GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
20766 #define ASSERT_PRED4(pred, v1, v2, v3, v4) \
20767 GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
20771 // Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use
20772 // this in your code.
20773 template <typename Pred,
20779 AssertionResult AssertPred5Helper(const char* pred_text,
20791 if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
20793 return AssertionFailure() << pred_text << "("
20798 << e5 << ") evaluates to false, where"
20799 << "\n" << e1 << " evaluates to " << v1
20800 << "\n" << e2 << " evaluates to " << v2
20801 << "\n" << e3 << " evaluates to " << v3
20802 << "\n" << e4 << " evaluates to " << v4
20803 << "\n" << e5 << " evaluates to " << v5;
20806 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
20807 // Don't use this in your code.
20808 #define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
20809 GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
20812 // Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use
20813 // this in your code.
20814 #define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
20815 GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
20828 // 5-ary predicate assertion macros.
20829 #define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
20830 GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
20831 #define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
20832 GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
20833 #define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
20834 GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
20835 #define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
20836 GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
20840 #endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
20842 // Macros for testing equalities and inequalities.
20844 // * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2
20845 // * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
20846 // * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
20847 // * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
20848 // * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
20849 // * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
20851 // When they are not, Google Test prints both the tested expressions and
20852 // their actual values. The values must be compatible built-in types,
20853 // or you will get a compiler error. By "compatible" we mean that the
20854 // values can be compared by the respective operator.
20858 // 1. It is possible to make a user-defined type work with
20859 // {ASSERT|EXPECT}_??(), but that requires overloading the
20860 // comparison operators and is thus discouraged by the Google C++
20861 // Usage Guide. Therefore, you are advised to use the
20862 // {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
20865 // 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
20866 // pointers (in particular, C strings). Therefore, if you use it
20867 // with two C strings, you are testing how their locations in memory
20868 // are related, not how their content is related. To compare two C
20869 // strings by content, use {ASSERT|EXPECT}_STR*().
20871 // 3. {ASSERT|EXPECT}_EQ(v1, v2) is preferred to
20872 // {ASSERT|EXPECT}_TRUE(v1 == v2), as the former tells you
20873 // what the actual value is when it fails, and similarly for the
20874 // other comparisons.
20876 // 4. Do not depend on the order in which {ASSERT|EXPECT}_??()
20877 // evaluate their arguments, which is undefined.
20879 // 5. These macros evaluate their arguments exactly once.
20883 // EXPECT_NE(5, Foo());
20884 // EXPECT_EQ(NULL, a_pointer);
20885 // ASSERT_LT(i, array_size);
20886 // ASSERT_GT(records.size(), 0) << "There is no record left.";
20888 #define EXPECT_EQ(val1, val2) \
20889 EXPECT_PRED_FORMAT2(::testing::internal:: \
20890 EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
20892 #define EXPECT_NE(val1, val2) \
20893 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
20894 #define EXPECT_LE(val1, val2) \
20895 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
20896 #define EXPECT_LT(val1, val2) \
20897 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
20898 #define EXPECT_GE(val1, val2) \
20899 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
20900 #define EXPECT_GT(val1, val2) \
20901 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
20903 #define GTEST_ASSERT_EQ(val1, val2) \
20904 ASSERT_PRED_FORMAT2(::testing::internal:: \
20905 EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
20907 #define GTEST_ASSERT_NE(val1, val2) \
20908 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
20909 #define GTEST_ASSERT_LE(val1, val2) \
20910 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
20911 #define GTEST_ASSERT_LT(val1, val2) \
20912 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
20913 #define GTEST_ASSERT_GE(val1, val2) \
20914 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
20915 #define GTEST_ASSERT_GT(val1, val2) \
20916 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
20918 // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
20919 // ASSERT_XY(), which clashes with some users' own code.
20921 #if !GTEST_DONT_DEFINE_ASSERT_EQ
20922 # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
20925 #if !GTEST_DONT_DEFINE_ASSERT_NE
20926 # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
20929 #if !GTEST_DONT_DEFINE_ASSERT_LE
20930 # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
20933 #if !GTEST_DONT_DEFINE_ASSERT_LT
20934 # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
20937 #if !GTEST_DONT_DEFINE_ASSERT_GE
20938 # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
20941 #if !GTEST_DONT_DEFINE_ASSERT_GT
20942 # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
20945 // C-string Comparisons. All tests treat NULL and any non-NULL string
20946 // as different. Two NULLs are equal.
20948 // * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2
20949 // * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2
20950 // * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
20951 // * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
20953 // For wide or narrow string objects, you can use the
20954 // {ASSERT|EXPECT}_??() macros.
20956 // Don't depend on the order in which the arguments are evaluated,
20957 // which is undefined.
20959 // These macros evaluate their arguments exactly once.
20961 #define EXPECT_STREQ(s1, s2) \
20962 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
20963 #define EXPECT_STRNE(s1, s2) \
20964 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
20965 #define EXPECT_STRCASEEQ(s1, s2) \
20966 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
20967 #define EXPECT_STRCASENE(s1, s2)\
20968 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
20970 #define ASSERT_STREQ(s1, s2) \
20971 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
20972 #define ASSERT_STRNE(s1, s2) \
20973 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
20974 #define ASSERT_STRCASEEQ(s1, s2) \
20975 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
20976 #define ASSERT_STRCASENE(s1, s2)\
20977 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
20979 // Macros for comparing floating-point numbers.
20981 // * {ASSERT|EXPECT}_FLOAT_EQ(val1, val2):
20982 // Tests that two float values are almost equal.
20983 // * {ASSERT|EXPECT}_DOUBLE_EQ(val1, val2):
20984 // Tests that two double values are almost equal.
20985 // * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
20986 // Tests that v1 and v2 are within the given distance to each other.
20988 // Google Test uses ULP-based comparison to automatically pick a default
20989 // error bound that is appropriate for the operands. See the
20990 // FloatingPoint template class in gtest-internal.h if you are
20991 // interested in the implementation details.
20993 #define EXPECT_FLOAT_EQ(val1, val2)\
20994 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
20997 #define EXPECT_DOUBLE_EQ(val1, val2)\
20998 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
21001 #define ASSERT_FLOAT_EQ(val1, val2)\
21002 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
21005 #define ASSERT_DOUBLE_EQ(val1, val2)\
21006 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
21009 #define EXPECT_NEAR(val1, val2, abs_error)\
21010 EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
21011 val1, val2, abs_error)
21013 #define ASSERT_NEAR(val1, val2, abs_error)\
21014 ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
21015 val1, val2, abs_error)
21017 // These predicate format functions work on floating-point values, and
21018 // can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
21020 // EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
21022 // Asserts that val1 is less than, or almost equal to, val2. Fails
21023 // otherwise. In particular, it fails if either val1 or val2 is NaN.
21024 GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
21025 float val1, float val2);
21026 GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
21027 double val1, double val2);
21030 #if GTEST_OS_WINDOWS
21032 // Macros that test for HRESULT failure and success, these are only useful
21033 // on Windows, and rely on Windows SDK macros and APIs to compile.
21035 // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
21037 // When expr unexpectedly fails or succeeds, Google Test prints the
21038 // expected result and the actual result with both a human-readable
21039 // string representation of the error, if available, as well as the
21040 // hex result code.
21041 # define EXPECT_HRESULT_SUCCEEDED(expr) \
21042 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
21044 # define ASSERT_HRESULT_SUCCEEDED(expr) \
21045 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
21047 # define EXPECT_HRESULT_FAILED(expr) \
21048 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
21050 # define ASSERT_HRESULT_FAILED(expr) \
21051 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
21053 #endif // GTEST_OS_WINDOWS
21055 // Macros that execute statement and check that it doesn't generate new fatal
21056 // failures in the current thread.
21058 // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
21062 // EXPECT_NO_FATAL_FAILURE(Process());
21063 // ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
21065 #define ASSERT_NO_FATAL_FAILURE(statement) \
21066 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
21067 #define EXPECT_NO_FATAL_FAILURE(statement) \
21068 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
21070 // Causes a trace (including the source file path, the current line
21071 // number, and the given message) to be included in every test failure
21072 // message generated by code in the current scope. The effect is
21073 // undone when the control leaves the current scope.
21075 // The message argument can be anything streamable to std::ostream.
21077 // In the implementation, we include the current line number as part
21078 // of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
21079 // to appear in the same block - as long as they are on different
21081 #define SCOPED_TRACE(message) \
21082 ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
21083 __FILE__, __LINE__, ::testing::Message() << (message))
21085 // Compile-time assertion for type equality.
21086 // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
21087 // the same type. The value it returns is not interesting.
21089 // Instead of making StaticAssertTypeEq a class template, we make it a
21090 // function template that invokes a helper class template. This
21091 // prevents a user from misusing StaticAssertTypeEq<T1, T2> by
21092 // defining objects of that type.
21096 // When used inside a method of a class template,
21097 // StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
21098 // instantiated. For example, given:
21100 // template <typename T> class Foo {
21102 // void Bar() { testing::StaticAssertTypeEq<int, T>(); }
21107 // void Test1() { Foo<bool> foo; }
21109 // will NOT generate a compiler error, as Foo<bool>::Bar() is never
21110 // actually instantiated. Instead, you need:
21112 // void Test2() { Foo<bool> foo; foo.Bar(); }
21114 // to cause a compiler error.
21115 template <typename T1, typename T2>
21116 bool StaticAssertTypeEq() {
21117 (void)internal::StaticAssertTypeEqHelper<T1, T2>();
21123 // The first parameter is the name of the test case, and the second
21124 // parameter is the name of the test within the test case.
21126 // The convention is to end the test case name with "Test". For
21127 // example, a test case for the Foo class can be named FooTest.
21129 // Test code should appear between braces after an invocation of
21130 // this macro. Example:
21132 // TEST(FooTest, InitializesCorrectly) {
21134 // EXPECT_TRUE(foo.StatusIsOK());
21137 // Note that we call GetTestTypeId() instead of GetTypeId<
21138 // ::testing::Test>() here to get the type ID of testing::Test. This
21139 // is to work around a suspected linker bug when using Google Test as
21140 // a framework on Mac OS X. The bug causes GetTypeId<
21141 // ::testing::Test>() to return different values depending on whether
21142 // the call is from the Google Test framework itself or from user test
21143 // code. GetTestTypeId() is guaranteed to always return the same
21144 // value, as it always calls GetTypeId<>() from the Google Test
21146 #define GTEST_TEST(test_case_name, test_name)\
21147 GTEST_TEST_(test_case_name, test_name, \
21148 ::testing::Test, ::testing::internal::GetTestTypeId())
21150 // Define this macro to 1 to omit the definition of TEST(), which
21151 // is a generic name and clashes with some other libraries.
21152 #if !GTEST_DONT_DEFINE_TEST
21153 # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
21156 // Defines a test that uses a test fixture.
21158 // The first parameter is the name of the test fixture class, which
21159 // also doubles as the test case name. The second parameter is the
21160 // name of the test within the test case.
21162 // A test fixture class must be declared earlier. The user should put
21163 // his test code between braces after using this macro. Example:
21165 // class FooTest : public testing::Test {
21167 // virtual void SetUp() { b_.AddElement(3); }
21173 // TEST_F(FooTest, InitializesCorrectly) {
21174 // EXPECT_TRUE(a_.StatusIsOK());
21177 // TEST_F(FooTest, ReturnsElementCountCorrectly) {
21178 // EXPECT_EQ(0, a_.size());
21179 // EXPECT_EQ(1, b_.size());
21182 #define TEST_F(test_fixture, test_name)\
21183 GTEST_TEST_(test_fixture, test_name, test_fixture, \
21184 ::testing::internal::GetTypeId<test_fixture>())
21186 } // namespace testing
21188 // Use this function in main() to run all tests. It returns 0 if all
21189 // tests are successful, or 1 otherwise.
21191 // RUN_ALL_TESTS() should be invoked after the command line has been
21192 // parsed by InitGoogleTest().
21194 // This function was formerly a macro; thus, it is in the global
21195 // namespace and has an all-caps name.
21196 int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
21198 inline int RUN_ALL_TESTS() {
21199 return ::testing::UnitTest::GetInstance()->Run();
21202 #endif // GTEST_INCLUDE_GTEST_GTEST_H_