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. They are subject to change without notice. DO NOT USE
130 // THEM IN USER CODE.
132 // This file is fundamental to Google Test. All other Google Test source
133 // files are expected to #include this. Therefore, it cannot #include
134 // any other Google Test header.
136 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
137 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
139 // The user can define the following macros in the build script to
140 // control Google Test's behavior. If the user doesn't define a macro
141 // in this list, Google Test will define it.
143 // GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
144 // is/isn't available.
145 // GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
147 // GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
148 // is/isn't available (some systems define
149 // ::string, which is different to std::string).
150 // GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
151 // is/isn't available (some systems define
152 // ::wstring, which is different to std::wstring).
153 // GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
154 // expressions are/aren't available.
155 // GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
156 // is/isn't available.
157 // GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't
159 // GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
160 // std::wstring does/doesn't work (Google Test can
161 // be used where std::wstring is unavailable).
162 // GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
163 // is/isn't available.
164 // GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
165 // compiler supports Microsoft's "Structured
166 // Exception Handling".
167 // GTEST_HAS_STREAM_REDIRECTION
168 // - Define it to 1/0 to indicate whether the
169 // platform supports I/O stream redirection using
171 // GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
172 // Test's own tr1 tuple implementation should be
173 // used. Unused when the user sets
174 // GTEST_HAS_TR1_TUPLE to 0.
175 // GTEST_LANG_CXX11 - Define it to 1/0 to indicate that Google Test
176 // is building in C++11/C++98 mode.
177 // GTEST_LINKED_AS_SHARED_LIBRARY
178 // - Define to 1 when compiling tests that use
179 // Google Test as a shared library (known as
181 // GTEST_CREATE_SHARED_LIBRARY
182 // - Define to 1 when compiling Google Test itself
183 // as a shared library.
185 // This header defines the following utilities:
187 // Macros indicating the current platform (defined to 1 if compiled on
188 // the given platform; otherwise undefined):
189 // GTEST_OS_AIX - IBM AIX
190 // GTEST_OS_CYGWIN - Cygwin
191 // GTEST_OS_HPUX - HP-UX
192 // GTEST_OS_LINUX - Linux
193 // GTEST_OS_LINUX_ANDROID - Google Android
194 // GTEST_OS_MAC - Mac OS X
195 // GTEST_OS_IOS - iOS
196 // GTEST_OS_IOS_SIMULATOR - iOS simulator
197 // GTEST_OS_NACL - Google Native Client (NaCl)
198 // GTEST_OS_OPENBSD - OpenBSD
199 // GTEST_OS_QNX - QNX
200 // GTEST_OS_SOLARIS - Sun Solaris
201 // GTEST_OS_SYMBIAN - Symbian
202 // GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile)
203 // GTEST_OS_WINDOWS_DESKTOP - Windows Desktop
204 // GTEST_OS_WINDOWS_MINGW - MinGW
205 // GTEST_OS_WINDOWS_MOBILE - Windows Mobile
206 // GTEST_OS_ZOS - z/OS
208 // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
209 // most stable support. Since core members of the Google Test project
210 // don't have access to other platforms, support for them may be less
211 // stable. If you notice any problems on your platform, please notify
212 // googletestframework@googlegroups.com (patches for fixing them are
213 // even more welcome!).
215 // Note that it is possible that none of the GTEST_OS_* macros are defined.
217 // Macros indicating available Google Test features (defined to 1 if
218 // the corresponding feature is supported; otherwise undefined):
219 // GTEST_HAS_COMBINE - the Combine() function (for value-parameterized
221 // GTEST_HAS_DEATH_TEST - death tests
222 // GTEST_HAS_PARAM_TEST - value-parameterized tests
223 // GTEST_HAS_TYPED_TEST - typed tests
224 // GTEST_HAS_TYPED_TEST_P - type-parameterized tests
225 // GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with
226 // GTEST_HAS_POSIX_RE (see above) which users can
227 // define themselves.
228 // GTEST_USES_SIMPLE_RE - our own simple regex is used;
229 // the above two are mutually exclusive.
230 // GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
232 // Macros for basic C++ coding:
233 // GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
234 // GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a
235 // variable don't have to be used.
236 // GTEST_DISALLOW_ASSIGN_ - disables operator=.
237 // GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
238 // GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
241 // Mutex, MutexLock, ThreadLocal, GetThreadCount()
242 // - synchronization primitives.
243 // GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
244 // synchronization primitives have real implementations
245 // and Google Test is thread-safe; or 0 otherwise.
247 // Template meta programming:
248 // is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only.
249 // IteratorTraits - partial implementation of std::iterator_traits, which
250 // is not available in libCstd when compiled with Sun C++.
253 // scoped_ptr - as in TR2.
255 // Regular expressions:
256 // RE - a simple regular expression class using the POSIX
257 // Extended Regular Expression syntax on UNIX-like
258 // platforms, or a reduced regular exception syntax on
259 // other platforms, including Windows.
262 // GTEST_LOG_() - logs messages at the specified severity level.
263 // LogToStderr() - directs all log messages to stderr.
264 // FlushInfoLog() - flushes informational log messages.
266 // Stdout and stderr capturing:
267 // CaptureStdout() - starts capturing stdout.
268 // GetCapturedStdout() - stops capturing stdout and returns the captured
270 // CaptureStderr() - starts capturing stderr.
271 // GetCapturedStderr() - stops capturing stderr and returns the captured
275 // TypeWithSize - maps an integer to a int type.
276 // Int32, UInt32, Int64, UInt64, TimeInMillis
277 // - integers of known sizes.
278 // BiggestInt - the biggest signed integer type.
280 // Command-line utilities:
281 // GTEST_FLAG() - references a flag.
282 // GTEST_DECLARE_*() - declares a flag.
283 // GTEST_DEFINE_*() - defines a flag.
284 // GetInjectableArgvs() - returns the command line as a vector of strings.
286 // Environment variable utilities:
287 // GetEnv() - gets the value of an environment variable.
288 // BoolFromGTestEnv() - parses a bool environment variable.
289 // Int32FromGTestEnv() - parses an Int32 environment variable.
290 // StringFromGTestEnv() - parses a string environment variable.
292 #include <ctype.h> // for isspace, etc
293 #include <stddef.h> // for ptrdiff_t
298 # include <sys/types.h>
299 # include <sys/stat.h>
300 #endif // !_WIN32_WCE
302 #if defined __APPLE__
303 # include <AvailabilityMacros.h>
304 # include <TargetConditionals.h>
307 #include <iostream> // NOLINT
308 #include <sstream> // NOLINT
309 #include <string> // NOLINT
311 #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
312 #define GTEST_FLAG_PREFIX_ "gtest_"
313 #define GTEST_FLAG_PREFIX_DASH_ "gtest-"
314 #define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
315 #define GTEST_NAME_ "Google Test"
316 #define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
318 // Determines the version of gcc that is used to compile this.
320 // 40302 means version 4.3.2.
321 # define GTEST_GCC_VER_ \
322 (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
325 // Determines the platform on which Google Test is compiled.
326 #define GTEST_OS_CYGWIN 0
327 #define GTEST_OS_SYMBIAN 0
328 #define GTEST_OS_WINDOWS 0
329 #define GTEST_OS_WINDOWS_MOBILE 0
330 #define GTEST_OS_WINDOWS_MINGW 0
331 #define GTEST_OS_WINDOWS_DESKTOP 0
332 #define GTEST_OS_MAC 0
333 #define GTEST_OS_LINUX 0
334 #define GTEST_OS_LINUX_ANDROID 0
335 #define GTEST_OS_ZOS 0
336 #define GTEST_OS_SOLARIS 0
337 #define GTEST_OS_AIX 0
338 #define GTEST_OS_HPUX 0
339 #define GTEST_OS_NACL 0
340 #define GTEST_OS_OPENBSD 0
341 #define GTEST_OS_QNX 0
342 #define GTEST_OS_IOS 0
343 #define GTEST_OS_IOS_SIMULATOR 0
346 # undef GTEST_OS_CYGWIN
347 # define GTEST_OS_CYGWIN 1
348 #elif defined __SYMBIAN32__
349 # undef GTEST_OS_SYMBIAN
350 # define GTEST_OS_SYMBIAN 1
352 # undef GTEST_OS_WINDOWS
353 # define GTEST_OS_WINDOWS 1
355 # undef GTEST_OS_WINDOWS_MOBILE
356 # define GTEST_OS_WINDOWS_MOBILE 1
357 # elif defined(__MINGW__) || defined(__MINGW32__)
358 # undef GTEST_OS_WINDOWS_MINGW
359 # define GTEST_OS_WINDOWS_MINGW 1
361 # undef GTEST_OS_WINDOWS_DESKTOP
362 # define GTEST_OS_WINDOWS_DESKTOP 1
363 # endif // _WIN32_WCE
364 #elif defined __APPLE__
366 # define GTEST_OS_MAC 1
367 # if TARGET_OS_IPHONE
369 # define GTEST_OS_IOS 1
370 # if TARGET_IPHONE_SIMULATOR
371 # undef GTEST_OS_IOS_SIMULATOR
372 # define GTEST_OS_IOS_SIMULATOR 1
375 #elif defined __linux__
376 # undef GTEST_OS_LINUX
377 # define GTEST_OS_LINUX 1
378 # if defined __ANDROID__
379 # undef GTEST_OS_LINUX_ANDROID
380 # define GTEST_OS_LINUX_ANDROID 1
382 #elif defined __MVS__
384 # define GTEST_OS_ZOS 1
385 #elif defined(__sun) && defined(__SVR4)
386 # undef GTEST_OS_SOLARIS
387 # define GTEST_OS_SOLARIS 1
390 # define GTEST_OS_AIX 1
391 #elif defined(__hpux)
392 # undef GTEST_OS_HPUX
393 # define GTEST_OS_HPUX 1
394 #elif defined __native_client__
395 # undef GTEST_OS_NACL
396 # define GTEST_OS_NACL 1
397 #elif defined __OpenBSD__
398 # undef GTEST_OS_OPENBSD
399 # define GTEST_OS_OPENBSD 1
400 #elif defined __QNX__
402 # define GTEST_OS_QNX 1
405 #ifndef GTEST_LANG_CXX11
406 // gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
407 // -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a
408 // value for __cplusplus, and recent versions of clang, gcc, and
409 // probably other compilers set that too in C++11 mode.
410 # if defined __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L
411 // Compiling in at least C++11 mode.
412 # define GTEST_LANG_CXX11 1
414 # define GTEST_LANG_CXX11 0
418 // Brings in definitions for functions used in the testing::internal::posix
419 // namespace (read, write, close, chdir, isatty, stat). We do not currently
420 // use them on Windows Mobile.
421 #if !GTEST_OS_WINDOWS
422 // This assumes that non-Windows OSes provide unistd.h. For OSes where this
423 // is not the case, we need to include headers that provide the functions
426 # include <strings.h>
427 #elif !GTEST_OS_WINDOWS_MOBILE
432 #if GTEST_OS_LINUX_ANDROID
433 // Used to define __ANDROID_API__ matching the target NDK API level.
434 # include <android/api-level.h> // NOLINT
437 // Defines this to true iff Google Test can use POSIX regular expressions.
438 #ifndef GTEST_HAS_POSIX_RE
439 # if GTEST_OS_LINUX_ANDROID
440 // On Android, <regex.h> is only available starting with Froyo.
441 # define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 8)
443 # define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
447 #if GTEST_HAS_POSIX_RE
449 // On some platforms, <regex.h> needs someone to define size_t, and
450 // won't compile otherwise. We can #include it here as we already
451 // included <stdlib.h>, which is guaranteed to define size_t through
453 # include <regex.h> // NOLINT
455 # define GTEST_USES_POSIX_RE 1
456 # define GTEST_USES_SIMPLE_RE 0
458 #elif GTEST_OS_WINDOWS
460 // <regex.h> is not available on Windows. Use our own simple regex
461 // implementation instead.
462 # define GTEST_USES_SIMPLE_RE 1
463 # define GTEST_USES_POSIX_RE 0
467 // <regex.h> may not be available on this platform. Use our own
468 // simple regex implementation instead.
469 # define GTEST_USES_SIMPLE_RE 1
470 # define GTEST_USES_POSIX_RE 0
472 #endif // GTEST_HAS_POSIX_RE
474 #ifndef GTEST_HAS_EXCEPTIONS
475 // The user didn't tell us whether exceptions are enabled, so we need
477 # if defined(_MSC_VER) || defined(__BORLANDC__)
478 // MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
479 // macro to enable exceptions, so we'll do the same.
480 // Assumes that exceptions are enabled by default.
481 # ifndef _HAS_EXCEPTIONS
482 # define _HAS_EXCEPTIONS 1
483 # endif // _HAS_EXCEPTIONS
484 # define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
485 # elif defined(__GNUC__) && __EXCEPTIONS
486 // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
487 # define GTEST_HAS_EXCEPTIONS 1
488 # elif defined(__SUNPRO_CC)
489 // Sun Pro CC supports exceptions. However, there is no compile-time way of
490 // detecting whether they are enabled or not. Therefore, we assume that
491 // they are enabled unless the user tells us otherwise.
492 # define GTEST_HAS_EXCEPTIONS 1
493 # elif defined(__IBMCPP__) && __EXCEPTIONS
494 // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
495 # define GTEST_HAS_EXCEPTIONS 1
496 # elif defined(__HP_aCC)
497 // Exception handling is in effect by default in HP aCC compiler. It has to
498 // be turned of by +noeh compiler option if desired.
499 # define GTEST_HAS_EXCEPTIONS 1
501 // For other compilers, we assume exceptions are disabled to be
503 # define GTEST_HAS_EXCEPTIONS 0
504 # endif // defined(_MSC_VER) || defined(__BORLANDC__)
505 #endif // GTEST_HAS_EXCEPTIONS
507 #if !defined(GTEST_HAS_STD_STRING)
508 // Even though we don't use this macro any longer, we keep it in case
509 // some clients still depend on it.
510 # define GTEST_HAS_STD_STRING 1
511 #elif !GTEST_HAS_STD_STRING
512 // The user told us that ::std::string isn't available.
513 # error "Google Test cannot be used where ::std::string isn't available."
514 #endif // !defined(GTEST_HAS_STD_STRING)
516 #ifndef GTEST_HAS_GLOBAL_STRING
517 // The user didn't tell us whether ::string is available, so we need
520 # define GTEST_HAS_GLOBAL_STRING 0
522 #endif // GTEST_HAS_GLOBAL_STRING
524 #ifndef GTEST_HAS_STD_WSTRING
525 // The user didn't tell us whether ::std::wstring is available, so we need
527 // TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
530 // Cygwin 1.7 and below doesn't support ::std::wstring.
531 // Solaris' libc++ doesn't support it either. Android has
532 // no support for it at least as recent as Froyo (2.2).
533 # define GTEST_HAS_STD_WSTRING \
534 (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
536 #endif // GTEST_HAS_STD_WSTRING
538 #ifndef GTEST_HAS_GLOBAL_WSTRING
539 // The user didn't tell us whether ::wstring is available, so we need
541 # define GTEST_HAS_GLOBAL_WSTRING \
542 (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
543 #endif // GTEST_HAS_GLOBAL_WSTRING
545 // Determines whether RTTI is available.
546 #ifndef GTEST_HAS_RTTI
547 // The user didn't tell us whether RTTI is enabled, so we need to
552 # ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled.
553 # define GTEST_HAS_RTTI 1
555 # define GTEST_HAS_RTTI 0
558 // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
559 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
562 // When building against STLport with the Android NDK and with
563 // -frtti -fno-exceptions, the build fails at link time with undefined
564 // references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
565 // so disable RTTI when detected.
566 # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \
567 !defined(__EXCEPTIONS)
568 # define GTEST_HAS_RTTI 0
570 # define GTEST_HAS_RTTI 1
571 # endif // GTEST_OS_LINUX_ANDROID && _STLPORT_MAJOR && !__EXCEPTIONS
573 # define GTEST_HAS_RTTI 0
574 # endif // __GXX_RTTI
576 // Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
577 // using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
578 // first version with C++ support.
579 # elif defined(__clang__)
581 # define GTEST_HAS_RTTI __has_feature(cxx_rtti)
583 // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
584 // both the typeid and dynamic_cast features are present.
585 # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
588 # define GTEST_HAS_RTTI 1
590 # define GTEST_HAS_RTTI 0
595 // For all other compilers, we assume RTTI is enabled.
596 # define GTEST_HAS_RTTI 1
600 #endif // GTEST_HAS_RTTI
602 // It's this header's responsibility to #include <typeinfo> when RTTI
608 // Determines whether Google Test can use the pthreads library.
609 #ifndef GTEST_HAS_PTHREAD
610 // The user didn't tell us explicitly, so we assume pthreads support is
611 // available on Linux and Mac.
613 // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
614 // to your compiler flags.
615 # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
617 #endif // GTEST_HAS_PTHREAD
619 #if GTEST_HAS_PTHREAD
620 // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
622 # include <pthread.h> // NOLINT
624 // For timespec and nanosleep, used below.
625 # include <time.h> // NOLINT
628 // Determines whether Google Test can use tr1/tuple. You can define
629 // this macro to 0 to prevent Google Test from using tuple (any
630 // feature depending on tuple with be disabled in this mode).
631 #ifndef GTEST_HAS_TR1_TUPLE
632 # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
633 // STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
634 # define GTEST_HAS_TR1_TUPLE 0
636 // The user didn't tell us not to do it, so we assume it's OK.
637 # define GTEST_HAS_TR1_TUPLE 1
639 #endif // GTEST_HAS_TR1_TUPLE
641 // Determines whether Google Test's own tr1 tuple implementation
643 #ifndef GTEST_USE_OWN_TR1_TUPLE
644 // The user didn't tell us, so we need to figure it out.
646 // We use our own TR1 tuple if we aren't sure the user has an
647 // implementation of it already. At this time, libstdc++ 4.0.0+ and
648 // MSVC 2010 are the only mainstream standard libraries that come
649 // with a TR1 tuple implementation. NVIDIA's CUDA NVCC compiler
650 // pretends to be GCC by defining __GNUC__ and friends, but cannot
651 // compile GCC's tuple implementation. MSVC 2008 (9.0) provides TR1
652 // tuple in a 323 MB Feature Pack download, which we cannot assume the
653 // user has. QNX's QCC compiler is a modified GCC but it doesn't
654 // support TR1 tuple. libc++ only provides std::tuple, in C++11 mode,
655 // and it can be used with some compilers that define __GNUC__.
656 # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
657 && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) && !defined(_STLPORT_MAJOR) \
658 || (defined(_MSC_VER) && _MSC_VER >= 1600)
659 # define GTEST_ENV_HAS_TR1_TUPLE_ 1
661 # define GTEST_ENV_HAS_TR1_TUPLE_ 0
664 // C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
665 // in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
666 // can build with clang but need to use gcc4.2's libstdc++).
667 # if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
668 # define GTEST_ENV_HAS_STD_TUPLE_ 1
670 # define GTEST_ENV_HAS_STD_TUPLE_ 0
673 # if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
674 # define GTEST_USE_OWN_TR1_TUPLE 0
676 # define GTEST_USE_OWN_TR1_TUPLE 1
677 # undef GTEST_HAS_TR1_TUPLE
678 # define GTEST_HAS_TR1_TUPLE 1
681 #endif // GTEST_USE_OWN_TR1_TUPLE
683 // To avoid conditional compilation everywhere, we make it
684 // gtest-port.h's responsibility to #include the header implementing
686 #if GTEST_HAS_TR1_TUPLE
688 # if GTEST_USE_OWN_TR1_TUPLE
689 // This file was GENERATED by command:
690 // pump.py gtest-tuple.h.pump
691 // DO NOT EDIT BY HAND!!!
693 // Copyright 2009 Google Inc.
694 // All Rights Reserved.
696 // Redistribution and use in source and binary forms, with or without
697 // modification, are permitted provided that the following conditions are
700 // * Redistributions of source code must retain the above copyright
701 // notice, this list of conditions and the following disclaimer.
702 // * Redistributions in binary form must reproduce the above
703 // copyright notice, this list of conditions and the following disclaimer
704 // in the documentation and/or other materials provided with the
706 // * Neither the name of Google Inc. nor the names of its
707 // contributors may be used to endorse or promote products derived from
708 // this software without specific prior written permission.
710 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
711 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
712 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
713 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
714 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
715 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
716 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
717 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
718 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
719 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
720 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
722 // Author: wan@google.com (Zhanyong Wan)
724 // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
726 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
727 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
729 #include <utility> // For ::std::pair.
731 // The compiler used in Symbian has a bug that prevents us from declaring the
732 // tuple template as a friend (it complains that tuple is redefined). This
733 // hack bypasses the bug by declaring the members that should otherwise be
734 // private as public.
735 // Sun Studio versions < 12 also have the above bug.
736 #if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
737 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
739 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
740 template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
744 // GTEST_n_TUPLE_(T) is the type of an n-tuple.
745 #define GTEST_0_TUPLE_(T) tuple<>
746 #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
748 #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
750 #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
752 #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
754 #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
756 #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
758 #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
760 #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
762 #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
764 #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
767 // GTEST_n_TYPENAMES_(T) declares a list of n typenames.
768 #define GTEST_0_TYPENAMES_(T)
769 #define GTEST_1_TYPENAMES_(T) typename T##0
770 #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
771 #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
772 #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
774 #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
775 typename T##3, typename T##4
776 #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
777 typename T##3, typename T##4, typename T##5
778 #define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
779 typename T##3, typename T##4, typename T##5, typename T##6
780 #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
781 typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
782 #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
783 typename T##3, typename T##4, typename T##5, typename T##6, \
784 typename T##7, typename T##8
785 #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
786 typename T##3, typename T##4, typename T##5, typename T##6, \
787 typename T##7, typename T##8, typename T##9
789 // In theory, defining stuff in the ::std namespace is undefined
790 // behavior. We can do this as we are playing the role of a standard
795 template <typename T0 = void, typename T1 = void, typename T2 = void,
796 typename T3 = void, typename T4 = void, typename T5 = void,
797 typename T6 = void, typename T7 = void, typename T8 = void,
801 // Anything in namespace gtest_internal is Google Test's INTERNAL
802 // IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
803 namespace gtest_internal {
805 // ByRef<T>::type is T if T is a reference; otherwise it's const T&.
806 template <typename T>
807 struct ByRef { typedef const T& type; }; // NOLINT
808 template <typename T>
809 struct ByRef<T&> { typedef T& type; }; // NOLINT
811 // A handy wrapper for ByRef.
812 #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
814 // AddRef<T>::type is T if T is a reference; otherwise it's T&. This
815 // is the same as tr1::add_reference<T>::type.
816 template <typename T>
817 struct AddRef { typedef T& type; }; // NOLINT
818 template <typename T>
819 struct AddRef<T&> { typedef T& type; }; // NOLINT
821 // A handy wrapper for AddRef.
822 #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
824 // A helper for implementing get<k>().
825 template <int k> class Get;
827 // A helper for implementing tuple_element<k, T>. kIndexValid is true
828 // iff k < the number of fields in tuple type T.
829 template <bool kIndexValid, int kIndex, class Tuple>
832 template <GTEST_10_TYPENAMES_(T)>
833 struct TupleElement<true, 0, GTEST_10_TUPLE_(T)> {
837 template <GTEST_10_TYPENAMES_(T)>
838 struct TupleElement<true, 1, GTEST_10_TUPLE_(T)> {
842 template <GTEST_10_TYPENAMES_(T)>
843 struct TupleElement<true, 2, GTEST_10_TUPLE_(T)> {
847 template <GTEST_10_TYPENAMES_(T)>
848 struct TupleElement<true, 3, GTEST_10_TUPLE_(T)> {
852 template <GTEST_10_TYPENAMES_(T)>
853 struct TupleElement<true, 4, GTEST_10_TUPLE_(T)> {
857 template <GTEST_10_TYPENAMES_(T)>
858 struct TupleElement<true, 5, GTEST_10_TUPLE_(T)> {
862 template <GTEST_10_TYPENAMES_(T)>
863 struct TupleElement<true, 6, GTEST_10_TUPLE_(T)> {
867 template <GTEST_10_TYPENAMES_(T)>
868 struct TupleElement<true, 7, GTEST_10_TUPLE_(T)> {
872 template <GTEST_10_TYPENAMES_(T)>
873 struct TupleElement<true, 8, GTEST_10_TUPLE_(T)> {
877 template <GTEST_10_TYPENAMES_(T)>
878 struct TupleElement<true, 9, GTEST_10_TUPLE_(T)> {
882 } // namespace gtest_internal
888 tuple(const tuple& /* t */) {}
889 tuple& operator=(const tuple& /* t */) { return *this; }
892 template <GTEST_1_TYPENAMES_(T)>
893 class GTEST_1_TUPLE_(T) {
895 template <int k> friend class gtest_internal::Get;
899 explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
901 tuple(const tuple& t) : f0_(t.f0_) {}
903 template <GTEST_1_TYPENAMES_(U)>
904 tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
906 tuple& operator=(const tuple& t) { return CopyFrom(t); }
908 template <GTEST_1_TYPENAMES_(U)>
909 tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
913 GTEST_DECLARE_TUPLE_AS_FRIEND_
915 template <GTEST_1_TYPENAMES_(U)>
916 tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
924 template <GTEST_2_TYPENAMES_(T)>
925 class GTEST_2_TUPLE_(T) {
927 template <int k> friend class gtest_internal::Get;
929 tuple() : f0_(), f1_() {}
931 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
934 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
936 template <GTEST_2_TYPENAMES_(U)>
937 tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
938 template <typename U0, typename U1>
939 tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
941 tuple& operator=(const tuple& t) { return CopyFrom(t); }
943 template <GTEST_2_TYPENAMES_(U)>
944 tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
947 template <typename U0, typename U1>
948 tuple& operator=(const ::std::pair<U0, U1>& p) {
954 GTEST_DECLARE_TUPLE_AS_FRIEND_
956 template <GTEST_2_TYPENAMES_(U)>
957 tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
967 template <GTEST_3_TYPENAMES_(T)>
968 class GTEST_3_TUPLE_(T) {
970 template <int k> friend class gtest_internal::Get;
972 tuple() : f0_(), f1_(), f2_() {}
974 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
975 GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
977 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
979 template <GTEST_3_TYPENAMES_(U)>
980 tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
982 tuple& operator=(const tuple& t) { return CopyFrom(t); }
984 template <GTEST_3_TYPENAMES_(U)>
985 tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
989 GTEST_DECLARE_TUPLE_AS_FRIEND_
991 template <GTEST_3_TYPENAMES_(U)>
992 tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
1004 template <GTEST_4_TYPENAMES_(T)>
1005 class GTEST_4_TUPLE_(T) {
1007 template <int k> friend class gtest_internal::Get;
1009 tuple() : f0_(), f1_(), f2_(), f3_() {}
1011 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1012 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
1015 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
1017 template <GTEST_4_TYPENAMES_(U)>
1018 tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1021 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1023 template <GTEST_4_TYPENAMES_(U)>
1024 tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
1028 GTEST_DECLARE_TUPLE_AS_FRIEND_
1030 template <GTEST_4_TYPENAMES_(U)>
1031 tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
1045 template <GTEST_5_TYPENAMES_(T)>
1046 class GTEST_5_TUPLE_(T) {
1048 template <int k> friend class gtest_internal::Get;
1050 tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
1052 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1053 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
1054 GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
1056 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1059 template <GTEST_5_TYPENAMES_(U)>
1060 tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1061 f3_(t.f3_), f4_(t.f4_) {}
1063 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1065 template <GTEST_5_TYPENAMES_(U)>
1066 tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
1070 GTEST_DECLARE_TUPLE_AS_FRIEND_
1072 template <GTEST_5_TYPENAMES_(U)>
1073 tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
1089 template <GTEST_6_TYPENAMES_(T)>
1090 class GTEST_6_TUPLE_(T) {
1092 template <int k> friend class gtest_internal::Get;
1094 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
1096 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1097 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1098 GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1101 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1102 f4_(t.f4_), f5_(t.f5_) {}
1104 template <GTEST_6_TYPENAMES_(U)>
1105 tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1106 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
1108 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1110 template <GTEST_6_TYPENAMES_(U)>
1111 tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
1115 GTEST_DECLARE_TUPLE_AS_FRIEND_
1117 template <GTEST_6_TYPENAMES_(U)>
1118 tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
1136 template <GTEST_7_TYPENAMES_(T)>
1137 class GTEST_7_TUPLE_(T) {
1139 template <int k> friend class gtest_internal::Get;
1141 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
1143 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1144 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1145 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
1146 f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
1148 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1149 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1151 template <GTEST_7_TYPENAMES_(U)>
1152 tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1153 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1155 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1157 template <GTEST_7_TYPENAMES_(U)>
1158 tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
1162 GTEST_DECLARE_TUPLE_AS_FRIEND_
1164 template <GTEST_7_TYPENAMES_(U)>
1165 tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
1185 template <GTEST_8_TYPENAMES_(T)>
1186 class GTEST_8_TUPLE_(T) {
1188 template <int k> friend class gtest_internal::Get;
1190 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
1192 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1193 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1194 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
1195 GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1196 f5_(f5), f6_(f6), f7_(f7) {}
1198 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1199 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1201 template <GTEST_8_TYPENAMES_(U)>
1202 tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1203 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1205 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1207 template <GTEST_8_TYPENAMES_(U)>
1208 tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
1212 GTEST_DECLARE_TUPLE_AS_FRIEND_
1214 template <GTEST_8_TYPENAMES_(U)>
1215 tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
1237 template <GTEST_9_TYPENAMES_(T)>
1238 class GTEST_9_TUPLE_(T) {
1240 template <int k> friend class gtest_internal::Get;
1242 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
1244 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1245 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1246 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1247 GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1248 f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
1250 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1251 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1253 template <GTEST_9_TYPENAMES_(U)>
1254 tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1255 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1257 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1259 template <GTEST_9_TYPENAMES_(U)>
1260 tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
1264 GTEST_DECLARE_TUPLE_AS_FRIEND_
1266 template <GTEST_9_TYPENAMES_(U)>
1267 tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
1291 template <GTEST_10_TYPENAMES_(T)>
1294 template <int k> friend class gtest_internal::Get;
1296 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
1299 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1300 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1301 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1302 GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
1303 f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
1305 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1306 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
1308 template <GTEST_10_TYPENAMES_(U)>
1309 tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1310 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
1313 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1315 template <GTEST_10_TYPENAMES_(U)>
1316 tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
1320 GTEST_DECLARE_TUPLE_AS_FRIEND_
1322 template <GTEST_10_TYPENAMES_(U)>
1323 tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
1349 // 6.1.3.2 Tuple creation functions.
1351 // Known limitations: we don't support passing an
1352 // std::tr1::reference_wrapper<T> to make_tuple(). And we don't
1355 inline tuple<> make_tuple() { return tuple<>(); }
1357 template <GTEST_1_TYPENAMES_(T)>
1358 inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
1359 return GTEST_1_TUPLE_(T)(f0);
1362 template <GTEST_2_TYPENAMES_(T)>
1363 inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
1364 return GTEST_2_TUPLE_(T)(f0, f1);
1367 template <GTEST_3_TYPENAMES_(T)>
1368 inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
1369 return GTEST_3_TUPLE_(T)(f0, f1, f2);
1372 template <GTEST_4_TYPENAMES_(T)>
1373 inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1375 return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
1378 template <GTEST_5_TYPENAMES_(T)>
1379 inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1380 const T3& f3, const T4& f4) {
1381 return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
1384 template <GTEST_6_TYPENAMES_(T)>
1385 inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1386 const T3& f3, const T4& f4, const T5& f5) {
1387 return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
1390 template <GTEST_7_TYPENAMES_(T)>
1391 inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1392 const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
1393 return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
1396 template <GTEST_8_TYPENAMES_(T)>
1397 inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1398 const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
1399 return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
1402 template <GTEST_9_TYPENAMES_(T)>
1403 inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1404 const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1406 return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
1409 template <GTEST_10_TYPENAMES_(T)>
1410 inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1411 const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1412 const T8& f8, const T9& f9) {
1413 return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
1416 // 6.1.3.3 Tuple helper classes.
1418 template <typename Tuple> struct tuple_size;
1420 template <GTEST_0_TYPENAMES_(T)>
1421 struct tuple_size<GTEST_0_TUPLE_(T)> {
1422 static const int value = 0;
1425 template <GTEST_1_TYPENAMES_(T)>
1426 struct tuple_size<GTEST_1_TUPLE_(T)> {
1427 static const int value = 1;
1430 template <GTEST_2_TYPENAMES_(T)>
1431 struct tuple_size<GTEST_2_TUPLE_(T)> {
1432 static const int value = 2;
1435 template <GTEST_3_TYPENAMES_(T)>
1436 struct tuple_size<GTEST_3_TUPLE_(T)> {
1437 static const int value = 3;
1440 template <GTEST_4_TYPENAMES_(T)>
1441 struct tuple_size<GTEST_4_TUPLE_(T)> {
1442 static const int value = 4;
1445 template <GTEST_5_TYPENAMES_(T)>
1446 struct tuple_size<GTEST_5_TUPLE_(T)> {
1447 static const int value = 5;
1450 template <GTEST_6_TYPENAMES_(T)>
1451 struct tuple_size<GTEST_6_TUPLE_(T)> {
1452 static const int value = 6;
1455 template <GTEST_7_TYPENAMES_(T)>
1456 struct tuple_size<GTEST_7_TUPLE_(T)> {
1457 static const int value = 7;
1460 template <GTEST_8_TYPENAMES_(T)>
1461 struct tuple_size<GTEST_8_TUPLE_(T)> {
1462 static const int value = 8;
1465 template <GTEST_9_TYPENAMES_(T)>
1466 struct tuple_size<GTEST_9_TUPLE_(T)> {
1467 static const int value = 9;
1470 template <GTEST_10_TYPENAMES_(T)>
1471 struct tuple_size<GTEST_10_TUPLE_(T)> {
1472 static const int value = 10;
1475 template <int k, class Tuple>
1476 struct tuple_element {
1477 typedef typename gtest_internal::TupleElement<
1478 k < (tuple_size<Tuple>::value), k, Tuple>::type type;
1481 #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
1483 // 6.1.3.4 Element access.
1485 namespace gtest_internal {
1490 template <class Tuple>
1491 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1492 Field(Tuple& t) { return t.f0_; } // NOLINT
1494 template <class Tuple>
1495 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1496 ConstField(const Tuple& t) { return t.f0_; }
1502 template <class Tuple>
1503 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1504 Field(Tuple& t) { return t.f1_; } // NOLINT
1506 template <class Tuple>
1507 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1508 ConstField(const Tuple& t) { return t.f1_; }
1514 template <class Tuple>
1515 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1516 Field(Tuple& t) { return t.f2_; } // NOLINT
1518 template <class Tuple>
1519 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1520 ConstField(const Tuple& t) { return t.f2_; }
1526 template <class Tuple>
1527 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1528 Field(Tuple& t) { return t.f3_; } // NOLINT
1530 template <class Tuple>
1531 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1532 ConstField(const Tuple& t) { return t.f3_; }
1538 template <class Tuple>
1539 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1540 Field(Tuple& t) { return t.f4_; } // NOLINT
1542 template <class Tuple>
1543 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1544 ConstField(const Tuple& t) { return t.f4_; }
1550 template <class Tuple>
1551 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1552 Field(Tuple& t) { return t.f5_; } // NOLINT
1554 template <class Tuple>
1555 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1556 ConstField(const Tuple& t) { return t.f5_; }
1562 template <class Tuple>
1563 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1564 Field(Tuple& t) { return t.f6_; } // NOLINT
1566 template <class Tuple>
1567 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1568 ConstField(const Tuple& t) { return t.f6_; }
1574 template <class Tuple>
1575 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1576 Field(Tuple& t) { return t.f7_; } // NOLINT
1578 template <class Tuple>
1579 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1580 ConstField(const Tuple& t) { return t.f7_; }
1586 template <class Tuple>
1587 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1588 Field(Tuple& t) { return t.f8_; } // NOLINT
1590 template <class Tuple>
1591 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1592 ConstField(const Tuple& t) { return t.f8_; }
1598 template <class Tuple>
1599 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1600 Field(Tuple& t) { return t.f9_; } // NOLINT
1602 template <class Tuple>
1603 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1604 ConstField(const Tuple& t) { return t.f9_; }
1607 } // namespace gtest_internal
1609 template <int k, GTEST_10_TYPENAMES_(T)>
1610 GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
1611 get(GTEST_10_TUPLE_(T)& t) {
1612 return gtest_internal::Get<k>::Field(t);
1615 template <int k, GTEST_10_TYPENAMES_(T)>
1616 GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
1617 get(const GTEST_10_TUPLE_(T)& t) {
1618 return gtest_internal::Get<k>::ConstField(t);
1621 // 6.1.3.5 Relational operators
1623 // We only implement == and !=, as we don't have a need for the rest yet.
1625 namespace gtest_internal {
1627 // SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
1628 // first k fields of t1 equals the first k fields of t2.
1629 // SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
1631 template <int kSize1, int kSize2>
1632 struct SameSizeTuplePrefixComparator;
1635 struct SameSizeTuplePrefixComparator<0, 0> {
1636 template <class Tuple1, class Tuple2>
1637 static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
1643 struct SameSizeTuplePrefixComparator<k, k> {
1644 template <class Tuple1, class Tuple2>
1645 static bool Eq(const Tuple1& t1, const Tuple2& t2) {
1646 return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
1647 ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
1651 } // namespace gtest_internal
1653 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1654 inline bool operator==(const GTEST_10_TUPLE_(T)& t,
1655 const GTEST_10_TUPLE_(U)& u) {
1656 return gtest_internal::SameSizeTuplePrefixComparator<
1657 tuple_size<GTEST_10_TUPLE_(T)>::value,
1658 tuple_size<GTEST_10_TUPLE_(U)>::value>::Eq(t, u);
1661 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1662 inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
1663 const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
1671 #undef GTEST_0_TUPLE_
1672 #undef GTEST_1_TUPLE_
1673 #undef GTEST_2_TUPLE_
1674 #undef GTEST_3_TUPLE_
1675 #undef GTEST_4_TUPLE_
1676 #undef GTEST_5_TUPLE_
1677 #undef GTEST_6_TUPLE_
1678 #undef GTEST_7_TUPLE_
1679 #undef GTEST_8_TUPLE_
1680 #undef GTEST_9_TUPLE_
1681 #undef GTEST_10_TUPLE_
1683 #undef GTEST_0_TYPENAMES_
1684 #undef GTEST_1_TYPENAMES_
1685 #undef GTEST_2_TYPENAMES_
1686 #undef GTEST_3_TYPENAMES_
1687 #undef GTEST_4_TYPENAMES_
1688 #undef GTEST_5_TYPENAMES_
1689 #undef GTEST_6_TYPENAMES_
1690 #undef GTEST_7_TYPENAMES_
1691 #undef GTEST_8_TYPENAMES_
1692 #undef GTEST_9_TYPENAMES_
1693 #undef GTEST_10_TYPENAMES_
1695 #undef GTEST_DECLARE_TUPLE_AS_FRIEND_
1696 #undef GTEST_BY_REF_
1697 #undef GTEST_ADD_REF_
1698 #undef GTEST_TUPLE_ELEMENT_
1700 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
1701 # elif GTEST_ENV_HAS_STD_TUPLE_
1703 // C++11 puts its tuple into the ::std namespace rather than
1704 // ::std::tr1. gtest expects tuple to live in ::std::tr1, so put it there.
1705 // This causes undefined behavior, but supported compilers react in
1706 // the way we intend.
1710 using ::std::make_tuple;
1712 using ::std::tuple_element;
1713 using ::std::tuple_size;
1717 # elif GTEST_OS_SYMBIAN
1719 // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
1720 // use STLport's tuple implementation, which unfortunately doesn't
1721 // work as the copy of STLport distributed with Symbian is incomplete.
1722 // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
1723 // use its own tuple implementation.
1724 # ifdef BOOST_HAS_TR1_TUPLE
1725 # undef BOOST_HAS_TR1_TUPLE
1726 # endif // BOOST_HAS_TR1_TUPLE
1728 // This prevents <boost/tr1/detail/config.hpp>, which defines
1729 // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
1730 # define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
1733 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
1734 // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
1735 // not conform to the TR1 spec, which requires the header to be <tuple>.
1737 # if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
1738 // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
1739 // which is #included by <tr1/tuple>, to not compile when RTTI is
1740 // disabled. _TR1_FUNCTIONAL is the header guard for
1741 // <tr1/functional>. Hence the following #define is a hack to prevent
1742 // <tr1/functional> from being included.
1743 # define _TR1_FUNCTIONAL 1
1744 # include <tr1/tuple>
1745 # undef _TR1_FUNCTIONAL // Allows the user to #include
1746 // <tr1/functional> if he chooses to.
1748 # include <tr1/tuple> // NOLINT
1749 # endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
1752 // If the compiler is not GCC 4.0+, we assume the user is using a
1753 // spec-conforming TR1 implementation.
1754 # include <tuple> // NOLINT
1755 # endif // GTEST_USE_OWN_TR1_TUPLE
1757 #endif // GTEST_HAS_TR1_TUPLE
1759 // Determines whether clone(2) is supported.
1760 // Usually it will only be available on Linux, excluding
1761 // Linux on the Itanium architecture.
1762 // Also see http://linux.die.net/man/2/clone.
1763 #ifndef GTEST_HAS_CLONE
1764 // The user didn't tell us, so we need to figure it out.
1766 # if GTEST_OS_LINUX && !defined(__ia64__)
1767 # if GTEST_OS_LINUX_ANDROID
1768 // On Android, clone() is only available on ARM starting with Gingerbread.
1769 # if (defined(__arm__) || defined(__mips__)) && __ANDROID_API__ >= 9
1770 # define GTEST_HAS_CLONE 1
1772 # define GTEST_HAS_CLONE 0
1775 # define GTEST_HAS_CLONE 1
1778 # define GTEST_HAS_CLONE 0
1779 # endif // GTEST_OS_LINUX && !defined(__ia64__)
1781 #endif // GTEST_HAS_CLONE
1783 // Determines whether to support stream redirection. This is used to test
1784 // output correctness and to implement death tests.
1785 #ifndef GTEST_HAS_STREAM_REDIRECTION
1786 // By default, we assume that stream redirection is supported on all
1787 // platforms except known mobile ones.
1788 # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN
1789 # define GTEST_HAS_STREAM_REDIRECTION 0
1791 # define GTEST_HAS_STREAM_REDIRECTION 1
1792 # endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
1793 #endif // GTEST_HAS_STREAM_REDIRECTION
1795 // Determines whether to support death tests.
1796 // Google Test does not support death tests for VC 7.1 and earlier as
1797 // abort() in a VC 7.1 application compiled as GUI in debug config
1798 // pops up a dialog window that cannot be suppressed programmatically.
1799 #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
1800 (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \
1801 (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
1802 GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
1803 GTEST_OS_OPENBSD || GTEST_OS_QNX)
1804 # define GTEST_HAS_DEATH_TEST 1
1805 # include <vector> // NOLINT
1807 # define GTEST_HAS_DEATH_TEST 0
1810 // We don't support MSVC 7.1 with exceptions disabled now. Therefore
1811 // all the compilers we care about are adequate for supporting
1812 // value-parameterized tests.
1813 #define GTEST_HAS_PARAM_TEST 1
1815 // Determines whether to support type-driven tests.
1817 // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
1818 // Sun Pro CC, IBM Visual Age, and HP aCC support.
1819 #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
1820 defined(__IBMCPP__) || defined(__HP_aCC)
1821 # define GTEST_HAS_TYPED_TEST 1
1822 # define GTEST_HAS_TYPED_TEST_P 1
1825 // Determines whether to support Combine(). This only makes sense when
1826 // value-parameterized tests are enabled. The implementation doesn't
1827 // work on Sun Studio since it doesn't understand templated conversion
1829 #if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
1830 # define GTEST_HAS_COMBINE 1
1833 // Determines whether the system compiler uses UTF-16 for encoding wide strings.
1834 #define GTEST_WIDE_STRING_USES_UTF16_ \
1835 (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
1837 // Determines whether test results can be streamed to a socket.
1839 # define GTEST_CAN_STREAM_RESULTS_ 1
1841 # define GTEST_CAN_STREAM_RESULTS_ 0
1844 // Defines some utility macros.
1846 // The GNU compiler emits a warning if nested "if" statements are followed by
1847 // an "else" statement and braces are not used to explicitly disambiguate the
1848 // "else" binding. This leads to problems with code like:
1851 // ASSERT_*(condition) << "Some message";
1853 // The "switch (0) case 0:" idiom is used to suppress this.
1854 #ifdef __INTEL_COMPILER
1855 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_
1857 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT
1860 // Use this annotation at the end of a struct/class definition to
1861 // prevent the compiler from optimizing away instances that are never
1862 // used. This is useful when all interesting logic happens inside the
1863 // c'tor and / or d'tor. Example:
1867 // } GTEST_ATTRIBUTE_UNUSED_;
1869 // Also use it after a variable or parameter declaration to tell the
1870 // compiler the variable/parameter does not have to be used.
1871 #if defined(__GNUC__) && !defined(COMPILER_ICC)
1872 # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
1874 # define GTEST_ATTRIBUTE_UNUSED_
1877 // A macro to disallow operator=
1878 // This should be used in the private: declarations for a class.
1879 #define GTEST_DISALLOW_ASSIGN_(type)\
1880 void operator=(type const &)
1882 // A macro to disallow copy constructor and operator=
1883 // This should be used in the private: declarations for a class.
1884 #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
1885 type(type const &);\
1886 GTEST_DISALLOW_ASSIGN_(type)
1888 // Tell the compiler to warn about unused return values for functions declared
1889 // with this macro. The macro should be used on function declarations
1890 // following the argument list:
1892 // Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
1893 #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
1894 # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
1896 # define GTEST_MUST_USE_RESULT_
1897 #endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
1899 // Determine whether the compiler supports Microsoft's Structured Exception
1900 // Handling. This is supported by several Windows compilers but generally
1901 // does not exist on any other system.
1902 #ifndef GTEST_HAS_SEH
1903 // The user didn't tell us, so we need to figure it out.
1905 # if defined(_MSC_VER) || defined(__BORLANDC__)
1906 // These two compilers are known to support SEH.
1907 # define GTEST_HAS_SEH 1
1910 # define GTEST_HAS_SEH 0
1913 #endif // GTEST_HAS_SEH
1917 # if GTEST_LINKED_AS_SHARED_LIBRARY
1918 # define GTEST_API_ __declspec(dllimport)
1919 # elif GTEST_CREATE_SHARED_LIBRARY
1920 # define GTEST_API_ __declspec(dllexport)
1930 // Ask the compiler to never inline a given function.
1931 # define GTEST_NO_INLINE_ __attribute__((noinline))
1933 # define GTEST_NO_INLINE_
1936 // _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
1937 #if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)
1938 # define GTEST_HAS_CXXABI_H_ 1
1940 # define GTEST_HAS_CXXABI_H_ 0
1947 namespace internal {
1949 // A secret type that Google Test users don't know about. It has no
1950 // definition on purpose. Therefore it's impossible to create a
1951 // Secret object, which is what we want.
1954 // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
1955 // expression is true. For example, you could use it to verify the
1956 // size of a static array:
1958 // GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
1959 // content_type_names_incorrect_size);
1961 // or to make sure a struct is smaller than a certain size:
1963 // GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
1965 // The second argument to the macro is the name of the variable. If
1966 // the expression is false, most compilers will issue a warning/error
1967 // containing the name of the variable.
1970 struct CompileAssert {
1973 #define GTEST_COMPILE_ASSERT_(expr, msg) \
1974 typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
1975 msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
1977 // Implementation details of GTEST_COMPILE_ASSERT_:
1979 // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
1980 // elements (and thus is invalid) when the expression is false.
1982 // - The simpler definition
1984 // #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
1986 // does not work, as gcc supports variable-length arrays whose sizes
1987 // are determined at run-time (this is gcc's extension and not part
1988 // of the C++ standard). As a result, gcc fails to reject the
1989 // following code with the simple definition:
1992 // GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
1993 // // not a compile-time constant.
1995 // - By using the type CompileAssert<(bool(expr))>, we ensures that
1996 // expr is a compile-time constant. (Template arguments must be
1997 // determined at compile-time.)
1999 // - The outter parentheses in CompileAssert<(bool(expr))> are necessary
2000 // to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
2002 // CompileAssert<bool(expr)>
2004 // instead, these compilers will refuse to compile
2006 // GTEST_COMPILE_ASSERT_(5 > 0, some_message);
2008 // (They seem to think the ">" in "5 > 0" marks the end of the
2009 // template argument list.)
2011 // - The array size is (bool(expr) ? 1 : -1), instead of simply
2013 // ((expr) ? 1 : -1).
2015 // This is to avoid running into a bug in MS VC 7.1, which
2016 // causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
2018 // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
2020 // This template is declared, but intentionally undefined.
2021 template <typename T1, typename T2>
2022 struct StaticAssertTypeEqHelper;
2024 template <typename T>
2025 struct StaticAssertTypeEqHelper<T, T> {};
2027 #if GTEST_HAS_GLOBAL_STRING
2028 typedef ::string string;
2030 typedef ::std::string string;
2031 #endif // GTEST_HAS_GLOBAL_STRING
2033 #if GTEST_HAS_GLOBAL_WSTRING
2034 typedef ::wstring wstring;
2035 #elif GTEST_HAS_STD_WSTRING
2036 typedef ::std::wstring wstring;
2037 #endif // GTEST_HAS_GLOBAL_WSTRING
2039 // A helper for suppressing warnings on constant condition. It just
2040 // returns 'condition'.
2041 GTEST_API_ bool IsTrue(bool condition);
2043 // Defines scoped_ptr.
2045 // This implementation of scoped_ptr is PARTIAL - it only contains
2046 // enough stuff to satisfy Google Test's need.
2047 template <typename T>
2050 typedef T element_type;
2052 explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
2053 ~scoped_ptr() { reset(); }
2055 T& operator*() const { return *ptr_; }
2056 T* operator->() const { return ptr_; }
2057 T* get() const { return ptr_; }
2060 T* const ptr = ptr_;
2065 void reset(T* p = NULL) {
2067 if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
2077 GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
2082 // A simple C++ wrapper for <regex.h>. It uses the POSIX Extended
2083 // Regular Expression syntax.
2084 class GTEST_API_ RE {
2086 // A copy constructor is required by the Standard to initialize object
2087 // references from r-values.
2088 RE(const RE& other) { Init(other.pattern()); }
2090 // Constructs an RE from a string.
2091 RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT
2093 #if GTEST_HAS_GLOBAL_STRING
2095 RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT
2097 #endif // GTEST_HAS_GLOBAL_STRING
2099 RE(const char* regex) { Init(regex); } // NOLINT
2102 // Returns the string representation of the regex.
2103 const char* pattern() const { return pattern_; }
2105 // FullMatch(str, re) returns true iff regular expression re matches
2107 // PartialMatch(str, re) returns true iff regular expression re
2108 // matches a substring of str (including str itself).
2110 // TODO(wan@google.com): make FullMatch() and PartialMatch() work
2111 // when str contains NUL characters.
2112 static bool FullMatch(const ::std::string& str, const RE& re) {
2113 return FullMatch(str.c_str(), re);
2115 static bool PartialMatch(const ::std::string& str, const RE& re) {
2116 return PartialMatch(str.c_str(), re);
2119 #if GTEST_HAS_GLOBAL_STRING
2121 static bool FullMatch(const ::string& str, const RE& re) {
2122 return FullMatch(str.c_str(), re);
2124 static bool PartialMatch(const ::string& str, const RE& re) {
2125 return PartialMatch(str.c_str(), re);
2128 #endif // GTEST_HAS_GLOBAL_STRING
2130 static bool FullMatch(const char* str, const RE& re);
2131 static bool PartialMatch(const char* str, const RE& re);
2134 void Init(const char* regex);
2136 // We use a const char* instead of an std::string, as Google Test used to be
2137 // used where std::string is not available. TODO(wan@google.com): change to
2139 const char* pattern_;
2142 #if GTEST_USES_POSIX_RE
2144 regex_t full_regex_; // For FullMatch().
2145 regex_t partial_regex_; // For PartialMatch().
2147 #else // GTEST_USES_SIMPLE_RE
2149 const char* full_pattern_; // For FullMatch();
2153 GTEST_DISALLOW_ASSIGN_(RE);
2156 // Formats a source file path and a line number as they would appear
2157 // in an error message from the compiler used to compile this code.
2158 GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
2160 // Formats a file location for compiler-independent XML output.
2161 // Although this function is not platform dependent, we put it next to
2162 // FormatFileLocation in order to contrast the two functions.
2163 GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
2166 // Defines logging utilities:
2167 // GTEST_LOG_(severity) - logs messages at the specified severity level. The
2168 // message itself is streamed into the macro.
2169 // LogToStderr() - directs all log messages to stderr.
2170 // FlushInfoLog() - flushes informational log messages.
2172 enum GTestLogSeverity {
2179 // Formats log entry severity, provides a stream object for streaming the
2180 // log message, and terminates the message with a newline when going out of
2182 class GTEST_API_ GTestLog {
2184 GTestLog(GTestLogSeverity severity, const char* file, int line);
2186 // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
2189 ::std::ostream& GetStream() { return ::std::cerr; }
2192 const GTestLogSeverity severity_;
2194 GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
2197 #define GTEST_LOG_(severity) \
2198 ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
2199 __FILE__, __LINE__).GetStream()
2201 inline void LogToStderr() {}
2202 inline void FlushInfoLog() { fflush(NULL); }
2204 // INTERNAL IMPLEMENTATION - DO NOT USE.
2206 // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
2207 // is not satisfied.
2209 // GTEST_CHECK_(boolean_condition);
2211 // GTEST_CHECK_(boolean_condition) << "Additional message";
2213 // This checks the condition and if the condition is not satisfied
2214 // it prints message about the condition violation, including the
2215 // condition itself, plus additional message streamed into it, if any,
2216 // and then it aborts the program. It aborts the program irrespective of
2217 // whether it is built in the debug mode or not.
2218 #define GTEST_CHECK_(condition) \
2219 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
2220 if (::testing::internal::IsTrue(condition)) \
2223 GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
2225 // An all-mode assert to verify that the given POSIX-style function
2226 // call returns 0 (indicating success). Known limitation: this
2227 // doesn't expand to a balanced 'if' statement, so enclose the macro
2228 // in {} if you need to use it as the only statement in an 'if'
2230 #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
2231 if (const int gtest_error = (posix_call)) \
2232 GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
2235 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
2237 // Use ImplicitCast_ as a safe version of static_cast for upcasting in
2238 // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
2239 // const Foo*). When you use ImplicitCast_, the compiler checks that
2240 // the cast is safe. Such explicit ImplicitCast_s are necessary in
2241 // surprisingly many situations where C++ demands an exact type match
2242 // instead of an argument type convertable to a target type.
2244 // The syntax for using ImplicitCast_ is the same as for static_cast:
2246 // ImplicitCast_<ToType>(expr)
2248 // ImplicitCast_ would have been part of the C++ standard library,
2249 // but the proposal was submitted too late. It will probably make
2250 // its way into the language in the future.
2252 // This relatively ugly name is intentional. It prevents clashes with
2253 // similar functions users may have (e.g., implicit_cast). The internal
2254 // namespace alone is not enough because the function can be found by ADL.
2255 template<typename To>
2256 inline To ImplicitCast_(To x) { return x; }
2258 // When you upcast (that is, cast a pointer from type Foo to type
2259 // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
2260 // always succeed. When you downcast (that is, cast a pointer from
2261 // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
2262 // how do you know the pointer is really of type SubclassOfFoo? It
2263 // could be a bare Foo, or of type DifferentSubclassOfFoo. Thus,
2264 // when you downcast, you should use this macro. In debug mode, we
2265 // use dynamic_cast<> to double-check the downcast is legal (we die
2266 // if it's not). In normal mode, we do the efficient static_cast<>
2267 // instead. Thus, it's important to test in debug mode to make sure
2268 // the cast is legal!
2269 // This is the only place in the code we should use dynamic_cast<>.
2270 // In particular, you SHOULDN'T be using dynamic_cast<> in order to
2271 // do RTTI (eg code like this:
2272 // if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
2273 // if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
2274 // You should design the code some other way not to need this.
2276 // This relatively ugly name is intentional. It prevents clashes with
2277 // similar functions users may have (e.g., down_cast). The internal
2278 // namespace alone is not enough because the function can be found by ADL.
2279 template<typename To, typename From> // use like this: DownCast_<T*>(foo);
2280 inline To DownCast_(From* f) { // so we only accept pointers
2281 // Ensures that To is a sub-type of From *. This test is here only
2282 // for compile-time type checking, and has no overhead in an
2283 // optimized build at run-time, as it will be optimized away
2287 ::testing::internal::ImplicitCast_<From*>(to);
2291 // RTTI: debug mode only!
2292 GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
2294 return static_cast<To>(f);
2297 // Downcasts the pointer of type Base to Derived.
2298 // Derived must be a subclass of Base. The parameter MUST
2299 // point to a class of type Derived, not any subclass of it.
2300 // When RTTI is available, the function performs a runtime
2301 // check to enforce this.
2302 template <class Derived, class Base>
2303 Derived* CheckedDowncastToActualType(Base* base) {
2305 GTEST_CHECK_(typeid(*base) == typeid(Derived));
2306 return dynamic_cast<Derived*>(base); // NOLINT
2308 return static_cast<Derived*>(base); // Poor man's downcast.
2312 #if GTEST_HAS_STREAM_REDIRECTION
2314 // Defines the stderr capturer:
2315 // CaptureStdout - starts capturing stdout.
2316 // GetCapturedStdout - stops capturing stdout and returns the captured string.
2317 // CaptureStderr - starts capturing stderr.
2318 // GetCapturedStderr - stops capturing stderr and returns the captured string.
2320 GTEST_API_ void CaptureStdout();
2321 GTEST_API_ std::string GetCapturedStdout();
2322 GTEST_API_ void CaptureStderr();
2323 GTEST_API_ std::string GetCapturedStderr();
2325 #endif // GTEST_HAS_STREAM_REDIRECTION
2328 #if GTEST_HAS_DEATH_TEST
2330 const ::std::vector<testing::internal::string>& GetInjectableArgvs();
2331 void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
2334 // A copy of all command line arguments. Set by InitGoogleTest().
2335 extern ::std::vector<testing::internal::string> g_argvs;
2337 #endif // GTEST_HAS_DEATH_TEST
2339 // Defines synchronization primitives.
2341 #if GTEST_HAS_PTHREAD
2343 // Sleeps for (roughly) n milli-seconds. This function is only for
2344 // testing Google Test's own constructs. Don't use it in user tests,
2345 // either directly or indirectly.
2346 inline void SleepMilliseconds(int n) {
2347 const timespec time = {
2349 n * 1000L * 1000L, // And n ms.
2351 nanosleep(&time, NULL);
2354 // Allows a controller thread to pause execution of newly created
2355 // threads until notified. Instances of this class must be created
2356 // and destroyed in the controller thread.
2358 // This class is only for testing Google Test's own constructs. Do not
2359 // use it in user tests, either directly or indirectly.
2360 class Notification {
2362 Notification() : notified_(false) {
2363 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
2366 pthread_mutex_destroy(&mutex_);
2369 // Notifies all threads created with this notification to start. Must
2370 // be called from the controller thread.
2372 pthread_mutex_lock(&mutex_);
2374 pthread_mutex_unlock(&mutex_);
2377 // Blocks until the controller thread notifies. Must be called from a test
2379 void WaitForNotification() {
2381 pthread_mutex_lock(&mutex_);
2382 const bool notified = notified_;
2383 pthread_mutex_unlock(&mutex_);
2386 SleepMilliseconds(10);
2391 pthread_mutex_t mutex_;
2394 GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
2397 // As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
2398 // Consequently, it cannot select a correct instantiation of ThreadWithParam
2399 // in order to call its Run(). Introducing ThreadWithParamBase as a
2400 // non-templated base class for ThreadWithParam allows us to bypass this
2402 class ThreadWithParamBase {
2404 virtual ~ThreadWithParamBase() {}
2405 virtual void Run() = 0;
2408 // pthread_create() accepts a pointer to a function type with the C linkage.
2409 // According to the Standard (7.5/1), function types with different linkages
2410 // are different even if they are otherwise identical. Some compilers (for
2411 // example, SunStudio) treat them as different types. Since class methods
2412 // cannot be defined with C-linkage we need to define a free C-function to
2413 // pass into pthread_create().
2414 extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
2415 static_cast<ThreadWithParamBase*>(thread)->Run();
2419 // Helper class for testing Google Test's multi-threading constructs.
2420 // To use it, write:
2422 // void ThreadFunc(int param) { /* Do things with param */ }
2423 // Notification thread_can_start;
2425 // // The thread_can_start parameter is optional; you can supply NULL.
2426 // ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
2427 // thread_can_start.Notify();
2429 // These classes are only for testing Google Test's own constructs. Do
2430 // not use them in user tests, either directly or indirectly.
2431 template <typename T>
2432 class ThreadWithParam : public ThreadWithParamBase {
2434 typedef void (*UserThreadFunc)(T);
2437 UserThreadFunc func, T param, Notification* thread_can_start)
2440 thread_can_start_(thread_can_start),
2442 ThreadWithParamBase* const base = this;
2443 // The thread can be created only after all fields except thread_
2444 // have been initialized.
2445 GTEST_CHECK_POSIX_SUCCESS_(
2446 pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
2448 ~ThreadWithParam() { Join(); }
2452 GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
2457 virtual void Run() {
2458 if (thread_can_start_ != NULL)
2459 thread_can_start_->WaitForNotification();
2464 const UserThreadFunc func_; // User-supplied thread function.
2465 const T param_; // User-supplied parameter to the thread function.
2466 // When non-NULL, used to block execution until the controller thread
2468 Notification* const thread_can_start_;
2469 bool finished_; // true iff we know that the thread function has finished.
2470 pthread_t thread_; // The native thread object.
2472 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
2475 // MutexBase and Mutex implement mutex on pthreads-based platforms. They
2476 // are used in conjunction with class MutexLock:
2480 // MutexLock lock(&mutex); // Acquires the mutex and releases it at the end
2481 // // of the current scope.
2483 // MutexBase implements behavior for both statically and dynamically
2484 // allocated mutexes. Do not use MutexBase directly. Instead, write
2485 // the following to define a static mutex:
2487 // GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
2489 // You can forward declare a static mutex like this:
2491 // GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
2493 // To create a dynamic mutex, just define an object of type Mutex.
2496 // Acquires this mutex.
2498 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
2499 owner_ = pthread_self();
2503 // Releases this mutex.
2505 // Since the lock is being released the owner_ field should no longer be
2506 // considered valid. We don't protect writing to has_owner_ here, as it's
2507 // the caller's responsibility to ensure that the current thread holds the
2508 // mutex when this is called.
2510 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
2513 // Does nothing if the current thread holds the mutex. Otherwise, crashes
2514 // with high probability.
2515 void AssertHeld() const {
2516 GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
2517 << "The current thread is not holding the mutex @" << this;
2520 // A static mutex may be used before main() is entered. It may even
2521 // be used before the dynamic initialization stage. Therefore we
2522 // must be able to initialize a static mutex object at link time.
2523 // This means MutexBase has to be a POD and its member variables
2524 // have to be public.
2526 pthread_mutex_t mutex_; // The underlying pthread mutex.
2527 // has_owner_ indicates whether the owner_ field below contains a valid thread
2528 // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
2529 // accesses to the owner_ field should be protected by a check of this field.
2530 // An alternative might be to memset() owner_ to all zeros, but there's no
2531 // guarantee that a zero'd pthread_t is necessarily invalid or even different
2532 // from pthread_self().
2534 pthread_t owner_; // The thread holding the mutex.
2537 // Forward-declares a static mutex.
2538 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
2539 extern ::testing::internal::MutexBase mutex
2541 // Defines and statically (i.e. at link time) initializes a static mutex.
2542 // The initialization list here does not explicitly initialize each field,
2543 // instead relying on default initialization for the unspecified fields. In
2544 // particular, the owner_ field (a pthread_t) is not explicitly initialized.
2545 // This allows initialization to work whether pthread_t is a scalar or struct.
2546 // The flag -Wmissing-field-initializers must not be specified for this to work.
2547 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
2548 ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }
2550 // The Mutex class can only be used for mutexes created at runtime. It
2551 // shares its API with MutexBase otherwise.
2552 class Mutex : public MutexBase {
2555 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
2559 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
2563 GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
2566 // We cannot name this class MutexLock as the ctor declaration would
2567 // conflict with a macro named MutexLock, which is defined on some
2568 // platforms. Hence the typedef trick below.
2569 class GTestMutexLock {
2571 explicit GTestMutexLock(MutexBase* mutex)
2572 : mutex_(mutex) { mutex_->Lock(); }
2574 ~GTestMutexLock() { mutex_->Unlock(); }
2577 MutexBase* const mutex_;
2579 GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
2582 typedef GTestMutexLock MutexLock;
2584 // Helpers for ThreadLocal.
2586 // pthread_key_create() requires DeleteThreadLocalValue() to have
2587 // C-linkage. Therefore it cannot be templatized to access
2588 // ThreadLocal<T>. Hence the need for class
2589 // ThreadLocalValueHolderBase.
2590 class ThreadLocalValueHolderBase {
2592 virtual ~ThreadLocalValueHolderBase() {}
2595 // Called by pthread to delete thread-local data stored by
2596 // pthread_setspecific().
2597 extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
2598 delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
2601 // Implements thread-local storage on pthreads-based systems.
2604 // ThreadLocal<int> tl(100); // 100 is the default value for each thread.
2607 // tl.set(150); // Changes the value for thread 2 only.
2608 // EXPECT_EQ(150, tl.get());
2611 // EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value.
2613 // EXPECT_EQ(200, tl.get());
2615 // The template type argument T must have a public copy constructor.
2616 // In addition, the default ThreadLocal constructor requires T to have
2617 // a public default constructor.
2619 // An object managed for a thread by a ThreadLocal instance is deleted
2620 // when the thread exits. Or, if the ThreadLocal instance dies in
2621 // that thread, when the ThreadLocal dies. It's the user's
2622 // responsibility to ensure that all other threads using a ThreadLocal
2623 // have exited when it dies, or the per-thread objects for those
2624 // threads will not be deleted.
2626 // Google Test only uses global ThreadLocal objects. That means they
2627 // will die after main() has returned. Therefore, no per-thread
2628 // object managed by Google Test will be leaked as long as all threads
2629 // using Google Test have exited when main() returns.
2630 template <typename T>
2633 ThreadLocal() : key_(CreateKey()),
2635 explicit ThreadLocal(const T& value) : key_(CreateKey()),
2639 // Destroys the managed object for the current thread, if any.
2640 DeleteThreadLocalValue(pthread_getspecific(key_));
2642 // Releases resources associated with the key. This will *not*
2643 // delete managed objects for other threads.
2644 GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
2647 T* pointer() { return GetOrCreateValue(); }
2648 const T* pointer() const { return GetOrCreateValue(); }
2649 const T& get() const { return *pointer(); }
2650 void set(const T& value) { *pointer() = value; }
2653 // Holds a value of type T.
2654 class ValueHolder : public ThreadLocalValueHolderBase {
2656 explicit ValueHolder(const T& value) : value_(value) {}
2658 T* pointer() { return &value_; }
2662 GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
2665 static pthread_key_t CreateKey() {
2667 // When a thread exits, DeleteThreadLocalValue() will be called on
2668 // the object managed for that thread.
2669 GTEST_CHECK_POSIX_SUCCESS_(
2670 pthread_key_create(&key, &DeleteThreadLocalValue));
2674 T* GetOrCreateValue() const {
2675 ThreadLocalValueHolderBase* const holder =
2676 static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
2677 if (holder != NULL) {
2678 return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
2681 ValueHolder* const new_holder = new ValueHolder(default_);
2682 ThreadLocalValueHolderBase* const holder_base = new_holder;
2683 GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
2684 return new_holder->pointer();
2687 // A key pthreads uses for looking up per-thread values.
2688 const pthread_key_t key_;
2689 const T default_; // The default value for each thread.
2691 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
2694 # define GTEST_IS_THREADSAFE 1
2696 #else // GTEST_HAS_PTHREAD
2698 // A dummy implementation of synchronization primitives (mutex, lock,
2699 // and thread-local variable). Necessary for compiling Google Test where
2700 // mutex is not supported - using Google Test in multiple threads is not
2701 // supported on such platforms.
2708 void AssertHeld() const {}
2711 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
2712 extern ::testing::internal::Mutex mutex
2714 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
2716 class GTestMutexLock {
2718 explicit GTestMutexLock(Mutex*) {} // NOLINT
2721 typedef GTestMutexLock MutexLock;
2723 template <typename T>
2726 ThreadLocal() : value_() {}
2727 explicit ThreadLocal(const T& value) : value_(value) {}
2728 T* pointer() { return &value_; }
2729 const T* pointer() const { return &value_; }
2730 const T& get() const { return value_; }
2731 void set(const T& value) { value_ = value; }
2736 // The above synchronization primitives have dummy implementations.
2737 // Therefore Google Test is not thread-safe.
2738 # define GTEST_IS_THREADSAFE 0
2740 #endif // GTEST_HAS_PTHREAD
2742 // Returns the number of threads running in the process, or 0 to indicate that
2743 // we cannot detect it.
2744 GTEST_API_ size_t GetThreadCount();
2746 // Passing non-POD classes through ellipsis (...) crashes the ARM
2747 // compiler and generates a warning in Sun Studio. The Nokia Symbian
2748 // and the IBM XL C/C++ compiler try to instantiate a copy constructor
2749 // for objects passed through ellipsis (...), failing for uncopyable
2750 // objects. We define this to ensure that only POD is passed through
2751 // ellipsis on these systems.
2752 #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
2753 // We lose support for NULL detection where the compiler doesn't like
2754 // passing non-POD classes through ellipsis (...).
2755 # define GTEST_ELLIPSIS_NEEDS_POD_ 1
2757 # define GTEST_CAN_COMPARE_NULL 1
2760 // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
2761 // const T& and const T* in a function template. These compilers
2762 // _can_ decide between class template specializations for T and T*,
2763 // so a tr1::type_traits-like is_pointer works.
2764 #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
2765 # define GTEST_NEEDS_IS_POINTER_ 1
2768 template <bool bool_value>
2769 struct bool_constant {
2770 typedef bool_constant<bool_value> type;
2771 static const bool value = bool_value;
2773 template <bool bool_value> const bool bool_constant<bool_value>::value;
2775 typedef bool_constant<false> false_type;
2776 typedef bool_constant<true> true_type;
2778 template <typename T>
2779 struct is_pointer : public false_type {};
2781 template <typename T>
2782 struct is_pointer<T*> : public true_type {};
2784 template <typename Iterator>
2785 struct IteratorTraits {
2786 typedef typename Iterator::value_type value_type;
2789 template <typename T>
2790 struct IteratorTraits<T*> {
2791 typedef T value_type;
2794 template <typename T>
2795 struct IteratorTraits<const T*> {
2796 typedef T value_type;
2799 #if GTEST_OS_WINDOWS
2800 # define GTEST_PATH_SEP_ "\\"
2801 # define GTEST_HAS_ALT_PATH_SEP_ 1
2802 // The biggest signed integer type the compiler supports.
2803 typedef __int64 BiggestInt;
2805 # define GTEST_PATH_SEP_ "/"
2806 # define GTEST_HAS_ALT_PATH_SEP_ 0
2807 typedef long long BiggestInt; // NOLINT
2808 #endif // GTEST_OS_WINDOWS
2810 // Utilities for char.
2812 // isspace(int ch) and friends accept an unsigned char or EOF. char
2813 // may be signed, depending on the compiler (or compiler flags).
2814 // Therefore we need to cast a char to unsigned char before calling
2817 inline bool IsAlpha(char ch) {
2818 return isalpha(static_cast<unsigned char>(ch)) != 0;
2820 inline bool IsAlNum(char ch) {
2821 return isalnum(static_cast<unsigned char>(ch)) != 0;
2823 inline bool IsDigit(char ch) {
2824 return isdigit(static_cast<unsigned char>(ch)) != 0;
2826 inline bool IsLower(char ch) {
2827 return islower(static_cast<unsigned char>(ch)) != 0;
2829 inline bool IsSpace(char ch) {
2830 return isspace(static_cast<unsigned char>(ch)) != 0;
2832 inline bool IsUpper(char ch) {
2833 return isupper(static_cast<unsigned char>(ch)) != 0;
2835 inline bool IsXDigit(char ch) {
2836 return isxdigit(static_cast<unsigned char>(ch)) != 0;
2838 inline bool IsXDigit(wchar_t ch) {
2839 const unsigned char low_byte = static_cast<unsigned char>(ch);
2840 return ch == low_byte && isxdigit(low_byte) != 0;
2843 inline char ToLower(char ch) {
2844 return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
2846 inline char ToUpper(char ch) {
2847 return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
2850 // The testing::internal::posix namespace holds wrappers for common
2851 // POSIX functions. These wrappers hide the differences between
2852 // Windows/MSVC and POSIX systems. Since some compilers define these
2853 // standard functions as macros, the wrapper cannot have the same name
2854 // as the wrapped function.
2858 // Functions with a different name on Windows.
2860 #if GTEST_OS_WINDOWS
2862 typedef struct _stat StatStruct;
2864 # ifdef __BORLANDC__
2865 inline int IsATTY(int fd) { return isatty(fd); }
2866 inline int StrCaseCmp(const char* s1, const char* s2) {
2867 return stricmp(s1, s2);
2869 inline char* StrDup(const char* src) { return strdup(src); }
2870 # else // !__BORLANDC__
2871 # if GTEST_OS_WINDOWS_MOBILE
2872 inline int IsATTY(int /* fd */) { return 0; }
2874 inline int IsATTY(int fd) { return _isatty(fd); }
2875 # endif // GTEST_OS_WINDOWS_MOBILE
2876 inline int StrCaseCmp(const char* s1, const char* s2) {
2877 return _stricmp(s1, s2);
2879 inline char* StrDup(const char* src) { return _strdup(src); }
2880 # endif // __BORLANDC__
2882 # if GTEST_OS_WINDOWS_MOBILE
2883 inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
2884 // Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
2885 // time and thus not defined there.
2887 inline int FileNo(FILE* file) { return _fileno(file); }
2888 inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
2889 inline int RmDir(const char* dir) { return _rmdir(dir); }
2890 inline bool IsDir(const StatStruct& st) {
2891 return (_S_IFDIR & st.st_mode) != 0;
2893 # endif // GTEST_OS_WINDOWS_MOBILE
2897 typedef struct stat StatStruct;
2899 inline int FileNo(FILE* file) { return fileno(file); }
2900 inline int IsATTY(int fd) { return isatty(fd); }
2901 inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
2902 inline int StrCaseCmp(const char* s1, const char* s2) {
2903 return strcasecmp(s1, s2);
2905 inline char* StrDup(const char* src) { return strdup(src); }
2906 inline int RmDir(const char* dir) { return rmdir(dir); }
2907 inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
2909 #endif // GTEST_OS_WINDOWS
2911 // Functions deprecated by MSVC 8.0.
2914 // Temporarily disable warning 4996 (deprecated function).
2915 # pragma warning(push)
2916 # pragma warning(disable:4996)
2919 inline const char* StrNCpy(char* dest, const char* src, size_t n) {
2920 return strncpy(dest, src, n);
2923 // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
2924 // StrError() aren't needed on Windows CE at this time and thus not
2927 #if !GTEST_OS_WINDOWS_MOBILE
2928 inline int ChDir(const char* dir) { return chdir(dir); }
2930 inline FILE* FOpen(const char* path, const char* mode) {
2931 return fopen(path, mode);
2933 #if !GTEST_OS_WINDOWS_MOBILE
2934 inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
2935 return freopen(path, mode, stream);
2937 inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
2939 inline int FClose(FILE* fp) { return fclose(fp); }
2940 #if !GTEST_OS_WINDOWS_MOBILE
2941 inline int Read(int fd, void* buf, unsigned int count) {
2942 return static_cast<int>(read(fd, buf, count));
2944 inline int Write(int fd, const void* buf, unsigned int count) {
2945 return static_cast<int>(write(fd, buf, count));
2947 inline int Close(int fd) { return close(fd); }
2948 inline const char* StrError(int errnum) { return strerror(errnum); }
2950 inline const char* GetEnv(const char* name) {
2951 #if GTEST_OS_WINDOWS_MOBILE
2952 // We are on Windows CE, which has no environment variables.
2954 #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
2955 // Environment variables which we programmatically clear will be set to the
2956 // empty string rather than unset (NULL). Handle that case.
2957 const char* const env = getenv(name);
2958 return (env != NULL && env[0] != '\0') ? env : NULL;
2960 return getenv(name);
2965 # pragma warning(pop) // Restores the warning state.
2968 #if GTEST_OS_WINDOWS_MOBILE
2969 // Windows CE has no C library. The abort() function is used in
2970 // several places in Google Test. This implementation provides a reasonable
2971 // imitation of standard behaviour.
2974 inline void Abort() { abort(); }
2975 #endif // GTEST_OS_WINDOWS_MOBILE
2977 } // namespace posix
2979 // MSVC "deprecates" snprintf and issues warnings wherever it is used. In
2980 // order to avoid these warnings, we need to use _snprintf or _snprintf_s on
2981 // MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate
2982 // function in order to achieve that. We use macro definition here because
2983 // snprintf is a variadic function.
2984 #if defined(_MSC_VER) && _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
2985 // MSVC 2005 and above support variadic macros.
2986 # define GTEST_SNPRINTF_(buffer, size, format, ...) \
2987 _snprintf_s(buffer, size, size, format, __VA_ARGS__)
2988 #elif defined(_MSC_VER)
2989 // Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
2990 // complain about _snprintf.
2991 # define GTEST_SNPRINTF_ _snprintf
2993 # define GTEST_SNPRINTF_ snprintf
2996 // The maximum number a BiggestInt can represent. This definition
2997 // works no matter BiggestInt is represented in one's complement or
2998 // two's complement.
3000 // We cannot rely on numeric_limits in STL, as __int64 and long long
3001 // are not part of standard C++ and numeric_limits doesn't need to be
3002 // defined for them.
3003 const BiggestInt kMaxBiggestInt =
3004 ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
3006 // This template class serves as a compile-time function from size to
3007 // type. It maps a size in bytes to a primitive type with that
3010 // TypeWithSize<4>::UInt
3012 // is typedef-ed to be unsigned int (unsigned integer made up of 4
3015 // Such functionality should belong to STL, but I cannot find it
3018 // Google Test uses this class in the implementation of floating-point
3021 // For now it only handles UInt (unsigned int) as that's all Google Test
3022 // needs. Other types can be easily added in the future if need
3024 template <size_t size>
3025 class TypeWithSize {
3027 // This prevents the user from using TypeWithSize<N> with incorrect
3032 // The specialization for size 4.
3034 class TypeWithSize<4> {
3036 // unsigned int has size 4 in both gcc and MSVC.
3038 // As base/basictypes.h doesn't compile on Windows, we cannot use
3039 // uint32, uint64, and etc here.
3041 typedef unsigned int UInt;
3044 // The specialization for size 8.
3046 class TypeWithSize<8> {
3048 #if GTEST_OS_WINDOWS
3049 typedef __int64 Int;
3050 typedef unsigned __int64 UInt;
3052 typedef long long Int; // NOLINT
3053 typedef unsigned long long UInt; // NOLINT
3054 #endif // GTEST_OS_WINDOWS
3057 // Integer types of known sizes.
3058 typedef TypeWithSize<4>::Int Int32;
3059 typedef TypeWithSize<4>::UInt UInt32;
3060 typedef TypeWithSize<8>::Int Int64;
3061 typedef TypeWithSize<8>::UInt UInt64;
3062 typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
3064 // Utilities for command line flags and environment variables.
3066 // Macro for referencing flags.
3067 #define GTEST_FLAG(name) FLAGS_gtest_##name
3069 // Macros for declaring flags.
3070 #define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
3071 #define GTEST_DECLARE_int32_(name) \
3072 GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
3073 #define GTEST_DECLARE_string_(name) \
3074 GTEST_API_ extern ::std::string GTEST_FLAG(name)
3076 // Macros for defining flags.
3077 #define GTEST_DEFINE_bool_(name, default_val, doc) \
3078 GTEST_API_ bool GTEST_FLAG(name) = (default_val)
3079 #define GTEST_DEFINE_int32_(name, default_val, doc) \
3080 GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
3081 #define GTEST_DEFINE_string_(name, default_val, doc) \
3082 GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
3084 // Thread annotations
3085 #define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
3086 #define GTEST_LOCK_EXCLUDED_(locks)
3088 // Parses 'str' for a 32-bit signed integer. If successful, writes the result
3089 // to *value and returns true; otherwise leaves *value unchanged and returns
3091 // TODO(chandlerc): Find a better way to refactor flag and environment parsing
3092 // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
3094 bool ParseInt32(const Message& src_text, const char* str, Int32* value);
3096 // Parses a bool/Int32/string from the environment variable
3097 // corresponding to the given Google Test flag.
3098 bool BoolFromGTestEnv(const char* flag, bool default_val);
3099 GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
3100 const char* StringFromGTestEnv(const char* flag, const char* default_val);
3102 } // namespace internal
3103 } // namespace testing
3105 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
3108 # include <stdlib.h>
3109 # include <sys/types.h>
3110 # include <sys/wait.h>
3111 # include <unistd.h>
3112 #endif // GTEST_OS_LINUX
3114 #if GTEST_HAS_EXCEPTIONS
3115 # include <stdexcept>
3124 // Copyright 2005, Google Inc.
3125 // All rights reserved.
3127 // Redistribution and use in source and binary forms, with or without
3128 // modification, are permitted provided that the following conditions are
3131 // * Redistributions of source code must retain the above copyright
3132 // notice, this list of conditions and the following disclaimer.
3133 // * Redistributions in binary form must reproduce the above
3134 // copyright notice, this list of conditions and the following disclaimer
3135 // in the documentation and/or other materials provided with the
3137 // * Neither the name of Google Inc. nor the names of its
3138 // contributors may be used to endorse or promote products derived from
3139 // this software without specific prior written permission.
3141 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3142 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3143 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3144 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3145 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3146 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3147 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3148 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3149 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3150 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3151 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3153 // Author: wan@google.com (Zhanyong Wan)
3155 // The Google C++ Testing Framework (Google Test)
3157 // This header file defines the Message class.
3159 // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
3160 // leave some internal implementation details in this header file.
3161 // They are clearly marked by comments like this:
3163 // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
3165 // Such code is NOT meant to be used by a user directly, and is subject
3166 // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
3169 #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
3170 #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
3175 // Ensures that there is at least one operator<< in the global namespace.
3176 // See Message& operator<<(...) below for why.
3177 void operator<<(const testing::internal::Secret&, int);
3181 // The Message class works like an ostream repeater.
3185 // 1. You stream a bunch of values to a Message object.
3186 // It will remember the text in a stringstream.
3187 // 2. Then you stream the Message object to an ostream.
3188 // This causes the text in the Message to be streamed
3193 // testing::Message foo;
3194 // foo << 1 << " != " << 2;
3195 // std::cout << foo;
3197 // will print "1 != 2".
3199 // Message is not intended to be inherited from. In particular, its
3200 // destructor is not virtual.
3202 // Note that stringstream behaves differently in gcc and in MSVC. You
3203 // can stream a NULL char pointer to it in the former, but not in the
3204 // latter (it causes an access violation if you do). The Message
3205 // class hides this difference by treating a NULL char pointer as
3207 class GTEST_API_ Message {
3209 // The type of basic IO manipulators (endl, ends, and flush) for
3211 typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
3214 // Constructs an empty Message.
3217 // Copy constructor.
3218 Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT
3219 *ss_ << msg.GetString();
3222 // Constructs a Message from a C-string.
3223 explicit Message(const char* str) : ss_(new ::std::stringstream) {
3227 #if GTEST_OS_SYMBIAN
3228 // Streams a value (either a pointer or not) to this object.
3229 template <typename T>
3230 inline Message& operator <<(const T& value) {
3231 StreamHelper(typename internal::is_pointer<T>::type(), value);
3235 // Streams a non-pointer value to this object.
3236 template <typename T>
3237 inline Message& operator <<(const T& val) {
3238 // Some libraries overload << for STL containers. These
3239 // overloads are defined in the global namespace instead of ::std.
3241 // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
3242 // overloads are visible in either the std namespace or the global
3243 // namespace, but not other namespaces, including the testing
3244 // namespace which Google Test's Message class is in.
3246 // To allow STL containers (and other types that has a << operator
3247 // defined in the global namespace) to be used in Google Test
3248 // assertions, testing::Message must access the custom << operator
3249 // from the global namespace. With this using declaration,
3250 // overloads of << defined in the global namespace and those
3251 // visible via Koenig lookup are both exposed in this function.
3252 using ::operator <<;
3257 // Streams a pointer value to this object.
3259 // This function is an overload of the previous one. When you
3260 // stream a pointer to a Message, this definition will be used as it
3261 // is more specialized. (The C++ Standard, section
3262 // [temp.func.order].) If you stream a non-pointer, then the
3263 // previous definition will be used.
3265 // The reason for this overload is that streaming a NULL pointer to
3266 // ostream is undefined behavior. Depending on the compiler, you
3267 // may get "0", "(nil)", "(null)", or an access violation. To
3268 // ensure consistent result across compilers, we always treat NULL
3270 template <typename T>
3271 inline Message& operator <<(T* const& pointer) { // NOLINT
3272 if (pointer == NULL) {
3279 #endif // GTEST_OS_SYMBIAN
3281 // Since the basic IO manipulators are overloaded for both narrow
3282 // and wide streams, we have to provide this specialized definition
3283 // of operator <<, even though its body is the same as the
3284 // templatized version above. Without this definition, streaming
3285 // endl or other basic IO manipulators to Message will confuse the
3287 Message& operator <<(BasicNarrowIoManip val) {
3292 // Instead of 1/0, we want to see true/false for bool values.
3293 Message& operator <<(bool b) {
3294 return *this << (b ? "true" : "false");
3297 // These two overloads allow streaming a wide C string to a Message
3298 // using the UTF-8 encoding.
3299 Message& operator <<(const wchar_t* wide_c_str);
3300 Message& operator <<(wchar_t* wide_c_str);
3302 #if GTEST_HAS_STD_WSTRING
3303 // Converts the given wide string to a narrow string using the UTF-8
3304 // encoding, and streams the result to this Message object.
3305 Message& operator <<(const ::std::wstring& wstr);
3306 #endif // GTEST_HAS_STD_WSTRING
3308 #if GTEST_HAS_GLOBAL_WSTRING
3309 // Converts the given wide string to a narrow string using the UTF-8
3310 // encoding, and streams the result to this Message object.
3311 Message& operator <<(const ::wstring& wstr);
3312 #endif // GTEST_HAS_GLOBAL_WSTRING
3314 // Gets the text streamed to this object so far as an std::string.
3315 // Each '\0' character in the buffer is replaced with "\\0".
3317 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
3318 std::string GetString() const;
3322 #if GTEST_OS_SYMBIAN
3323 // These are needed as the Nokia Symbian Compiler cannot decide between
3324 // const T& and const T* in a function template. The Nokia compiler _can_
3325 // decide between class template specializations for T and T*, so a
3326 // tr1::type_traits-like is_pointer works, and we can overload on that.
3327 template <typename T>
3328 inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
3329 if (pointer == NULL) {
3335 template <typename T>
3336 inline void StreamHelper(internal::false_type /*is_pointer*/,
3338 // See the comments in Message& operator <<(const T&) above for why
3339 // we need this using statement.
3340 using ::operator <<;
3343 #endif // GTEST_OS_SYMBIAN
3345 // We'll hold the text streamed to this object here.
3346 const internal::scoped_ptr< ::std::stringstream> ss_;
3348 // We declare (but don't implement) this to prevent the compiler
3349 // from implementing the assignment operator.
3350 void operator=(const Message&);
3353 // Streams a Message to an ostream.
3354 inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
3355 return os << sb.GetString();
3358 namespace internal {
3360 // Converts a streamable value to an std::string. A NULL pointer is
3361 // converted to "(null)". When the input value is a ::string,
3362 // ::std::string, ::wstring, or ::std::wstring object, each NUL
3363 // character in it is replaced with "\\0".
3364 template <typename T>
3365 std::string StreamableToString(const T& streamable) {
3366 return (Message() << streamable).GetString();
3369 } // namespace internal
3370 } // namespace testing
3372 #endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
3373 // Copyright 2005, Google Inc.
3374 // All rights reserved.
3376 // Redistribution and use in source and binary forms, with or without
3377 // modification, are permitted provided that the following conditions are
3380 // * Redistributions of source code must retain the above copyright
3381 // notice, this list of conditions and the following disclaimer.
3382 // * Redistributions in binary form must reproduce the above
3383 // copyright notice, this list of conditions and the following disclaimer
3384 // in the documentation and/or other materials provided with the
3386 // * Neither the name of Google Inc. nor the names of its
3387 // contributors may be used to endorse or promote products derived from
3388 // this software without specific prior written permission.
3390 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3391 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3392 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3393 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3394 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3395 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3396 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3397 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3398 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3399 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3400 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3402 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
3404 // The Google C++ Testing Framework (Google Test)
3406 // This header file declares the String class and functions used internally by
3407 // Google Test. They are subject to change without notice. They should not used
3408 // by code external to Google Test.
3410 // This header file is #included by <gtest/internal/gtest-internal.h>.
3411 // It should not be #included by other files.
3413 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
3414 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
3417 // string.h is not guaranteed to provide strcpy on C++ Builder.
3426 namespace internal {
3428 // String - an abstract class holding static string utilities.
3429 class GTEST_API_ String {
3431 // Static utility methods
3433 // Clones a 0-terminated C string, allocating memory using new. The
3434 // caller is responsible for deleting the return value using
3435 // delete[]. Returns the cloned string, or NULL if the input is
3438 // This is different from strdup() in string.h, which allocates
3439 // memory using malloc().
3440 static const char* CloneCString(const char* c_str);
3442 #if GTEST_OS_WINDOWS_MOBILE
3443 // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
3444 // able to pass strings to Win32 APIs on CE we need to convert them
3445 // to 'Unicode', UTF-16.
3447 // Creates a UTF-16 wide string from the given ANSI string, allocating
3448 // memory using new. The caller is responsible for deleting the return
3449 // value using delete[]. Returns the wide string, or NULL if the
3452 // The wide string is created using the ANSI codepage (CP_ACP) to
3453 // match the behaviour of the ANSI versions of Win32 calls and the
3455 static LPCWSTR AnsiToUtf16(const char* c_str);
3457 // Creates an ANSI string from the given wide string, allocating
3458 // memory using new. The caller is responsible for deleting the return
3459 // value using delete[]. Returns the ANSI string, or NULL if the
3462 // The returned string is created using the ANSI codepage (CP_ACP) to
3463 // match the behaviour of the ANSI versions of Win32 calls and the
3465 static const char* Utf16ToAnsi(LPCWSTR utf16_str);
3468 // Compares two C strings. Returns true iff they have the same content.
3470 // Unlike strcmp(), this function can handle NULL argument(s). A
3471 // NULL C string is considered different to any non-NULL C string,
3472 // including the empty string.
3473 static bool CStringEquals(const char* lhs, const char* rhs);
3475 // Converts a wide C string to a String using the UTF-8 encoding.
3476 // NULL will be converted to "(null)". If an error occurred during
3477 // the conversion, "(failed to convert from wide string)" is
3479 static std::string ShowWideCString(const wchar_t* wide_c_str);
3481 // Compares two wide C strings. Returns true iff they have the same
3484 // Unlike wcscmp(), this function can handle NULL argument(s). A
3485 // NULL C string is considered different to any non-NULL C string,
3486 // including the empty string.
3487 static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
3489 // Compares two C strings, ignoring case. Returns true iff they
3490 // have the same content.
3492 // Unlike strcasecmp(), this function can handle NULL argument(s).
3493 // A NULL C string is considered different to any non-NULL C string,
3494 // including the empty string.
3495 static bool CaseInsensitiveCStringEquals(const char* lhs,
3498 // Compares two wide C strings, ignoring case. Returns true iff they
3499 // have the same content.
3501 // Unlike wcscasecmp(), this function can handle NULL argument(s).
3502 // A NULL C string is considered different to any non-NULL wide C string,
3503 // including the empty string.
3504 // NB: The implementations on different platforms slightly differ.
3505 // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
3506 // environment variable. On GNU platform this method uses wcscasecmp
3507 // which compares according to LC_CTYPE category of the current locale.
3508 // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
3510 static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
3511 const wchar_t* rhs);
3513 // Returns true iff the given string ends with the given suffix, ignoring
3514 // case. Any string is considered to end with an empty suffix.
3515 static bool EndsWithCaseInsensitive(
3516 const std::string& str, const std::string& suffix);
3518 // Formats an int value as "%02d".
3519 static std::string FormatIntWidth2(int value); // "%02d" for width == 2
3521 // Formats an int value as "%X".
3522 static std::string FormatHexInt(int value);
3524 // Formats a byte as "%02X".
3525 static std::string FormatByte(unsigned char value);
3528 String(); // Not meant to be instantiated.
3531 // Gets the content of the stringstream's buffer as an std::string. Each '\0'
3532 // character in the buffer is replaced with "\\0".
3533 GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
3535 } // namespace internal
3536 } // namespace testing
3538 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
3539 // Copyright 2008, Google Inc.
3540 // All rights reserved.
3542 // Redistribution and use in source and binary forms, with or without
3543 // modification, are permitted provided that the following conditions are
3546 // * Redistributions of source code must retain the above copyright
3547 // notice, this list of conditions and the following disclaimer.
3548 // * Redistributions in binary form must reproduce the above
3549 // copyright notice, this list of conditions and the following disclaimer
3550 // in the documentation and/or other materials provided with the
3552 // * Neither the name of Google Inc. nor the names of its
3553 // contributors may be used to endorse or promote products derived from
3554 // this software without specific prior written permission.
3556 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3557 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3558 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3559 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3560 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3561 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3562 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3563 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3564 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3565 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3566 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3568 // Author: keith.ray@gmail.com (Keith Ray)
3570 // Google Test filepath utilities
3572 // This header file declares classes and functions used internally by
3573 // Google Test. They are subject to change without notice.
3575 // This file is #included in <gtest/internal/gtest-internal.h>.
3576 // Do not include this header file separately!
3578 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3579 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3583 namespace internal {
3585 // FilePath - a class for file and directory pathname manipulation which
3586 // handles platform-specific conventions (like the pathname separator).
3587 // Used for helper functions for naming files in a directory for xml output.
3588 // Except for Set methods, all methods are const or static, which provides an
3589 // "immutable value object" -- useful for peace of mind.
3590 // A FilePath with a value ending in a path separator ("like/this/") represents
3591 // a directory, otherwise it is assumed to represent a file. In either case,
3592 // it may or may not represent an actual file or directory in the file system.
3593 // Names are NOT checked for syntax correctness -- no checking for illegal
3594 // characters, malformed paths, etc.
3596 class GTEST_API_ FilePath {
3598 FilePath() : pathname_("") { }
3599 FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
3601 explicit FilePath(const std::string& pathname) : pathname_(pathname) {
3605 FilePath& operator=(const FilePath& rhs) {
3610 void Set(const FilePath& rhs) {
3611 pathname_ = rhs.pathname_;
3614 const std::string& string() const { return pathname_; }
3615 const char* c_str() const { return pathname_.c_str(); }
3617 // Returns the current working directory, or "" if unsuccessful.
3618 static FilePath GetCurrentDir();
3620 // Given directory = "dir", base_name = "test", number = 0,
3621 // extension = "xml", returns "dir/test.xml". If number is greater
3622 // than zero (e.g., 12), returns "dir/test_12.xml".
3623 // On Windows platform, uses \ as the separator rather than /.
3624 static FilePath MakeFileName(const FilePath& directory,
3625 const FilePath& base_name,
3627 const char* extension);
3629 // Given directory = "dir", relative_path = "test.xml",
3630 // returns "dir/test.xml".
3631 // On Windows, uses \ as the separator rather than /.
3632 static FilePath ConcatPaths(const FilePath& directory,
3633 const FilePath& relative_path);
3635 // Returns a pathname for a file that does not currently exist. The pathname
3636 // will be directory/base_name.extension or
3637 // directory/base_name_<number>.extension if directory/base_name.extension
3638 // already exists. The number will be incremented until a pathname is found
3639 // that does not already exist.
3640 // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
3641 // There could be a race condition if two or more processes are calling this
3642 // function at the same time -- they could both pick the same filename.
3643 static FilePath GenerateUniqueFileName(const FilePath& directory,
3644 const FilePath& base_name,
3645 const char* extension);
3647 // Returns true iff the path is "".
3648 bool IsEmpty() const { return pathname_.empty(); }
3650 // If input name has a trailing separator character, removes it and returns
3651 // the name, otherwise return the name string unmodified.
3652 // On Windows platform, uses \ as the separator, other platforms use /.
3653 FilePath RemoveTrailingPathSeparator() const;
3655 // Returns a copy of the FilePath with the directory part removed.
3656 // Example: FilePath("path/to/file").RemoveDirectoryName() returns
3657 // FilePath("file"). If there is no directory part ("just_a_file"), it returns
3658 // the FilePath unmodified. If there is no file part ("just_a_dir/") it
3659 // returns an empty FilePath ("").
3660 // On Windows platform, '\' is the path separator, otherwise it is '/'.
3661 FilePath RemoveDirectoryName() const;
3663 // RemoveFileName returns the directory path with the filename removed.
3664 // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
3665 // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
3666 // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
3667 // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
3668 // On Windows platform, '\' is the path separator, otherwise it is '/'.
3669 FilePath RemoveFileName() const;
3671 // Returns a copy of the FilePath with the case-insensitive extension removed.
3672 // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
3673 // FilePath("dir/file"). If a case-insensitive extension is not
3674 // found, returns a copy of the original FilePath.
3675 FilePath RemoveExtension(const char* extension) const;
3677 // Creates directories so that path exists. Returns true if successful or if
3678 // the directories already exist; returns false if unable to create
3679 // directories for any reason. Will also return false if the FilePath does
3680 // not represent a directory (that is, it doesn't end with a path separator).
3681 bool CreateDirectoriesRecursively() const;
3683 // Create the directory so that path exists. Returns true if successful or
3684 // if the directory already exists; returns false if unable to create the
3685 // directory for any reason, including if the parent directory does not
3686 // exist. Not named "CreateDirectory" because that's a macro on Windows.
3687 bool CreateFolder() const;
3689 // Returns true if FilePath describes something in the file-system,
3690 // either a file, directory, or whatever, and that something exists.
3691 bool FileOrDirectoryExists() const;
3693 // Returns true if pathname describes a directory in the file-system
3695 bool DirectoryExists() const;
3697 // Returns true if FilePath ends with a path separator, which indicates that
3698 // it is intended to represent a directory. Returns false otherwise.
3699 // This does NOT check that a directory (or file) actually exists.
3700 bool IsDirectory() const;
3702 // Returns true if pathname describes a root directory. (Windows has one
3703 // root directory per disk drive.)
3704 bool IsRootDirectory() const;
3706 // Returns true if pathname describes an absolute path.
3707 bool IsAbsolutePath() const;
3710 // Replaces multiple consecutive separators with a single separator.
3711 // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
3712 // redundancies that might be in a pathname involving "." or "..".
3714 // A pathname with multiple consecutive separators may occur either through
3715 // user error or as a result of some scripts or APIs that generate a pathname
3716 // with a trailing separator. On other platforms the same API or script
3717 // may NOT generate a pathname with a trailing "/". Then elsewhere that
3718 // pathname may have another "/" and pathname components added to it,
3719 // without checking for the separator already being there.
3720 // The script language and operating system may allow paths like "foo//bar"
3721 // but some of the functions in FilePath will not handle that correctly. In
3722 // particular, RemoveTrailingPathSeparator() only removes one separator, and
3723 // it is called in CreateDirectoriesRecursively() assuming that it will change
3724 // a pathname from directory syntax (trailing separator) to filename syntax.
3726 // On Windows this method also replaces the alternate path separator '/' with
3727 // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
3732 // Returns a pointer to the last occurence of a valid path separator in
3733 // the FilePath. On Windows, for example, both '/' and '\' are valid path
3734 // separators. Returns NULL if no path separator was found.
3735 const char* FindLastPathSeparator() const;
3737 std::string pathname_;
3738 }; // class FilePath
3740 } // namespace internal
3741 } // namespace testing
3743 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3744 // This file was GENERATED by command:
3745 // pump.py gtest-type-util.h.pump
3746 // DO NOT EDIT BY HAND!!!
3748 // Copyright 2008 Google Inc.
3749 // All Rights Reserved.
3751 // Redistribution and use in source and binary forms, with or without
3752 // modification, are permitted provided that the following conditions are
3755 // * Redistributions of source code must retain the above copyright
3756 // notice, this list of conditions and the following disclaimer.
3757 // * Redistributions in binary form must reproduce the above
3758 // copyright notice, this list of conditions and the following disclaimer
3759 // in the documentation and/or other materials provided with the
3761 // * Neither the name of Google Inc. nor the names of its
3762 // contributors may be used to endorse or promote products derived from
3763 // this software without specific prior written permission.
3765 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3766 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3767 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3768 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3769 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3770 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3771 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3772 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3773 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3774 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3775 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3777 // Author: wan@google.com (Zhanyong Wan)
3779 // Type utilities needed for implementing typed and type-parameterized
3780 // tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
3782 // Currently we support at most 50 types in a list, and at most 50
3783 // type-parameterized tests in one type-parameterized test case.
3784 // Please contact googletestframework@googlegroups.com if you need
3787 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
3788 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
3791 // #ifdef __GNUC__ is too general here. It is possible to use gcc without using
3792 // libstdc++ (which is where cxxabi.h comes from).
3793 # if GTEST_HAS_CXXABI_H_
3794 # include <cxxabi.h>
3795 # elif defined(__HP_aCC)
3796 # include <acxx_demangle.h>
3797 # endif // GTEST_HASH_CXXABI_H_
3800 namespace internal {
3802 // GetTypeName<T>() returns a human-readable name of type T.
3803 // NB: This function is also used in Google Mock, so don't move it inside of
3804 // the typed-test-only section below.
3805 template <typename T>
3806 std::string GetTypeName() {
3809 const char* const name = typeid(T).name();
3810 # if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
3812 // gcc's implementation of typeid(T).name() mangles the type name,
3813 // so we have to demangle it.
3814 # if GTEST_HAS_CXXABI_H_
3815 using abi::__cxa_demangle;
3816 # endif // GTEST_HAS_CXXABI_H_
3817 char* const readable_name = __cxa_demangle(name, 0, 0, &status);
3818 const std::string name_str(status == 0 ? readable_name : name);
3819 free(readable_name);
3823 # endif // GTEST_HAS_CXXABI_H_ || __HP_aCC
3829 # endif // GTEST_HAS_RTTI
3832 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
3834 // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
3835 // type. This can be used as a compile-time assertion to ensure that
3836 // two types are equal.
3838 template <typename T1, typename T2>
3839 struct AssertTypeEq;
3841 template <typename T>
3842 struct AssertTypeEq<T, T> {
3846 // A unique type used as the default value for the arguments of class
3847 // template Types. This allows us to simulate variadic templates
3848 // (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
3849 // support directly.
3852 // The following family of struct and struct templates are used to
3853 // represent type lists. In particular, TypesN<T1, T2, ..., TN>
3854 // represents a type list with N types (T1, T2, ..., and TN) in it.
3855 // Except for Types0, every struct in the family has two member types:
3856 // Head for the first type in the list, and Tail for the rest of the
3859 // The empty type list.
3862 // Type lists of length 1, 2, 3, and so on.
3864 template <typename T1>
3867 typedef Types0 Tail;
3869 template <typename T1, typename T2>
3872 typedef Types1<T2> Tail;
3875 template <typename T1, typename T2, typename T3>
3878 typedef Types2<T2, T3> Tail;
3881 template <typename T1, typename T2, typename T3, typename T4>
3884 typedef Types3<T2, T3, T4> Tail;
3887 template <typename T1, typename T2, typename T3, typename T4, typename T5>
3890 typedef Types4<T2, T3, T4, T5> Tail;
3893 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3897 typedef Types5<T2, T3, T4, T5, T6> Tail;
3900 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3901 typename T6, typename T7>
3904 typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
3907 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3908 typename T6, typename T7, typename T8>
3911 typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
3914 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3915 typename T6, typename T7, typename T8, typename T9>
3918 typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
3921 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3922 typename T6, typename T7, typename T8, typename T9, typename T10>
3925 typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
3928 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3929 typename T6, typename T7, typename T8, typename T9, typename T10,
3933 typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
3936 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3937 typename T6, typename T7, typename T8, typename T9, typename T10,
3938 typename T11, typename T12>
3941 typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
3944 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3945 typename T6, typename T7, typename T8, typename T9, typename T10,
3946 typename T11, typename T12, typename T13>
3949 typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
3952 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3953 typename T6, typename T7, typename T8, typename T9, typename T10,
3954 typename T11, typename T12, typename T13, typename T14>
3957 typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
3960 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3961 typename T6, typename T7, typename T8, typename T9, typename T10,
3962 typename T11, typename T12, typename T13, typename T14, typename T15>
3965 typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
3969 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3970 typename T6, typename T7, typename T8, typename T9, typename T10,
3971 typename T11, typename T12, typename T13, typename T14, typename T15,
3975 typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3979 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3980 typename T6, typename T7, typename T8, typename T9, typename T10,
3981 typename T11, typename T12, typename T13, typename T14, typename T15,
3982 typename T16, typename T17>
3985 typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3989 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3990 typename T6, typename T7, typename T8, typename T9, typename T10,
3991 typename T11, typename T12, typename T13, typename T14, typename T15,
3992 typename T16, typename T17, typename T18>
3995 typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3996 T16, T17, T18> Tail;
3999 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4000 typename T6, typename T7, typename T8, typename T9, typename T10,
4001 typename T11, typename T12, typename T13, typename T14, typename T15,
4002 typename T16, typename T17, typename T18, typename T19>
4005 typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4006 T16, T17, T18, T19> Tail;
4009 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4010 typename T6, typename T7, typename T8, typename T9, typename T10,
4011 typename T11, typename T12, typename T13, typename T14, typename T15,
4012 typename T16, typename T17, typename T18, typename T19, typename T20>
4015 typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4016 T16, T17, T18, T19, T20> Tail;
4019 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4020 typename T6, typename T7, typename T8, typename T9, typename T10,
4021 typename T11, typename T12, typename T13, typename T14, typename T15,
4022 typename T16, typename T17, typename T18, typename T19, typename T20,
4026 typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4027 T16, T17, T18, T19, T20, T21> Tail;
4030 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4031 typename T6, typename T7, typename T8, typename T9, typename T10,
4032 typename T11, typename T12, typename T13, typename T14, typename T15,
4033 typename T16, typename T17, typename T18, typename T19, typename T20,
4034 typename T21, typename T22>
4037 typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4038 T16, T17, T18, T19, T20, T21, T22> Tail;
4041 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4042 typename T6, typename T7, typename T8, typename T9, typename T10,
4043 typename T11, typename T12, typename T13, typename T14, typename T15,
4044 typename T16, typename T17, typename T18, typename T19, typename T20,
4045 typename T21, typename T22, typename T23>
4048 typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4049 T16, T17, T18, T19, T20, T21, T22, T23> Tail;
4052 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4053 typename T6, typename T7, typename T8, typename T9, typename T10,
4054 typename T11, typename T12, typename T13, typename T14, typename T15,
4055 typename T16, typename T17, typename T18, typename T19, typename T20,
4056 typename T21, typename T22, typename T23, typename T24>
4059 typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4060 T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
4063 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4064 typename T6, typename T7, typename T8, typename T9, typename T10,
4065 typename T11, typename T12, typename T13, typename T14, typename T15,
4066 typename T16, typename T17, typename T18, typename T19, typename T20,
4067 typename T21, typename T22, typename T23, typename T24, typename T25>
4070 typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4071 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
4074 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4075 typename T6, typename T7, typename T8, typename T9, typename T10,
4076 typename T11, typename T12, typename T13, typename T14, typename T15,
4077 typename T16, typename T17, typename T18, typename T19, typename T20,
4078 typename T21, typename T22, typename T23, typename T24, typename T25,
4082 typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4083 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
4086 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4087 typename T6, typename T7, typename T8, typename T9, typename T10,
4088 typename T11, typename T12, typename T13, typename T14, typename T15,
4089 typename T16, typename T17, typename T18, typename T19, typename T20,
4090 typename T21, typename T22, typename T23, typename T24, typename T25,
4091 typename T26, typename T27>
4094 typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4095 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
4098 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4099 typename T6, typename T7, typename T8, typename T9, typename T10,
4100 typename T11, typename T12, typename T13, typename T14, typename T15,
4101 typename T16, typename T17, typename T18, typename T19, typename T20,
4102 typename T21, typename T22, typename T23, typename T24, typename T25,
4103 typename T26, typename T27, typename T28>
4106 typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4107 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
4110 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4111 typename T6, typename T7, typename T8, typename T9, typename T10,
4112 typename T11, typename T12, typename T13, typename T14, typename T15,
4113 typename T16, typename T17, typename T18, typename T19, typename T20,
4114 typename T21, typename T22, typename T23, typename T24, typename T25,
4115 typename T26, typename T27, typename T28, typename T29>
4118 typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4119 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
4123 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4124 typename T6, typename T7, typename T8, typename T9, typename T10,
4125 typename T11, typename T12, typename T13, typename T14, typename T15,
4126 typename T16, typename T17, typename T18, typename T19, typename T20,
4127 typename T21, typename T22, typename T23, typename T24, typename T25,
4128 typename T26, typename T27, typename T28, typename T29, typename T30>
4131 typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4132 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4136 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4137 typename T6, typename T7, typename T8, typename T9, typename T10,
4138 typename T11, typename T12, typename T13, typename T14, typename T15,
4139 typename T16, typename T17, typename T18, typename T19, typename T20,
4140 typename T21, typename T22, typename T23, typename T24, typename T25,
4141 typename T26, typename T27, typename T28, typename T29, typename T30,
4145 typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4146 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4150 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4151 typename T6, typename T7, typename T8, typename T9, typename T10,
4152 typename T11, typename T12, typename T13, typename T14, typename T15,
4153 typename T16, typename T17, typename T18, typename T19, typename T20,
4154 typename T21, typename T22, typename T23, typename T24, typename T25,
4155 typename T26, typename T27, typename T28, typename T29, typename T30,
4156 typename T31, typename T32>
4159 typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4160 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4161 T30, T31, T32> Tail;
4164 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4165 typename T6, typename T7, typename T8, typename T9, typename T10,
4166 typename T11, typename T12, typename T13, typename T14, typename T15,
4167 typename T16, typename T17, typename T18, typename T19, typename T20,
4168 typename T21, typename T22, typename T23, typename T24, typename T25,
4169 typename T26, typename T27, typename T28, typename T29, typename T30,
4170 typename T31, typename T32, typename T33>
4173 typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4174 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4175 T30, T31, T32, T33> Tail;
4178 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4179 typename T6, typename T7, typename T8, typename T9, typename T10,
4180 typename T11, typename T12, typename T13, typename T14, typename T15,
4181 typename T16, typename T17, typename T18, typename T19, typename T20,
4182 typename T21, typename T22, typename T23, typename T24, typename T25,
4183 typename T26, typename T27, typename T28, typename T29, typename T30,
4184 typename T31, typename T32, typename T33, typename T34>
4187 typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4188 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4189 T30, T31, T32, T33, T34> Tail;
4192 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4193 typename T6, typename T7, typename T8, typename T9, typename T10,
4194 typename T11, typename T12, typename T13, typename T14, typename T15,
4195 typename T16, typename T17, typename T18, typename T19, typename T20,
4196 typename T21, typename T22, typename T23, typename T24, typename T25,
4197 typename T26, typename T27, typename T28, typename T29, typename T30,
4198 typename T31, typename T32, typename T33, typename T34, typename T35>
4201 typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4202 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4203 T30, T31, T32, T33, T34, T35> Tail;
4206 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4207 typename T6, typename T7, typename T8, typename T9, typename T10,
4208 typename T11, typename T12, typename T13, typename T14, typename T15,
4209 typename T16, typename T17, typename T18, typename T19, typename T20,
4210 typename T21, typename T22, typename T23, typename T24, typename T25,
4211 typename T26, typename T27, typename T28, typename T29, typename T30,
4212 typename T31, typename T32, typename T33, typename T34, typename T35,
4216 typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4217 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4218 T30, T31, T32, T33, T34, T35, T36> Tail;
4221 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4222 typename T6, typename T7, typename T8, typename T9, typename T10,
4223 typename T11, typename T12, typename T13, typename T14, typename T15,
4224 typename T16, typename T17, typename T18, typename T19, typename T20,
4225 typename T21, typename T22, typename T23, typename T24, typename T25,
4226 typename T26, typename T27, typename T28, typename T29, typename T30,
4227 typename T31, typename T32, typename T33, typename T34, typename T35,
4228 typename T36, typename T37>
4231 typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4232 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4233 T30, T31, T32, T33, T34, T35, T36, T37> Tail;
4236 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4237 typename T6, typename T7, typename T8, typename T9, typename T10,
4238 typename T11, typename T12, typename T13, typename T14, typename T15,
4239 typename T16, typename T17, typename T18, typename T19, typename T20,
4240 typename T21, typename T22, typename T23, typename T24, typename T25,
4241 typename T26, typename T27, typename T28, typename T29, typename T30,
4242 typename T31, typename T32, typename T33, typename T34, typename T35,
4243 typename T36, typename T37, typename T38>
4246 typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4247 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4248 T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
4251 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4252 typename T6, typename T7, typename T8, typename T9, typename T10,
4253 typename T11, typename T12, typename T13, typename T14, typename T15,
4254 typename T16, typename T17, typename T18, typename T19, typename T20,
4255 typename T21, typename T22, typename T23, typename T24, typename T25,
4256 typename T26, typename T27, typename T28, typename T29, typename T30,
4257 typename T31, typename T32, typename T33, typename T34, typename T35,
4258 typename T36, typename T37, typename T38, typename T39>
4261 typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4262 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4263 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
4266 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4267 typename T6, typename T7, typename T8, typename T9, typename T10,
4268 typename T11, typename T12, typename T13, typename T14, typename T15,
4269 typename T16, typename T17, typename T18, typename T19, typename T20,
4270 typename T21, typename T22, typename T23, typename T24, typename T25,
4271 typename T26, typename T27, typename T28, typename T29, typename T30,
4272 typename T31, typename T32, typename T33, typename T34, typename T35,
4273 typename T36, typename T37, typename T38, typename T39, typename T40>
4276 typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4277 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4278 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
4281 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4282 typename T6, typename T7, typename T8, typename T9, typename T10,
4283 typename T11, typename T12, typename T13, typename T14, typename T15,
4284 typename T16, typename T17, typename T18, typename T19, typename T20,
4285 typename T21, typename T22, typename T23, typename T24, typename T25,
4286 typename T26, typename T27, typename T28, typename T29, typename T30,
4287 typename T31, typename T32, typename T33, typename T34, typename T35,
4288 typename T36, typename T37, typename T38, typename T39, typename T40,
4292 typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4293 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4294 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
4297 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4298 typename T6, typename T7, typename T8, typename T9, typename T10,
4299 typename T11, typename T12, typename T13, typename T14, typename T15,
4300 typename T16, typename T17, typename T18, typename T19, typename T20,
4301 typename T21, typename T22, typename T23, typename T24, typename T25,
4302 typename T26, typename T27, typename T28, typename T29, typename T30,
4303 typename T31, typename T32, typename T33, typename T34, typename T35,
4304 typename T36, typename T37, typename T38, typename T39, typename T40,
4305 typename T41, typename T42>
4308 typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4309 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4310 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
4313 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4314 typename T6, typename T7, typename T8, typename T9, typename T10,
4315 typename T11, typename T12, typename T13, typename T14, typename T15,
4316 typename T16, typename T17, typename T18, typename T19, typename T20,
4317 typename T21, typename T22, typename T23, typename T24, typename T25,
4318 typename T26, typename T27, typename T28, typename T29, typename T30,
4319 typename T31, typename T32, typename T33, typename T34, typename T35,
4320 typename T36, typename T37, typename T38, typename T39, typename T40,
4321 typename T41, typename T42, typename T43>
4324 typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4325 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4326 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
4330 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4331 typename T6, typename T7, typename T8, typename T9, typename T10,
4332 typename T11, typename T12, typename T13, typename T14, typename T15,
4333 typename T16, typename T17, typename T18, typename T19, typename T20,
4334 typename T21, typename T22, typename T23, typename T24, typename T25,
4335 typename T26, typename T27, typename T28, typename T29, typename T30,
4336 typename T31, typename T32, typename T33, typename T34, typename T35,
4337 typename T36, typename T37, typename T38, typename T39, typename T40,
4338 typename T41, typename T42, typename T43, typename T44>
4341 typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4342 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4343 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4347 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4348 typename T6, typename T7, typename T8, typename T9, typename T10,
4349 typename T11, typename T12, typename T13, typename T14, typename T15,
4350 typename T16, typename T17, typename T18, typename T19, typename T20,
4351 typename T21, typename T22, typename T23, typename T24, typename T25,
4352 typename T26, typename T27, typename T28, typename T29, typename T30,
4353 typename T31, typename T32, typename T33, typename T34, typename T35,
4354 typename T36, typename T37, typename T38, typename T39, typename T40,
4355 typename T41, typename T42, typename T43, typename T44, typename T45>
4358 typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4359 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4360 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4364 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4365 typename T6, typename T7, typename T8, typename T9, typename T10,
4366 typename T11, typename T12, typename T13, typename T14, typename T15,
4367 typename T16, typename T17, typename T18, typename T19, typename T20,
4368 typename T21, typename T22, typename T23, typename T24, typename T25,
4369 typename T26, typename T27, typename T28, typename T29, typename T30,
4370 typename T31, typename T32, typename T33, typename T34, typename T35,
4371 typename T36, typename T37, typename T38, typename T39, typename T40,
4372 typename T41, typename T42, typename T43, typename T44, typename T45,
4376 typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4377 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4378 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4379 T44, T45, T46> Tail;
4382 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4383 typename T6, typename T7, typename T8, typename T9, typename T10,
4384 typename T11, typename T12, typename T13, typename T14, typename T15,
4385 typename T16, typename T17, typename T18, typename T19, typename T20,
4386 typename T21, typename T22, typename T23, typename T24, typename T25,
4387 typename T26, typename T27, typename T28, typename T29, typename T30,
4388 typename T31, typename T32, typename T33, typename T34, typename T35,
4389 typename T36, typename T37, typename T38, typename T39, typename T40,
4390 typename T41, typename T42, typename T43, typename T44, typename T45,
4391 typename T46, typename T47>
4394 typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4395 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4396 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4397 T44, T45, T46, T47> Tail;
4400 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4401 typename T6, typename T7, typename T8, typename T9, typename T10,
4402 typename T11, typename T12, typename T13, typename T14, typename T15,
4403 typename T16, typename T17, typename T18, typename T19, typename T20,
4404 typename T21, typename T22, typename T23, typename T24, typename T25,
4405 typename T26, typename T27, typename T28, typename T29, typename T30,
4406 typename T31, typename T32, typename T33, typename T34, typename T35,
4407 typename T36, typename T37, typename T38, typename T39, typename T40,
4408 typename T41, typename T42, typename T43, typename T44, typename T45,
4409 typename T46, typename T47, typename T48>
4412 typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4413 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4414 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4415 T44, T45, T46, T47, T48> Tail;
4418 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4419 typename T6, typename T7, typename T8, typename T9, typename T10,
4420 typename T11, typename T12, typename T13, typename T14, typename T15,
4421 typename T16, typename T17, typename T18, typename T19, typename T20,
4422 typename T21, typename T22, typename T23, typename T24, typename T25,
4423 typename T26, typename T27, typename T28, typename T29, typename T30,
4424 typename T31, typename T32, typename T33, typename T34, typename T35,
4425 typename T36, typename T37, typename T38, typename T39, typename T40,
4426 typename T41, typename T42, typename T43, typename T44, typename T45,
4427 typename T46, typename T47, typename T48, typename T49>
4430 typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4431 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4432 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4433 T44, T45, T46, T47, T48, T49> Tail;
4436 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4437 typename T6, typename T7, typename T8, typename T9, typename T10,
4438 typename T11, typename T12, typename T13, typename T14, typename T15,
4439 typename T16, typename T17, typename T18, typename T19, typename T20,
4440 typename T21, typename T22, typename T23, typename T24, typename T25,
4441 typename T26, typename T27, typename T28, typename T29, typename T30,
4442 typename T31, typename T32, typename T33, typename T34, typename T35,
4443 typename T36, typename T37, typename T38, typename T39, typename T40,
4444 typename T41, typename T42, typename T43, typename T44, typename T45,
4445 typename T46, typename T47, typename T48, typename T49, typename T50>
4448 typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4449 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4450 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4451 T44, T45, T46, T47, T48, T49, T50> Tail;
4455 } // namespace internal
4457 // We don't want to require the users to write TypesN<...> directly,
4458 // as that would require them to count the length. Types<...> is much
4459 // easier to write, but generates horrible messages when there is a
4460 // compiler error, as gcc insists on printing out each template
4461 // argument, even if it has the default value (this means Types<int>
4462 // will appear as Types<int, None, None, ..., None> in the compiler
4465 // Our solution is to combine the best part of the two approaches: a
4466 // user would write Types<T1, ..., TN>, and Google Test will translate
4467 // that to TypesN<T1, ..., TN> internally to make error messages
4468 // readable. The translation is done by the 'type' member of the
4470 template <typename T1 = internal::None, typename T2 = internal::None,
4471 typename T3 = internal::None, typename T4 = internal::None,
4472 typename T5 = internal::None, typename T6 = internal::None,
4473 typename T7 = internal::None, typename T8 = internal::None,
4474 typename T9 = internal::None, typename T10 = internal::None,
4475 typename T11 = internal::None, typename T12 = internal::None,
4476 typename T13 = internal::None, typename T14 = internal::None,
4477 typename T15 = internal::None, typename T16 = internal::None,
4478 typename T17 = internal::None, typename T18 = internal::None,
4479 typename T19 = internal::None, typename T20 = internal::None,
4480 typename T21 = internal::None, typename T22 = internal::None,
4481 typename T23 = internal::None, typename T24 = internal::None,
4482 typename T25 = internal::None, typename T26 = internal::None,
4483 typename T27 = internal::None, typename T28 = internal::None,
4484 typename T29 = internal::None, typename T30 = internal::None,
4485 typename T31 = internal::None, typename T32 = internal::None,
4486 typename T33 = internal::None, typename T34 = internal::None,
4487 typename T35 = internal::None, typename T36 = internal::None,
4488 typename T37 = internal::None, typename T38 = internal::None,
4489 typename T39 = internal::None, typename T40 = internal::None,
4490 typename T41 = internal::None, typename T42 = internal::None,
4491 typename T43 = internal::None, typename T44 = internal::None,
4492 typename T45 = internal::None, typename T46 = internal::None,
4493 typename T47 = internal::None, typename T48 = internal::None,
4494 typename T49 = internal::None, typename T50 = internal::None>
4496 typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4497 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4498 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4499 T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
4503 struct Types<internal::None, internal::None, internal::None, internal::None,
4504 internal::None, internal::None, internal::None, internal::None,
4505 internal::None, internal::None, internal::None, internal::None,
4506 internal::None, internal::None, internal::None, internal::None,
4507 internal::None, internal::None, internal::None, internal::None,
4508 internal::None, internal::None, internal::None, internal::None,
4509 internal::None, internal::None, internal::None, internal::None,
4510 internal::None, internal::None, internal::None, internal::None,
4511 internal::None, internal::None, internal::None, internal::None,
4512 internal::None, internal::None, internal::None, internal::None,
4513 internal::None, internal::None, internal::None, internal::None,
4514 internal::None, internal::None, internal::None, internal::None,
4515 internal::None, internal::None> {
4516 typedef internal::Types0 type;
4518 template <typename T1>
4519 struct Types<T1, internal::None, internal::None, internal::None,
4520 internal::None, internal::None, internal::None, internal::None,
4521 internal::None, internal::None, internal::None, internal::None,
4522 internal::None, internal::None, internal::None, internal::None,
4523 internal::None, internal::None, internal::None, internal::None,
4524 internal::None, internal::None, internal::None, internal::None,
4525 internal::None, internal::None, internal::None, internal::None,
4526 internal::None, internal::None, internal::None, internal::None,
4527 internal::None, internal::None, internal::None, internal::None,
4528 internal::None, internal::None, internal::None, internal::None,
4529 internal::None, internal::None, internal::None, internal::None,
4530 internal::None, internal::None, internal::None, internal::None,
4531 internal::None, internal::None> {
4532 typedef internal::Types1<T1> type;
4534 template <typename T1, typename T2>
4535 struct Types<T1, T2, internal::None, internal::None, internal::None,
4536 internal::None, internal::None, internal::None, internal::None,
4537 internal::None, internal::None, internal::None, internal::None,
4538 internal::None, internal::None, internal::None, internal::None,
4539 internal::None, internal::None, internal::None, internal::None,
4540 internal::None, internal::None, internal::None, internal::None,
4541 internal::None, internal::None, internal::None, internal::None,
4542 internal::None, internal::None, internal::None, internal::None,
4543 internal::None, internal::None, internal::None, internal::None,
4544 internal::None, internal::None, internal::None, internal::None,
4545 internal::None, internal::None, internal::None, internal::None,
4546 internal::None, internal::None, internal::None, internal::None,
4548 typedef internal::Types2<T1, T2> type;
4550 template <typename T1, typename T2, typename T3>
4551 struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
4552 internal::None, internal::None, internal::None, internal::None,
4553 internal::None, internal::None, internal::None, internal::None,
4554 internal::None, internal::None, internal::None, internal::None,
4555 internal::None, internal::None, internal::None, internal::None,
4556 internal::None, internal::None, internal::None, internal::None,
4557 internal::None, internal::None, internal::None, internal::None,
4558 internal::None, internal::None, internal::None, internal::None,
4559 internal::None, internal::None, internal::None, internal::None,
4560 internal::None, internal::None, internal::None, internal::None,
4561 internal::None, internal::None, internal::None, internal::None,
4562 internal::None, internal::None, internal::None, internal::None> {
4563 typedef internal::Types3<T1, T2, T3> type;
4565 template <typename T1, typename T2, typename T3, typename T4>
4566 struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
4567 internal::None, internal::None, internal::None, internal::None,
4568 internal::None, internal::None, internal::None, internal::None,
4569 internal::None, internal::None, internal::None, internal::None,
4570 internal::None, internal::None, internal::None, internal::None,
4571 internal::None, internal::None, internal::None, internal::None,
4572 internal::None, internal::None, internal::None, internal::None,
4573 internal::None, internal::None, internal::None, internal::None,
4574 internal::None, internal::None, internal::None, internal::None,
4575 internal::None, internal::None, internal::None, internal::None,
4576 internal::None, internal::None, internal::None, internal::None,
4577 internal::None, internal::None, internal::None> {
4578 typedef internal::Types4<T1, T2, T3, T4> type;
4580 template <typename T1, typename T2, typename T3, typename T4, typename T5>
4581 struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
4582 internal::None, internal::None, internal::None, internal::None,
4583 internal::None, internal::None, internal::None, internal::None,
4584 internal::None, internal::None, internal::None, internal::None,
4585 internal::None, internal::None, internal::None, internal::None,
4586 internal::None, internal::None, internal::None, internal::None,
4587 internal::None, internal::None, internal::None, internal::None,
4588 internal::None, internal::None, internal::None, internal::None,
4589 internal::None, internal::None, internal::None, internal::None,
4590 internal::None, internal::None, internal::None, internal::None,
4591 internal::None, internal::None, internal::None, internal::None,
4592 internal::None, internal::None, internal::None> {
4593 typedef internal::Types5<T1, T2, T3, T4, T5> type;
4595 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4597 struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
4598 internal::None, internal::None, internal::None, internal::None,
4599 internal::None, internal::None, internal::None, internal::None,
4600 internal::None, internal::None, internal::None, internal::None,
4601 internal::None, internal::None, internal::None, internal::None,
4602 internal::None, internal::None, internal::None, internal::None,
4603 internal::None, internal::None, internal::None, internal::None,
4604 internal::None, internal::None, internal::None, internal::None,
4605 internal::None, internal::None, internal::None, internal::None,
4606 internal::None, internal::None, internal::None, internal::None,
4607 internal::None, internal::None, internal::None, internal::None,
4608 internal::None, internal::None> {
4609 typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
4611 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4612 typename T6, typename T7>
4613 struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
4614 internal::None, internal::None, internal::None, internal::None,
4615 internal::None, internal::None, internal::None, internal::None,
4616 internal::None, internal::None, internal::None, internal::None,
4617 internal::None, internal::None, internal::None, internal::None,
4618 internal::None, internal::None, internal::None, internal::None,
4619 internal::None, internal::None, internal::None, internal::None,
4620 internal::None, internal::None, internal::None, internal::None,
4621 internal::None, internal::None, internal::None, internal::None,
4622 internal::None, internal::None, internal::None, internal::None,
4623 internal::None, internal::None, internal::None, internal::None,
4625 typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
4627 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4628 typename T6, typename T7, typename T8>
4629 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
4630 internal::None, internal::None, internal::None, internal::None,
4631 internal::None, internal::None, internal::None, internal::None,
4632 internal::None, internal::None, internal::None, internal::None,
4633 internal::None, internal::None, internal::None, internal::None,
4634 internal::None, internal::None, internal::None, internal::None,
4635 internal::None, internal::None, internal::None, internal::None,
4636 internal::None, internal::None, internal::None, internal::None,
4637 internal::None, internal::None, internal::None, internal::None,
4638 internal::None, internal::None, internal::None, internal::None,
4639 internal::None, internal::None, internal::None, internal::None> {
4640 typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
4642 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4643 typename T6, typename T7, typename T8, typename T9>
4644 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
4645 internal::None, internal::None, internal::None, internal::None,
4646 internal::None, internal::None, internal::None, internal::None,
4647 internal::None, internal::None, internal::None, internal::None,
4648 internal::None, internal::None, internal::None, internal::None,
4649 internal::None, internal::None, internal::None, internal::None,
4650 internal::None, internal::None, internal::None, internal::None,
4651 internal::None, internal::None, internal::None, internal::None,
4652 internal::None, internal::None, internal::None, internal::None,
4653 internal::None, internal::None, internal::None, internal::None,
4654 internal::None, internal::None, internal::None, internal::None> {
4655 typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
4657 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4658 typename T6, typename T7, typename T8, typename T9, typename T10>
4659 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
4660 internal::None, internal::None, internal::None, internal::None,
4661 internal::None, internal::None, internal::None, internal::None,
4662 internal::None, internal::None, internal::None, internal::None,
4663 internal::None, internal::None, internal::None, internal::None,
4664 internal::None, internal::None, internal::None, internal::None,
4665 internal::None, internal::None, internal::None, internal::None,
4666 internal::None, internal::None, internal::None, internal::None,
4667 internal::None, internal::None, internal::None, internal::None,
4668 internal::None, internal::None, internal::None, internal::None,
4669 internal::None, internal::None, internal::None> {
4670 typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
4672 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4673 typename T6, typename T7, typename T8, typename T9, typename T10,
4675 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
4676 internal::None, internal::None, internal::None, internal::None,
4677 internal::None, internal::None, internal::None, internal::None,
4678 internal::None, internal::None, internal::None, internal::None,
4679 internal::None, internal::None, internal::None, internal::None,
4680 internal::None, internal::None, internal::None, internal::None,
4681 internal::None, internal::None, internal::None, internal::None,
4682 internal::None, internal::None, internal::None, internal::None,
4683 internal::None, internal::None, internal::None, internal::None,
4684 internal::None, internal::None, internal::None, internal::None,
4685 internal::None, internal::None> {
4686 typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
4688 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4689 typename T6, typename T7, typename T8, typename T9, typename T10,
4690 typename T11, typename T12>
4691 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
4692 internal::None, internal::None, internal::None, internal::None,
4693 internal::None, internal::None, internal::None, internal::None,
4694 internal::None, internal::None, internal::None, internal::None,
4695 internal::None, internal::None, internal::None, internal::None,
4696 internal::None, internal::None, internal::None, internal::None,
4697 internal::None, internal::None, internal::None, internal::None,
4698 internal::None, internal::None, internal::None, internal::None,
4699 internal::None, internal::None, internal::None, internal::None,
4700 internal::None, internal::None, internal::None, internal::None,
4702 typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
4705 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4706 typename T6, typename T7, typename T8, typename T9, typename T10,
4707 typename T11, typename T12, typename T13>
4708 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
4709 internal::None, internal::None, internal::None, internal::None,
4710 internal::None, internal::None, internal::None, internal::None,
4711 internal::None, internal::None, internal::None, internal::None,
4712 internal::None, internal::None, internal::None, internal::None,
4713 internal::None, internal::None, internal::None, internal::None,
4714 internal::None, internal::None, internal::None, internal::None,
4715 internal::None, internal::None, internal::None, internal::None,
4716 internal::None, internal::None, internal::None, internal::None,
4717 internal::None, internal::None, internal::None, internal::None,
4719 typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4722 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4723 typename T6, typename T7, typename T8, typename T9, typename T10,
4724 typename T11, typename T12, typename T13, typename T14>
4725 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4726 internal::None, internal::None, internal::None, internal::None,
4727 internal::None, internal::None, internal::None, internal::None,
4728 internal::None, internal::None, internal::None, internal::None,
4729 internal::None, internal::None, internal::None, internal::None,
4730 internal::None, internal::None, internal::None, internal::None,
4731 internal::None, internal::None, internal::None, internal::None,
4732 internal::None, internal::None, internal::None, internal::None,
4733 internal::None, internal::None, internal::None, internal::None,
4734 internal::None, internal::None, internal::None, internal::None> {
4735 typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4738 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4739 typename T6, typename T7, typename T8, typename T9, typename T10,
4740 typename T11, typename T12, typename T13, typename T14, typename T15>
4741 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4742 internal::None, internal::None, internal::None, internal::None,
4743 internal::None, internal::None, internal::None, internal::None,
4744 internal::None, internal::None, internal::None, internal::None,
4745 internal::None, internal::None, internal::None, internal::None,
4746 internal::None, internal::None, internal::None, internal::None,
4747 internal::None, internal::None, internal::None, internal::None,
4748 internal::None, internal::None, internal::None, internal::None,
4749 internal::None, internal::None, internal::None, internal::None,
4750 internal::None, internal::None, internal::None> {
4751 typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4752 T13, T14, T15> type;
4754 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4755 typename T6, typename T7, typename T8, typename T9, typename T10,
4756 typename T11, typename T12, typename T13, typename T14, typename T15,
4758 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4759 T16, internal::None, internal::None, internal::None, internal::None,
4760 internal::None, internal::None, internal::None, internal::None,
4761 internal::None, internal::None, internal::None, internal::None,
4762 internal::None, internal::None, internal::None, internal::None,
4763 internal::None, internal::None, internal::None, internal::None,
4764 internal::None, internal::None, internal::None, internal::None,
4765 internal::None, internal::None, internal::None, internal::None,
4766 internal::None, internal::None, internal::None, internal::None,
4767 internal::None, internal::None> {
4768 typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4769 T13, T14, T15, T16> type;
4771 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4772 typename T6, typename T7, typename T8, typename T9, typename T10,
4773 typename T11, typename T12, typename T13, typename T14, typename T15,
4774 typename T16, typename T17>
4775 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4776 T16, T17, internal::None, internal::None, internal::None, internal::None,
4777 internal::None, internal::None, internal::None, internal::None,
4778 internal::None, internal::None, internal::None, internal::None,
4779 internal::None, internal::None, internal::None, internal::None,
4780 internal::None, internal::None, internal::None, internal::None,
4781 internal::None, internal::None, internal::None, internal::None,
4782 internal::None, internal::None, internal::None, internal::None,
4783 internal::None, internal::None, internal::None, internal::None,
4785 typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4786 T13, T14, T15, T16, T17> type;
4788 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4789 typename T6, typename T7, typename T8, typename T9, typename T10,
4790 typename T11, typename T12, typename T13, typename T14, typename T15,
4791 typename T16, typename T17, typename T18>
4792 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4793 T16, T17, T18, internal::None, internal::None, internal::None,
4794 internal::None, internal::None, internal::None, internal::None,
4795 internal::None, internal::None, internal::None, internal::None,
4796 internal::None, internal::None, internal::None, internal::None,
4797 internal::None, internal::None, internal::None, internal::None,
4798 internal::None, internal::None, internal::None, internal::None,
4799 internal::None, internal::None, internal::None, internal::None,
4800 internal::None, internal::None, internal::None, internal::None,
4802 typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4803 T13, T14, T15, T16, T17, T18> type;
4805 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4806 typename T6, typename T7, typename T8, typename T9, typename T10,
4807 typename T11, typename T12, typename T13, typename T14, typename T15,
4808 typename T16, typename T17, typename T18, typename T19>
4809 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4810 T16, T17, T18, T19, internal::None, internal::None, internal::None,
4811 internal::None, internal::None, internal::None, internal::None,
4812 internal::None, internal::None, internal::None, internal::None,
4813 internal::None, internal::None, internal::None, internal::None,
4814 internal::None, internal::None, internal::None, internal::None,
4815 internal::None, internal::None, internal::None, internal::None,
4816 internal::None, internal::None, internal::None, internal::None,
4817 internal::None, internal::None, internal::None, internal::None> {
4818 typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4819 T13, T14, T15, T16, T17, T18, T19> type;
4821 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4822 typename T6, typename T7, typename T8, typename T9, typename T10,
4823 typename T11, typename T12, typename T13, typename T14, typename T15,
4824 typename T16, typename T17, typename T18, typename T19, typename T20>
4825 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4826 T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
4827 internal::None, internal::None, internal::None, internal::None,
4828 internal::None, internal::None, internal::None, internal::None,
4829 internal::None, internal::None, internal::None, internal::None,
4830 internal::None, internal::None, internal::None, internal::None,
4831 internal::None, internal::None, internal::None, internal::None,
4832 internal::None, internal::None, internal::None, internal::None,
4833 internal::None, internal::None, internal::None> {
4834 typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4835 T13, T14, T15, T16, T17, T18, T19, T20> type;
4837 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4838 typename T6, typename T7, typename T8, typename T9, typename T10,
4839 typename T11, typename T12, typename T13, typename T14, typename T15,
4840 typename T16, typename T17, typename T18, typename T19, typename T20,
4842 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4843 T16, T17, T18, T19, T20, T21, internal::None, internal::None,
4844 internal::None, internal::None, internal::None, internal::None,
4845 internal::None, internal::None, internal::None, internal::None,
4846 internal::None, internal::None, internal::None, internal::None,
4847 internal::None, internal::None, internal::None, internal::None,
4848 internal::None, internal::None, internal::None, internal::None,
4849 internal::None, internal::None, internal::None, internal::None,
4850 internal::None, internal::None, internal::None> {
4851 typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4852 T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
4854 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4855 typename T6, typename T7, typename T8, typename T9, typename T10,
4856 typename T11, typename T12, typename T13, typename T14, typename T15,
4857 typename T16, typename T17, typename T18, typename T19, typename T20,
4858 typename T21, typename T22>
4859 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4860 T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
4861 internal::None, internal::None, internal::None, internal::None,
4862 internal::None, internal::None, internal::None, internal::None,
4863 internal::None, internal::None, internal::None, internal::None,
4864 internal::None, internal::None, internal::None, internal::None,
4865 internal::None, internal::None, internal::None, internal::None,
4866 internal::None, internal::None, internal::None, internal::None,
4867 internal::None, internal::None> {
4868 typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4869 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
4871 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4872 typename T6, typename T7, typename T8, typename T9, typename T10,
4873 typename T11, typename T12, typename T13, typename T14, typename T15,
4874 typename T16, typename T17, typename T18, typename T19, typename T20,
4875 typename T21, typename T22, typename T23>
4876 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4877 T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
4878 internal::None, internal::None, internal::None, internal::None,
4879 internal::None, internal::None, internal::None, internal::None,
4880 internal::None, internal::None, internal::None, internal::None,
4881 internal::None, internal::None, internal::None, internal::None,
4882 internal::None, internal::None, internal::None, internal::None,
4883 internal::None, internal::None, internal::None, internal::None,
4885 typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4886 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
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>
4893 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4894 T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
4895 internal::None, internal::None, internal::None, internal::None,
4896 internal::None, internal::None, internal::None, internal::None,
4897 internal::None, internal::None, internal::None, internal::None,
4898 internal::None, internal::None, internal::None, internal::None,
4899 internal::None, internal::None, internal::None, internal::None,
4900 internal::None, internal::None, internal::None, internal::None,
4902 typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4903 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
4905 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4906 typename T6, typename T7, typename T8, typename T9, typename T10,
4907 typename T11, typename T12, typename T13, typename T14, typename T15,
4908 typename T16, typename T17, typename T18, typename T19, typename T20,
4909 typename T21, typename T22, typename T23, typename T24, typename T25>
4910 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4911 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
4912 internal::None, internal::None, internal::None, internal::None,
4913 internal::None, internal::None, internal::None, internal::None,
4914 internal::None, internal::None, internal::None, internal::None,
4915 internal::None, internal::None, internal::None, internal::None,
4916 internal::None, internal::None, internal::None, internal::None,
4917 internal::None, internal::None, internal::None, internal::None> {
4918 typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4919 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
4921 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4922 typename T6, typename T7, typename T8, typename T9, typename T10,
4923 typename T11, typename T12, typename T13, typename T14, typename T15,
4924 typename T16, typename T17, typename T18, typename T19, typename T20,
4925 typename T21, typename T22, typename T23, typename T24, typename T25,
4927 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4928 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
4929 internal::None, internal::None, internal::None, internal::None,
4930 internal::None, internal::None, internal::None, internal::None,
4931 internal::None, internal::None, internal::None, internal::None,
4932 internal::None, internal::None, internal::None, internal::None,
4933 internal::None, internal::None, internal::None, internal::None,
4934 internal::None, internal::None, internal::None> {
4935 typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4936 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
4939 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4940 typename T6, typename T7, typename T8, typename T9, typename T10,
4941 typename T11, typename T12, typename T13, typename T14, typename T15,
4942 typename T16, typename T17, typename T18, typename T19, typename T20,
4943 typename T21, typename T22, typename T23, typename T24, typename T25,
4944 typename T26, typename T27>
4945 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4946 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
4947 internal::None, internal::None, internal::None, internal::None,
4948 internal::None, internal::None, internal::None, internal::None,
4949 internal::None, internal::None, internal::None, internal::None,
4950 internal::None, internal::None, internal::None, internal::None,
4951 internal::None, internal::None, internal::None, internal::None,
4952 internal::None, internal::None> {
4953 typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4954 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4957 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4958 typename T6, typename T7, typename T8, typename T9, typename T10,
4959 typename T11, typename T12, typename T13, typename T14, typename T15,
4960 typename T16, typename T17, typename T18, typename T19, typename T20,
4961 typename T21, typename T22, typename T23, typename T24, typename T25,
4962 typename T26, typename T27, typename T28>
4963 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4964 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
4965 internal::None, internal::None, internal::None, internal::None,
4966 internal::None, internal::None, internal::None, internal::None,
4967 internal::None, internal::None, internal::None, internal::None,
4968 internal::None, internal::None, internal::None, internal::None,
4969 internal::None, internal::None, internal::None, internal::None,
4970 internal::None, internal::None> {
4971 typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4972 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4975 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4976 typename T6, typename T7, typename T8, typename T9, typename T10,
4977 typename T11, typename T12, typename T13, typename T14, typename T15,
4978 typename T16, typename T17, typename T18, typename T19, typename T20,
4979 typename T21, typename T22, typename T23, typename T24, typename T25,
4980 typename T26, typename T27, typename T28, typename T29>
4981 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4982 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4983 internal::None, internal::None, internal::None, internal::None,
4984 internal::None, internal::None, internal::None, internal::None,
4985 internal::None, internal::None, internal::None, internal::None,
4986 internal::None, internal::None, internal::None, internal::None,
4987 internal::None, internal::None, internal::None, internal::None,
4989 typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4990 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4991 T27, T28, T29> type;
4993 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4994 typename T6, typename T7, typename T8, typename T9, typename T10,
4995 typename T11, typename T12, typename T13, typename T14, typename T15,
4996 typename T16, typename T17, typename T18, typename T19, typename T20,
4997 typename T21, typename T22, typename T23, typename T24, typename T25,
4998 typename T26, typename T27, typename T28, typename T29, typename T30>
4999 struct Types<T1, 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, T30,
5001 internal::None, internal::None, internal::None, internal::None,
5002 internal::None, internal::None, internal::None, internal::None,
5003 internal::None, internal::None, internal::None, internal::None,
5004 internal::None, internal::None, internal::None, internal::None,
5005 internal::None, internal::None, internal::None, internal::None> {
5006 typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5007 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5008 T27, T28, T29, T30> type;
5010 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5011 typename T6, typename T7, typename T8, typename T9, typename T10,
5012 typename T11, typename T12, typename T13, typename T14, typename T15,
5013 typename T16, typename T17, typename T18, typename T19, typename T20,
5014 typename T21, typename T22, typename T23, typename T24, typename T25,
5015 typename T26, typename T27, typename T28, typename T29, typename T30,
5017 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5018 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5019 T31, internal::None, internal::None, internal::None, internal::None,
5020 internal::None, internal::None, internal::None, internal::None,
5021 internal::None, internal::None, internal::None, internal::None,
5022 internal::None, internal::None, internal::None, internal::None,
5023 internal::None, internal::None, internal::None> {
5024 typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5025 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5026 T27, T28, T29, T30, T31> type;
5028 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5029 typename T6, typename T7, typename T8, typename T9, typename T10,
5030 typename T11, typename T12, typename T13, typename T14, typename T15,
5031 typename T16, typename T17, typename T18, typename T19, typename T20,
5032 typename T21, typename T22, typename T23, typename T24, typename T25,
5033 typename T26, typename T27, typename T28, typename T29, typename T30,
5034 typename T31, typename T32>
5035 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5036 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5037 T31, T32, internal::None, internal::None, internal::None, internal::None,
5038 internal::None, internal::None, internal::None, internal::None,
5039 internal::None, internal::None, internal::None, internal::None,
5040 internal::None, internal::None, internal::None, internal::None,
5041 internal::None, internal::None> {
5042 typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5043 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5044 T27, T28, T29, T30, T31, T32> type;
5046 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5047 typename T6, typename T7, typename T8, typename T9, typename T10,
5048 typename T11, typename T12, typename T13, typename T14, typename T15,
5049 typename T16, typename T17, typename T18, typename T19, typename T20,
5050 typename T21, typename T22, typename T23, typename T24, typename T25,
5051 typename T26, typename T27, typename T28, typename T29, typename T30,
5052 typename T31, typename T32, typename T33>
5053 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5054 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5055 T31, T32, T33, internal::None, internal::None, internal::None,
5056 internal::None, internal::None, internal::None, internal::None,
5057 internal::None, internal::None, internal::None, internal::None,
5058 internal::None, internal::None, internal::None, internal::None,
5059 internal::None, internal::None> {
5060 typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5061 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5062 T27, T28, T29, T30, T31, T32, T33> type;
5064 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5065 typename T6, typename T7, typename T8, typename T9, typename T10,
5066 typename T11, typename T12, typename T13, typename T14, typename T15,
5067 typename T16, typename T17, typename T18, typename T19, typename T20,
5068 typename T21, typename T22, typename T23, typename T24, typename T25,
5069 typename T26, typename T27, typename T28, typename T29, typename T30,
5070 typename T31, typename T32, typename T33, typename T34>
5071 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5072 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5073 T31, T32, T33, T34, internal::None, internal::None, internal::None,
5074 internal::None, internal::None, internal::None, internal::None,
5075 internal::None, internal::None, internal::None, internal::None,
5076 internal::None, internal::None, internal::None, internal::None,
5078 typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5079 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5080 T27, T28, T29, T30, T31, T32, T33, T34> type;
5082 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5083 typename T6, typename T7, typename T8, typename T9, typename T10,
5084 typename T11, typename T12, typename T13, typename T14, typename T15,
5085 typename T16, typename T17, typename T18, typename T19, typename T20,
5086 typename T21, typename T22, typename T23, typename T24, typename T25,
5087 typename T26, typename T27, typename T28, typename T29, typename T30,
5088 typename T31, typename T32, typename T33, typename T34, typename T35>
5089 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5090 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5091 T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
5092 internal::None, internal::None, internal::None, internal::None,
5093 internal::None, internal::None, internal::None, internal::None,
5094 internal::None, internal::None, internal::None, internal::None> {
5095 typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5096 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5097 T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
5099 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5100 typename T6, typename T7, typename T8, typename T9, typename T10,
5101 typename T11, typename T12, typename T13, typename T14, typename T15,
5102 typename T16, typename T17, typename T18, typename T19, typename T20,
5103 typename T21, typename T22, typename T23, typename T24, typename T25,
5104 typename T26, typename T27, typename T28, typename T29, typename T30,
5105 typename T31, typename T32, typename T33, typename T34, typename T35,
5107 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5108 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5109 T31, T32, T33, T34, T35, T36, internal::None, internal::None,
5110 internal::None, internal::None, internal::None, internal::None,
5111 internal::None, internal::None, internal::None, internal::None,
5112 internal::None, internal::None, internal::None, internal::None> {
5113 typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5114 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5115 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
5117 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5118 typename T6, typename T7, typename T8, typename T9, typename T10,
5119 typename T11, typename T12, typename T13, typename T14, typename T15,
5120 typename T16, typename T17, typename T18, typename T19, typename T20,
5121 typename T21, typename T22, typename T23, typename T24, typename T25,
5122 typename T26, typename T27, typename T28, typename T29, typename T30,
5123 typename T31, typename T32, typename T33, typename T34, typename T35,
5124 typename T36, typename T37>
5125 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5126 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5127 T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
5128 internal::None, internal::None, internal::None, internal::None,
5129 internal::None, internal::None, internal::None, internal::None,
5130 internal::None, internal::None, internal::None> {
5131 typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5132 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5133 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
5135 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5136 typename T6, typename T7, typename T8, typename T9, typename T10,
5137 typename T11, typename T12, typename T13, typename T14, typename T15,
5138 typename T16, typename T17, typename T18, typename T19, typename T20,
5139 typename T21, typename T22, typename T23, typename T24, typename T25,
5140 typename T26, typename T27, typename T28, typename T29, typename T30,
5141 typename T31, typename T32, typename T33, typename T34, typename T35,
5142 typename T36, typename T37, typename T38>
5143 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5144 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5145 T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
5146 internal::None, internal::None, internal::None, internal::None,
5147 internal::None, internal::None, internal::None, internal::None,
5148 internal::None, internal::None> {
5149 typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5150 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5151 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
5153 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5154 typename T6, typename T7, typename T8, typename T9, typename T10,
5155 typename T11, typename T12, typename T13, typename T14, typename T15,
5156 typename T16, typename T17, typename T18, typename T19, typename T20,
5157 typename T21, typename T22, typename T23, typename T24, typename T25,
5158 typename T26, typename T27, typename T28, typename T29, typename T30,
5159 typename T31, typename T32, typename T33, typename T34, typename T35,
5160 typename T36, typename T37, typename T38, typename T39>
5161 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5162 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5163 T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
5164 internal::None, internal::None, internal::None, internal::None,
5165 internal::None, internal::None, internal::None, internal::None,
5166 internal::None, internal::None> {
5167 typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5168 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5169 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
5171 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5172 typename T6, typename T7, typename T8, typename T9, typename T10,
5173 typename T11, typename T12, typename T13, typename T14, typename T15,
5174 typename T16, typename T17, typename T18, typename T19, typename T20,
5175 typename T21, typename T22, typename T23, typename T24, typename T25,
5176 typename T26, typename T27, typename T28, typename T29, typename T30,
5177 typename T31, typename T32, typename T33, typename T34, typename T35,
5178 typename T36, typename T37, typename T38, typename T39, typename T40>
5179 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5180 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5181 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
5182 internal::None, internal::None, internal::None, internal::None,
5183 internal::None, internal::None, internal::None, internal::None,
5185 typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5186 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5187 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
5190 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5191 typename T6, typename T7, typename T8, typename T9, typename T10,
5192 typename T11, typename T12, typename T13, typename T14, typename T15,
5193 typename T16, typename T17, typename T18, typename T19, typename T20,
5194 typename T21, typename T22, typename T23, typename T24, typename T25,
5195 typename T26, typename T27, typename T28, typename T29, typename T30,
5196 typename T31, typename T32, typename T33, typename T34, typename T35,
5197 typename T36, typename T37, typename T38, typename T39, typename T40,
5199 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5200 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5201 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
5202 internal::None, internal::None, internal::None, internal::None,
5203 internal::None, internal::None, internal::None, internal::None> {
5204 typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5205 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5206 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5209 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5210 typename T6, typename T7, typename T8, typename T9, typename T10,
5211 typename T11, typename T12, typename T13, typename T14, typename T15,
5212 typename T16, typename T17, typename T18, typename T19, typename T20,
5213 typename T21, typename T22, typename T23, typename T24, typename T25,
5214 typename T26, typename T27, typename T28, typename T29, typename T30,
5215 typename T31, typename T32, typename T33, typename T34, typename T35,
5216 typename T36, typename T37, typename T38, typename T39, typename T40,
5217 typename T41, typename T42>
5218 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5219 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5220 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
5221 internal::None, internal::None, internal::None, internal::None,
5222 internal::None, internal::None, internal::None> {
5223 typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5224 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5225 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5228 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5229 typename T6, typename T7, typename T8, typename T9, typename T10,
5230 typename T11, typename T12, typename T13, typename T14, typename T15,
5231 typename T16, typename T17, typename T18, typename T19, typename T20,
5232 typename T21, typename T22, typename T23, typename T24, typename T25,
5233 typename T26, typename T27, typename T28, typename T29, typename T30,
5234 typename T31, typename T32, typename T33, typename T34, typename T35,
5235 typename T36, typename T37, typename T38, typename T39, typename T40,
5236 typename T41, typename T42, typename T43>
5237 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5238 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5239 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5240 internal::None, internal::None, internal::None, internal::None,
5241 internal::None, internal::None, internal::None> {
5242 typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5243 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5244 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5245 T41, T42, T43> type;
5247 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5248 typename T6, typename T7, typename T8, typename T9, typename T10,
5249 typename T11, typename T12, typename T13, typename T14, typename T15,
5250 typename T16, typename T17, typename T18, typename T19, typename T20,
5251 typename T21, typename T22, typename T23, typename T24, typename T25,
5252 typename T26, typename T27, typename T28, typename T29, typename T30,
5253 typename T31, typename T32, typename T33, typename T34, typename T35,
5254 typename T36, typename T37, typename T38, typename T39, typename T40,
5255 typename T41, typename T42, typename T43, typename T44>
5256 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5257 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5258 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
5259 internal::None, internal::None, internal::None, internal::None,
5260 internal::None, internal::None> {
5261 typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5262 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5263 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5264 T41, T42, T43, T44> type;
5266 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5267 typename T6, typename T7, typename T8, typename T9, typename T10,
5268 typename T11, typename T12, typename T13, typename T14, typename T15,
5269 typename T16, typename T17, typename T18, typename T19, typename T20,
5270 typename T21, typename T22, typename T23, typename T24, typename T25,
5271 typename T26, typename T27, typename T28, typename T29, typename T30,
5272 typename T31, typename T32, typename T33, typename T34, typename T35,
5273 typename T36, typename T37, typename T38, typename T39, typename T40,
5274 typename T41, typename T42, typename T43, typename T44, typename T45>
5275 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5276 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5277 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5278 internal::None, internal::None, internal::None, internal::None,
5280 typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5281 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5282 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5283 T41, T42, T43, T44, T45> type;
5285 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5286 typename T6, typename T7, typename T8, typename T9, typename T10,
5287 typename T11, typename T12, typename T13, typename T14, typename T15,
5288 typename T16, typename T17, typename T18, typename T19, typename T20,
5289 typename T21, typename T22, typename T23, typename T24, typename T25,
5290 typename T26, typename T27, typename T28, typename T29, typename T30,
5291 typename T31, typename T32, typename T33, typename T34, typename T35,
5292 typename T36, typename T37, typename T38, typename T39, typename T40,
5293 typename T41, typename T42, typename T43, typename T44, typename T45,
5295 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5296 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5297 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5298 T46, internal::None, internal::None, internal::None, internal::None> {
5299 typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5300 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5301 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5302 T41, T42, T43, T44, T45, T46> type;
5304 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5305 typename T6, typename T7, typename T8, typename T9, typename T10,
5306 typename T11, typename T12, typename T13, typename T14, typename T15,
5307 typename T16, typename T17, typename T18, typename T19, typename T20,
5308 typename T21, typename T22, typename T23, typename T24, typename T25,
5309 typename T26, typename T27, typename T28, typename T29, typename T30,
5310 typename T31, typename T32, typename T33, typename T34, typename T35,
5311 typename T36, typename T37, typename T38, typename T39, typename T40,
5312 typename T41, typename T42, typename T43, typename T44, typename T45,
5313 typename T46, typename T47>
5314 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5315 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5316 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5317 T46, T47, internal::None, internal::None, internal::None> {
5318 typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5319 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5320 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5321 T41, T42, T43, T44, T45, T46, T47> type;
5323 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5324 typename T6, typename T7, typename T8, typename T9, typename T10,
5325 typename T11, typename T12, typename T13, typename T14, typename T15,
5326 typename T16, typename T17, typename T18, typename T19, typename T20,
5327 typename T21, typename T22, typename T23, typename T24, typename T25,
5328 typename T26, typename T27, typename T28, typename T29, typename T30,
5329 typename T31, typename T32, typename T33, typename T34, typename T35,
5330 typename T36, typename T37, typename T38, typename T39, typename T40,
5331 typename T41, typename T42, typename T43, typename T44, typename T45,
5332 typename T46, typename T47, typename T48>
5333 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5334 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5335 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5336 T46, T47, T48, internal::None, internal::None> {
5337 typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5338 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5339 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5340 T41, T42, T43, T44, T45, T46, T47, T48> type;
5342 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5343 typename T6, typename T7, typename T8, typename T9, typename T10,
5344 typename T11, typename T12, typename T13, typename T14, typename T15,
5345 typename T16, typename T17, typename T18, typename T19, typename T20,
5346 typename T21, typename T22, typename T23, typename T24, typename T25,
5347 typename T26, typename T27, typename T28, typename T29, typename T30,
5348 typename T31, typename T32, typename T33, typename T34, typename T35,
5349 typename T36, typename T37, typename T38, typename T39, typename T40,
5350 typename T41, typename T42, typename T43, typename T44, typename T45,
5351 typename T46, typename T47, typename T48, typename T49>
5352 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5353 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5354 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5355 T46, T47, T48, T49, internal::None> {
5356 typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5357 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5358 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5359 T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
5362 namespace internal {
5364 # define GTEST_TEMPLATE_ template <typename T> class
5366 // The template "selector" struct TemplateSel<Tmpl> is used to
5367 // represent Tmpl, which must be a class template with one type
5368 // parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined
5369 // as the type Tmpl<T>. This allows us to actually instantiate the
5370 // template "selected" by TemplateSel<Tmpl>.
5372 // This trick is necessary for simulating typedef for class templates,
5373 // which C++ doesn't support directly.
5374 template <GTEST_TEMPLATE_ Tmpl>
5375 struct TemplateSel {
5376 template <typename T>
5378 typedef Tmpl<T> type;
5382 # define GTEST_BIND_(TmplSel, T) \
5383 TmplSel::template Bind<T>::type
5385 // A unique struct template used as the default value for the
5386 // arguments of class template Templates. This allows us to simulate
5387 // variadic templates (e.g. Templates<int>, Templates<int, double>,
5388 // and etc), which C++ doesn't support directly.
5389 template <typename T>
5392 // The following family of struct and struct templates are used to
5393 // represent template lists. In particular, TemplatesN<T1, T2, ...,
5394 // TN> represents a list of N templates (T1, T2, ..., and TN). Except
5395 // for Templates0, every struct in the family has two member types:
5396 // Head for the selector of the first template in the list, and Tail
5397 // for the rest of the list.
5399 // The empty template list.
5400 struct Templates0 {};
5402 // Template lists of length 1, 2, 3, and so on.
5404 template <GTEST_TEMPLATE_ T1>
5406 typedef TemplateSel<T1> Head;
5407 typedef Templates0 Tail;
5409 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
5411 typedef TemplateSel<T1> Head;
5412 typedef Templates1<T2> Tail;
5415 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
5417 typedef TemplateSel<T1> Head;
5418 typedef Templates2<T2, T3> Tail;
5421 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5424 typedef TemplateSel<T1> Head;
5425 typedef Templates3<T2, T3, T4> Tail;
5428 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5429 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
5431 typedef TemplateSel<T1> Head;
5432 typedef Templates4<T2, T3, T4, T5> Tail;
5435 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5436 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
5438 typedef TemplateSel<T1> Head;
5439 typedef Templates5<T2, T3, T4, T5, T6> Tail;
5442 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5443 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5446 typedef TemplateSel<T1> Head;
5447 typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
5450 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5451 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5452 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
5454 typedef TemplateSel<T1> Head;
5455 typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
5458 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5459 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5460 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
5462 typedef TemplateSel<T1> Head;
5463 typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
5466 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5467 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5468 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5469 GTEST_TEMPLATE_ T10>
5470 struct Templates10 {
5471 typedef TemplateSel<T1> Head;
5472 typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
5475 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5476 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5477 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5478 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
5479 struct Templates11 {
5480 typedef TemplateSel<T1> Head;
5481 typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
5484 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5485 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5486 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5487 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
5488 struct Templates12 {
5489 typedef TemplateSel<T1> Head;
5490 typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
5493 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5494 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5495 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5496 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5497 GTEST_TEMPLATE_ T13>
5498 struct Templates13 {
5499 typedef TemplateSel<T1> Head;
5500 typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
5503 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5504 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5505 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5506 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5507 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
5508 struct Templates14 {
5509 typedef TemplateSel<T1> Head;
5510 typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5514 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5515 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5516 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5517 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5518 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
5519 struct Templates15 {
5520 typedef TemplateSel<T1> Head;
5521 typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5525 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5526 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5527 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5528 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5529 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5530 GTEST_TEMPLATE_ T16>
5531 struct Templates16 {
5532 typedef TemplateSel<T1> Head;
5533 typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5537 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5538 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5539 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5540 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5541 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5542 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
5543 struct Templates17 {
5544 typedef TemplateSel<T1> Head;
5545 typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5546 T15, T16, T17> Tail;
5549 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5550 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5551 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5552 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5553 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5554 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
5555 struct Templates18 {
5556 typedef TemplateSel<T1> Head;
5557 typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5558 T15, T16, T17, T18> Tail;
5561 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5562 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5563 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5564 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5565 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5566 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5567 GTEST_TEMPLATE_ T19>
5568 struct Templates19 {
5569 typedef TemplateSel<T1> Head;
5570 typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5571 T15, T16, T17, T18, T19> Tail;
5574 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5575 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5576 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5577 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5578 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5579 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5580 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
5581 struct Templates20 {
5582 typedef TemplateSel<T1> Head;
5583 typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5584 T15, T16, T17, T18, T19, T20> Tail;
5587 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5588 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5589 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5590 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5591 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5592 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5593 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
5594 struct Templates21 {
5595 typedef TemplateSel<T1> Head;
5596 typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5597 T15, T16, T17, T18, T19, T20, T21> Tail;
5600 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5601 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5602 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5603 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5604 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5605 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5606 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5607 GTEST_TEMPLATE_ T22>
5608 struct Templates22 {
5609 typedef TemplateSel<T1> Head;
5610 typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5611 T15, T16, T17, T18, T19, T20, T21, T22> Tail;
5614 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5615 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5616 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5617 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5618 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5619 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5620 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5621 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
5622 struct Templates23 {
5623 typedef TemplateSel<T1> Head;
5624 typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5625 T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
5628 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5629 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5630 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5631 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5632 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5633 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5634 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5635 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
5636 struct Templates24 {
5637 typedef TemplateSel<T1> Head;
5638 typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5639 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
5642 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5643 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5644 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5645 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5646 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5647 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5648 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5649 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5650 GTEST_TEMPLATE_ T25>
5651 struct Templates25 {
5652 typedef TemplateSel<T1> Head;
5653 typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5654 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
5657 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5658 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5659 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5660 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5661 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5662 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5663 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5664 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5665 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
5666 struct Templates26 {
5667 typedef TemplateSel<T1> Head;
5668 typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5669 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
5672 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5673 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5674 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5675 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5676 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5677 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5678 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5679 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5680 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
5681 struct Templates27 {
5682 typedef TemplateSel<T1> Head;
5683 typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5684 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
5687 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5688 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5689 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5690 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5691 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5692 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5693 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5694 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5695 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5696 GTEST_TEMPLATE_ T28>
5697 struct Templates28 {
5698 typedef TemplateSel<T1> Head;
5699 typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5700 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
5704 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5705 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5706 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5707 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5708 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5709 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5710 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5711 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5712 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5713 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
5714 struct Templates29 {
5715 typedef TemplateSel<T1> Head;
5716 typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5717 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5721 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5722 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5723 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5724 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5725 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5726 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5727 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5728 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5729 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5730 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
5731 struct Templates30 {
5732 typedef TemplateSel<T1> Head;
5733 typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5734 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5738 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5739 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5740 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5741 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5742 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5743 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5744 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5745 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5746 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5747 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5748 GTEST_TEMPLATE_ T31>
5749 struct Templates31 {
5750 typedef TemplateSel<T1> Head;
5751 typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5752 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5753 T29, T30, T31> Tail;
5756 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5757 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5758 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5759 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5760 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5761 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5762 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5763 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5764 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5765 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5766 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
5767 struct Templates32 {
5768 typedef TemplateSel<T1> Head;
5769 typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5770 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5771 T29, T30, T31, T32> Tail;
5774 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5775 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5776 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5777 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5778 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5779 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5780 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5781 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5782 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5783 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5784 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
5785 struct Templates33 {
5786 typedef TemplateSel<T1> Head;
5787 typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5788 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5789 T29, T30, T31, T32, T33> Tail;
5792 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5793 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5794 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5795 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5796 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5797 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5798 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5799 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5800 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5801 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5802 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5803 GTEST_TEMPLATE_ T34>
5804 struct Templates34 {
5805 typedef TemplateSel<T1> Head;
5806 typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5807 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5808 T29, T30, T31, T32, T33, T34> Tail;
5811 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5812 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5813 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5814 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5815 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5816 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5817 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5818 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5819 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5820 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5821 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5822 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
5823 struct Templates35 {
5824 typedef TemplateSel<T1> Head;
5825 typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5826 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5827 T29, T30, T31, T32, T33, T34, T35> Tail;
5830 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5831 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5832 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5833 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5834 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5835 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5836 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5837 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5838 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5839 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5840 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5841 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
5842 struct Templates36 {
5843 typedef TemplateSel<T1> Head;
5844 typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5845 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5846 T29, T30, T31, T32, T33, T34, T35, T36> Tail;
5849 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5850 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5851 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5852 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5853 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5854 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5855 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5856 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5857 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5858 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5859 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5860 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5861 GTEST_TEMPLATE_ T37>
5862 struct Templates37 {
5863 typedef TemplateSel<T1> Head;
5864 typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5865 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5866 T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
5869 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5870 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5871 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5872 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5873 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5874 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5875 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5876 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5877 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5878 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5879 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5880 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5881 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
5882 struct Templates38 {
5883 typedef TemplateSel<T1> Head;
5884 typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5885 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5886 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
5889 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5890 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5891 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5892 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5893 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5894 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5895 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5896 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5897 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5898 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5899 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5900 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5901 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
5902 struct Templates39 {
5903 typedef TemplateSel<T1> Head;
5904 typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5905 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5906 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
5909 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5910 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5911 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5912 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5913 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5914 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5915 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5916 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5917 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5918 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5919 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5920 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5921 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5922 GTEST_TEMPLATE_ T40>
5923 struct Templates40 {
5924 typedef TemplateSel<T1> Head;
5925 typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5926 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5927 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
5930 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5931 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5932 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5933 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5934 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5935 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5936 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5937 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5938 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5939 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5940 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5941 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5942 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5943 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
5944 struct Templates41 {
5945 typedef TemplateSel<T1> Head;
5946 typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5947 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5948 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
5951 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5952 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5953 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5954 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5955 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5956 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5957 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5958 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5959 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5960 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5961 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5962 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5963 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5964 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
5965 struct Templates42 {
5966 typedef TemplateSel<T1> Head;
5967 typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5968 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5969 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
5973 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5974 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5975 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5976 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5977 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5978 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5979 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5980 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5981 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5982 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5983 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5984 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5985 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5986 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5987 GTEST_TEMPLATE_ T43>
5988 struct Templates43 {
5989 typedef TemplateSel<T1> Head;
5990 typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5991 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5992 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5996 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5997 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5998 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5999 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6000 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6001 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6002 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6003 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6004 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6005 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6006 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6007 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6008 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6009 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6010 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
6011 struct Templates44 {
6012 typedef TemplateSel<T1> Head;
6013 typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6014 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6015 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6019 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6020 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6021 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6022 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6023 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6024 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6025 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6026 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6027 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6028 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6029 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6030 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6031 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6032 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6033 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
6034 struct Templates45 {
6035 typedef TemplateSel<T1> Head;
6036 typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6037 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6038 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6039 T43, T44, T45> Tail;
6042 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6043 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6044 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6045 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6046 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6047 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6048 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6049 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6050 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6051 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6052 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6053 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6054 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6055 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6056 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6057 GTEST_TEMPLATE_ T46>
6058 struct Templates46 {
6059 typedef TemplateSel<T1> Head;
6060 typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6061 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6062 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6063 T43, T44, T45, T46> Tail;
6066 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6067 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6068 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6069 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6070 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6071 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6072 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6073 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6074 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6075 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6076 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6077 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6078 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6079 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6080 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6081 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
6082 struct Templates47 {
6083 typedef TemplateSel<T1> Head;
6084 typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6085 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6086 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6087 T43, T44, T45, T46, T47> Tail;
6090 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6091 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6092 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6093 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6094 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6095 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6096 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6097 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6098 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6099 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6100 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6101 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6102 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6103 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6104 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6105 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
6106 struct Templates48 {
6107 typedef TemplateSel<T1> Head;
6108 typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6109 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6110 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6111 T43, T44, T45, T46, T47, T48> Tail;
6114 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6115 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6116 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6117 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6118 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6119 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6120 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6121 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6122 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6123 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6124 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6125 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6126 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6127 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6128 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6129 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
6130 GTEST_TEMPLATE_ T49>
6131 struct Templates49 {
6132 typedef TemplateSel<T1> Head;
6133 typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6134 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6135 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6136 T43, T44, T45, T46, T47, T48, T49> Tail;
6139 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6140 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6141 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6142 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6143 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6144 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6145 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6146 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6147 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6148 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6149 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6150 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6151 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6152 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6153 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6154 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
6155 GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
6156 struct Templates50 {
6157 typedef TemplateSel<T1> Head;
6158 typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6159 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6160 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6161 T43, T44, T45, T46, T47, T48, T49, T50> Tail;
6165 // We don't want to require the users to write TemplatesN<...> directly,
6166 // as that would require them to count the length. Templates<...> is much
6167 // easier to write, but generates horrible messages when there is a
6168 // compiler error, as gcc insists on printing out each template
6169 // argument, even if it has the default value (this means Templates<list>
6170 // will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
6173 // Our solution is to combine the best part of the two approaches: a
6174 // user would write Templates<T1, ..., TN>, and Google Test will translate
6175 // that to TemplatesN<T1, ..., TN> internally to make error messages
6176 // readable. The translation is done by the 'type' member of the
6177 // Templates template.
6178 template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
6179 GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
6180 GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
6181 GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
6182 GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
6183 GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
6184 GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
6185 GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
6186 GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
6187 GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
6188 GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
6189 GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
6190 GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
6191 GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
6192 GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
6193 GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
6194 GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
6195 GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
6196 GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
6197 GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
6198 GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
6199 GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
6200 GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
6201 GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
6202 GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
6204 typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6205 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6206 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6207 T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
6211 struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6212 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6213 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6214 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6215 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6217 typedef Templates0 type;
6219 template <GTEST_TEMPLATE_ T1>
6220 struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6221 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6222 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6223 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6224 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6226 typedef Templates1<T1> type;
6228 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
6229 struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6230 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6231 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6232 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6233 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6235 typedef Templates2<T1, T2> type;
6237 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
6238 struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6239 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6240 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6241 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6242 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6243 typedef Templates3<T1, T2, T3> type;
6245 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6247 struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6248 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6249 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6250 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6251 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6252 typedef Templates4<T1, T2, T3, T4> type;
6254 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6255 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
6256 struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6257 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6258 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6259 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6260 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6261 typedef Templates5<T1, T2, T3, T4, T5> type;
6263 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6264 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
6265 struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
6266 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6267 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6268 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6269 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6270 typedef Templates6<T1, T2, T3, T4, T5, T6> type;
6272 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6273 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6275 struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
6276 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6277 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6278 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6279 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6280 typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
6282 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6283 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6284 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
6285 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
6286 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6287 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6288 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6289 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6290 typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
6292 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6293 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6294 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
6295 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
6296 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6297 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6298 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6299 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6300 typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
6302 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6303 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6304 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6305 GTEST_TEMPLATE_ T10>
6306 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
6307 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6308 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6309 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6310 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6311 typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
6313 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6314 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6315 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6316 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
6317 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
6318 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6319 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6320 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6321 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6322 typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
6324 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6325 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6326 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6327 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
6328 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
6329 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6330 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6331 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6332 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6333 typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
6335 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6336 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6337 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6338 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6339 GTEST_TEMPLATE_ T13>
6340 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
6341 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6342 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6343 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6344 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6345 typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6348 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6349 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6350 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6351 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6352 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
6353 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6354 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6355 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6356 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6357 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6358 typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6361 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6362 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6363 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6364 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6365 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
6366 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6367 T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6368 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6369 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6370 NoneT, NoneT, NoneT, NoneT, NoneT> {
6371 typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6374 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6375 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6376 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6377 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6378 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6379 GTEST_TEMPLATE_ T16>
6380 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6381 T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6382 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6383 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6384 NoneT, NoneT, NoneT, NoneT, NoneT> {
6385 typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6386 T14, T15, T16> type;
6388 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6389 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6390 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6391 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6392 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6393 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
6394 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6395 T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6396 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6397 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6398 NoneT, NoneT, NoneT, NoneT, NoneT> {
6399 typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6400 T14, T15, T16, T17> type;
6402 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6403 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6404 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6405 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6406 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6407 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
6408 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6409 T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6410 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6411 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6412 NoneT, NoneT, NoneT, NoneT> {
6413 typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6414 T14, T15, T16, T17, T18> type;
6416 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6417 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6418 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6419 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6420 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6421 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6422 GTEST_TEMPLATE_ T19>
6423 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6424 T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6425 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6426 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6427 NoneT, NoneT, NoneT, NoneT> {
6428 typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6429 T14, T15, T16, T17, T18, T19> type;
6431 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6432 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6433 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6434 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6435 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6436 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6437 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
6438 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6439 T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6440 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6441 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6442 NoneT, NoneT, NoneT, NoneT> {
6443 typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6444 T14, T15, T16, T17, T18, T19, T20> type;
6446 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6447 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6448 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6449 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6450 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6451 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6452 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
6453 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6454 T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
6455 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6456 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6457 NoneT, NoneT, NoneT, NoneT> {
6458 typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6459 T14, T15, T16, T17, T18, T19, T20, T21> type;
6461 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6462 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6463 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6464 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6465 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6466 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6467 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6468 GTEST_TEMPLATE_ T22>
6469 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6470 T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
6471 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6472 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6473 NoneT, NoneT, NoneT> {
6474 typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6475 T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
6477 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6478 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6479 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6480 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6481 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6482 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6483 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6484 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
6485 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6486 T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
6487 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6488 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6489 NoneT, NoneT, NoneT> {
6490 typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6491 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
6493 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6494 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6495 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6496 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6497 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6498 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6499 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6500 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
6501 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6502 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
6503 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6504 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6505 NoneT, NoneT, NoneT> {
6506 typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6507 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
6509 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6510 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6511 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6512 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6513 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6514 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6515 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6516 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6517 GTEST_TEMPLATE_ T25>
6518 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6519 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
6520 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6521 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6523 typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6524 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
6526 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6527 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6528 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6529 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6530 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6531 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6532 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6533 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6534 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
6535 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6536 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
6537 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6538 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6540 typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6541 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
6543 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6544 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6545 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6546 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6547 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6548 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6549 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6550 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6551 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
6552 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6553 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
6554 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6555 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6557 typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6558 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6561 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6562 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6563 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6564 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6565 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6566 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6567 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6568 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6569 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6570 GTEST_TEMPLATE_ T28>
6571 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6572 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6573 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6574 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6576 typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6577 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6580 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6581 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6582 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6583 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6584 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6585 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6586 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6587 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6588 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6589 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
6590 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6591 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6592 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6593 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6595 typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6596 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6599 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6600 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6601 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6602 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6603 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6604 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6605 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6606 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6607 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6608 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
6609 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6610 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6611 T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6612 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6613 typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6614 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6615 T28, T29, T30> type;
6617 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6618 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6619 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6620 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6621 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6622 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6623 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6624 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6625 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6626 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6627 GTEST_TEMPLATE_ T31>
6628 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6629 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6630 T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6631 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6632 typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6633 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6634 T28, T29, T30, T31> type;
6636 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6637 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6638 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6639 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6640 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6641 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6642 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6643 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6644 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6645 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6646 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
6647 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6648 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6649 T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6650 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6651 typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6652 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6653 T28, T29, T30, T31, T32> type;
6655 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6656 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6657 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6658 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6659 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6660 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6661 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6662 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6663 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6664 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6665 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
6666 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6667 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6668 T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6669 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6670 typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6671 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6672 T28, T29, T30, T31, T32, T33> type;
6674 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6675 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6676 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6677 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6678 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6679 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6680 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6681 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6682 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6683 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6684 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6685 GTEST_TEMPLATE_ T34>
6686 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6687 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6688 T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6689 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6690 typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6691 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6692 T28, T29, T30, T31, T32, T33, T34> type;
6694 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6695 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6696 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6697 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6698 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6699 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6700 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6701 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6702 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6703 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6704 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6705 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
6706 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6707 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6708 T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6709 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6710 typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6711 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6712 T28, T29, T30, T31, T32, T33, T34, T35> type;
6714 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6715 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6716 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6717 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6718 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6719 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6720 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6721 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6722 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6723 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6724 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6725 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
6726 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6727 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6728 T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
6729 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6730 typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6731 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6732 T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
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>
6747 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6748 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6749 T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
6750 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6751 typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6752 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6753 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
6755 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6756 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6757 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6758 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6759 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6760 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6761 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6762 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6763 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6764 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6765 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6766 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6767 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
6768 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6769 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6770 T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
6771 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6772 typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6773 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6774 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
6776 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6777 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6778 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6779 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6780 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6781 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6782 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6783 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6784 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6785 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6786 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6787 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6788 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
6789 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6790 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6791 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
6792 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6793 typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6794 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6795 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
6797 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6798 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6799 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6800 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6801 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6802 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6803 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6804 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6805 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6806 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6807 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6808 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6809 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6810 GTEST_TEMPLATE_ T40>
6811 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6812 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6813 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
6814 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6815 typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6816 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6817 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
6819 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6820 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6821 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6822 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6823 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6824 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6825 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6826 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6827 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6828 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6829 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6830 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6831 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6832 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
6833 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6834 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6835 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
6836 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6837 typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6838 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6839 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6842 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6843 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6844 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6845 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6846 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6847 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6848 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6849 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6850 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6851 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6852 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6853 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6854 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6855 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
6856 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6857 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6858 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
6859 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6860 typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6861 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6862 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6865 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6866 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6867 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6868 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6869 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6870 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6871 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6872 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6873 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6874 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6875 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6876 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6877 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6878 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6879 GTEST_TEMPLATE_ T43>
6880 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6881 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6882 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
6883 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6884 typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6885 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6886 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6889 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6890 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6891 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6892 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6893 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6894 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6895 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6896 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6897 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6898 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6899 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6900 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6901 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6902 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6903 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
6904 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6905 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6906 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6907 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6908 typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6909 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6910 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6911 T42, T43, T44> type;
6913 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6914 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6915 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6916 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6917 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6918 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6919 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6920 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6921 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6922 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6923 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6924 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6925 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6926 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6927 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
6928 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6929 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6930 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6931 T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
6932 typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6933 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6934 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6935 T42, T43, T44, T45> type;
6937 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6938 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6939 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6940 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6941 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6942 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6943 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6944 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6945 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6946 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6947 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6948 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6949 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6950 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6951 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6952 GTEST_TEMPLATE_ T46>
6953 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6954 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6955 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6956 T45, T46, NoneT, NoneT, NoneT, NoneT> {
6957 typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6958 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6959 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6960 T42, T43, T44, T45, T46> type;
6962 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6963 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6964 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6965 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6966 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6967 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6968 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6969 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6970 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6971 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6972 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6973 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6974 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6975 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6976 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6977 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
6978 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6979 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6980 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6981 T45, T46, T47, NoneT, NoneT, NoneT> {
6982 typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6983 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6984 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6985 T42, T43, T44, T45, T46, T47> type;
6987 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6988 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6989 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6990 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6991 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6992 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6993 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6994 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6995 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6996 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6997 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6998 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6999 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7000 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7001 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7002 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
7003 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7004 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7005 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7006 T45, T46, T47, T48, NoneT, NoneT> {
7007 typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7008 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7009 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7010 T42, T43, T44, T45, T46, T47, T48> type;
7012 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7013 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7014 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7015 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7016 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7017 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7018 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7019 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7020 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7021 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7022 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7023 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7024 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7025 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7026 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7027 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
7028 GTEST_TEMPLATE_ T49>
7029 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7030 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7031 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7032 T45, T46, T47, T48, T49, NoneT> {
7033 typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7034 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7035 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7036 T42, T43, T44, T45, T46, T47, T48, T49> type;
7039 // The TypeList template makes it possible to use either a single type
7040 // or a Types<...> list in TYPED_TEST_CASE() and
7041 // INSTANTIATE_TYPED_TEST_CASE_P().
7043 template <typename T>
7045 typedef Types1<T> type;
7048 template <typename T1, typename T2, typename T3, typename T4, typename T5,
7049 typename T6, typename T7, typename T8, typename T9, typename T10,
7050 typename T11, typename T12, typename T13, typename T14, typename T15,
7051 typename T16, typename T17, typename T18, typename T19, typename T20,
7052 typename T21, typename T22, typename T23, typename T24, typename T25,
7053 typename T26, typename T27, typename T28, typename T29, typename T30,
7054 typename T31, typename T32, typename T33, typename T34, typename T35,
7055 typename T36, typename T37, typename T38, typename T39, typename T40,
7056 typename T41, typename T42, typename T43, typename T44, typename T45,
7057 typename T46, typename T47, typename T48, typename T49, typename T50>
7058 struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7059 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
7060 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
7061 T44, T45, T46, T47, T48, T49, T50> > {
7062 typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
7063 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
7064 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
7065 T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
7068 #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7070 } // namespace internal
7071 } // namespace testing
7073 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
7075 // Due to C++ preprocessor weirdness, we need double indirection to
7076 // concatenate two tokens when one of them is __LINE__. Writing
7080 // will result in the token foo__LINE__, instead of foo followed by
7081 // the current line number. For more details, see
7082 // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
7083 #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
7084 #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
7086 class ProtocolMessage;
7087 namespace proto2 { class Message; }
7091 // Forward declarations.
7093 class AssertionResult; // Result of an assertion.
7094 class Message; // Represents a failure message.
7095 class Test; // Represents a test.
7096 class TestInfo; // Information about a test.
7097 class TestPartResult; // Result of a test part.
7098 class UnitTest; // A collection of test cases.
7100 template <typename T>
7101 ::std::string PrintToString(const T& value);
7103 namespace internal {
7105 struct TraceInfo; // Information about a trace point.
7106 class ScopedTrace; // Implements scoped trace.
7107 class TestInfoImpl; // Opaque implementation of TestInfo
7108 class UnitTestImpl; // Opaque implementation of UnitTest
7110 // How many times InitGoogleTest() has been called.
7111 GTEST_API_ extern int g_init_gtest_count;
7113 // The text used in failure messages to indicate the start of the
7115 GTEST_API_ extern const char kStackTraceMarker[];
7117 // Two overloaded helpers for checking at compile time whether an
7118 // expression is a null pointer literal (i.e. NULL or any 0-valued
7119 // compile-time integral constant). Their return values have
7120 // different sizes, so we can use sizeof() to test which version is
7121 // picked by the compiler. These helpers have no implementations, as
7122 // we only need their signatures.
7124 // Given IsNullLiteralHelper(x), the compiler will pick the first
7125 // version if x can be implicitly converted to Secret*, and pick the
7126 // second version otherwise. Since Secret is a secret and incomplete
7127 // type, the only expression a user can write that has type Secret* is
7128 // a null pointer literal. Therefore, we know that x is a null
7129 // pointer literal if and only if the first version is picked by the
7131 char IsNullLiteralHelper(Secret* p);
7132 char (&IsNullLiteralHelper(...))[2]; // NOLINT
7134 // A compile-time bool constant that is true if and only if x is a
7135 // null pointer literal (i.e. NULL or any 0-valued compile-time
7136 // integral constant).
7137 #ifdef GTEST_ELLIPSIS_NEEDS_POD_
7138 // We lose support for NULL detection where the compiler doesn't like
7139 // passing non-POD classes through ellipsis (...).
7140 # define GTEST_IS_NULL_LITERAL_(x) false
7142 # define GTEST_IS_NULL_LITERAL_(x) \
7143 (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
7144 #endif // GTEST_ELLIPSIS_NEEDS_POD_
7146 // Appends the user-supplied message to the Google-Test-generated message.
7147 GTEST_API_ std::string AppendUserMessage(
7148 const std::string& gtest_msg, const Message& user_msg);
7150 #if GTEST_HAS_EXCEPTIONS
7152 // This exception is thrown by (and only by) a failed Google Test
7153 // assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
7154 // are enabled). We derive it from std::runtime_error, which is for
7155 // errors presumably detectable only at run time. Since
7156 // std::runtime_error inherits from std::exception, many testing
7157 // frameworks know how to extract and print the message inside it.
7160 # pragma warning(push) // Saves the current warning state.
7161 # pragma warning(disable:4275) // Temporarily disables warning 4275.
7164 class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
7166 explicit GoogleTestFailureException(const TestPartResult& failure);
7170 # pragma warning(pop) // Restores the warning state.
7173 #endif // GTEST_HAS_EXCEPTIONS
7175 // A helper class for creating scoped traces in user programs.
7176 class GTEST_API_ ScopedTrace {
7178 // The c'tor pushes the given source file location and message onto
7179 // a trace stack maintained by Google Test.
7180 ScopedTrace(const char* file, int line, const Message& message);
7182 // The d'tor pops the info pushed by the c'tor.
7184 // Note that the d'tor is not virtual in order to be efficient.
7185 // Don't inherit from ScopedTrace!
7189 GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
7190 } GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its
7191 // c'tor and d'tor. Therefore it doesn't
7192 // need to be used otherwise.
7194 // Constructs and returns the message for an equality assertion
7195 // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
7197 // The first four parameters are the expressions used in the assertion
7198 // and their values, as strings. For example, for ASSERT_EQ(foo, bar)
7199 // where foo is 5 and bar is 6, we have:
7201 // expected_expression: "foo"
7202 // actual_expression: "bar"
7203 // expected_value: "5"
7204 // actual_value: "6"
7206 // The ignoring_case parameter is true iff the assertion is a
7207 // *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
7208 // be inserted into the message.
7209 GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
7210 const char* actual_expression,
7211 const std::string& expected_value,
7212 const std::string& actual_value,
7213 bool ignoring_case);
7215 // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
7216 GTEST_API_ std::string GetBoolAssertionFailureMessage(
7217 const AssertionResult& assertion_result,
7218 const char* expression_text,
7219 const char* actual_predicate_value,
7220 const char* expected_predicate_value);
7222 // This template class represents an IEEE floating-point number
7223 // (either single-precision or double-precision, depending on the
7224 // template parameters).
7226 // The purpose of this class is to do more sophisticated number
7227 // comparison. (Due to round-off error, etc, it's very unlikely that
7228 // two floating-points will be equal exactly. Hence a naive
7229 // comparison by the == operation often doesn't work.)
7231 // Format of IEEE floating-point:
7233 // The most-significant bit being the leftmost, an IEEE
7234 // floating-point looks like
7236 // sign_bit exponent_bits fraction_bits
7238 // Here, sign_bit is a single bit that designates the sign of the
7241 // For float, there are 8 exponent bits and 23 fraction bits.
7243 // For double, there are 11 exponent bits and 52 fraction bits.
7245 // More details can be found at
7246 // http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
7248 // Template parameter:
7250 // RawType: the raw floating-point type (either float or double)
7251 template <typename RawType>
7252 class FloatingPoint {
7254 // Defines the unsigned integer type that has the same size as the
7255 // floating point number.
7256 typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
7260 // # of bits in a number.
7261 static const size_t kBitCount = 8*sizeof(RawType);
7263 // # of fraction bits in a number.
7264 static const size_t kFractionBitCount =
7265 std::numeric_limits<RawType>::digits - 1;
7267 // # of exponent bits in a number.
7268 static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
7270 // The mask for the sign bit.
7271 static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
7273 // The mask for the fraction bits.
7274 static const Bits kFractionBitMask =
7275 ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
7277 // The mask for the exponent bits.
7278 static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
7280 // How many ULP's (Units in the Last Place) we want to tolerate when
7281 // comparing two numbers. The larger the value, the more error we
7282 // allow. A 0 value means that two numbers must be exactly the same
7283 // to be considered equal.
7285 // The maximum error of a single floating-point operation is 0.5
7286 // units in the last place. On Intel CPU's, all floating-point
7287 // calculations are done with 80-bit precision, while double has 64
7288 // bits. Therefore, 4 should be enough for ordinary use.
7290 // See the following article for more details on ULP:
7291 // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
7292 static const size_t kMaxUlps = 4;
7294 // Constructs a FloatingPoint from a raw floating-point number.
7296 // On an Intel CPU, passing a non-normalized NAN (Not a Number)
7297 // around may change its bits, although the new value is guaranteed
7298 // to be also a NAN. Therefore, don't expect this constructor to
7299 // preserve the bits in x when x is a NAN.
7300 explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
7304 // Reinterprets a bit pattern as a floating-point number.
7306 // This function is needed to test the AlmostEquals() method.
7307 static RawType ReinterpretBits(const Bits bits) {
7308 FloatingPoint fp(0);
7310 return fp.u_.value_;
7313 // Returns the floating-point number that represent positive infinity.
7314 static RawType Infinity() {
7315 return ReinterpretBits(kExponentBitMask);
7318 // Non-static methods
7320 // Returns the bits that represents this number.
7321 const Bits &bits() const { return u_.bits_; }
7323 // Returns the exponent bits of this number.
7324 Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
7326 // Returns the fraction bits of this number.
7327 Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
7329 // Returns the sign bit of this number.
7330 Bits sign_bit() const { return kSignBitMask & u_.bits_; }
7332 // Returns true iff this is NAN (not a number).
7333 bool is_nan() const {
7334 // It's a NAN if the exponent bits are all ones and the fraction
7335 // bits are not entirely zeros.
7336 return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
7339 // Returns true iff this number is at most kMaxUlps ULP's away from
7340 // rhs. In particular, this function:
7342 // - returns false if either number is (or both are) NAN.
7343 // - treats really large numbers as almost equal to infinity.
7344 // - thinks +0.0 and -0.0 are 0 DLP's apart.
7345 bool AlmostEquals(const FloatingPoint& rhs) const {
7346 // The IEEE standard says that any comparison operation involving
7347 // a NAN must return false.
7348 if (is_nan() || rhs.is_nan()) return false;
7350 return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
7355 // The data type used to store the actual floating-point number.
7356 union FloatingPointUnion {
7357 RawType value_; // The raw floating-point number.
7358 Bits bits_; // The bits that represent the number.
7361 // Converts an integer from the sign-and-magnitude representation to
7362 // the biased representation. More precisely, let N be 2 to the
7363 // power of (kBitCount - 1), an integer x is represented by the
7364 // unsigned number x + N.
7368 // -N + 1 (the most negative number representable using
7369 // sign-and-magnitude) is represented by 1;
7370 // 0 is represented by N; and
7371 // N - 1 (the biggest number representable using
7372 // sign-and-magnitude) is represented by 2N - 1.
7374 // Read http://en.wikipedia.org/wiki/Signed_number_representations
7375 // for more details on signed number representations.
7376 static Bits SignAndMagnitudeToBiased(const Bits &sam) {
7377 if (kSignBitMask & sam) {
7378 // sam represents a negative number.
7381 // sam represents a positive number.
7382 return kSignBitMask | sam;
7386 // Given two numbers in the sign-and-magnitude representation,
7387 // returns the distance between them as an unsigned number.
7388 static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
7390 const Bits biased1 = SignAndMagnitudeToBiased(sam1);
7391 const Bits biased2 = SignAndMagnitudeToBiased(sam2);
7392 return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
7395 FloatingPointUnion u_;
7398 // Typedefs the instances of the FloatingPoint template class that we
7400 typedef FloatingPoint<float> Float;
7401 typedef FloatingPoint<double> Double;
7403 // In order to catch the mistake of putting tests that use different
7404 // test fixture classes in the same test case, we need to assign
7405 // unique IDs to fixture classes and compare them. The TypeId type is
7406 // used to hold such IDs. The user should treat TypeId as an opaque
7407 // type: the only operation allowed on TypeId values is to compare
7408 // them for equality using the == operator.
7409 typedef const void* TypeId;
7411 template <typename T>
7412 class TypeIdHelper {
7414 // dummy_ must not have a const type. Otherwise an overly eager
7415 // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
7416 // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
7420 template <typename T>
7421 bool TypeIdHelper<T>::dummy_ = false;
7423 // GetTypeId<T>() returns the ID of type T. Different values will be
7424 // returned for different types. Calling the function twice with the
7425 // same type argument is guaranteed to return the same ID.
7426 template <typename T>
7427 TypeId GetTypeId() {
7428 // The compiler is required to allocate a different
7429 // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
7430 // the template. Therefore, the address of dummy_ is guaranteed to
7432 return &(TypeIdHelper<T>::dummy_);
7435 // Returns the type ID of ::testing::Test. Always call this instead
7436 // of GetTypeId< ::testing::Test>() to get the type ID of
7437 // ::testing::Test, as the latter may give the wrong result due to a
7438 // suspected linker bug when compiling Google Test as a Mac OS X
7440 GTEST_API_ TypeId GetTestTypeId();
7442 // Defines the abstract factory interface that creates instances
7443 // of a Test object.
7444 class TestFactoryBase {
7446 virtual ~TestFactoryBase() {}
7448 // Creates a test instance to run. The instance is both created and destroyed
7449 // within TestInfoImpl::Run()
7450 virtual Test* CreateTest() = 0;
7453 TestFactoryBase() {}
7456 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
7459 // This class provides implementation of TeastFactoryBase interface.
7460 // It is used in TEST and TEST_F macros.
7461 template <class TestClass>
7462 class TestFactoryImpl : public TestFactoryBase {
7464 virtual Test* CreateTest() { return new TestClass; }
7467 #if GTEST_OS_WINDOWS
7469 // Predicate-formatters for implementing the HRESULT checking macros
7470 // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
7471 // We pass a long instead of HRESULT to avoid causing an
7472 // include dependency for the HRESULT type.
7473 GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
7475 GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
7478 #endif // GTEST_OS_WINDOWS
7480 // Types of SetUpTestCase() and TearDownTestCase() functions.
7481 typedef void (*SetUpTestCaseFunc)();
7482 typedef void (*TearDownTestCaseFunc)();
7484 // Creates a new TestInfo object and registers it with Google Test;
7485 // returns the created object.
7489 // test_case_name: name of the test case
7490 // name: name of the test
7491 // type_param the name of the test's type parameter, or NULL if
7492 // this is not a typed or a type-parameterized test.
7493 // value_param text representation of the test's value parameter,
7494 // or NULL if this is not a type-parameterized test.
7495 // fixture_class_id: ID of the test fixture class
7496 // set_up_tc: pointer to the function that sets up the test case
7497 // tear_down_tc: pointer to the function that tears down the test case
7498 // factory: pointer to the factory that creates a test object.
7499 // The newly created TestInfo instance will assume
7500 // ownership of the factory object.
7501 GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
7502 const char* test_case_name,
7504 const char* type_param,
7505 const char* value_param,
7506 TypeId fixture_class_id,
7507 SetUpTestCaseFunc set_up_tc,
7508 TearDownTestCaseFunc tear_down_tc,
7509 TestFactoryBase* factory);
7511 // If *pstr starts with the given prefix, modifies *pstr to be right
7512 // past the prefix and returns true; otherwise leaves *pstr unchanged
7513 // and returns false. None of pstr, *pstr, and prefix can be NULL.
7514 GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
7516 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7518 // State of the definition of a type-parameterized test case.
7519 class GTEST_API_ TypedTestCasePState {
7521 TypedTestCasePState() : registered_(false) {}
7523 // Adds the given test name to defined_test_names_ and return true
7524 // if the test case hasn't been registered; otherwise aborts the
7526 bool AddTestName(const char* file, int line, const char* case_name,
7527 const char* test_name) {
7529 fprintf(stderr, "%s Test %s must be defined before "
7530 "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
7531 FormatFileLocation(file, line).c_str(), test_name, case_name);
7535 defined_test_names_.insert(test_name);
7539 // Verifies that registered_tests match the test names in
7540 // defined_test_names_; returns registered_tests if successful, or
7541 // aborts the program otherwise.
7542 const char* VerifyRegisteredTestNames(
7543 const char* file, int line, const char* registered_tests);
7547 ::std::set<const char*> defined_test_names_;
7550 // Skips to the first non-space char after the first comma in 'str';
7551 // returns NULL if no comma is found in 'str'.
7552 inline const char* SkipComma(const char* str) {
7553 const char* comma = strchr(str, ',');
7554 if (comma == NULL) {
7557 while (IsSpace(*(++comma))) {}
7561 // Returns the prefix of 'str' before the first comma in it; returns
7562 // the entire string if it contains no comma.
7563 inline std::string GetPrefixUntilComma(const char* str) {
7564 const char* comma = strchr(str, ',');
7565 return comma == NULL ? str : std::string(str, comma);
7568 // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
7569 // registers a list of type-parameterized tests with Google Test. The
7570 // return value is insignificant - we just need to return something
7571 // such that we can call this function in a namespace scope.
7573 // Implementation note: The GTEST_TEMPLATE_ macro declares a template
7574 // template parameter. It's defined in gtest-type-util.h.
7575 template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
7576 class TypeParameterizedTest {
7578 // 'index' is the index of the test in the type list 'Types'
7579 // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
7580 // Types). Valid values for 'index' are [0, N - 1] where N is the
7582 static bool Register(const char* prefix, const char* case_name,
7583 const char* test_names, int index) {
7584 typedef typename Types::Head Type;
7585 typedef Fixture<Type> FixtureClass;
7586 typedef typename GTEST_BIND_(TestSel, Type) TestClass;
7588 // First, registers the first type-parameterized test in the type
7590 MakeAndRegisterTestInfo(
7591 (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
7592 + StreamableToString(index)).c_str(),
7593 GetPrefixUntilComma(test_names).c_str(),
7594 GetTypeName<Type>().c_str(),
7595 NULL, // No value parameter.
7596 GetTypeId<FixtureClass>(),
7597 TestClass::SetUpTestCase,
7598 TestClass::TearDownTestCase,
7599 new TestFactoryImpl<TestClass>);
7601 // Next, recurses (at compile time) with the tail of the type list.
7602 return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
7603 ::Register(prefix, case_name, test_names, index + 1);
7607 // The base case for the compile time recursion.
7608 template <GTEST_TEMPLATE_ Fixture, class TestSel>
7609 class TypeParameterizedTest<Fixture, TestSel, Types0> {
7611 static bool Register(const char* /*prefix*/, const char* /*case_name*/,
7612 const char* /*test_names*/, int /*index*/) {
7617 // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
7618 // registers *all combinations* of 'Tests' and 'Types' with Google
7619 // Test. The return value is insignificant - we just need to return
7620 // something such that we can call this function in a namespace scope.
7621 template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
7622 class TypeParameterizedTestCase {
7624 static bool Register(const char* prefix, const char* case_name,
7625 const char* test_names) {
7626 typedef typename Tests::Head Head;
7628 // First, register the first test in 'Test' for each type in 'Types'.
7629 TypeParameterizedTest<Fixture, Head, Types>::Register(
7630 prefix, case_name, test_names, 0);
7632 // Next, recurses (at compile time) with the tail of the test list.
7633 return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
7634 ::Register(prefix, case_name, SkipComma(test_names));
7638 // The base case for the compile time recursion.
7639 template <GTEST_TEMPLATE_ Fixture, typename Types>
7640 class TypeParameterizedTestCase<Fixture, Templates0, Types> {
7642 static bool Register(const char* /*prefix*/, const char* /*case_name*/,
7643 const char* /*test_names*/) {
7648 #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7650 // Returns the current OS stack trace as an std::string.
7652 // The maximum number of stack frames to be included is specified by
7653 // the gtest_stack_trace_depth flag. The skip_count parameter
7654 // specifies the number of top frames to be skipped, which doesn't
7655 // count against the number of frames to be included.
7657 // For example, if Foo() calls Bar(), which in turn calls
7658 // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
7659 // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
7660 GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
7661 UnitTest* unit_test, int skip_count);
7663 // Helpers for suppressing warnings on unreachable code or constant
7666 // Always returns true.
7667 GTEST_API_ bool AlwaysTrue();
7669 // Always returns false.
7670 inline bool AlwaysFalse() { return !AlwaysTrue(); }
7672 // Helper for suppressing false warning from Clang on a const char*
7673 // variable declared in a conditional expression always being NULL in
7675 struct GTEST_API_ ConstCharPtr {
7676 ConstCharPtr(const char* str) : value(str) {}
7677 operator bool() const { return true; }
7681 // A simple Linear Congruential Generator for generating random
7682 // numbers with a uniform distribution. Unlike rand() and srand(), it
7683 // doesn't use global state (and therefore can't interfere with user
7684 // code). Unlike rand_r(), it's portable. An LCG isn't very random,
7685 // but it's good enough for our purposes.
7686 class GTEST_API_ Random {
7688 static const UInt32 kMaxRange = 1u << 31;
7690 explicit Random(UInt32 seed) : state_(seed) {}
7692 void Reseed(UInt32 seed) { state_ = seed; }
7694 // Generates a random number from [0, range). Crashes if 'range' is
7695 // 0 or greater than kMaxRange.
7696 UInt32 Generate(UInt32 range);
7700 GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
7703 // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
7704 // compiler error iff T1 and T2 are different types.
7705 template <typename T1, typename T2>
7706 struct CompileAssertTypesEqual;
7708 template <typename T>
7709 struct CompileAssertTypesEqual<T, T> {
7712 // Removes the reference from a type if it is a reference type,
7713 // otherwise leaves it unchanged. This is the same as
7714 // tr1::remove_reference, which is not widely available yet.
7715 template <typename T>
7716 struct RemoveReference { typedef T type; }; // NOLINT
7717 template <typename T>
7718 struct RemoveReference<T&> { typedef T type; }; // NOLINT
7720 // A handy wrapper around RemoveReference that works when the argument
7721 // T depends on template parameters.
7722 #define GTEST_REMOVE_REFERENCE_(T) \
7723 typename ::testing::internal::RemoveReference<T>::type
7725 // Removes const from a type if it is a const type, otherwise leaves
7726 // it unchanged. This is the same as tr1::remove_const, which is not
7727 // widely available yet.
7728 template <typename T>
7729 struct RemoveConst { typedef T type; }; // NOLINT
7730 template <typename T>
7731 struct RemoveConst<const T> { typedef T type; }; // NOLINT
7733 // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
7734 // definition to fail to remove the const in 'const int[3]' and 'const
7735 // char[3][4]'. The following specialization works around the bug.
7736 template <typename T, size_t N>
7737 struct RemoveConst<const T[N]> {
7738 typedef typename RemoveConst<T>::type type[N];
7741 #if defined(_MSC_VER) && _MSC_VER < 1400
7742 // This is the only specialization that allows VC++ 7.1 to remove const in
7743 // 'const int[3] and 'const int[3][4]'. However, it causes trouble with GCC
7744 // and thus needs to be conditionally compiled.
7745 template <typename T, size_t N>
7746 struct RemoveConst<T[N]> {
7747 typedef typename RemoveConst<T>::type type[N];
7751 // A handy wrapper around RemoveConst that works when the argument
7752 // T depends on template parameters.
7753 #define GTEST_REMOVE_CONST_(T) \
7754 typename ::testing::internal::RemoveConst<T>::type
7756 // Turns const U&, U&, const U, and U all into U.
7757 #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
7758 GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
7760 // Adds reference to a type if it is not a reference type,
7761 // otherwise leaves it unchanged. This is the same as
7762 // tr1::add_reference, which is not widely available yet.
7763 template <typename T>
7764 struct AddReference { typedef T& type; }; // NOLINT
7765 template <typename T>
7766 struct AddReference<T&> { typedef T& type; }; // NOLINT
7768 // A handy wrapper around AddReference that works when the argument T
7769 // depends on template parameters.
7770 #define GTEST_ADD_REFERENCE_(T) \
7771 typename ::testing::internal::AddReference<T>::type
7773 // Adds a reference to const on top of T as necessary. For example,
7776 // char ==> const char&
7777 // const char ==> const char&
7778 // char& ==> const char&
7779 // const char& ==> const char&
7781 // The argument T must depend on some template parameters.
7782 #define GTEST_REFERENCE_TO_CONST_(T) \
7783 GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
7785 // ImplicitlyConvertible<From, To>::value is a compile-time bool
7786 // constant that's true iff type From can be implicitly converted to
7788 template <typename From, typename To>
7789 class ImplicitlyConvertible {
7791 // We need the following helper functions only for their types.
7792 // They have no implementations.
7794 // MakeFrom() is an expression whose type is From. We cannot simply
7795 // use From(), as the type From may not have a public default
7797 static From MakeFrom();
7799 // These two functions are overloaded. Given an expression
7800 // Helper(x), the compiler will pick the first version if x can be
7801 // implicitly converted to type To; otherwise it will pick the
7804 // The first version returns a value of size 1, and the second
7805 // version returns a value of size 2. Therefore, by checking the
7806 // size of Helper(x), which can be done at compile time, we can tell
7807 // which version of Helper() is used, and hence whether x can be
7808 // implicitly converted to type To.
7809 static char Helper(To);
7810 static char (&Helper(...))[2]; // NOLINT
7812 // We have to put the 'public' section after the 'private' section,
7813 // or MSVC refuses to compile the code.
7815 // MSVC warns about implicitly converting from double to int for
7816 // possible loss of data, so we need to temporarily disable the
7819 # pragma warning(push) // Saves the current warning state.
7820 # pragma warning(disable:4244) // Temporarily disables warning 4244.
7822 static const bool value =
7823 sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
7824 # pragma warning(pop) // Restores the warning state.
7825 #elif defined(__BORLANDC__)
7826 // C++Builder cannot use member overload resolution during template
7827 // instantiation. The simplest workaround is to use its C++0x type traits
7828 // functions (C++Builder 2009 and above only).
7829 static const bool value = __is_convertible(From, To);
7831 static const bool value =
7832 sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
7835 template <typename From, typename To>
7836 const bool ImplicitlyConvertible<From, To>::value;
7838 // IsAProtocolMessage<T>::value is a compile-time bool constant that's
7839 // true iff T is type ProtocolMessage, proto2::Message, or a subclass
7841 template <typename T>
7842 struct IsAProtocolMessage
7843 : public bool_constant<
7844 ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
7845 ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
7848 // When the compiler sees expression IsContainerTest<C>(0), if C is an
7849 // STL-style container class, the first overload of IsContainerTest
7850 // will be viable (since both C::iterator* and C::const_iterator* are
7851 // valid types and NULL can be implicitly converted to them). It will
7852 // be picked over the second overload as 'int' is a perfect match for
7853 // the type of argument 0. If C::iterator or C::const_iterator is not
7854 // a valid type, the first overload is not viable, and the second
7855 // overload will be picked. Therefore, we can determine whether C is
7856 // a container class by checking the type of IsContainerTest<C>(0).
7857 // The value of the expression is insignificant.
7859 // Note that we look for both C::iterator and C::const_iterator. The
7860 // reason is that C++ injects the name of a class as a member of the
7861 // class itself (e.g. you can refer to class iterator as either
7862 // 'iterator' or 'iterator::iterator'). If we look for C::iterator
7863 // only, for example, we would mistakenly think that a class named
7864 // iterator is an STL container.
7866 // Also note that the simpler approach of overloading
7867 // IsContainerTest(typename C::const_iterator*) and
7868 // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
7869 typedef int IsContainer;
7871 IsContainer IsContainerTest(int /* dummy */,
7872 typename C::iterator* /* it */ = NULL,
7873 typename C::const_iterator* /* const_it */ = NULL) {
7877 typedef char IsNotContainer;
7879 IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
7881 // EnableIf<condition>::type is void when 'Cond' is true, and
7882 // undefined when 'Cond' is false. To use SFINAE to make a function
7883 // overload only apply when a particular expression is true, add
7884 // "typename EnableIf<expression>::type* = 0" as the last parameter.
7885 template<bool> struct EnableIf;
7886 template<> struct EnableIf<true> { typedef void type; }; // NOLINT
7888 // Utilities for native arrays.
7890 // ArrayEq() compares two k-dimensional native arrays using the
7891 // elements' operator==, where k can be any integer >= 0. When k is
7892 // 0, ArrayEq() degenerates into comparing a single pair of values.
7894 template <typename T, typename U>
7895 bool ArrayEq(const T* lhs, size_t size, const U* rhs);
7897 // This generic version is used when k is 0.
7898 template <typename T, typename U>
7899 inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
7901 // This overload is used when k >= 1.
7902 template <typename T, typename U, size_t N>
7903 inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
7904 return internal::ArrayEq(lhs, N, rhs);
7907 // This helper reduces code bloat. If we instead put its logic inside
7908 // the previous ArrayEq() function, arrays with different sizes would
7909 // lead to different copies of the template code.
7910 template <typename T, typename U>
7911 bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
7912 for (size_t i = 0; i != size; i++) {
7913 if (!internal::ArrayEq(lhs[i], rhs[i]))
7919 // Finds the first element in the iterator range [begin, end) that
7920 // equals elem. Element may be a native array type itself.
7921 template <typename Iter, typename Element>
7922 Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
7923 for (Iter it = begin; it != end; ++it) {
7924 if (internal::ArrayEq(*it, elem))
7930 // CopyArray() copies a k-dimensional native array using the elements'
7931 // operator=, where k can be any integer >= 0. When k is 0,
7932 // CopyArray() degenerates into copying a single value.
7934 template <typename T, typename U>
7935 void CopyArray(const T* from, size_t size, U* to);
7937 // This generic version is used when k is 0.
7938 template <typename T, typename U>
7939 inline void CopyArray(const T& from, U* to) { *to = from; }
7941 // This overload is used when k >= 1.
7942 template <typename T, typename U, size_t N>
7943 inline void CopyArray(const T(&from)[N], U(*to)[N]) {
7944 internal::CopyArray(from, N, *to);
7947 // This helper reduces code bloat. If we instead put its logic inside
7948 // the previous CopyArray() function, arrays with different sizes
7949 // would lead to different copies of the template code.
7950 template <typename T, typename U>
7951 void CopyArray(const T* from, size_t size, U* to) {
7952 for (size_t i = 0; i != size; i++) {
7953 internal::CopyArray(from[i], to + i);
7957 // The relation between an NativeArray object (see below) and the
7958 // native array it represents.
7959 enum RelationToSource {
7960 kReference, // The NativeArray references the native array.
7961 kCopy // The NativeArray makes a copy of the native array and
7965 // Adapts a native array to a read-only STL-style container. Instead
7966 // of the complete STL container concept, this adaptor only implements
7967 // members useful for Google Mock's container matchers. New members
7968 // should be added as needed. To simplify the implementation, we only
7969 // support Element being a raw type (i.e. having no top-level const or
7970 // reference modifier). It's the client's responsibility to satisfy
7971 // this requirement. Element can be an array type itself (hence
7972 // multi-dimensional arrays are supported).
7973 template <typename Element>
7976 // STL-style container typedefs.
7977 typedef Element value_type;
7978 typedef Element* iterator;
7979 typedef const Element* const_iterator;
7981 // Constructs from a native array.
7982 NativeArray(const Element* array, size_t count, RelationToSource relation) {
7983 Init(array, count, relation);
7986 // Copy constructor.
7987 NativeArray(const NativeArray& rhs) {
7988 Init(rhs.array_, rhs.size_, rhs.relation_to_source_);
7992 // Ensures that the user doesn't instantiate NativeArray with a
7993 // const or reference type.
7994 static_cast<void>(StaticAssertTypeEqHelper<Element,
7995 GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
7996 if (relation_to_source_ == kCopy)
8000 // STL-style container methods.
8001 size_t size() const { return size_; }
8002 const_iterator begin() const { return array_; }
8003 const_iterator end() const { return array_ + size_; }
8004 bool operator==(const NativeArray& rhs) const {
8005 return size() == rhs.size() &&
8006 ArrayEq(begin(), size(), rhs.begin());
8010 // Initializes this object; makes a copy of the input array if
8011 // 'relation' is kCopy.
8012 void Init(const Element* array, size_t a_size, RelationToSource relation) {
8013 if (relation == kReference) {
8016 Element* const copy = new Element[a_size];
8017 CopyArray(array, a_size, copy);
8021 relation_to_source_ = relation;
8024 const Element* array_;
8026 RelationToSource relation_to_source_;
8028 GTEST_DISALLOW_ASSIGN_(NativeArray);
8031 } // namespace internal
8032 } // namespace testing
8034 #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
8035 ::testing::internal::AssertHelper(result_type, file, line, message) \
8036 = ::testing::Message()
8038 #define GTEST_MESSAGE_(message, result_type) \
8039 GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
8041 #define GTEST_FATAL_FAILURE_(message) \
8042 return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
8044 #define GTEST_NONFATAL_FAILURE_(message) \
8045 GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
8047 #define GTEST_SUCCESS_(message) \
8048 GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
8050 // Suppresses MSVC warnings 4072 (unreachable code) for the code following
8051 // statement if it returns or throws (or doesn't return or throw in some
8053 #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
8054 if (::testing::internal::AlwaysTrue()) { statement; }
8056 #define GTEST_TEST_THROW_(statement, expected_exception, fail) \
8057 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8058 if (::testing::internal::ConstCharPtr gtest_msg = "") { \
8059 bool gtest_caught_expected = false; \
8061 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8063 catch (expected_exception const&) { \
8064 gtest_caught_expected = true; \
8068 "Expected: " #statement " throws an exception of type " \
8069 #expected_exception ".\n Actual: it throws a different type."; \
8070 goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
8072 if (!gtest_caught_expected) { \
8074 "Expected: " #statement " throws an exception of type " \
8075 #expected_exception ".\n Actual: it throws nothing."; \
8076 goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
8079 GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
8080 fail(gtest_msg.value)
8082 #define GTEST_TEST_NO_THROW_(statement, fail) \
8083 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8084 if (::testing::internal::AlwaysTrue()) { \
8086 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8089 goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
8092 GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
8093 fail("Expected: " #statement " doesn't throw an exception.\n" \
8094 " Actual: it throws.")
8096 #define GTEST_TEST_ANY_THROW_(statement, fail) \
8097 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8098 if (::testing::internal::AlwaysTrue()) { \
8099 bool gtest_caught_any = false; \
8101 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8104 gtest_caught_any = true; \
8106 if (!gtest_caught_any) { \
8107 goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
8110 GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
8111 fail("Expected: " #statement " throws an exception.\n" \
8112 " Actual: it doesn't.")
8115 // Implements Boolean test assertions such as EXPECT_TRUE. expression can be
8116 // either a boolean expression or an AssertionResult. text is a textual
8117 // represenation of expression as it was passed into the EXPECT_TRUE.
8118 #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
8119 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8120 if (const ::testing::AssertionResult gtest_ar_ = \
8121 ::testing::AssertionResult(expression)) \
8124 fail(::testing::internal::GetBoolAssertionFailureMessage(\
8125 gtest_ar_, text, #actual, #expected).c_str())
8127 #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
8128 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8129 if (::testing::internal::AlwaysTrue()) { \
8130 ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
8131 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8132 if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
8133 goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
8136 GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
8137 fail("Expected: " #statement " doesn't generate new fatal " \
8138 "failures in the current thread.\n" \
8139 " Actual: it does.")
8141 // Expands to the name of the class that implements the given test.
8142 #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
8143 test_case_name##_##test_name##_Test
8145 // Helper macro for defining tests.
8146 #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
8147 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
8149 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
8151 virtual void TestBody();\
8152 static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
8153 GTEST_DISALLOW_COPY_AND_ASSIGN_(\
8154 GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
8157 ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
8159 ::testing::internal::MakeAndRegisterTestInfo(\
8160 #test_case_name, #test_name, NULL, NULL, \
8162 parent_class::SetUpTestCase, \
8163 parent_class::TearDownTestCase, \
8164 new ::testing::internal::TestFactoryImpl<\
8165 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
8166 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
8168 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
8169 // Copyright 2005, Google Inc.
8170 // All rights reserved.
8172 // Redistribution and use in source and binary forms, with or without
8173 // modification, are permitted provided that the following conditions are
8176 // * Redistributions of source code must retain the above copyright
8177 // notice, this list of conditions and the following disclaimer.
8178 // * Redistributions in binary form must reproduce the above
8179 // copyright notice, this list of conditions and the following disclaimer
8180 // in the documentation and/or other materials provided with the
8182 // * Neither the name of Google Inc. nor the names of its
8183 // contributors may be used to endorse or promote products derived from
8184 // this software without specific prior written permission.
8186 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8187 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8188 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8189 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8190 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8191 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8192 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8193 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8194 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8195 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8196 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8198 // Author: wan@google.com (Zhanyong Wan)
8200 // The Google C++ Testing Framework (Google Test)
8202 // This header file defines the public API for death tests. It is
8203 // #included by gtest.h so a user doesn't need to include this
8206 #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
8207 #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
8209 // Copyright 2005, Google Inc.
8210 // All rights reserved.
8212 // Redistribution and use in source and binary forms, with or without
8213 // modification, are permitted provided that the following conditions are
8216 // * Redistributions of source code must retain the above copyright
8217 // notice, this list of conditions and the following disclaimer.
8218 // * Redistributions in binary form must reproduce the above
8219 // copyright notice, this list of conditions and the following disclaimer
8220 // in the documentation and/or other materials provided with the
8222 // * Neither the name of Google Inc. nor the names of its
8223 // contributors may be used to endorse or promote products derived from
8224 // this software without specific prior written permission.
8226 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8227 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8228 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8229 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8230 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8231 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8232 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8233 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8234 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8235 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8236 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8238 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
8240 // The Google C++ Testing Framework (Google Test)
8242 // This header file defines internal utilities needed for implementing
8243 // death tests. They are subject to change without notice.
8245 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
8246 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
8252 namespace internal {
8254 GTEST_DECLARE_string_(internal_run_death_test);
8256 // Names of the flags (needed for parsing Google Test flags).
8257 const char kDeathTestStyleFlag[] = "death_test_style";
8258 const char kDeathTestUseFork[] = "death_test_use_fork";
8259 const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
8261 #if GTEST_HAS_DEATH_TEST
8263 // DeathTest is a class that hides much of the complexity of the
8264 // GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
8265 // returns a concrete class that depends on the prevailing death test
8266 // style, as defined by the --gtest_death_test_style and/or
8267 // --gtest_internal_run_death_test flags.
8269 // In describing the results of death tests, these terms are used with
8270 // the corresponding definitions:
8272 // exit status: The integer exit information in the format specified
8274 // exit code: The integer code passed to exit(3), _exit(2), or
8275 // returned from main()
8276 class GTEST_API_ DeathTest {
8278 // Create returns false if there was an error determining the
8279 // appropriate action to take for the current death test; for example,
8280 // if the gtest_death_test_style flag is set to an invalid value.
8281 // The LastMessage method will return a more detailed message in that
8282 // case. Otherwise, the DeathTest pointer pointed to by the "test"
8283 // argument is set. If the death test should be skipped, the pointer
8284 // is set to NULL; otherwise, it is set to the address of a new concrete
8285 // DeathTest object that controls the execution of the current test.
8286 static bool Create(const char* statement, const RE* regex,
8287 const char* file, int line, DeathTest** test);
8289 virtual ~DeathTest() { }
8291 // A helper class that aborts a death test when it's deleted.
8292 class ReturnSentinel {
8294 explicit ReturnSentinel(DeathTest* test) : test_(test) { }
8295 ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
8297 DeathTest* const test_;
8298 GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
8299 } GTEST_ATTRIBUTE_UNUSED_;
8301 // An enumeration of possible roles that may be taken when a death
8302 // test is encountered. EXECUTE means that the death test logic should
8303 // be executed immediately. OVERSEE means that the program should prepare
8304 // the appropriate environment for a child process to execute the death
8305 // test, then wait for it to complete.
8306 enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
8308 // An enumeration of the three reasons that a test might be aborted.
8310 TEST_ENCOUNTERED_RETURN_STATEMENT,
8311 TEST_THREW_EXCEPTION,
8315 // Assumes one of the above roles.
8316 virtual TestRole AssumeRole() = 0;
8318 // Waits for the death test to finish and returns its status.
8319 virtual int Wait() = 0;
8321 // Returns true if the death test passed; that is, the test process
8322 // exited during the test, its exit status matches a user-supplied
8323 // predicate, and its stderr output matches a user-supplied regular
8325 // The user-supplied predicate may be a macro expression rather
8326 // than a function pointer or functor, or else Wait and Passed could
8328 virtual bool Passed(bool exit_status_ok) = 0;
8330 // Signals that the death test did not die as expected.
8331 virtual void Abort(AbortReason reason) = 0;
8333 // Returns a human-readable outcome message regarding the outcome of
8334 // the last death test.
8335 static const char* LastMessage();
8337 static void set_last_death_test_message(const std::string& message);
8340 // A string containing a description of the outcome of the last death test.
8341 static std::string last_death_test_message_;
8343 GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
8346 // Factory interface for death tests. May be mocked out for testing.
8347 class DeathTestFactory {
8349 virtual ~DeathTestFactory() { }
8350 virtual bool Create(const char* statement, const RE* regex,
8351 const char* file, int line, DeathTest** test) = 0;
8354 // A concrete DeathTestFactory implementation for normal use.
8355 class DefaultDeathTestFactory : public DeathTestFactory {
8357 virtual bool Create(const char* statement, const RE* regex,
8358 const char* file, int line, DeathTest** test);
8361 // Returns true if exit_status describes a process that was terminated
8362 // by a signal, or exited normally with a nonzero exit code.
8363 GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
8365 // Traps C++ exceptions escaping statement and reports them as test
8366 // failures. Note that trapping SEH exceptions is not implemented here.
8367 # if GTEST_HAS_EXCEPTIONS
8368 # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
8370 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8371 } catch (const ::std::exception& gtest_exception) { \
8374 "\n%s: Caught std::exception-derived exception escaping the " \
8375 "death test statement. Exception message: %s\n", \
8376 ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
8377 gtest_exception.what()); \
8379 death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
8381 death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
8385 # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
8386 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
8390 // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
8391 // ASSERT_EXIT*, and EXPECT_EXIT*.
8392 # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
8393 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8394 if (::testing::internal::AlwaysTrue()) { \
8395 const ::testing::internal::RE& gtest_regex = (regex); \
8396 ::testing::internal::DeathTest* gtest_dt; \
8397 if (!::testing::internal::DeathTest::Create(#statement, >est_regex, \
8398 __FILE__, __LINE__, >est_dt)) { \
8399 goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
8401 if (gtest_dt != NULL) { \
8402 ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
8403 gtest_dt_ptr(gtest_dt); \
8404 switch (gtest_dt->AssumeRole()) { \
8405 case ::testing::internal::DeathTest::OVERSEE_TEST: \
8406 if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
8407 goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
8410 case ::testing::internal::DeathTest::EXECUTE_TEST: { \
8411 ::testing::internal::DeathTest::ReturnSentinel \
8412 gtest_sentinel(gtest_dt); \
8413 GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
8414 gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
8422 GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
8423 fail(::testing::internal::DeathTest::LastMessage())
8424 // The symbol "fail" here expands to something into which a message
8427 // This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
8428 // NDEBUG mode. In this case we need the statements to be executed, the regex is
8429 // ignored, and the macro must accept a streamed message even though the message
8430 // is never printed.
8431 # define GTEST_EXECUTE_STATEMENT_(statement, regex) \
8432 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8433 if (::testing::internal::AlwaysTrue()) { \
8434 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8436 ::testing::Message()
8438 // A class representing the parsed contents of the
8439 // --gtest_internal_run_death_test flag, as it existed when
8440 // RUN_ALL_TESTS was called.
8441 class InternalRunDeathTestFlag {
8443 InternalRunDeathTestFlag(const std::string& a_file,
8447 : file_(a_file), line_(a_line), index_(an_index),
8448 write_fd_(a_write_fd) {}
8450 ~InternalRunDeathTestFlag() {
8452 posix::Close(write_fd_);
8455 const std::string& file() const { return file_; }
8456 int line() const { return line_; }
8457 int index() const { return index_; }
8458 int write_fd() const { return write_fd_; }
8466 GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
8469 // Returns a newly created InternalRunDeathTestFlag object with fields
8470 // initialized from the GTEST_FLAG(internal_run_death_test) flag if
8471 // the flag is specified; otherwise returns NULL.
8472 InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
8474 #else // GTEST_HAS_DEATH_TEST
8476 // This macro is used for implementing macros such as
8477 // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
8478 // death tests are not supported. Those macros must compile on such systems
8479 // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
8480 // systems that support death tests. This allows one to write such a macro
8481 // on a system that does not support death tests and be sure that it will
8482 // compile on a death-test supporting system.
8485 // statement - A statement that a macro such as EXPECT_DEATH would test
8486 // for program termination. This macro has to make sure this
8487 // statement is compiled but not executed, to ensure that
8488 // EXPECT_DEATH_IF_SUPPORTED compiles with a certain
8489 // parameter iff EXPECT_DEATH compiles with it.
8490 // regex - A regex that a macro such as EXPECT_DEATH would use to test
8491 // the output of statement. This parameter has to be
8492 // compiled but not evaluated by this macro, to ensure that
8493 // this macro only accepts expressions that a macro such as
8494 // EXPECT_DEATH would accept.
8495 // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
8496 // and a return statement for ASSERT_DEATH_IF_SUPPORTED.
8497 // This ensures that ASSERT_DEATH_IF_SUPPORTED will not
8498 // compile inside functions where ASSERT_DEATH doesn't
8501 // The branch that has an always false condition is used to ensure that
8502 // statement and regex are compiled (and thus syntactically correct) but
8503 // never executed. The unreachable code macro protects the terminator
8504 // statement from generating an 'unreachable code' warning in case
8505 // statement unconditionally returns or throws. The Message constructor at
8506 // the end allows the syntax of streaming additional messages into the
8507 // macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
8508 # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
8509 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8510 if (::testing::internal::AlwaysTrue()) { \
8511 GTEST_LOG_(WARNING) \
8512 << "Death tests are not supported on this platform.\n" \
8513 << "Statement '" #statement "' cannot be verified."; \
8514 } else if (::testing::internal::AlwaysFalse()) { \
8515 ::testing::internal::RE::PartialMatch(".*", (regex)); \
8516 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8519 ::testing::Message()
8521 #endif // GTEST_HAS_DEATH_TEST
8523 } // namespace internal
8524 } // namespace testing
8526 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
8530 // This flag controls the style of death tests. Valid values are "threadsafe",
8531 // meaning that the death test child process will re-execute the test binary
8532 // from the start, running only a single death test, or "fast",
8533 // meaning that the child process will execute the test logic immediately
8535 GTEST_DECLARE_string_(death_test_style);
8537 #if GTEST_HAS_DEATH_TEST
8539 namespace internal {
8541 // Returns a Boolean value indicating whether the caller is currently
8542 // executing in the context of the death test child process. Tools such as
8543 // Valgrind heap checkers may need this to modify their behavior in death
8544 // tests. IMPORTANT: This is an internal utility. Using it may break the
8545 // implementation of death tests. User code MUST NOT use it.
8546 GTEST_API_ bool InDeathTestChild();
8548 } // namespace internal
8550 // The following macros are useful for writing death tests.
8552 // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
8555 // 1. It generates a warning if there is more than one active
8556 // thread. This is because it's safe to fork() or clone() only
8557 // when there is a single thread.
8559 // 2. The parent process clone()s a sub-process and runs the death
8560 // test in it; the sub-process exits with code 0 at the end of the
8561 // death test, if it hasn't exited already.
8563 // 3. The parent process waits for the sub-process to terminate.
8565 // 4. The parent process checks the exit code and error message of
8570 // ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
8571 // for (int i = 0; i < 5; i++) {
8572 // EXPECT_DEATH(server.ProcessRequest(i),
8573 // "Invalid request .* in ProcessRequest()")
8574 // << "Failed to die on request " << i;
8577 // ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
8579 // bool KilledBySIGHUP(int exit_code) {
8580 // return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
8583 // ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
8585 // On the regular expressions used in death tests:
8587 // On POSIX-compliant systems (*nix), we use the <regex.h> library,
8588 // which uses the POSIX extended regex syntax.
8590 // On other platforms (e.g. Windows), we only support a simple regex
8591 // syntax implemented as part of Google Test. This limited
8592 // implementation should be enough most of the time when writing
8593 // death tests; though it lacks many features you can find in PCRE
8594 // or POSIX extended regex syntax. For example, we don't support
8595 // union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
8596 // repetition count ("x{5,7}"), among others.
8598 // Below is the syntax that we do support. We chose it to be a
8599 // subset of both PCRE and POSIX extended regex, so it's easy to
8600 // learn wherever you come from. In the following: 'A' denotes a
8601 // literal character, period (.), or a single \\ escape sequence;
8602 // 'x' and 'y' denote regular expressions; 'm' and 'n' are for
8605 // c matches any literal character c
8606 // \\d matches any decimal digit
8607 // \\D matches any character that's not a decimal digit
8611 // \\s matches any ASCII whitespace, including \n
8612 // \\S matches any character that's not a whitespace
8615 // \\w matches any letter, _, or decimal digit
8616 // \\W matches any character that \\w doesn't match
8617 // \\c matches any literal character c, which must be a punctuation
8618 // . matches any single character except \n
8619 // A? matches 0 or 1 occurrences of A
8620 // A* matches 0 or many occurrences of A
8621 // A+ matches 1 or many occurrences of A
8622 // ^ matches the beginning of a string (not that of each line)
8623 // $ matches the end of a string (not that of each line)
8624 // xy matches x followed by y
8626 // If you accidentally use PCRE or POSIX extended regex features
8627 // not implemented by us, you will get a run-time failure. In that
8628 // case, please try to rewrite your regular expression within the
8631 // This implementation is *not* meant to be as highly tuned or robust
8632 // as a compiled regex library, but should perform well enough for a
8633 // death test, which already incurs significant overhead by launching
8638 // A "threadsafe" style death test obtains the path to the test
8639 // program from argv[0] and re-executes it in the sub-process. For
8640 // simplicity, the current implementation doesn't search the PATH
8641 // when launching the sub-process. This means that the user must
8642 // invoke the test program via a path that contains at least one
8643 // path separator (e.g. path/to/foo_test and
8644 // /absolute/path/to/bar_test are fine, but foo_test is not). This
8645 // is rarely a problem as people usually don't put the test binary
8646 // directory in PATH.
8648 // TODO(wan@google.com): make thread-safe death tests search the PATH.
8650 // Asserts that a given statement causes the program to exit, with an
8651 // integer exit status that satisfies predicate, and emitting error output
8652 // that matches regex.
8653 # define ASSERT_EXIT(statement, predicate, regex) \
8654 GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
8656 // Like ASSERT_EXIT, but continues on to successive tests in the
8657 // test case, if any:
8658 # define EXPECT_EXIT(statement, predicate, regex) \
8659 GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
8661 // Asserts that a given statement causes the program to exit, either by
8662 // explicitly exiting with a nonzero exit code or being killed by a
8663 // signal, and emitting error output that matches regex.
8664 # define ASSERT_DEATH(statement, regex) \
8665 ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
8667 // Like ASSERT_DEATH, but continues on to successive tests in the
8668 // test case, if any:
8669 # define EXPECT_DEATH(statement, regex) \
8670 EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
8672 // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
8674 // Tests that an exit code describes a normal exit with a given exit code.
8675 class GTEST_API_ ExitedWithCode {
8677 explicit ExitedWithCode(int exit_code);
8678 bool operator()(int exit_status) const;
8680 // No implementation - assignment is unsupported.
8681 void operator=(const ExitedWithCode& other);
8683 const int exit_code_;
8686 # if !GTEST_OS_WINDOWS
8687 // Tests that an exit code describes an exit due to termination by a
8689 class GTEST_API_ KilledBySignal {
8691 explicit KilledBySignal(int signum);
8692 bool operator()(int exit_status) const;
8696 # endif // !GTEST_OS_WINDOWS
8698 // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
8699 // The death testing framework causes this to have interesting semantics,
8700 // since the sideeffects of the call are only visible in opt mode, and not
8703 // In practice, this can be used to test functions that utilize the
8704 // LOG(DFATAL) macro using the following style:
8706 // int DieInDebugOr12(int* sideeffect) {
8707 // if (sideeffect) {
8708 // *sideeffect = 12;
8710 // LOG(DFATAL) << "death";
8714 // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
8715 // int sideeffect = 0;
8716 // // Only asserts in dbg.
8717 // EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
8720 // // opt-mode has sideeffect visible.
8721 // EXPECT_EQ(12, sideeffect);
8723 // // dbg-mode no visible sideeffect.
8724 // EXPECT_EQ(0, sideeffect);
8728 // This will assert that DieInDebugReturn12InOpt() crashes in debug
8729 // mode, usually due to a DCHECK or LOG(DFATAL), but returns the
8730 // appropriate fallback value (12 in this case) in opt mode. If you
8731 // need to test that a function has appropriate side-effects in opt
8732 // mode, include assertions against the side-effects. A general
8733 // pattern for this is:
8735 // EXPECT_DEBUG_DEATH({
8736 // // Side-effects here will have an effect after this statement in
8737 // // opt mode, but none in debug mode.
8738 // EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
8743 # define EXPECT_DEBUG_DEATH(statement, regex) \
8744 GTEST_EXECUTE_STATEMENT_(statement, regex)
8746 # define ASSERT_DEBUG_DEATH(statement, regex) \
8747 GTEST_EXECUTE_STATEMENT_(statement, regex)
8751 # define EXPECT_DEBUG_DEATH(statement, regex) \
8752 EXPECT_DEATH(statement, regex)
8754 # define ASSERT_DEBUG_DEATH(statement, regex) \
8755 ASSERT_DEATH(statement, regex)
8757 # endif // NDEBUG for EXPECT_DEBUG_DEATH
8758 #endif // GTEST_HAS_DEATH_TEST
8760 // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
8761 // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
8762 // death tests are supported; otherwise they just issue a warning. This is
8763 // useful when you are combining death test assertions with normal test
8764 // assertions in one test.
8765 #if GTEST_HAS_DEATH_TEST
8766 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
8767 EXPECT_DEATH(statement, regex)
8768 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
8769 ASSERT_DEATH(statement, regex)
8771 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
8772 GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
8773 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
8774 GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
8777 } // namespace testing
8779 #endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
8780 // This file was GENERATED by command:
8781 // pump.py gtest-param-test.h.pump
8782 // DO NOT EDIT BY HAND!!!
8784 // Copyright 2008, Google Inc.
8785 // All rights reserved.
8787 // Redistribution and use in source and binary forms, with or without
8788 // modification, are permitted provided that the following conditions are
8791 // * Redistributions of source code must retain the above copyright
8792 // notice, this list of conditions and the following disclaimer.
8793 // * Redistributions in binary form must reproduce the above
8794 // copyright notice, this list of conditions and the following disclaimer
8795 // in the documentation and/or other materials provided with the
8797 // * Neither the name of Google Inc. nor the names of its
8798 // contributors may be used to endorse or promote products derived from
8799 // this software without specific prior written permission.
8801 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8802 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8803 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8804 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8805 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8806 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8807 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8808 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8809 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8810 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8811 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8813 // Authors: vladl@google.com (Vlad Losev)
8815 // Macros and functions for implementing parameterized tests
8816 // in Google C++ Testing Framework (Google Test)
8818 // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
8820 #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
8821 #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
8824 // Value-parameterized tests allow you to test your code with different
8825 // parameters without writing multiple copies of the same test.
8827 // Here is how you use value-parameterized tests:
8831 // To write value-parameterized tests, first you should define a fixture
8832 // class. It is usually derived from testing::TestWithParam<T> (see below for
8833 // another inheritance scheme that's sometimes useful in more complicated
8834 // class hierarchies), where the type of your parameter values.
8835 // TestWithParam<T> is itself derived from testing::Test. T can be any
8836 // copyable type. If it's a raw pointer, you are responsible for managing the
8837 // lifespan of the pointed values.
8839 class FooTest : public ::testing::TestWithParam<const char*> {
8840 // You can implement all the usual class fixture members here.
8843 // Then, use the TEST_P macro to define as many parameterized tests
8844 // for this fixture as you want. The _P suffix is for "parameterized"
8845 // or "pattern", whichever you prefer to think.
8847 TEST_P(FooTest, DoesBlah) {
8848 // Inside a test, access the test parameter with the GetParam() method
8849 // of the TestWithParam<T> class:
8850 EXPECT_TRUE(foo.Blah(GetParam()));
8854 TEST_P(FooTest, HasBlahBlah) {
8858 // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
8859 // case with any set of parameters you want. Google Test defines a number
8860 // of functions for generating test parameters. They return what we call
8861 // (surprise!) parameter generators. Here is a summary of them, which
8862 // are all in the testing namespace:
8865 // Range(begin, end [, step]) - Yields values {begin, begin+step,
8866 // begin+step+step, ...}. The values do not
8867 // include end. step defaults to 1.
8868 // Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
8869 // ValuesIn(container) - Yields values from a C-style array, an STL
8870 // ValuesIn(begin,end) container, or an iterator range [begin, end).
8871 // Bool() - Yields sequence {false, true}.
8872 // Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
8873 // for the math savvy) of the values generated
8874 // by the N generators.
8876 // For more details, see comments at the definitions of these functions below
8879 // The following statement will instantiate tests from the FooTest test case
8880 // each with parameter values "meeny", "miny", and "moe".
8882 INSTANTIATE_TEST_CASE_P(InstantiationName,
8884 Values("meeny", "miny", "moe"));
8886 // To distinguish different instances of the pattern, (yes, you
8887 // can instantiate it more then once) the first argument to the
8888 // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
8889 // actual test case name. Remember to pick unique prefixes for different
8890 // instantiations. The tests from the instantiation above will have
8893 // * InstantiationName/FooTest.DoesBlah/0 for "meeny"
8894 // * InstantiationName/FooTest.DoesBlah/1 for "miny"
8895 // * InstantiationName/FooTest.DoesBlah/2 for "moe"
8896 // * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
8897 // * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
8898 // * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
8900 // You can use these names in --gtest_filter.
8902 // This statement will instantiate all tests from FooTest again, each
8903 // with parameter values "cat" and "dog":
8905 const char* pets[] = {"cat", "dog"};
8906 INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
8908 // The tests from the instantiation above will have these names:
8910 // * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
8911 // * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
8912 // * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
8913 // * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
8915 // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
8916 // in the given test case, whether their definitions come before or
8917 // AFTER the INSTANTIATE_TEST_CASE_P statement.
8919 // Please also note that generator expressions (including parameters to the
8920 // generators) are evaluated in InitGoogleTest(), after main() has started.
8921 // This allows the user on one hand, to adjust generator parameters in order
8922 // to dynamically determine a set of tests to run and on the other hand,
8923 // give the user a chance to inspect the generated tests with Google Test
8924 // reflection API before RUN_ALL_TESTS() is executed.
8926 // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
8927 // for more examples.
8929 // In the future, we plan to publish the API for defining new parameter
8930 // generators. But for now this interface remains part of the internal
8931 // implementation and is subject to change.
8934 // A parameterized test fixture must be derived from testing::Test and from
8935 // testing::WithParamInterface<T>, where T is the type of the parameter
8936 // values. Inheriting from TestWithParam<T> satisfies that requirement because
8937 // TestWithParam<T> inherits from both Test and WithParamInterface. In more
8938 // complicated hierarchies, however, it is occasionally useful to inherit
8939 // separately from Test and WithParamInterface. For example:
8941 class BaseTest : public ::testing::Test {
8942 // You can inherit all the usual members for a non-parameterized test
8946 class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
8947 // The usual test fixture members go here too.
8950 TEST_F(BaseTest, HasFoo) {
8951 // This is an ordinary non-parameterized test.
8954 TEST_P(DerivedTest, DoesBlah) {
8955 // GetParam works just the same here as if you inherit from TestWithParam.
8956 EXPECT_TRUE(foo.Blah(GetParam()));
8962 #if !GTEST_OS_SYMBIAN
8966 // scripts/fuse_gtest.py depends on gtest's own header being #included
8967 // *unconditionally*. Therefore these #includes cannot be moved
8968 // inside #if GTEST_HAS_PARAM_TEST.
8969 // Copyright 2008 Google Inc.
8970 // All Rights Reserved.
8972 // Redistribution and use in source and binary forms, with or without
8973 // modification, are permitted provided that the following conditions are
8976 // * Redistributions of source code must retain the above copyright
8977 // notice, this list of conditions and the following disclaimer.
8978 // * Redistributions in binary form must reproduce the above
8979 // copyright notice, this list of conditions and the following disclaimer
8980 // in the documentation and/or other materials provided with the
8982 // * Neither the name of Google Inc. nor the names of its
8983 // contributors may be used to endorse or promote products derived from
8984 // this software without specific prior written permission.
8986 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8987 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8988 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8989 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8990 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8991 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8992 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8993 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8994 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8995 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8996 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8998 // Author: vladl@google.com (Vlad Losev)
9000 // Type and function utilities for implementing parameterized tests.
9002 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
9003 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
9009 // scripts/fuse_gtest.py depends on gtest's own header being #included
9010 // *unconditionally*. Therefore these #includes cannot be moved
9011 // inside #if GTEST_HAS_PARAM_TEST.
9012 // Copyright 2003 Google Inc.
9013 // All rights reserved.
9015 // Redistribution and use in source and binary forms, with or without
9016 // modification, are permitted provided that the following conditions are
9019 // * Redistributions of source code must retain the above copyright
9020 // notice, this list of conditions and the following disclaimer.
9021 // * Redistributions in binary form must reproduce the above
9022 // copyright notice, this list of conditions and the following disclaimer
9023 // in the documentation and/or other materials provided with the
9025 // * Neither the name of Google Inc. nor the names of its
9026 // contributors may be used to endorse or promote products derived from
9027 // this software without specific prior written permission.
9029 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9030 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9031 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9032 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9033 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9034 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9035 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9036 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9037 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9038 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9039 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9041 // Authors: Dan Egnor (egnor@google.com)
9043 // A "smart" pointer type with reference tracking. Every pointer to a
9044 // particular object is kept on a circular linked list. When the last pointer
9045 // to an object is destroyed or reassigned, the object is deleted.
9047 // Used properly, this deletes the object when the last reference goes away.
9048 // There are several caveats:
9049 // - Like all reference counting schemes, cycles lead to leaks.
9050 // - Each smart pointer is actually two pointers (8 bytes instead of 4).
9051 // - Every time a pointer is assigned, the entire list of pointers to that
9052 // object is traversed. This class is therefore NOT SUITABLE when there
9053 // will often be more than two or three pointers to a particular object.
9054 // - References are only tracked as long as linked_ptr<> objects are copied.
9055 // If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
9056 // will happen (double deletion).
9058 // A good use of this class is storing object references in STL containers.
9059 // You can safely put linked_ptr<> in a vector<>.
9060 // Other uses may not be as good.
9062 // Note: If you use an incomplete type with linked_ptr<>, the class
9063 // *containing* linked_ptr<> must have a constructor and destructor (even
9064 // if they do nothing!).
9066 // Bill Gibbons suggested we use something like this.
9069 // Unlike other linked_ptr implementations, in this implementation
9070 // a linked_ptr object is thread-safe in the sense that:
9071 // - it's safe to copy linked_ptr objects concurrently,
9072 // - it's safe to copy *from* a linked_ptr and read its underlying
9073 // raw pointer (e.g. via get()) concurrently, and
9074 // - it's safe to write to two linked_ptrs that point to the same
9075 // shared object concurrently.
9076 // TODO(wan@google.com): rename this to safe_linked_ptr to avoid
9077 // confusion with normal linked_ptr.
9079 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9080 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9087 namespace internal {
9089 // Protects copying of all linked_ptr objects.
9090 GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
9092 // This is used internally by all instances of linked_ptr<>. It needs to be
9093 // a non-template class because different types of linked_ptr<> can refer to
9094 // the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
9095 // So, it needs to be possible for different types of linked_ptr to participate
9096 // in the same circular linked list, so we need a single class type here.
9098 // DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr<T>.
9099 class linked_ptr_internal {
9101 // Create a new circle that includes only this instance.
9106 // Many linked_ptr operations may change p.link_ for some linked_ptr
9107 // variable p in the same circle as this object. Therefore we need
9108 // to prevent two such operations from occurring concurrently.
9110 // Note that different types of linked_ptr objects can coexist in a
9111 // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
9112 // linked_ptr<Derived2>). Therefore we must use a single mutex to
9113 // protect all linked_ptr objects. This can create serious
9114 // contention in production code, but is acceptable in a testing
9117 // Join an existing circle.
9118 void join(linked_ptr_internal const* ptr)
9119 GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
9120 MutexLock lock(&g_linked_ptr_mutex);
9122 linked_ptr_internal const* p = ptr;
9123 while (p->next_ != ptr) p = p->next_;
9128 // Leave whatever circle we're part of. Returns true if we were the
9129 // last member of the circle. Once this is done, you can join() another.
9131 GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
9132 MutexLock lock(&g_linked_ptr_mutex);
9134 if (next_ == this) return true;
9135 linked_ptr_internal const* p = next_;
9136 while (p->next_ != this) p = p->next_;
9142 mutable linked_ptr_internal const* next_;
9145 template <typename T>
9148 typedef T element_type;
9150 // Take over ownership of a raw pointer. This should happen as soon as
9151 // possible after the object is created.
9152 explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
9153 ~linked_ptr() { depart(); }
9155 // Copy an existing linked_ptr<>, adding ourselves to the list of references.
9156 template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
9157 linked_ptr(linked_ptr const& ptr) { // NOLINT
9158 assert(&ptr != this);
9162 // Assignment releases the old value and acquires the new.
9163 template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
9169 linked_ptr& operator=(linked_ptr const& ptr) {
9177 // Smart pointer members.
9178 void reset(T* ptr = NULL) {
9182 T* get() const { return value_; }
9183 T* operator->() const { return value_; }
9184 T& operator*() const { return *value_; }
9186 bool operator==(T* p) const { return value_ == p; }
9187 bool operator!=(T* p) const { return value_ != p; }
9188 template <typename U>
9189 bool operator==(linked_ptr<U> const& ptr) const {
9190 return value_ == ptr.get();
9192 template <typename U>
9193 bool operator!=(linked_ptr<U> const& ptr) const {
9194 return value_ != ptr.get();
9198 template <typename U>
9199 friend class linked_ptr;
9202 linked_ptr_internal link_;
9205 if (link_.depart()) delete value_;
9208 void capture(T* ptr) {
9213 template <typename U> void copy(linked_ptr<U> const* ptr) {
9214 value_ = ptr->get();
9216 link_.join(&ptr->link_);
9222 template<typename T> inline
9223 bool operator==(T* ptr, const linked_ptr<T>& x) {
9224 return ptr == x.get();
9227 template<typename T> inline
9228 bool operator!=(T* ptr, const linked_ptr<T>& x) {
9229 return ptr != x.get();
9232 // A function to convert T* into linked_ptr<T>
9233 // Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
9234 // for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
9235 template <typename T>
9236 linked_ptr<T> make_linked_ptr(T* ptr) {
9237 return linked_ptr<T>(ptr);
9240 } // namespace internal
9241 } // namespace testing
9243 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9244 // Copyright 2007, Google Inc.
9245 // All rights reserved.
9247 // Redistribution and use in source and binary forms, with or without
9248 // modification, are permitted provided that the following conditions are
9251 // * Redistributions of source code must retain the above copyright
9252 // notice, this list of conditions and the following disclaimer.
9253 // * Redistributions in binary form must reproduce the above
9254 // copyright notice, this list of conditions and the following disclaimer
9255 // in the documentation and/or other materials provided with the
9257 // * Neither the name of Google Inc. nor the names of its
9258 // contributors may be used to endorse or promote products derived from
9259 // this software without specific prior written permission.
9261 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9262 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9263 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9264 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9265 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9266 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9267 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9268 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9269 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9270 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9271 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9273 // Author: wan@google.com (Zhanyong Wan)
9275 // Google Test - The Google C++ Testing Framework
9277 // This file implements a universal value printer that can print a
9278 // value of any type T:
9280 // void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
9282 // A user can teach this function how to print a class type T by
9283 // defining either operator<<() or PrintTo() in the namespace that
9284 // defines T. More specifically, the FIRST defined function in the
9285 // following list will be used (assuming T is defined in namespace
9288 // 1. foo::PrintTo(const T&, ostream*)
9289 // 2. operator<<(ostream&, const T&) defined in either foo or the
9290 // global namespace.
9292 // If none of the above is defined, it will print the debug string of
9293 // the value if it is a protocol buffer, or print the raw bytes in the
9296 // To aid debugging: when T is a reference type, the address of the
9297 // value is also printed; when T is a (const) char pointer, both the
9298 // pointer value and the NUL-terminated string it points to are
9301 // We also provide some convenient wrappers:
9303 // // Prints a value to a string. For a (const or not) char
9304 // // pointer, the NUL-terminated string (but not the pointer) is
9306 // std::string ::testing::PrintToString(const T& value);
9308 // // Prints a value tersely: for a reference type, the referenced
9309 // // value (but not the address) is printed; for a (const or not) char
9310 // // pointer, the NUL-terminated string (but not the pointer) is
9312 // void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
9314 // // Prints value using the type inferred by the compiler. The difference
9315 // // from UniversalTersePrint() is that this function prints both the
9316 // // pointer and the NUL-terminated string for a (const or not) char pointer.
9317 // void ::testing::internal::UniversalPrint(const T& value, ostream*);
9319 // // Prints the fields of a tuple tersely to a string vector, one
9320 // // element for each field. Tuple support must be enabled in
9322 // std::vector<string> UniversalTersePrintTupleFieldsToStrings(
9323 // const Tuple& value);
9325 // Known limitation:
9327 // The print primitives print the elements of an STL-style container
9328 // using the compiler-inferred type of *iter where iter is a
9329 // const_iterator of the container. When const_iterator is an input
9330 // iterator but not a forward iterator, this inferred type may not
9331 // match value_type, and the print output may be incorrect. In
9332 // practice, this is rarely a problem as for most containers
9333 // const_iterator is a forward iterator. We'll fix this if there's an
9334 // actual need for it. Note that this fix cannot rely on value_type
9335 // being defined as many user-defined container types don't have
9338 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
9339 #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
9341 #include <ostream> // NOLINT
9349 // Definitions in the 'internal' and 'internal2' name spaces are
9350 // subject to change without notice. DO NOT USE THEM IN USER CODE!
9351 namespace internal2 {
9353 // Prints the given number of bytes in the given object to the given
9355 GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
9357 ::std::ostream* os);
9359 // For selecting which printer to use when a given type has neither <<
9362 kProtobuf, // a protobuf type
9363 kConvertibleToInteger, // a type implicitly convertible to BiggestInt
9364 // (e.g. a named or unnamed enum type)
9365 kOtherType // anything else
9368 // TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
9369 // by the universal printer to print a value of type T when neither
9370 // operator<< nor PrintTo() is defined for T, where kTypeKind is the
9371 // "kind" of T as defined by enum TypeKind.
9372 template <typename T, TypeKind kTypeKind>
9373 class TypeWithoutFormatter {
9375 // This default version is called when kTypeKind is kOtherType.
9376 static void PrintValue(const T& value, ::std::ostream* os) {
9377 PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
9382 // We print a protobuf using its ShortDebugString() when the string
9383 // doesn't exceed this many characters; otherwise we print it using
9384 // DebugString() for better readability.
9385 const size_t kProtobufOneLinerMaxLength = 50;
9387 template <typename T>
9388 class TypeWithoutFormatter<T, kProtobuf> {
9390 static void PrintValue(const T& value, ::std::ostream* os) {
9391 const ::testing::internal::string short_str = value.ShortDebugString();
9392 const ::testing::internal::string pretty_str =
9393 short_str.length() <= kProtobufOneLinerMaxLength ?
9394 short_str : ("\n" + value.DebugString());
9395 *os << ("<" + pretty_str + ">");
9399 template <typename T>
9400 class TypeWithoutFormatter<T, kConvertibleToInteger> {
9402 // Since T has no << operator or PrintTo() but can be implicitly
9403 // converted to BiggestInt, we print it as a BiggestInt.
9405 // Most likely T is an enum type (either named or unnamed), in which
9406 // case printing it as an integer is the desired behavior. In case
9407 // T is not an enum, printing it as an integer is the best we can do
9408 // given that it has no user-defined printer.
9409 static void PrintValue(const T& value, ::std::ostream* os) {
9410 const internal::BiggestInt kBigInt = value;
9415 // Prints the given value to the given ostream. If the value is a
9416 // protocol message, its debug string is printed; if it's an enum or
9417 // of a type implicitly convertible to BiggestInt, it's printed as an
9418 // integer; otherwise the bytes in the value are printed. This is
9419 // what UniversalPrinter<T>::Print() does when it knows nothing about
9420 // type T and T has neither << operator nor PrintTo().
9422 // A user can override this behavior for a class type Foo by defining
9423 // a << operator in the namespace where Foo is defined.
9425 // We put this operator in namespace 'internal2' instead of 'internal'
9426 // to simplify the implementation, as much code in 'internal' needs to
9427 // use << in STL, which would conflict with our own << were it defined
9430 // Note that this operator<< takes a generic std::basic_ostream<Char,
9431 // CharTraits> type instead of the more restricted std::ostream. If
9432 // we define it to take an std::ostream instead, we'll get an
9433 // "ambiguous overloads" compiler error when trying to print a type
9434 // Foo that supports streaming to std::basic_ostream<Char,
9435 // CharTraits>, as the compiler cannot tell whether
9436 // operator<<(std::ostream&, const T&) or
9437 // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
9439 template <typename Char, typename CharTraits, typename T>
9440 ::std::basic_ostream<Char, CharTraits>& operator<<(
9441 ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
9442 TypeWithoutFormatter<T,
9443 (internal::IsAProtocolMessage<T>::value ? kProtobuf :
9444 internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
9445 kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
9449 } // namespace internal2
9450 } // namespace testing
9452 // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
9453 // magic needed for implementing UniversalPrinter won't work.
9454 namespace testing_internal {
9456 // Used to print a value that is not an STL-style container when the
9457 // user doesn't define PrintTo() for it.
9458 template <typename T>
9459 void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
9460 // With the following statement, during unqualified name lookup,
9461 // testing::internal2::operator<< appears as if it was declared in
9462 // the nearest enclosing namespace that contains both
9463 // ::testing_internal and ::testing::internal2, i.e. the global
9464 // namespace. For more details, refer to the C++ Standard section
9465 // 7.3.4-1 [namespace.udir]. This allows us to fall back onto
9466 // testing::internal2::operator<< in case T doesn't come with a <<
9469 // We cannot write 'using ::testing::internal2::operator<<;', which
9470 // gcc 3.3 fails to compile due to a compiler bug.
9471 using namespace ::testing::internal2; // NOLINT
9473 // Assuming T is defined in namespace foo, in the next statement,
9474 // the compiler will consider all of:
9476 // 1. foo::operator<< (thanks to Koenig look-up),
9477 // 2. ::operator<< (as the current namespace is enclosed in ::),
9478 // 3. testing::internal2::operator<< (thanks to the using statement above).
9480 // The operator<< whose type matches T best will be picked.
9482 // We deliberately allow #2 to be a candidate, as sometimes it's
9483 // impossible to define #1 (e.g. when foo is ::std, defining
9484 // anything in it is undefined behavior unless you are a compiler
9489 } // namespace testing_internal
9492 namespace internal {
9494 // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
9495 // value to the given ostream. The caller must ensure that
9496 // 'ostream_ptr' is not NULL, or the behavior is undefined.
9498 // We define UniversalPrinter as a class template (as opposed to a
9499 // function template), as we need to partially specialize it for
9500 // reference types, which cannot be done with function templates.
9501 template <typename T>
9502 class UniversalPrinter;
9504 template <typename T>
9505 void UniversalPrint(const T& value, ::std::ostream* os);
9507 // Used to print an STL-style container when the user doesn't define
9508 // a PrintTo() for it.
9509 template <typename C>
9510 void DefaultPrintTo(IsContainer /* dummy */,
9511 false_type /* is not a pointer */,
9512 const C& container, ::std::ostream* os) {
9513 const size_t kMaxCount = 32; // The maximum number of elements to print.
9516 for (typename C::const_iterator it = container.begin();
9517 it != container.end(); ++it, ++count) {
9520 if (count == kMaxCount) { // Enough has been printed.
9526 // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
9527 // handle *it being a native array.
9528 internal::UniversalPrint(*it, os);
9537 // Used to print a pointer that is neither a char pointer nor a member
9538 // pointer, when the user doesn't define PrintTo() for it. (A member
9539 // variable pointer or member function pointer doesn't really point to
9540 // a location in the address space. Their representation is
9541 // implementation-defined. Therefore they will be printed as raw
9543 template <typename T>
9544 void DefaultPrintTo(IsNotContainer /* dummy */,
9545 true_type /* is a pointer */,
9546 T* p, ::std::ostream* os) {
9550 // C++ doesn't allow casting from a function pointer to any object
9553 // IsTrue() silences warnings: "Condition is always true",
9554 // "unreachable code".
9555 if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
9556 // T is not a function type. We just call << to print p,
9557 // relying on ADL to pick up user-defined << for their pointer
9561 // T is a function type, so '*os << p' doesn't do what we want
9562 // (it just prints p as bool). We want to print p as a const
9563 // void*. However, we cannot cast it to const void* directly,
9564 // even using reinterpret_cast, as earlier versions of gcc
9565 // (e.g. 3.4.5) cannot compile the cast when p is a function
9566 // pointer. Casting to UInt64 first solves the problem.
9567 *os << reinterpret_cast<const void*>(
9568 reinterpret_cast<internal::UInt64>(p));
9573 // Used to print a non-container, non-pointer value when the user
9574 // doesn't define PrintTo() for it.
9575 template <typename T>
9576 void DefaultPrintTo(IsNotContainer /* dummy */,
9577 false_type /* is not a pointer */,
9578 const T& value, ::std::ostream* os) {
9579 ::testing_internal::DefaultPrintNonContainerTo(value, os);
9582 // Prints the given value using the << operator if it has one;
9583 // otherwise prints the bytes in it. This is what
9584 // UniversalPrinter<T>::Print() does when PrintTo() is not specialized
9585 // or overloaded for type T.
9587 // A user can override this behavior for a class type Foo by defining
9588 // an overload of PrintTo() in the namespace where Foo is defined. We
9589 // give the user this option as sometimes defining a << operator for
9590 // Foo is not desirable (e.g. the coding style may prevent doing it,
9591 // or there is already a << operator but it doesn't do what the user
9593 template <typename T>
9594 void PrintTo(const T& value, ::std::ostream* os) {
9595 // DefaultPrintTo() is overloaded. The type of its first two
9596 // arguments determine which version will be picked. If T is an
9597 // STL-style container, the version for container will be called; if
9598 // T is a pointer, the pointer version will be called; otherwise the
9599 // generic version will be called.
9601 // Note that we check for container types here, prior to we check
9602 // for protocol message types in our operator<<. The rationale is:
9604 // For protocol messages, we want to give people a chance to
9605 // override Google Mock's format by defining a PrintTo() or
9606 // operator<<. For STL containers, other formats can be
9607 // incompatible with Google Mock's format for the container
9608 // elements; therefore we check for container types here to ensure
9609 // that our format is used.
9611 // The second argument of DefaultPrintTo() is needed to bypass a bug
9612 // in Symbian's C++ compiler that prevents it from picking the right
9613 // overload between:
9615 // PrintTo(const T& x, ...);
9616 // PrintTo(T* x, ...);
9617 DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
9620 // The following list of PrintTo() overloads tells
9621 // UniversalPrinter<T>::Print() how to print standard types (built-in
9622 // types, strings, plain arrays, and pointers).
9624 // Overloads for various char types.
9625 GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
9626 GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
9627 inline void PrintTo(char c, ::std::ostream* os) {
9628 // When printing a plain char, we always treat it as unsigned. This
9629 // way, the output won't be affected by whether the compiler thinks
9630 // char is signed or not.
9631 PrintTo(static_cast<unsigned char>(c), os);
9634 // Overloads for other simple built-in types.
9635 inline void PrintTo(bool x, ::std::ostream* os) {
9636 *os << (x ? "true" : "false");
9639 // Overload for wchar_t type.
9640 // Prints a wchar_t as a symbol if it is printable or as its internal
9641 // code otherwise and also as its decimal code (except for L'\0').
9642 // The L'\0' char is printed as "L'\\0'". The decimal code is printed
9643 // as signed integer when wchar_t is implemented by the compiler
9644 // as a signed type and is printed as an unsigned integer when wchar_t
9645 // is implemented as an unsigned type.
9646 GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
9648 // Overloads for C strings.
9649 GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
9650 inline void PrintTo(char* s, ::std::ostream* os) {
9651 PrintTo(ImplicitCast_<const char*>(s), os);
9654 // signed/unsigned char is often used for representing binary data, so
9655 // we print pointers to it as void* to be safe.
9656 inline void PrintTo(const signed char* s, ::std::ostream* os) {
9657 PrintTo(ImplicitCast_<const void*>(s), os);
9659 inline void PrintTo(signed char* s, ::std::ostream* os) {
9660 PrintTo(ImplicitCast_<const void*>(s), os);
9662 inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
9663 PrintTo(ImplicitCast_<const void*>(s), os);
9665 inline void PrintTo(unsigned char* s, ::std::ostream* os) {
9666 PrintTo(ImplicitCast_<const void*>(s), os);
9669 // MSVC can be configured to define wchar_t as a typedef of unsigned
9670 // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
9671 // type. When wchar_t is a typedef, defining an overload for const
9672 // wchar_t* would cause unsigned short* be printed as a wide string,
9673 // possibly causing invalid memory accesses.
9674 #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
9675 // Overloads for wide C strings
9676 GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
9677 inline void PrintTo(wchar_t* s, ::std::ostream* os) {
9678 PrintTo(ImplicitCast_<const wchar_t*>(s), os);
9682 // Overload for C arrays. Multi-dimensional arrays are printed
9685 // Prints the given number of elements in an array, without printing
9686 // the curly braces.
9687 template <typename T>
9688 void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
9689 UniversalPrint(a[0], os);
9690 for (size_t i = 1; i != count; i++) {
9692 UniversalPrint(a[i], os);
9696 // Overloads for ::string and ::std::string.
9697 #if GTEST_HAS_GLOBAL_STRING
9698 GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
9699 inline void PrintTo(const ::string& s, ::std::ostream* os) {
9700 PrintStringTo(s, os);
9702 #endif // GTEST_HAS_GLOBAL_STRING
9704 GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
9705 inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
9706 PrintStringTo(s, os);
9709 // Overloads for ::wstring and ::std::wstring.
9710 #if GTEST_HAS_GLOBAL_WSTRING
9711 GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
9712 inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
9713 PrintWideStringTo(s, os);
9715 #endif // GTEST_HAS_GLOBAL_WSTRING
9717 #if GTEST_HAS_STD_WSTRING
9718 GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
9719 inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
9720 PrintWideStringTo(s, os);
9722 #endif // GTEST_HAS_STD_WSTRING
9724 #if GTEST_HAS_TR1_TUPLE
9725 // Overload for ::std::tr1::tuple. Needed for printing function arguments,
9726 // which are packed as tuples.
9728 // Helper function for printing a tuple. T must be instantiated with
9730 template <typename T>
9731 void PrintTupleTo(const T& t, ::std::ostream* os);
9733 // Overloaded PrintTo() for tuples of various arities. We support
9734 // tuples of up-to 10 fields. The following implementation works
9735 // regardless of whether tr1::tuple is implemented using the
9736 // non-standard variadic template feature or not.
9738 inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
9739 PrintTupleTo(t, os);
9742 template <typename T1>
9743 void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
9744 PrintTupleTo(t, os);
9747 template <typename T1, typename T2>
9748 void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
9749 PrintTupleTo(t, os);
9752 template <typename T1, typename T2, typename T3>
9753 void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
9754 PrintTupleTo(t, os);
9757 template <typename T1, typename T2, typename T3, typename T4>
9758 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
9759 PrintTupleTo(t, os);
9762 template <typename T1, typename T2, typename T3, typename T4, typename T5>
9763 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
9764 ::std::ostream* os) {
9765 PrintTupleTo(t, os);
9768 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9770 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
9771 ::std::ostream* os) {
9772 PrintTupleTo(t, os);
9775 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9776 typename T6, typename T7>
9777 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
9778 ::std::ostream* os) {
9779 PrintTupleTo(t, os);
9782 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9783 typename T6, typename T7, typename T8>
9784 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
9785 ::std::ostream* os) {
9786 PrintTupleTo(t, os);
9789 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9790 typename T6, typename T7, typename T8, typename T9>
9791 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
9792 ::std::ostream* os) {
9793 PrintTupleTo(t, os);
9796 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9797 typename T6, typename T7, typename T8, typename T9, typename T10>
9799 const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
9800 ::std::ostream* os) {
9801 PrintTupleTo(t, os);
9803 #endif // GTEST_HAS_TR1_TUPLE
9805 // Overload for std::pair.
9806 template <typename T1, typename T2>
9807 void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
9809 // We cannot use UniversalPrint(value.first, os) here, as T1 may be
9810 // a reference type. The same for printing value.second.
9811 UniversalPrinter<T1>::Print(value.first, os);
9813 UniversalPrinter<T2>::Print(value.second, os);
9817 // Implements printing a non-reference type T by letting the compiler
9818 // pick the right overload of PrintTo() for T.
9819 template <typename T>
9820 class UniversalPrinter {
9822 // MSVC warns about adding const to a function type, so we want to
9823 // disable the warning.
9825 # pragma warning(push) // Saves the current warning state.
9826 # pragma warning(disable:4180) // Temporarily disables warning 4180.
9829 // Note: we deliberately don't call this PrintTo(), as that name
9830 // conflicts with ::testing::internal::PrintTo in the body of the
9832 static void Print(const T& value, ::std::ostream* os) {
9833 // By default, ::testing::internal::PrintTo() is used for printing
9836 // Thanks to Koenig look-up, if T is a class and has its own
9837 // PrintTo() function defined in its namespace, that function will
9838 // be visible here. Since it is more specific than the generic ones
9839 // in ::testing::internal, it will be picked by the compiler in the
9840 // following statement - exactly what we want.
9845 # pragma warning(pop) // Restores the warning state.
9849 // UniversalPrintArray(begin, len, os) prints an array of 'len'
9850 // elements, starting at address 'begin'.
9851 template <typename T>
9852 void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
9857 const size_t kThreshold = 18;
9858 const size_t kChunkSize = 8;
9859 // If the array has more than kThreshold elements, we'll have to
9860 // omit some details by printing only the first and the last
9861 // kChunkSize elements.
9862 // TODO(wan@google.com): let the user control the threshold using a flag.
9863 if (len <= kThreshold) {
9864 PrintRawArrayTo(begin, len, os);
9866 PrintRawArrayTo(begin, kChunkSize, os);
9868 PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
9873 // This overload prints a (const) char array compactly.
9874 GTEST_API_ void UniversalPrintArray(
9875 const char* begin, size_t len, ::std::ostream* os);
9877 // This overload prints a (const) wchar_t array compactly.
9878 GTEST_API_ void UniversalPrintArray(
9879 const wchar_t* begin, size_t len, ::std::ostream* os);
9881 // Implements printing an array type T[N].
9882 template <typename T, size_t N>
9883 class UniversalPrinter<T[N]> {
9885 // Prints the given array, omitting some elements when there are too
9887 static void Print(const T (&a)[N], ::std::ostream* os) {
9888 UniversalPrintArray(a, N, os);
9892 // Implements printing a reference type T&.
9893 template <typename T>
9894 class UniversalPrinter<T&> {
9896 // MSVC warns about adding const to a function type, so we want to
9897 // disable the warning.
9899 # pragma warning(push) // Saves the current warning state.
9900 # pragma warning(disable:4180) // Temporarily disables warning 4180.
9903 static void Print(const T& value, ::std::ostream* os) {
9904 // Prints the address of the value. We use reinterpret_cast here
9905 // as static_cast doesn't compile when T is a function type.
9906 *os << "@" << reinterpret_cast<const void*>(&value) << " ";
9908 // Then prints the value itself.
9909 UniversalPrint(value, os);
9913 # pragma warning(pop) // Restores the warning state.
9917 // Prints a value tersely: for a reference type, the referenced value
9918 // (but not the address) is printed; for a (const) char pointer, the
9919 // NUL-terminated string (but not the pointer) is printed.
9921 template <typename T>
9922 class UniversalTersePrinter {
9924 static void Print(const T& value, ::std::ostream* os) {
9925 UniversalPrint(value, os);
9928 template <typename T>
9929 class UniversalTersePrinter<T&> {
9931 static void Print(const T& value, ::std::ostream* os) {
9932 UniversalPrint(value, os);
9935 template <typename T, size_t N>
9936 class UniversalTersePrinter<T[N]> {
9938 static void Print(const T (&value)[N], ::std::ostream* os) {
9939 UniversalPrinter<T[N]>::Print(value, os);
9943 class UniversalTersePrinter<const char*> {
9945 static void Print(const char* str, ::std::ostream* os) {
9949 UniversalPrint(string(str), os);
9954 class UniversalTersePrinter<char*> {
9956 static void Print(char* str, ::std::ostream* os) {
9957 UniversalTersePrinter<const char*>::Print(str, os);
9961 #if GTEST_HAS_STD_WSTRING
9963 class UniversalTersePrinter<const wchar_t*> {
9965 static void Print(const wchar_t* str, ::std::ostream* os) {
9969 UniversalPrint(::std::wstring(str), os);
9976 class UniversalTersePrinter<wchar_t*> {
9978 static void Print(wchar_t* str, ::std::ostream* os) {
9979 UniversalTersePrinter<const wchar_t*>::Print(str, os);
9983 template <typename T>
9984 void UniversalTersePrint(const T& value, ::std::ostream* os) {
9985 UniversalTersePrinter<T>::Print(value, os);
9988 // Prints a value using the type inferred by the compiler. The
9989 // difference between this and UniversalTersePrint() is that for a
9990 // (const) char pointer, this prints both the pointer and the
9991 // NUL-terminated string.
9992 template <typename T>
9993 void UniversalPrint(const T& value, ::std::ostream* os) {
9994 // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
9995 // UniversalPrinter with T directly.
9997 UniversalPrinter<T1>::Print(value, os);
10000 #if GTEST_HAS_TR1_TUPLE
10001 typedef ::std::vector<string> Strings;
10003 // This helper template allows PrintTo() for tuples and
10004 // UniversalTersePrintTupleFieldsToStrings() to be defined by
10005 // induction on the number of tuple fields. The idea is that
10006 // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
10007 // fields in tuple t, and can be defined in terms of
10008 // TuplePrefixPrinter<N - 1>.
10010 // The inductive case.
10011 template <size_t N>
10012 struct TuplePrefixPrinter {
10013 // Prints the first N fields of a tuple.
10014 template <typename Tuple>
10015 static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
10016 TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
10018 UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
10019 ::Print(::std::tr1::get<N - 1>(t), os);
10022 // Tersely prints the first N fields of a tuple to a string vector,
10023 // one element for each field.
10024 template <typename Tuple>
10025 static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
10026 TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
10027 ::std::stringstream ss;
10028 UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
10029 strings->push_back(ss.str());
10035 struct TuplePrefixPrinter<0> {
10036 template <typename Tuple>
10037 static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
10039 template <typename Tuple>
10040 static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
10042 // We have to specialize the entire TuplePrefixPrinter<> class
10043 // template here, even though the definition of
10044 // TersePrintPrefixToStrings() is the same as the generic version, as
10045 // Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
10046 // support specializing a method template of a class template.
10048 struct TuplePrefixPrinter<1> {
10049 template <typename Tuple>
10050 static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
10051 UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
10052 Print(::std::tr1::get<0>(t), os);
10055 template <typename Tuple>
10056 static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
10057 ::std::stringstream ss;
10058 UniversalTersePrint(::std::tr1::get<0>(t), &ss);
10059 strings->push_back(ss.str());
10063 // Helper function for printing a tuple. T must be instantiated with
10065 template <typename T>
10066 void PrintTupleTo(const T& t, ::std::ostream* os) {
10068 TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
10069 PrintPrefixTo(t, os);
10073 // Prints the fields of a tuple tersely to a string vector, one
10074 // element for each field. See the comment before
10075 // UniversalTersePrint() for how we define "tersely".
10076 template <typename Tuple>
10077 Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
10079 TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
10080 TersePrintPrefixToStrings(value, &result);
10083 #endif // GTEST_HAS_TR1_TUPLE
10085 } // namespace internal
10087 template <typename T>
10088 ::std::string PrintToString(const T& value) {
10089 ::std::stringstream ss;
10090 internal::UniversalTersePrinter<T>::Print(value, &ss);
10094 } // namespace testing
10096 #endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
10098 #if GTEST_HAS_PARAM_TEST
10100 namespace testing {
10101 namespace internal {
10103 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10105 // Outputs a message explaining invalid registration of different
10106 // fixture class for the same test case. This may happen when
10107 // TEST_P macro is used to define two tests with the same name
10108 // but in different namespaces.
10109 GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
10110 const char* file, int line);
10112 template <typename> class ParamGeneratorInterface;
10113 template <typename> class ParamGenerator;
10115 // Interface for iterating over elements provided by an implementation
10116 // of ParamGeneratorInterface<T>.
10117 template <typename T>
10118 class ParamIteratorInterface {
10120 virtual ~ParamIteratorInterface() {}
10121 // A pointer to the base generator instance.
10122 // Used only for the purposes of iterator comparison
10123 // to make sure that two iterators belong to the same generator.
10124 virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
10125 // Advances iterator to point to the next element
10126 // provided by the generator. The caller is responsible
10127 // for not calling Advance() on an iterator equal to
10128 // BaseGenerator()->End().
10129 virtual void Advance() = 0;
10130 // Clones the iterator object. Used for implementing copy semantics
10131 // of ParamIterator<T>.
10132 virtual ParamIteratorInterface* Clone() const = 0;
10133 // Dereferences the current iterator and provides (read-only) access
10134 // to the pointed value. It is the caller's responsibility not to call
10135 // Current() on an iterator equal to BaseGenerator()->End().
10136 // Used for implementing ParamGenerator<T>::operator*().
10137 virtual const T* Current() const = 0;
10138 // Determines whether the given iterator and other point to the same
10139 // element in the sequence generated by the generator.
10140 // Used for implementing ParamGenerator<T>::operator==().
10141 virtual bool Equals(const ParamIteratorInterface& other) const = 0;
10144 // Class iterating over elements provided by an implementation of
10145 // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
10146 // and implements the const forward iterator concept.
10147 template <typename T>
10148 class ParamIterator {
10150 typedef T value_type;
10151 typedef const T& reference;
10152 typedef ptrdiff_t difference_type;
10154 // ParamIterator assumes ownership of the impl_ pointer.
10155 ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
10156 ParamIterator& operator=(const ParamIterator& other) {
10157 if (this != &other)
10158 impl_.reset(other.impl_->Clone());
10162 const T& operator*() const { return *impl_->Current(); }
10163 const T* operator->() const { return impl_->Current(); }
10164 // Prefix version of operator++.
10165 ParamIterator& operator++() {
10169 // Postfix version of operator++.
10170 ParamIterator operator++(int /*unused*/) {
10171 ParamIteratorInterface<T>* clone = impl_->Clone();
10173 return ParamIterator(clone);
10175 bool operator==(const ParamIterator& other) const {
10176 return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
10178 bool operator!=(const ParamIterator& other) const {
10179 return !(*this == other);
10183 friend class ParamGenerator<T>;
10184 explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
10185 scoped_ptr<ParamIteratorInterface<T> > impl_;
10188 // ParamGeneratorInterface<T> is the binary interface to access generators
10189 // defined in other translation units.
10190 template <typename T>
10191 class ParamGeneratorInterface {
10193 typedef T ParamType;
10195 virtual ~ParamGeneratorInterface() {}
10197 // Generator interface definition
10198 virtual ParamIteratorInterface<T>* Begin() const = 0;
10199 virtual ParamIteratorInterface<T>* End() const = 0;
10202 // Wraps ParamGeneratorInterface<T> and provides general generator syntax
10203 // compatible with the STL Container concept.
10204 // This class implements copy initialization semantics and the contained
10205 // ParamGeneratorInterface<T> instance is shared among all copies
10206 // of the original object. This is possible because that instance is immutable.
10207 template<typename T>
10208 class ParamGenerator {
10210 typedef ParamIterator<T> iterator;
10212 explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
10213 ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
10215 ParamGenerator& operator=(const ParamGenerator& other) {
10216 impl_ = other.impl_;
10220 iterator begin() const { return iterator(impl_->Begin()); }
10221 iterator end() const { return iterator(impl_->End()); }
10224 linked_ptr<const ParamGeneratorInterface<T> > impl_;
10227 // Generates values from a range of two comparable values. Can be used to
10228 // generate sequences of user-defined types that implement operator+() and
10230 // This class is used in the Range() function.
10231 template <typename T, typename IncrementT>
10232 class RangeGenerator : public ParamGeneratorInterface<T> {
10234 RangeGenerator(T begin, T end, IncrementT step)
10235 : begin_(begin), end_(end),
10236 step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
10237 virtual ~RangeGenerator() {}
10239 virtual ParamIteratorInterface<T>* Begin() const {
10240 return new Iterator(this, begin_, 0, step_);
10242 virtual ParamIteratorInterface<T>* End() const {
10243 return new Iterator(this, end_, end_index_, step_);
10247 class Iterator : public ParamIteratorInterface<T> {
10249 Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
10251 : base_(base), value_(value), index_(index), step_(step) {}
10252 virtual ~Iterator() {}
10254 virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
10257 virtual void Advance() {
10258 value_ = value_ + step_;
10261 virtual ParamIteratorInterface<T>* Clone() const {
10262 return new Iterator(*this);
10264 virtual const T* Current() const { return &value_; }
10265 virtual bool Equals(const ParamIteratorInterface<T>& other) const {
10266 // Having the same base generator guarantees that the other
10267 // iterator is of the same type and we can downcast.
10268 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
10269 << "The program attempted to compare iterators "
10270 << "from different generators." << std::endl;
10271 const int other_index =
10272 CheckedDowncastToActualType<const Iterator>(&other)->index_;
10273 return index_ == other_index;
10277 Iterator(const Iterator& other)
10278 : ParamIteratorInterface<T>(),
10279 base_(other.base_), value_(other.value_), index_(other.index_),
10280 step_(other.step_) {}
10282 // No implementation - assignment is unsupported.
10283 void operator=(const Iterator& other);
10285 const ParamGeneratorInterface<T>* const base_;
10288 const IncrementT step_;
10289 }; // class RangeGenerator::Iterator
10291 static int CalculateEndIndex(const T& begin,
10293 const IncrementT& step) {
10295 for (T i = begin; i < end; i = i + step)
10300 // No implementation - assignment is unsupported.
10301 void operator=(const RangeGenerator& other);
10305 const IncrementT step_;
10306 // The index for the end() iterator. All the elements in the generated
10307 // sequence are indexed (0-based) to aid iterator comparison.
10308 const int end_index_;
10309 }; // class RangeGenerator
10312 // Generates values from a pair of STL-style iterators. Used in the
10313 // ValuesIn() function. The elements are copied from the source range
10314 // since the source can be located on the stack, and the generator
10315 // is likely to persist beyond that stack frame.
10316 template <typename T>
10317 class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
10319 template <typename ForwardIterator>
10320 ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
10321 : container_(begin, end) {}
10322 virtual ~ValuesInIteratorRangeGenerator() {}
10324 virtual ParamIteratorInterface<T>* Begin() const {
10325 return new Iterator(this, container_.begin());
10327 virtual ParamIteratorInterface<T>* End() const {
10328 return new Iterator(this, container_.end());
10332 typedef typename ::std::vector<T> ContainerType;
10334 class Iterator : public ParamIteratorInterface<T> {
10336 Iterator(const ParamGeneratorInterface<T>* base,
10337 typename ContainerType::const_iterator iterator)
10338 : base_(base), iterator_(iterator) {}
10339 virtual ~Iterator() {}
10341 virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
10344 virtual void Advance() {
10348 virtual ParamIteratorInterface<T>* Clone() const {
10349 return new Iterator(*this);
10351 // We need to use cached value referenced by iterator_ because *iterator_
10352 // can return a temporary object (and of type other then T), so just
10353 // having "return &*iterator_;" doesn't work.
10354 // value_ is updated here and not in Advance() because Advance()
10355 // can advance iterator_ beyond the end of the range, and we cannot
10356 // detect that fact. The client code, on the other hand, is
10357 // responsible for not calling Current() on an out-of-range iterator.
10358 virtual const T* Current() const {
10359 if (value_.get() == NULL)
10360 value_.reset(new T(*iterator_));
10361 return value_.get();
10363 virtual bool Equals(const ParamIteratorInterface<T>& other) const {
10364 // Having the same base generator guarantees that the other
10365 // iterator is of the same type and we can downcast.
10366 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
10367 << "The program attempted to compare iterators "
10368 << "from different generators." << std::endl;
10369 return iterator_ ==
10370 CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
10374 Iterator(const Iterator& other)
10375 // The explicit constructor call suppresses a false warning
10376 // emitted by gcc when supplied with the -Wextra option.
10377 : ParamIteratorInterface<T>(),
10378 base_(other.base_),
10379 iterator_(other.iterator_) {}
10381 const ParamGeneratorInterface<T>* const base_;
10382 typename ContainerType::const_iterator iterator_;
10383 // A cached value of *iterator_. We keep it here to allow access by
10384 // pointer in the wrapping iterator's operator->().
10385 // value_ needs to be mutable to be accessed in Current().
10386 // Use of scoped_ptr helps manage cached value's lifetime,
10387 // which is bound by the lifespan of the iterator itself.
10388 mutable scoped_ptr<const T> value_;
10389 }; // class ValuesInIteratorRangeGenerator::Iterator
10391 // No implementation - assignment is unsupported.
10392 void operator=(const ValuesInIteratorRangeGenerator& other);
10394 const ContainerType container_;
10395 }; // class ValuesInIteratorRangeGenerator
10397 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10399 // Stores a parameter value and later creates tests parameterized with that
10401 template <class TestClass>
10402 class ParameterizedTestFactory : public TestFactoryBase {
10404 typedef typename TestClass::ParamType ParamType;
10405 explicit ParameterizedTestFactory(ParamType parameter) :
10406 parameter_(parameter) {}
10407 virtual Test* CreateTest() {
10408 TestClass::SetParam(¶meter_);
10409 return new TestClass();
10413 const ParamType parameter_;
10415 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
10418 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10420 // TestMetaFactoryBase is a base class for meta-factories that create
10421 // test factories for passing into MakeAndRegisterTestInfo function.
10422 template <class ParamType>
10423 class TestMetaFactoryBase {
10425 virtual ~TestMetaFactoryBase() {}
10427 virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
10430 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10432 // TestMetaFactory creates test factories for passing into
10433 // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
10434 // ownership of test factory pointer, same factory object cannot be passed
10435 // into that method twice. But ParameterizedTestCaseInfo is going to call
10436 // it for each Test/Parameter value combination. Thus it needs meta factory
10438 template <class TestCase>
10439 class TestMetaFactory
10440 : public TestMetaFactoryBase<typename TestCase::ParamType> {
10442 typedef typename TestCase::ParamType ParamType;
10444 TestMetaFactory() {}
10446 virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
10447 return new ParameterizedTestFactory<TestCase>(parameter);
10451 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
10454 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10456 // ParameterizedTestCaseInfoBase is a generic interface
10457 // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
10458 // accumulates test information provided by TEST_P macro invocations
10459 // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
10460 // and uses that information to register all resulting test instances
10461 // in RegisterTests method. The ParameterizeTestCaseRegistry class holds
10462 // a collection of pointers to the ParameterizedTestCaseInfo objects
10463 // and calls RegisterTests() on each of them when asked.
10464 class ParameterizedTestCaseInfoBase {
10466 virtual ~ParameterizedTestCaseInfoBase() {}
10468 // Base part of test case name for display purposes.
10469 virtual const string& GetTestCaseName() const = 0;
10470 // Test case id to verify identity.
10471 virtual TypeId GetTestCaseTypeId() const = 0;
10472 // UnitTest class invokes this method to register tests in this
10473 // test case right before running them in RUN_ALL_TESTS macro.
10474 // This method should not be called more then once on any single
10475 // instance of a ParameterizedTestCaseInfoBase derived class.
10476 virtual void RegisterTests() = 0;
10479 ParameterizedTestCaseInfoBase() {}
10482 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
10485 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10487 // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
10488 // macro invocations for a particular test case and generators
10489 // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
10490 // test case. It registers tests with all values generated by all
10491 // generators when asked.
10492 template <class TestCase>
10493 class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
10495 // ParamType and GeneratorCreationFunc are private types but are required
10496 // for declarations of public methods AddTestPattern() and
10497 // AddTestCaseInstantiation().
10498 typedef typename TestCase::ParamType ParamType;
10499 // A function that returns an instance of appropriate generator type.
10500 typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
10502 explicit ParameterizedTestCaseInfo(const char* name)
10503 : test_case_name_(name) {}
10505 // Test case base name for display purposes.
10506 virtual const string& GetTestCaseName() const { return test_case_name_; }
10507 // Test case id to verify identity.
10508 virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
10509 // TEST_P macro uses AddTestPattern() to record information
10510 // about a single test in a LocalTestInfo structure.
10511 // test_case_name is the base name of the test case (without invocation
10512 // prefix). test_base_name is the name of an individual test without
10513 // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
10514 // test case base name and DoBar is test base name.
10515 void AddTestPattern(const char* test_case_name,
10516 const char* test_base_name,
10517 TestMetaFactoryBase<ParamType>* meta_factory) {
10518 tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
10522 // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
10523 // about a generator.
10524 int AddTestCaseInstantiation(const string& instantiation_name,
10525 GeneratorCreationFunc* func,
10526 const char* /* file */,
10528 instantiations_.push_back(::std::make_pair(instantiation_name, func));
10529 return 0; // Return value used only to run this method in namespace scope.
10531 // UnitTest class invokes this method to register tests in this test case
10532 // test cases right before running tests in RUN_ALL_TESTS macro.
10533 // This method should not be called more then once on any single
10534 // instance of a ParameterizedTestCaseInfoBase derived class.
10535 // UnitTest has a guard to prevent from calling this method more then once.
10536 virtual void RegisterTests() {
10537 for (typename TestInfoContainer::iterator test_it = tests_.begin();
10538 test_it != tests_.end(); ++test_it) {
10539 linked_ptr<TestInfo> test_info = *test_it;
10540 for (typename InstantiationContainer::iterator gen_it =
10541 instantiations_.begin(); gen_it != instantiations_.end();
10543 const string& instantiation_name = gen_it->first;
10544 ParamGenerator<ParamType> generator((*gen_it->second)());
10546 string test_case_name;
10547 if ( !instantiation_name.empty() )
10548 test_case_name = instantiation_name + "/";
10549 test_case_name += test_info->test_case_base_name;
10552 for (typename ParamGenerator<ParamType>::iterator param_it =
10554 param_it != generator.end(); ++param_it, ++i) {
10555 Message test_name_stream;
10556 test_name_stream << test_info->test_base_name << "/" << i;
10557 MakeAndRegisterTestInfo(
10558 test_case_name.c_str(),
10559 test_name_stream.GetString().c_str(),
10560 NULL, // No type parameter.
10561 PrintToString(*param_it).c_str(),
10562 GetTestCaseTypeId(),
10563 TestCase::SetUpTestCase,
10564 TestCase::TearDownTestCase,
10565 test_info->test_meta_factory->CreateTestFactory(*param_it));
10572 // LocalTestInfo structure keeps information about a single test registered
10573 // with TEST_P macro.
10575 TestInfo(const char* a_test_case_base_name,
10576 const char* a_test_base_name,
10577 TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
10578 test_case_base_name(a_test_case_base_name),
10579 test_base_name(a_test_base_name),
10580 test_meta_factory(a_test_meta_factory) {}
10582 const string test_case_base_name;
10583 const string test_base_name;
10584 const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
10586 typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
10587 // Keeps pairs of <Instantiation name, Sequence generator creation function>
10588 // received from INSTANTIATE_TEST_CASE_P macros.
10589 typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
10590 InstantiationContainer;
10592 const string test_case_name_;
10593 TestInfoContainer tests_;
10594 InstantiationContainer instantiations_;
10596 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
10597 }; // class ParameterizedTestCaseInfo
10599 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10601 // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
10602 // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
10603 // macros use it to locate their corresponding ParameterizedTestCaseInfo
10605 class ParameterizedTestCaseRegistry {
10607 ParameterizedTestCaseRegistry() {}
10608 ~ParameterizedTestCaseRegistry() {
10609 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10610 it != test_case_infos_.end(); ++it) {
10615 // Looks up or creates and returns a structure containing information about
10616 // tests and instantiations of a particular test case.
10617 template <class TestCase>
10618 ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
10619 const char* test_case_name,
10622 ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
10623 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10624 it != test_case_infos_.end(); ++it) {
10625 if ((*it)->GetTestCaseName() == test_case_name) {
10626 if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
10627 // Complain about incorrect usage of Google Test facilities
10628 // and terminate the program since we cannot guaranty correct
10629 // test case setup and tear-down in this case.
10630 ReportInvalidTestCaseType(test_case_name, file, line);
10633 // At this point we are sure that the object we found is of the same
10634 // type we are looking for, so we downcast it to that type
10635 // without further checks.
10636 typed_test_info = CheckedDowncastToActualType<
10637 ParameterizedTestCaseInfo<TestCase> >(*it);
10642 if (typed_test_info == NULL) {
10643 typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
10644 test_case_infos_.push_back(typed_test_info);
10646 return typed_test_info;
10648 void RegisterTests() {
10649 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10650 it != test_case_infos_.end(); ++it) {
10651 (*it)->RegisterTests();
10656 typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
10658 TestCaseInfoContainer test_case_infos_;
10660 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
10663 } // namespace internal
10664 } // namespace testing
10666 #endif // GTEST_HAS_PARAM_TEST
10668 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
10669 // This file was GENERATED by command:
10670 // pump.py gtest-param-util-generated.h.pump
10671 // DO NOT EDIT BY HAND!!!
10673 // Copyright 2008 Google Inc.
10674 // All Rights Reserved.
10676 // Redistribution and use in source and binary forms, with or without
10677 // modification, are permitted provided that the following conditions are
10680 // * Redistributions of source code must retain the above copyright
10681 // notice, this list of conditions and the following disclaimer.
10682 // * Redistributions in binary form must reproduce the above
10683 // copyright notice, this list of conditions and the following disclaimer
10684 // in the documentation and/or other materials provided with the
10686 // * Neither the name of Google Inc. nor the names of its
10687 // contributors may be used to endorse or promote products derived from
10688 // this software without specific prior written permission.
10690 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10691 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10692 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10693 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10694 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10695 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10696 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10697 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
10698 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10699 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
10700 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10702 // Author: vladl@google.com (Vlad Losev)
10704 // Type and function utilities for implementing parameterized tests.
10705 // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
10707 // Currently Google Test supports at most 50 arguments in Values,
10708 // and at most 10 arguments in Combine. Please contact
10709 // googletestframework@googlegroups.com if you need more.
10710 // Please note that the number of arguments to Combine is limited
10711 // by the maximum arity of the implementation of tr1::tuple which is
10712 // currently set at 10.
10714 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
10715 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
10717 // scripts/fuse_gtest.py depends on gtest's own header being #included
10718 // *unconditionally*. Therefore these #includes cannot be moved
10719 // inside #if GTEST_HAS_PARAM_TEST.
10721 #if GTEST_HAS_PARAM_TEST
10723 namespace testing {
10725 // Forward declarations of ValuesIn(), which is implemented in
10726 // include/gtest/gtest-param-test.h.
10727 template <typename ForwardIterator>
10728 internal::ParamGenerator<
10729 typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
10730 ValuesIn(ForwardIterator begin, ForwardIterator end);
10732 template <typename T, size_t N>
10733 internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
10735 template <class Container>
10736 internal::ParamGenerator<typename Container::value_type> ValuesIn(
10737 const Container& container);
10739 namespace internal {
10741 // Used in the Values() function to provide polymorphic capabilities.
10742 template <typename T1>
10743 class ValueArray1 {
10745 explicit ValueArray1(T1 v1) : v1_(v1) {}
10747 template <typename T>
10748 operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
10751 // No implementation - assignment is unsupported.
10752 void operator=(const ValueArray1& other);
10757 template <typename T1, typename T2>
10758 class ValueArray2 {
10760 ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
10762 template <typename T>
10763 operator ParamGenerator<T>() const {
10764 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};
10765 return ValuesIn(array);
10769 // No implementation - assignment is unsupported.
10770 void operator=(const ValueArray2& other);
10776 template <typename T1, typename T2, typename T3>
10777 class ValueArray3 {
10779 ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
10781 template <typename T>
10782 operator ParamGenerator<T>() const {
10783 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10784 static_cast<T>(v3_)};
10785 return ValuesIn(array);
10789 // No implementation - assignment is unsupported.
10790 void operator=(const ValueArray3& other);
10797 template <typename T1, typename T2, typename T3, typename T4>
10798 class ValueArray4 {
10800 ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
10803 template <typename T>
10804 operator ParamGenerator<T>() const {
10805 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10806 static_cast<T>(v3_), static_cast<T>(v4_)};
10807 return ValuesIn(array);
10811 // No implementation - assignment is unsupported.
10812 void operator=(const ValueArray4& other);
10820 template <typename T1, typename T2, typename T3, typename T4, typename T5>
10821 class ValueArray5 {
10823 ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
10824 v4_(v4), v5_(v5) {}
10826 template <typename T>
10827 operator ParamGenerator<T>() const {
10828 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10829 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};
10830 return ValuesIn(array);
10834 // No implementation - assignment is unsupported.
10835 void operator=(const ValueArray5& other);
10844 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10846 class ValueArray6 {
10848 ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
10849 v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
10851 template <typename T>
10852 operator ParamGenerator<T>() const {
10853 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10854 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10855 static_cast<T>(v6_)};
10856 return ValuesIn(array);
10860 // No implementation - assignment is unsupported.
10861 void operator=(const ValueArray6& other);
10871 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10872 typename T6, typename T7>
10873 class ValueArray7 {
10875 ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
10876 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
10878 template <typename T>
10879 operator ParamGenerator<T>() const {
10880 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10881 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10882 static_cast<T>(v6_), static_cast<T>(v7_)};
10883 return ValuesIn(array);
10887 // No implementation - assignment is unsupported.
10888 void operator=(const ValueArray7& other);
10899 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10900 typename T6, typename T7, typename T8>
10901 class ValueArray8 {
10903 ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
10904 T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10907 template <typename T>
10908 operator ParamGenerator<T>() const {
10909 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10910 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10911 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};
10912 return ValuesIn(array);
10916 // No implementation - assignment is unsupported.
10917 void operator=(const ValueArray8& other);
10929 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10930 typename T6, typename T7, typename T8, typename T9>
10931 class ValueArray9 {
10933 ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
10934 T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10935 v8_(v8), v9_(v9) {}
10937 template <typename T>
10938 operator ParamGenerator<T>() const {
10939 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10940 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10941 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10942 static_cast<T>(v9_)};
10943 return ValuesIn(array);
10947 // No implementation - assignment is unsupported.
10948 void operator=(const ValueArray9& other);
10961 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10962 typename T6, typename T7, typename T8, typename T9, typename T10>
10963 class ValueArray10 {
10965 ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10966 T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10967 v8_(v8), v9_(v9), v10_(v10) {}
10969 template <typename T>
10970 operator ParamGenerator<T>() const {
10971 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10972 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10973 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10974 static_cast<T>(v9_), static_cast<T>(v10_)};
10975 return ValuesIn(array);
10979 // No implementation - assignment is unsupported.
10980 void operator=(const ValueArray10& other);
10994 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10995 typename T6, typename T7, typename T8, typename T9, typename T10,
10997 class ValueArray11 {
10999 ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11000 T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11001 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
11003 template <typename T>
11004 operator ParamGenerator<T>() const {
11005 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11006 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11007 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11008 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};
11009 return ValuesIn(array);
11013 // No implementation - assignment is unsupported.
11014 void operator=(const ValueArray11& other);
11029 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11030 typename T6, typename T7, typename T8, typename T9, typename T10,
11031 typename T11, typename T12>
11032 class ValueArray12 {
11034 ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11035 T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11036 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
11038 template <typename T>
11039 operator ParamGenerator<T>() const {
11040 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11041 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11042 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11043 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11044 static_cast<T>(v12_)};
11045 return ValuesIn(array);
11049 // No implementation - assignment is unsupported.
11050 void operator=(const ValueArray12& other);
11066 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11067 typename T6, typename T7, typename T8, typename T9, typename T10,
11068 typename T11, typename T12, typename T13>
11069 class ValueArray13 {
11071 ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11072 T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11073 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11074 v12_(v12), v13_(v13) {}
11076 template <typename T>
11077 operator ParamGenerator<T>() const {
11078 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11079 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11080 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11081 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11082 static_cast<T>(v12_), static_cast<T>(v13_)};
11083 return ValuesIn(array);
11087 // No implementation - assignment is unsupported.
11088 void operator=(const ValueArray13& other);
11105 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11106 typename T6, typename T7, typename T8, typename T9, typename T10,
11107 typename T11, typename T12, typename T13, typename T14>
11108 class ValueArray14 {
11110 ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11111 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
11112 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11113 v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
11115 template <typename T>
11116 operator ParamGenerator<T>() const {
11117 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11118 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11119 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11120 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11121 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};
11122 return ValuesIn(array);
11126 // No implementation - assignment is unsupported.
11127 void operator=(const ValueArray14& other);
11145 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11146 typename T6, typename T7, typename T8, typename T9, typename T10,
11147 typename T11, typename T12, typename T13, typename T14, typename T15>
11148 class ValueArray15 {
11150 ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11151 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
11152 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11153 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
11155 template <typename T>
11156 operator ParamGenerator<T>() const {
11157 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11158 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11159 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11160 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11161 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11162 static_cast<T>(v15_)};
11163 return ValuesIn(array);
11167 // No implementation - assignment is unsupported.
11168 void operator=(const ValueArray15& other);
11187 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11188 typename T6, typename T7, typename T8, typename T9, typename T10,
11189 typename T11, typename T12, typename T13, typename T14, typename T15,
11191 class ValueArray16 {
11193 ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11194 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
11195 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11196 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11199 template <typename T>
11200 operator ParamGenerator<T>() const {
11201 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11202 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11203 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11204 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11205 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11206 static_cast<T>(v15_), static_cast<T>(v16_)};
11207 return ValuesIn(array);
11211 // No implementation - assignment is unsupported.
11212 void operator=(const ValueArray16& other);
11232 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11233 typename T6, typename T7, typename T8, typename T9, typename T10,
11234 typename T11, typename T12, typename T13, typename T14, typename T15,
11235 typename T16, typename T17>
11236 class ValueArray17 {
11238 ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11239 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
11240 T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11241 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11242 v15_(v15), v16_(v16), v17_(v17) {}
11244 template <typename T>
11245 operator ParamGenerator<T>() const {
11246 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11247 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11248 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11249 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11250 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11251 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};
11252 return ValuesIn(array);
11256 // No implementation - assignment is unsupported.
11257 void operator=(const ValueArray17& other);
11278 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11279 typename T6, typename T7, typename T8, typename T9, typename T10,
11280 typename T11, typename T12, typename T13, typename T14, typename T15,
11281 typename T16, typename T17, typename T18>
11282 class ValueArray18 {
11284 ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11285 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11286 T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11287 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11288 v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
11290 template <typename T>
11291 operator ParamGenerator<T>() const {
11292 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11293 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11294 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11295 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11296 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11297 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11298 static_cast<T>(v18_)};
11299 return ValuesIn(array);
11303 // No implementation - assignment is unsupported.
11304 void operator=(const ValueArray18& other);
11326 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11327 typename T6, typename T7, typename T8, typename T9, typename T10,
11328 typename T11, typename T12, typename T13, typename T14, typename T15,
11329 typename T16, typename T17, typename T18, typename T19>
11330 class ValueArray19 {
11332 ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11333 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11334 T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11335 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11336 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
11338 template <typename T>
11339 operator ParamGenerator<T>() const {
11340 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11341 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11342 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11343 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11344 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11345 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11346 static_cast<T>(v18_), static_cast<T>(v19_)};
11347 return ValuesIn(array);
11351 // No implementation - assignment is unsupported.
11352 void operator=(const ValueArray19& other);
11375 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11376 typename T6, typename T7, typename T8, typename T9, typename T10,
11377 typename T11, typename T12, typename T13, typename T14, typename T15,
11378 typename T16, typename T17, typename T18, typename T19, typename T20>
11379 class ValueArray20 {
11381 ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11382 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11383 T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11384 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11385 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11386 v19_(v19), v20_(v20) {}
11388 template <typename T>
11389 operator ParamGenerator<T>() const {
11390 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11391 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11392 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11393 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11394 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11395 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11396 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};
11397 return ValuesIn(array);
11401 // No implementation - assignment is unsupported.
11402 void operator=(const ValueArray20& other);
11426 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11427 typename T6, typename T7, typename T8, typename T9, typename T10,
11428 typename T11, typename T12, typename T13, typename T14, typename T15,
11429 typename T16, typename T17, typename T18, typename T19, typename T20,
11431 class ValueArray21 {
11433 ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11434 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11435 T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11436 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11437 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11438 v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
11440 template <typename T>
11441 operator ParamGenerator<T>() const {
11442 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11443 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11444 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11445 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11446 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11447 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11448 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11449 static_cast<T>(v21_)};
11450 return ValuesIn(array);
11454 // No implementation - assignment is unsupported.
11455 void operator=(const ValueArray21& other);
11480 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11481 typename T6, typename T7, typename T8, typename T9, typename T10,
11482 typename T11, typename T12, typename T13, typename T14, typename T15,
11483 typename T16, typename T17, typename T18, typename T19, typename T20,
11484 typename T21, typename T22>
11485 class ValueArray22 {
11487 ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11488 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11489 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
11490 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11491 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11492 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
11494 template <typename T>
11495 operator ParamGenerator<T>() const {
11496 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11497 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11498 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11499 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11500 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11501 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11502 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11503 static_cast<T>(v21_), static_cast<T>(v22_)};
11504 return ValuesIn(array);
11508 // No implementation - assignment is unsupported.
11509 void operator=(const ValueArray22& other);
11535 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11536 typename T6, typename T7, typename T8, typename T9, typename T10,
11537 typename T11, typename T12, typename T13, typename T14, typename T15,
11538 typename T16, typename T17, typename T18, typename T19, typename T20,
11539 typename T21, typename T22, typename T23>
11540 class ValueArray23 {
11542 ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11543 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11544 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
11545 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11546 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11547 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11550 template <typename T>
11551 operator ParamGenerator<T>() const {
11552 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11553 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11554 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11555 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11556 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11557 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11558 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11559 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};
11560 return ValuesIn(array);
11564 // No implementation - assignment is unsupported.
11565 void operator=(const ValueArray23& other);
11592 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11593 typename T6, typename T7, typename T8, typename T9, typename T10,
11594 typename T11, typename T12, typename T13, typename T14, typename T15,
11595 typename T16, typename T17, typename T18, typename T19, typename T20,
11596 typename T21, typename T22, typename T23, typename T24>
11597 class ValueArray24 {
11599 ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11600 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11601 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
11602 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11603 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11604 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
11605 v22_(v22), v23_(v23), v24_(v24) {}
11607 template <typename T>
11608 operator ParamGenerator<T>() const {
11609 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11610 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11611 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11612 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11613 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11614 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11615 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11616 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11617 static_cast<T>(v24_)};
11618 return ValuesIn(array);
11622 // No implementation - assignment is unsupported.
11623 void operator=(const ValueArray24& other);
11651 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11652 typename T6, typename T7, typename T8, typename T9, typename T10,
11653 typename T11, typename T12, typename T13, typename T14, typename T15,
11654 typename T16, typename T17, typename T18, typename T19, typename T20,
11655 typename T21, typename T22, typename T23, typename T24, typename T25>
11656 class ValueArray25 {
11658 ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11659 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11660 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
11661 T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11662 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11663 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11664 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
11666 template <typename T>
11667 operator ParamGenerator<T>() const {
11668 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11669 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11670 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11671 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11672 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11673 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11674 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11675 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11676 static_cast<T>(v24_), static_cast<T>(v25_)};
11677 return ValuesIn(array);
11681 // No implementation - assignment is unsupported.
11682 void operator=(const ValueArray25& other);
11711 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11712 typename T6, typename T7, typename T8, typename T9, typename T10,
11713 typename T11, typename T12, typename T13, typename T14, typename T15,
11714 typename T16, typename T17, typename T18, typename T19, typename T20,
11715 typename T21, typename T22, typename T23, typename T24, typename T25,
11717 class ValueArray26 {
11719 ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11720 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11721 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11722 T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11723 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11724 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11725 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
11727 template <typename T>
11728 operator ParamGenerator<T>() const {
11729 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11730 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11731 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11732 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11733 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11734 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11735 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11736 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11737 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};
11738 return ValuesIn(array);
11742 // No implementation - assignment is unsupported.
11743 void operator=(const ValueArray26& other);
11773 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11774 typename T6, typename T7, typename T8, typename T9, typename T10,
11775 typename T11, typename T12, typename T13, typename T14, typename T15,
11776 typename T16, typename T17, typename T18, typename T19, typename T20,
11777 typename T21, typename T22, typename T23, typename T24, typename T25,
11778 typename T26, typename T27>
11779 class ValueArray27 {
11781 ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11782 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11783 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11784 T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11785 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11786 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
11787 v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
11788 v26_(v26), v27_(v27) {}
11790 template <typename T>
11791 operator ParamGenerator<T>() const {
11792 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11793 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11794 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11795 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11796 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11797 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11798 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11799 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11800 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11801 static_cast<T>(v27_)};
11802 return ValuesIn(array);
11806 // No implementation - assignment is unsupported.
11807 void operator=(const ValueArray27& other);
11838 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11839 typename T6, typename T7, typename T8, typename T9, typename T10,
11840 typename T11, typename T12, typename T13, typename T14, typename T15,
11841 typename T16, typename T17, typename T18, typename T19, typename T20,
11842 typename T21, typename T22, typename T23, typename T24, typename T25,
11843 typename T26, typename T27, typename T28>
11844 class ValueArray28 {
11846 ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11847 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11848 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11849 T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11850 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11851 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11852 v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
11853 v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
11855 template <typename T>
11856 operator ParamGenerator<T>() const {
11857 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11858 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11859 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11860 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11861 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11862 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11863 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11864 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11865 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11866 static_cast<T>(v27_), static_cast<T>(v28_)};
11867 return ValuesIn(array);
11871 // No implementation - assignment is unsupported.
11872 void operator=(const ValueArray28& other);
11904 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11905 typename T6, typename T7, typename T8, typename T9, typename T10,
11906 typename T11, typename T12, typename T13, typename T14, typename T15,
11907 typename T16, typename T17, typename T18, typename T19, typename T20,
11908 typename T21, typename T22, typename T23, typename T24, typename T25,
11909 typename T26, typename T27, typename T28, typename T29>
11910 class ValueArray29 {
11912 ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11913 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11914 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11915 T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11916 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11917 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11918 v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
11919 v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
11921 template <typename T>
11922 operator ParamGenerator<T>() const {
11923 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11924 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11925 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11926 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11927 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11928 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11929 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11930 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11931 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11932 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};
11933 return ValuesIn(array);
11937 // No implementation - assignment is unsupported.
11938 void operator=(const ValueArray29& other);
11971 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11972 typename T6, typename T7, typename T8, typename T9, typename T10,
11973 typename T11, typename T12, typename T13, typename T14, typename T15,
11974 typename T16, typename T17, typename T18, typename T19, typename T20,
11975 typename T21, typename T22, typename T23, typename T24, typename T25,
11976 typename T26, typename T27, typename T28, typename T29, typename T30>
11977 class ValueArray30 {
11979 ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11980 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11981 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11982 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
11983 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11984 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11985 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11986 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
11987 v29_(v29), v30_(v30) {}
11989 template <typename T>
11990 operator ParamGenerator<T>() const {
11991 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11992 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11993 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11994 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11995 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11996 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11997 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11998 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11999 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12000 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12001 static_cast<T>(v30_)};
12002 return ValuesIn(array);
12006 // No implementation - assignment is unsupported.
12007 void operator=(const ValueArray30& other);
12041 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12042 typename T6, typename T7, typename T8, typename T9, typename T10,
12043 typename T11, typename T12, typename T13, typename T14, typename T15,
12044 typename T16, typename T17, typename T18, typename T19, typename T20,
12045 typename T21, typename T22, typename T23, typename T24, typename T25,
12046 typename T26, typename T27, typename T28, typename T29, typename T30,
12048 class ValueArray31 {
12050 ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12051 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12052 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12053 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
12054 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12055 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12056 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12057 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12058 v29_(v29), v30_(v30), v31_(v31) {}
12060 template <typename T>
12061 operator ParamGenerator<T>() const {
12062 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12063 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12064 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12065 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12066 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12067 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12068 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12069 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12070 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12071 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12072 static_cast<T>(v30_), static_cast<T>(v31_)};
12073 return ValuesIn(array);
12077 // No implementation - assignment is unsupported.
12078 void operator=(const ValueArray31& other);
12113 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12114 typename T6, typename T7, typename T8, typename T9, typename T10,
12115 typename T11, typename T12, typename T13, typename T14, typename T15,
12116 typename T16, typename T17, typename T18, typename T19, typename T20,
12117 typename T21, typename T22, typename T23, typename T24, typename T25,
12118 typename T26, typename T27, typename T28, typename T29, typename T30,
12119 typename T31, typename T32>
12120 class ValueArray32 {
12122 ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12123 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12124 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12125 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
12126 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12127 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12128 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
12129 v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
12130 v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
12132 template <typename T>
12133 operator ParamGenerator<T>() const {
12134 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12135 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12136 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12137 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12138 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12139 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12140 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12141 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12142 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12143 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12144 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};
12145 return ValuesIn(array);
12149 // No implementation - assignment is unsupported.
12150 void operator=(const ValueArray32& other);
12186 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12187 typename T6, typename T7, typename T8, typename T9, typename T10,
12188 typename T11, typename T12, typename T13, typename T14, typename T15,
12189 typename T16, typename T17, typename T18, typename T19, typename T20,
12190 typename T21, typename T22, typename T23, typename T24, typename T25,
12191 typename T26, typename T27, typename T28, typename T29, typename T30,
12192 typename T31, typename T32, typename T33>
12193 class ValueArray33 {
12195 ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12196 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12197 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12198 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
12199 T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12200 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12201 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12202 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12203 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12206 template <typename T>
12207 operator ParamGenerator<T>() const {
12208 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12209 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12210 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12211 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12212 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12213 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12214 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12215 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12216 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12217 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12218 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12219 static_cast<T>(v33_)};
12220 return ValuesIn(array);
12224 // No implementation - assignment is unsupported.
12225 void operator=(const ValueArray33& other);
12262 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12263 typename T6, typename T7, typename T8, typename T9, typename T10,
12264 typename T11, typename T12, typename T13, typename T14, typename T15,
12265 typename T16, typename T17, typename T18, typename T19, typename T20,
12266 typename T21, typename T22, typename T23, typename T24, typename T25,
12267 typename T26, typename T27, typename T28, typename T29, typename T30,
12268 typename T31, typename T32, typename T33, typename T34>
12269 class ValueArray34 {
12271 ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12272 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12273 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12274 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12275 T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12276 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12277 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12278 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12279 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12280 v33_(v33), v34_(v34) {}
12282 template <typename T>
12283 operator ParamGenerator<T>() const {
12284 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12285 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12286 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12287 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12288 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12289 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12290 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12291 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12292 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12293 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12294 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12295 static_cast<T>(v33_), static_cast<T>(v34_)};
12296 return ValuesIn(array);
12300 // No implementation - assignment is unsupported.
12301 void operator=(const ValueArray34& other);
12339 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12340 typename T6, typename T7, typename T8, typename T9, typename T10,
12341 typename T11, typename T12, typename T13, typename T14, typename T15,
12342 typename T16, typename T17, typename T18, typename T19, typename T20,
12343 typename T21, typename T22, typename T23, typename T24, typename T25,
12344 typename T26, typename T27, typename T28, typename T29, typename T30,
12345 typename T31, typename T32, typename T33, typename T34, typename T35>
12346 class ValueArray35 {
12348 ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12349 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12350 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12351 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12352 T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12353 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12354 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
12355 v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
12356 v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
12357 v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
12359 template <typename T>
12360 operator ParamGenerator<T>() const {
12361 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12362 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12363 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12364 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12365 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12366 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12367 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12368 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12369 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12370 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12371 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12372 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};
12373 return ValuesIn(array);
12377 // No implementation - assignment is unsupported.
12378 void operator=(const ValueArray35& other);
12417 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12418 typename T6, typename T7, typename T8, typename T9, typename T10,
12419 typename T11, typename T12, typename T13, typename T14, typename T15,
12420 typename T16, typename T17, typename T18, typename T19, typename T20,
12421 typename T21, typename T22, typename T23, typename T24, typename T25,
12422 typename T26, typename T27, typename T28, typename T29, typename T30,
12423 typename T31, typename T32, typename T33, typename T34, typename T35,
12425 class ValueArray36 {
12427 ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12428 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12429 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12430 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12431 T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
12432 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
12433 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
12434 v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
12435 v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
12436 v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
12438 template <typename T>
12439 operator ParamGenerator<T>() const {
12440 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12441 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12442 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12443 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12444 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12445 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12446 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12447 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12448 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12449 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12450 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12451 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12452 static_cast<T>(v36_)};
12453 return ValuesIn(array);
12457 // No implementation - assignment is unsupported.
12458 void operator=(const ValueArray36& other);
12498 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12499 typename T6, typename T7, typename T8, typename T9, typename T10,
12500 typename T11, typename T12, typename T13, typename T14, typename T15,
12501 typename T16, typename T17, typename T18, typename T19, typename T20,
12502 typename T21, typename T22, typename T23, typename T24, typename T25,
12503 typename T26, typename T27, typename T28, typename T29, typename T30,
12504 typename T31, typename T32, typename T33, typename T34, typename T35,
12505 typename T36, typename T37>
12506 class ValueArray37 {
12508 ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12509 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12510 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12511 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12512 T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
12513 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
12514 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
12515 v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
12516 v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
12517 v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
12518 v36_(v36), v37_(v37) {}
12520 template <typename T>
12521 operator ParamGenerator<T>() const {
12522 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12523 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12524 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12525 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12526 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12527 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12528 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12529 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12530 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12531 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12532 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12533 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12534 static_cast<T>(v36_), static_cast<T>(v37_)};
12535 return ValuesIn(array);
12539 // No implementation - assignment is unsupported.
12540 void operator=(const ValueArray37& other);
12581 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12582 typename T6, typename T7, typename T8, typename T9, typename T10,
12583 typename T11, typename T12, typename T13, typename T14, typename T15,
12584 typename T16, typename T17, typename T18, typename T19, typename T20,
12585 typename T21, typename T22, typename T23, typename T24, typename T25,
12586 typename T26, typename T27, typename T28, typename T29, typename T30,
12587 typename T31, typename T32, typename T33, typename T34, typename T35,
12588 typename T36, typename T37, typename T38>
12589 class ValueArray38 {
12591 ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12592 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12593 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12594 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12595 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
12596 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12597 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12598 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12599 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12600 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12601 v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
12603 template <typename T>
12604 operator ParamGenerator<T>() const {
12605 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12606 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12607 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12608 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12609 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12610 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12611 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12612 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12613 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12614 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12615 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12616 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12617 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};
12618 return ValuesIn(array);
12622 // No implementation - assignment is unsupported.
12623 void operator=(const ValueArray38& other);
12665 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12666 typename T6, typename T7, typename T8, typename T9, typename T10,
12667 typename T11, typename T12, typename T13, typename T14, typename T15,
12668 typename T16, typename T17, typename T18, typename T19, typename T20,
12669 typename T21, typename T22, typename T23, typename T24, typename T25,
12670 typename T26, typename T27, typename T28, typename T29, typename T30,
12671 typename T31, typename T32, typename T33, typename T34, typename T35,
12672 typename T36, typename T37, typename T38, typename T39>
12673 class ValueArray39 {
12675 ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12676 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12677 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12678 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12679 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
12680 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12681 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12682 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12683 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12684 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12685 v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
12687 template <typename T>
12688 operator ParamGenerator<T>() const {
12689 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12690 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12691 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12692 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12693 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12694 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12695 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12696 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12697 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12698 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12699 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12700 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12701 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12702 static_cast<T>(v39_)};
12703 return ValuesIn(array);
12707 // No implementation - assignment is unsupported.
12708 void operator=(const ValueArray39& other);
12751 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12752 typename T6, typename T7, typename T8, typename T9, typename T10,
12753 typename T11, typename T12, typename T13, typename T14, typename T15,
12754 typename T16, typename T17, typename T18, typename T19, typename T20,
12755 typename T21, typename T22, typename T23, typename T24, typename T25,
12756 typename T26, typename T27, typename T28, typename T29, typename T30,
12757 typename T31, typename T32, typename T33, typename T34, typename T35,
12758 typename T36, typename T37, typename T38, typename T39, typename T40>
12759 class ValueArray40 {
12761 ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12762 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12763 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12764 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12765 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
12766 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12767 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12768 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
12769 v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
12770 v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
12771 v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
12774 template <typename T>
12775 operator ParamGenerator<T>() const {
12776 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12777 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12778 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12779 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12780 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12781 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12782 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12783 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12784 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12785 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12786 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12787 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12788 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12789 static_cast<T>(v39_), static_cast<T>(v40_)};
12790 return ValuesIn(array);
12794 // No implementation - assignment is unsupported.
12795 void operator=(const ValueArray40& other);
12839 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12840 typename T6, typename T7, typename T8, typename T9, typename T10,
12841 typename T11, typename T12, typename T13, typename T14, typename T15,
12842 typename T16, typename T17, typename T18, typename T19, typename T20,
12843 typename T21, typename T22, typename T23, typename T24, typename T25,
12844 typename T26, typename T27, typename T28, typename T29, typename T30,
12845 typename T31, typename T32, typename T33, typename T34, typename T35,
12846 typename T36, typename T37, typename T38, typename T39, typename T40,
12848 class ValueArray41 {
12850 ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12851 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12852 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12853 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12854 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
12855 T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12856 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12857 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12858 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12859 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12860 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
12861 v39_(v39), v40_(v40), v41_(v41) {}
12863 template <typename T>
12864 operator ParamGenerator<T>() const {
12865 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12866 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12867 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12868 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12869 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12870 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12871 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12872 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12873 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12874 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12875 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12876 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12877 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12878 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};
12879 return ValuesIn(array);
12883 // No implementation - assignment is unsupported.
12884 void operator=(const ValueArray41& other);
12929 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12930 typename T6, typename T7, typename T8, typename T9, typename T10,
12931 typename T11, typename T12, typename T13, typename T14, typename T15,
12932 typename T16, typename T17, typename T18, typename T19, typename T20,
12933 typename T21, typename T22, typename T23, typename T24, typename T25,
12934 typename T26, typename T27, typename T28, typename T29, typename T30,
12935 typename T31, typename T32, typename T33, typename T34, typename T35,
12936 typename T36, typename T37, typename T38, typename T39, typename T40,
12937 typename T41, typename T42>
12938 class ValueArray42 {
12940 ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12941 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12942 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12943 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12944 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
12945 T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12946 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12947 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12948 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12949 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12950 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
12951 v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
12953 template <typename T>
12954 operator ParamGenerator<T>() const {
12955 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12956 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12957 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12958 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12959 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12960 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12961 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12962 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12963 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12964 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12965 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12966 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12967 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12968 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
12969 static_cast<T>(v42_)};
12970 return ValuesIn(array);
12974 // No implementation - assignment is unsupported.
12975 void operator=(const ValueArray42& other);
13021 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13022 typename T6, typename T7, typename T8, typename T9, typename T10,
13023 typename T11, typename T12, typename T13, typename T14, typename T15,
13024 typename T16, typename T17, typename T18, typename T19, typename T20,
13025 typename T21, typename T22, typename T23, typename T24, typename T25,
13026 typename T26, typename T27, typename T28, typename T29, typename T30,
13027 typename T31, typename T32, typename T33, typename T34, typename T35,
13028 typename T36, typename T37, typename T38, typename T39, typename T40,
13029 typename T41, typename T42, typename T43>
13030 class ValueArray43 {
13032 ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13033 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13034 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13035 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13036 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13037 T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
13038 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
13039 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
13040 v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
13041 v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
13042 v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
13043 v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
13045 template <typename T>
13046 operator ParamGenerator<T>() const {
13047 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13048 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13049 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13050 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13051 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13052 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13053 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13054 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13055 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13056 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13057 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13058 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13059 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13060 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13061 static_cast<T>(v42_), static_cast<T>(v43_)};
13062 return ValuesIn(array);
13066 // No implementation - assignment is unsupported.
13067 void operator=(const ValueArray43& other);
13114 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13115 typename T6, typename T7, typename T8, typename T9, typename T10,
13116 typename T11, typename T12, typename T13, typename T14, typename T15,
13117 typename T16, typename T17, typename T18, typename T19, typename T20,
13118 typename T21, typename T22, typename T23, typename T24, typename T25,
13119 typename T26, typename T27, typename T28, typename T29, typename T30,
13120 typename T31, typename T32, typename T33, typename T34, typename T35,
13121 typename T36, typename T37, typename T38, typename T39, typename T40,
13122 typename T41, typename T42, typename T43, typename T44>
13123 class ValueArray44 {
13125 ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13126 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13127 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13128 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13129 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13130 T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
13131 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
13132 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
13133 v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
13134 v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
13135 v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
13136 v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
13137 v43_(v43), v44_(v44) {}
13139 template <typename T>
13140 operator ParamGenerator<T>() const {
13141 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13142 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13143 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13144 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13145 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13146 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13147 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13148 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13149 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13150 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13151 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13152 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13153 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13154 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13155 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};
13156 return ValuesIn(array);
13160 // No implementation - assignment is unsupported.
13161 void operator=(const ValueArray44& other);
13209 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13210 typename T6, typename T7, typename T8, typename T9, typename T10,
13211 typename T11, typename T12, typename T13, typename T14, typename T15,
13212 typename T16, typename T17, typename T18, typename T19, typename T20,
13213 typename T21, typename T22, typename T23, typename T24, typename T25,
13214 typename T26, typename T27, typename T28, typename T29, typename T30,
13215 typename T31, typename T32, typename T33, typename T34, typename T35,
13216 typename T36, typename T37, typename T38, typename T39, typename T40,
13217 typename T41, typename T42, typename T43, typename T44, typename T45>
13218 class ValueArray45 {
13220 ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13221 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13222 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13223 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13224 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13225 T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
13226 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
13227 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
13228 v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
13229 v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
13230 v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
13231 v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
13232 v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
13234 template <typename T>
13235 operator ParamGenerator<T>() const {
13236 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13237 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13238 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13239 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13240 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13241 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13242 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13243 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13244 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13245 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13246 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13247 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13248 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13249 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13250 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13251 static_cast<T>(v45_)};
13252 return ValuesIn(array);
13256 // No implementation - assignment is unsupported.
13257 void operator=(const ValueArray45& other);
13306 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13307 typename T6, typename T7, typename T8, typename T9, typename T10,
13308 typename T11, typename T12, typename T13, typename T14, typename T15,
13309 typename T16, typename T17, typename T18, typename T19, typename T20,
13310 typename T21, typename T22, typename T23, typename T24, typename T25,
13311 typename T26, typename T27, typename T28, typename T29, typename T30,
13312 typename T31, typename T32, typename T33, typename T34, typename T35,
13313 typename T36, typename T37, typename T38, typename T39, typename T40,
13314 typename T41, typename T42, typename T43, typename T44, typename T45,
13316 class ValueArray46 {
13318 ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13319 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13320 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13321 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13322 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13323 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
13324 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13325 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13326 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13327 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13328 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13329 v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
13330 v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
13332 template <typename T>
13333 operator ParamGenerator<T>() const {
13334 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13335 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13336 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13337 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13338 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13339 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13340 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13341 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13342 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13343 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13344 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13345 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13346 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13347 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13348 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13349 static_cast<T>(v45_), static_cast<T>(v46_)};
13350 return ValuesIn(array);
13354 // No implementation - assignment is unsupported.
13355 void operator=(const ValueArray46& other);
13405 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13406 typename T6, typename T7, typename T8, typename T9, typename T10,
13407 typename T11, typename T12, typename T13, typename T14, typename T15,
13408 typename T16, typename T17, typename T18, typename T19, typename T20,
13409 typename T21, typename T22, typename T23, typename T24, typename T25,
13410 typename T26, typename T27, typename T28, typename T29, typename T30,
13411 typename T31, typename T32, typename T33, typename T34, typename T35,
13412 typename T36, typename T37, typename T38, typename T39, typename T40,
13413 typename T41, typename T42, typename T43, typename T44, typename T45,
13414 typename T46, typename T47>
13415 class ValueArray47 {
13417 ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13418 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13419 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13420 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13421 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13422 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
13423 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13424 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13425 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13426 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13427 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13428 v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
13429 v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
13432 template <typename T>
13433 operator ParamGenerator<T>() const {
13434 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13435 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13436 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13437 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13438 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13439 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13440 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13441 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13442 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13443 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13444 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13445 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13446 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13447 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13448 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13449 static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};
13450 return ValuesIn(array);
13454 // No implementation - assignment is unsupported.
13455 void operator=(const ValueArray47& other);
13506 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13507 typename T6, typename T7, typename T8, typename T9, typename T10,
13508 typename T11, typename T12, typename T13, typename T14, typename T15,
13509 typename T16, typename T17, typename T18, typename T19, typename T20,
13510 typename T21, typename T22, typename T23, typename T24, typename T25,
13511 typename T26, typename T27, typename T28, typename T29, typename T30,
13512 typename T31, typename T32, typename T33, typename T34, typename T35,
13513 typename T36, typename T37, typename T38, typename T39, typename T40,
13514 typename T41, typename T42, typename T43, typename T44, typename T45,
13515 typename T46, typename T47, typename T48>
13516 class ValueArray48 {
13518 ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13519 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13520 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13521 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13522 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13523 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
13524 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
13525 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
13526 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
13527 v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
13528 v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
13529 v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
13530 v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
13531 v46_(v46), v47_(v47), v48_(v48) {}
13533 template <typename T>
13534 operator ParamGenerator<T>() const {
13535 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13536 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13537 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13538 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13539 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13540 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13541 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13542 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13543 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13544 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13545 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13546 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13547 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13548 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13549 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13550 static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13551 static_cast<T>(v48_)};
13552 return ValuesIn(array);
13556 // No implementation - assignment is unsupported.
13557 void operator=(const ValueArray48& other);
13609 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13610 typename T6, typename T7, typename T8, typename T9, typename T10,
13611 typename T11, typename T12, typename T13, typename T14, typename T15,
13612 typename T16, typename T17, typename T18, typename T19, typename T20,
13613 typename T21, typename T22, typename T23, typename T24, typename T25,
13614 typename T26, typename T27, typename T28, typename T29, typename T30,
13615 typename T31, typename T32, typename T33, typename T34, typename T35,
13616 typename T36, typename T37, typename T38, typename T39, typename T40,
13617 typename T41, typename T42, typename T43, typename T44, typename T45,
13618 typename T46, typename T47, typename T48, typename T49>
13619 class ValueArray49 {
13621 ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13622 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13623 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13624 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13625 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13626 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
13627 T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13628 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13629 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13630 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13631 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13632 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13633 v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
13634 v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
13636 template <typename T>
13637 operator ParamGenerator<T>() const {
13638 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13639 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13640 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13641 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13642 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13643 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13644 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13645 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13646 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13647 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13648 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13649 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13650 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13651 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13652 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13653 static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13654 static_cast<T>(v48_), static_cast<T>(v49_)};
13655 return ValuesIn(array);
13659 // No implementation - assignment is unsupported.
13660 void operator=(const ValueArray49& other);
13713 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13714 typename T6, typename T7, typename T8, typename T9, typename T10,
13715 typename T11, typename T12, typename T13, typename T14, typename T15,
13716 typename T16, typename T17, typename T18, typename T19, typename T20,
13717 typename T21, typename T22, typename T23, typename T24, typename T25,
13718 typename T26, typename T27, typename T28, typename T29, typename T30,
13719 typename T31, typename T32, typename T33, typename T34, typename T35,
13720 typename T36, typename T37, typename T38, typename T39, typename T40,
13721 typename T41, typename T42, typename T43, typename T44, typename T45,
13722 typename T46, typename T47, typename T48, typename T49, typename T50>
13723 class ValueArray50 {
13725 ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13726 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13727 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13728 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13729 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13730 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
13731 T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13732 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13733 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13734 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13735 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13736 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13737 v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
13738 v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
13740 template <typename T>
13741 operator ParamGenerator<T>() const {
13742 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13743 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13744 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13745 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13746 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13747 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13748 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13749 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13750 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13751 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13752 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13753 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13754 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13755 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13756 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13757 static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13758 static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};
13759 return ValuesIn(array);
13763 // No implementation - assignment is unsupported.
13764 void operator=(const ValueArray50& other);
13818 # if GTEST_HAS_COMBINE
13819 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
13821 // Generates values from the Cartesian product of values produced
13822 // by the argument generators.
13824 template <typename T1, typename T2>
13825 class CartesianProductGenerator2
13826 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
13828 typedef ::std::tr1::tuple<T1, T2> ParamType;
13830 CartesianProductGenerator2(const ParamGenerator<T1>& g1,
13831 const ParamGenerator<T2>& g2)
13832 : g1_(g1), g2_(g2) {}
13833 virtual ~CartesianProductGenerator2() {}
13835 virtual ParamIteratorInterface<ParamType>* Begin() const {
13836 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
13838 virtual ParamIteratorInterface<ParamType>* End() const {
13839 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
13843 class Iterator : public ParamIteratorInterface<ParamType> {
13845 Iterator(const ParamGeneratorInterface<ParamType>* base,
13846 const ParamGenerator<T1>& g1,
13847 const typename ParamGenerator<T1>::iterator& current1,
13848 const ParamGenerator<T2>& g2,
13849 const typename ParamGenerator<T2>::iterator& current2)
13851 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13852 begin2_(g2.begin()), end2_(g2.end()), current2_(current2) {
13853 ComputeCurrentValue();
13855 virtual ~Iterator() {}
13857 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13860 // Advance should not be called on beyond-of-range iterators
13861 // so no component iterators must be beyond end of range, either.
13862 virtual void Advance() {
13865 if (current2_ == end2_) {
13866 current2_ = begin2_;
13869 ComputeCurrentValue();
13871 virtual ParamIteratorInterface<ParamType>* Clone() const {
13872 return new Iterator(*this);
13874 virtual const ParamType* Current() const { return ¤t_value_; }
13875 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13876 // Having the same base generator guarantees that the other
13877 // iterator is of the same type and we can downcast.
13878 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13879 << "The program attempted to compare iterators "
13880 << "from different generators." << std::endl;
13881 const Iterator* typed_other =
13882 CheckedDowncastToActualType<const Iterator>(&other);
13883 // We must report iterators equal if they both point beyond their
13884 // respective ranges. That can happen in a variety of fashions,
13885 // so we have to consult AtEnd().
13886 return (AtEnd() && typed_other->AtEnd()) ||
13888 current1_ == typed_other->current1_ &&
13889 current2_ == typed_other->current2_);
13893 Iterator(const Iterator& other)
13894 : base_(other.base_),
13895 begin1_(other.begin1_),
13896 end1_(other.end1_),
13897 current1_(other.current1_),
13898 begin2_(other.begin2_),
13899 end2_(other.end2_),
13900 current2_(other.current2_) {
13901 ComputeCurrentValue();
13904 void ComputeCurrentValue() {
13906 current_value_ = ParamType(*current1_, *current2_);
13908 bool AtEnd() const {
13909 // We must report iterator past the end of the range when either of the
13910 // component iterators has reached the end of its range.
13912 current1_ == end1_ ||
13913 current2_ == end2_;
13916 // No implementation - assignment is unsupported.
13917 void operator=(const Iterator& other);
13919 const ParamGeneratorInterface<ParamType>* const base_;
13920 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
13921 // current[i]_ is the actual traversing iterator.
13922 const typename ParamGenerator<T1>::iterator begin1_;
13923 const typename ParamGenerator<T1>::iterator end1_;
13924 typename ParamGenerator<T1>::iterator current1_;
13925 const typename ParamGenerator<T2>::iterator begin2_;
13926 const typename ParamGenerator<T2>::iterator end2_;
13927 typename ParamGenerator<T2>::iterator current2_;
13928 ParamType current_value_;
13929 }; // class CartesianProductGenerator2::Iterator
13931 // No implementation - assignment is unsupported.
13932 void operator=(const CartesianProductGenerator2& other);
13934 const ParamGenerator<T1> g1_;
13935 const ParamGenerator<T2> g2_;
13936 }; // class CartesianProductGenerator2
13939 template <typename T1, typename T2, typename T3>
13940 class CartesianProductGenerator3
13941 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
13943 typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
13945 CartesianProductGenerator3(const ParamGenerator<T1>& g1,
13946 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
13947 : g1_(g1), g2_(g2), g3_(g3) {}
13948 virtual ~CartesianProductGenerator3() {}
13950 virtual ParamIteratorInterface<ParamType>* Begin() const {
13951 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
13954 virtual ParamIteratorInterface<ParamType>* End() const {
13955 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
13959 class Iterator : public ParamIteratorInterface<ParamType> {
13961 Iterator(const ParamGeneratorInterface<ParamType>* base,
13962 const ParamGenerator<T1>& g1,
13963 const typename ParamGenerator<T1>::iterator& current1,
13964 const ParamGenerator<T2>& g2,
13965 const typename ParamGenerator<T2>::iterator& current2,
13966 const ParamGenerator<T3>& g3,
13967 const typename ParamGenerator<T3>::iterator& current3)
13969 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13970 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
13971 begin3_(g3.begin()), end3_(g3.end()), current3_(current3) {
13972 ComputeCurrentValue();
13974 virtual ~Iterator() {}
13976 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13979 // Advance should not be called on beyond-of-range iterators
13980 // so no component iterators must be beyond end of range, either.
13981 virtual void Advance() {
13984 if (current3_ == end3_) {
13985 current3_ = begin3_;
13988 if (current2_ == end2_) {
13989 current2_ = begin2_;
13992 ComputeCurrentValue();
13994 virtual ParamIteratorInterface<ParamType>* Clone() const {
13995 return new Iterator(*this);
13997 virtual const ParamType* Current() const { return ¤t_value_; }
13998 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13999 // Having the same base generator guarantees that the other
14000 // iterator is of the same type and we can downcast.
14001 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14002 << "The program attempted to compare iterators "
14003 << "from different generators." << std::endl;
14004 const Iterator* typed_other =
14005 CheckedDowncastToActualType<const Iterator>(&other);
14006 // We must report iterators equal if they both point beyond their
14007 // respective ranges. That can happen in a variety of fashions,
14008 // so we have to consult AtEnd().
14009 return (AtEnd() && typed_other->AtEnd()) ||
14011 current1_ == typed_other->current1_ &&
14012 current2_ == typed_other->current2_ &&
14013 current3_ == typed_other->current3_);
14017 Iterator(const Iterator& other)
14018 : base_(other.base_),
14019 begin1_(other.begin1_),
14020 end1_(other.end1_),
14021 current1_(other.current1_),
14022 begin2_(other.begin2_),
14023 end2_(other.end2_),
14024 current2_(other.current2_),
14025 begin3_(other.begin3_),
14026 end3_(other.end3_),
14027 current3_(other.current3_) {
14028 ComputeCurrentValue();
14031 void ComputeCurrentValue() {
14033 current_value_ = ParamType(*current1_, *current2_, *current3_);
14035 bool AtEnd() const {
14036 // We must report iterator past the end of the range when either of the
14037 // component iterators has reached the end of its range.
14039 current1_ == end1_ ||
14040 current2_ == end2_ ||
14041 current3_ == end3_;
14044 // No implementation - assignment is unsupported.
14045 void operator=(const Iterator& other);
14047 const ParamGeneratorInterface<ParamType>* const base_;
14048 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14049 // current[i]_ is the actual traversing iterator.
14050 const typename ParamGenerator<T1>::iterator begin1_;
14051 const typename ParamGenerator<T1>::iterator end1_;
14052 typename ParamGenerator<T1>::iterator current1_;
14053 const typename ParamGenerator<T2>::iterator begin2_;
14054 const typename ParamGenerator<T2>::iterator end2_;
14055 typename ParamGenerator<T2>::iterator current2_;
14056 const typename ParamGenerator<T3>::iterator begin3_;
14057 const typename ParamGenerator<T3>::iterator end3_;
14058 typename ParamGenerator<T3>::iterator current3_;
14059 ParamType current_value_;
14060 }; // class CartesianProductGenerator3::Iterator
14062 // No implementation - assignment is unsupported.
14063 void operator=(const CartesianProductGenerator3& other);
14065 const ParamGenerator<T1> g1_;
14066 const ParamGenerator<T2> g2_;
14067 const ParamGenerator<T3> g3_;
14068 }; // class CartesianProductGenerator3
14071 template <typename T1, typename T2, typename T3, typename T4>
14072 class CartesianProductGenerator4
14073 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
14075 typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
14077 CartesianProductGenerator4(const ParamGenerator<T1>& g1,
14078 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14079 const ParamGenerator<T4>& g4)
14080 : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
14081 virtual ~CartesianProductGenerator4() {}
14083 virtual ParamIteratorInterface<ParamType>* Begin() const {
14084 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14085 g3_.begin(), g4_, g4_.begin());
14087 virtual ParamIteratorInterface<ParamType>* End() const {
14088 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14093 class Iterator : public ParamIteratorInterface<ParamType> {
14095 Iterator(const ParamGeneratorInterface<ParamType>* base,
14096 const ParamGenerator<T1>& g1,
14097 const typename ParamGenerator<T1>::iterator& current1,
14098 const ParamGenerator<T2>& g2,
14099 const typename ParamGenerator<T2>::iterator& current2,
14100 const ParamGenerator<T3>& g3,
14101 const typename ParamGenerator<T3>::iterator& current3,
14102 const ParamGenerator<T4>& g4,
14103 const typename ParamGenerator<T4>::iterator& current4)
14105 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14106 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14107 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14108 begin4_(g4.begin()), end4_(g4.end()), current4_(current4) {
14109 ComputeCurrentValue();
14111 virtual ~Iterator() {}
14113 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14116 // Advance should not be called on beyond-of-range iterators
14117 // so no component iterators must be beyond end of range, either.
14118 virtual void Advance() {
14121 if (current4_ == end4_) {
14122 current4_ = begin4_;
14125 if (current3_ == end3_) {
14126 current3_ = begin3_;
14129 if (current2_ == end2_) {
14130 current2_ = begin2_;
14133 ComputeCurrentValue();
14135 virtual ParamIteratorInterface<ParamType>* Clone() const {
14136 return new Iterator(*this);
14138 virtual const ParamType* Current() const { return ¤t_value_; }
14139 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14140 // Having the same base generator guarantees that the other
14141 // iterator is of the same type and we can downcast.
14142 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14143 << "The program attempted to compare iterators "
14144 << "from different generators." << std::endl;
14145 const Iterator* typed_other =
14146 CheckedDowncastToActualType<const Iterator>(&other);
14147 // We must report iterators equal if they both point beyond their
14148 // respective ranges. That can happen in a variety of fashions,
14149 // so we have to consult AtEnd().
14150 return (AtEnd() && typed_other->AtEnd()) ||
14152 current1_ == typed_other->current1_ &&
14153 current2_ == typed_other->current2_ &&
14154 current3_ == typed_other->current3_ &&
14155 current4_ == typed_other->current4_);
14159 Iterator(const Iterator& other)
14160 : base_(other.base_),
14161 begin1_(other.begin1_),
14162 end1_(other.end1_),
14163 current1_(other.current1_),
14164 begin2_(other.begin2_),
14165 end2_(other.end2_),
14166 current2_(other.current2_),
14167 begin3_(other.begin3_),
14168 end3_(other.end3_),
14169 current3_(other.current3_),
14170 begin4_(other.begin4_),
14171 end4_(other.end4_),
14172 current4_(other.current4_) {
14173 ComputeCurrentValue();
14176 void ComputeCurrentValue() {
14178 current_value_ = ParamType(*current1_, *current2_, *current3_,
14181 bool AtEnd() const {
14182 // We must report iterator past the end of the range when either of the
14183 // component iterators has reached the end of its range.
14185 current1_ == end1_ ||
14186 current2_ == end2_ ||
14187 current3_ == end3_ ||
14188 current4_ == end4_;
14191 // No implementation - assignment is unsupported.
14192 void operator=(const Iterator& other);
14194 const ParamGeneratorInterface<ParamType>* const base_;
14195 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14196 // current[i]_ is the actual traversing iterator.
14197 const typename ParamGenerator<T1>::iterator begin1_;
14198 const typename ParamGenerator<T1>::iterator end1_;
14199 typename ParamGenerator<T1>::iterator current1_;
14200 const typename ParamGenerator<T2>::iterator begin2_;
14201 const typename ParamGenerator<T2>::iterator end2_;
14202 typename ParamGenerator<T2>::iterator current2_;
14203 const typename ParamGenerator<T3>::iterator begin3_;
14204 const typename ParamGenerator<T3>::iterator end3_;
14205 typename ParamGenerator<T3>::iterator current3_;
14206 const typename ParamGenerator<T4>::iterator begin4_;
14207 const typename ParamGenerator<T4>::iterator end4_;
14208 typename ParamGenerator<T4>::iterator current4_;
14209 ParamType current_value_;
14210 }; // class CartesianProductGenerator4::Iterator
14212 // No implementation - assignment is unsupported.
14213 void operator=(const CartesianProductGenerator4& other);
14215 const ParamGenerator<T1> g1_;
14216 const ParamGenerator<T2> g2_;
14217 const ParamGenerator<T3> g3_;
14218 const ParamGenerator<T4> g4_;
14219 }; // class CartesianProductGenerator4
14222 template <typename T1, typename T2, typename T3, typename T4, typename T5>
14223 class CartesianProductGenerator5
14224 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
14226 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
14228 CartesianProductGenerator5(const ParamGenerator<T1>& g1,
14229 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14230 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
14231 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
14232 virtual ~CartesianProductGenerator5() {}
14234 virtual ParamIteratorInterface<ParamType>* Begin() const {
14235 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14236 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
14238 virtual ParamIteratorInterface<ParamType>* End() const {
14239 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14240 g4_, g4_.end(), g5_, g5_.end());
14244 class Iterator : public ParamIteratorInterface<ParamType> {
14246 Iterator(const ParamGeneratorInterface<ParamType>* base,
14247 const ParamGenerator<T1>& g1,
14248 const typename ParamGenerator<T1>::iterator& current1,
14249 const ParamGenerator<T2>& g2,
14250 const typename ParamGenerator<T2>::iterator& current2,
14251 const ParamGenerator<T3>& g3,
14252 const typename ParamGenerator<T3>::iterator& current3,
14253 const ParamGenerator<T4>& g4,
14254 const typename ParamGenerator<T4>::iterator& current4,
14255 const ParamGenerator<T5>& g5,
14256 const typename ParamGenerator<T5>::iterator& current5)
14258 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14259 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14260 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14261 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14262 begin5_(g5.begin()), end5_(g5.end()), current5_(current5) {
14263 ComputeCurrentValue();
14265 virtual ~Iterator() {}
14267 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14270 // Advance should not be called on beyond-of-range iterators
14271 // so no component iterators must be beyond end of range, either.
14272 virtual void Advance() {
14275 if (current5_ == end5_) {
14276 current5_ = begin5_;
14279 if (current4_ == end4_) {
14280 current4_ = begin4_;
14283 if (current3_ == end3_) {
14284 current3_ = begin3_;
14287 if (current2_ == end2_) {
14288 current2_ = begin2_;
14291 ComputeCurrentValue();
14293 virtual ParamIteratorInterface<ParamType>* Clone() const {
14294 return new Iterator(*this);
14296 virtual const ParamType* Current() const { return ¤t_value_; }
14297 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14298 // Having the same base generator guarantees that the other
14299 // iterator is of the same type and we can downcast.
14300 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14301 << "The program attempted to compare iterators "
14302 << "from different generators." << std::endl;
14303 const Iterator* typed_other =
14304 CheckedDowncastToActualType<const Iterator>(&other);
14305 // We must report iterators equal if they both point beyond their
14306 // respective ranges. That can happen in a variety of fashions,
14307 // so we have to consult AtEnd().
14308 return (AtEnd() && typed_other->AtEnd()) ||
14310 current1_ == typed_other->current1_ &&
14311 current2_ == typed_other->current2_ &&
14312 current3_ == typed_other->current3_ &&
14313 current4_ == typed_other->current4_ &&
14314 current5_ == typed_other->current5_);
14318 Iterator(const Iterator& other)
14319 : base_(other.base_),
14320 begin1_(other.begin1_),
14321 end1_(other.end1_),
14322 current1_(other.current1_),
14323 begin2_(other.begin2_),
14324 end2_(other.end2_),
14325 current2_(other.current2_),
14326 begin3_(other.begin3_),
14327 end3_(other.end3_),
14328 current3_(other.current3_),
14329 begin4_(other.begin4_),
14330 end4_(other.end4_),
14331 current4_(other.current4_),
14332 begin5_(other.begin5_),
14333 end5_(other.end5_),
14334 current5_(other.current5_) {
14335 ComputeCurrentValue();
14338 void ComputeCurrentValue() {
14340 current_value_ = ParamType(*current1_, *current2_, *current3_,
14341 *current4_, *current5_);
14343 bool AtEnd() const {
14344 // We must report iterator past the end of the range when either of the
14345 // component iterators has reached the end of its range.
14347 current1_ == end1_ ||
14348 current2_ == end2_ ||
14349 current3_ == end3_ ||
14350 current4_ == end4_ ||
14351 current5_ == end5_;
14354 // No implementation - assignment is unsupported.
14355 void operator=(const Iterator& other);
14357 const ParamGeneratorInterface<ParamType>* const base_;
14358 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14359 // current[i]_ is the actual traversing iterator.
14360 const typename ParamGenerator<T1>::iterator begin1_;
14361 const typename ParamGenerator<T1>::iterator end1_;
14362 typename ParamGenerator<T1>::iterator current1_;
14363 const typename ParamGenerator<T2>::iterator begin2_;
14364 const typename ParamGenerator<T2>::iterator end2_;
14365 typename ParamGenerator<T2>::iterator current2_;
14366 const typename ParamGenerator<T3>::iterator begin3_;
14367 const typename ParamGenerator<T3>::iterator end3_;
14368 typename ParamGenerator<T3>::iterator current3_;
14369 const typename ParamGenerator<T4>::iterator begin4_;
14370 const typename ParamGenerator<T4>::iterator end4_;
14371 typename ParamGenerator<T4>::iterator current4_;
14372 const typename ParamGenerator<T5>::iterator begin5_;
14373 const typename ParamGenerator<T5>::iterator end5_;
14374 typename ParamGenerator<T5>::iterator current5_;
14375 ParamType current_value_;
14376 }; // class CartesianProductGenerator5::Iterator
14378 // No implementation - assignment is unsupported.
14379 void operator=(const CartesianProductGenerator5& other);
14381 const ParamGenerator<T1> g1_;
14382 const ParamGenerator<T2> g2_;
14383 const ParamGenerator<T3> g3_;
14384 const ParamGenerator<T4> g4_;
14385 const ParamGenerator<T5> g5_;
14386 }; // class CartesianProductGenerator5
14389 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14391 class CartesianProductGenerator6
14392 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
14395 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
14397 CartesianProductGenerator6(const ParamGenerator<T1>& g1,
14398 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14399 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14400 const ParamGenerator<T6>& g6)
14401 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
14402 virtual ~CartesianProductGenerator6() {}
14404 virtual ParamIteratorInterface<ParamType>* Begin() const {
14405 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14406 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
14408 virtual ParamIteratorInterface<ParamType>* End() const {
14409 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14410 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
14414 class Iterator : public ParamIteratorInterface<ParamType> {
14416 Iterator(const ParamGeneratorInterface<ParamType>* base,
14417 const ParamGenerator<T1>& g1,
14418 const typename ParamGenerator<T1>::iterator& current1,
14419 const ParamGenerator<T2>& g2,
14420 const typename ParamGenerator<T2>::iterator& current2,
14421 const ParamGenerator<T3>& g3,
14422 const typename ParamGenerator<T3>::iterator& current3,
14423 const ParamGenerator<T4>& g4,
14424 const typename ParamGenerator<T4>::iterator& current4,
14425 const ParamGenerator<T5>& g5,
14426 const typename ParamGenerator<T5>::iterator& current5,
14427 const ParamGenerator<T6>& g6,
14428 const typename ParamGenerator<T6>::iterator& current6)
14430 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14431 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14432 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14433 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14434 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14435 begin6_(g6.begin()), end6_(g6.end()), current6_(current6) {
14436 ComputeCurrentValue();
14438 virtual ~Iterator() {}
14440 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14443 // Advance should not be called on beyond-of-range iterators
14444 // so no component iterators must be beyond end of range, either.
14445 virtual void Advance() {
14448 if (current6_ == end6_) {
14449 current6_ = begin6_;
14452 if (current5_ == end5_) {
14453 current5_ = begin5_;
14456 if (current4_ == end4_) {
14457 current4_ = begin4_;
14460 if (current3_ == end3_) {
14461 current3_ = begin3_;
14464 if (current2_ == end2_) {
14465 current2_ = begin2_;
14468 ComputeCurrentValue();
14470 virtual ParamIteratorInterface<ParamType>* Clone() const {
14471 return new Iterator(*this);
14473 virtual const ParamType* Current() const { return ¤t_value_; }
14474 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14475 // Having the same base generator guarantees that the other
14476 // iterator is of the same type and we can downcast.
14477 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14478 << "The program attempted to compare iterators "
14479 << "from different generators." << std::endl;
14480 const Iterator* typed_other =
14481 CheckedDowncastToActualType<const Iterator>(&other);
14482 // We must report iterators equal if they both point beyond their
14483 // respective ranges. That can happen in a variety of fashions,
14484 // so we have to consult AtEnd().
14485 return (AtEnd() && typed_other->AtEnd()) ||
14487 current1_ == typed_other->current1_ &&
14488 current2_ == typed_other->current2_ &&
14489 current3_ == typed_other->current3_ &&
14490 current4_ == typed_other->current4_ &&
14491 current5_ == typed_other->current5_ &&
14492 current6_ == typed_other->current6_);
14496 Iterator(const Iterator& other)
14497 : base_(other.base_),
14498 begin1_(other.begin1_),
14499 end1_(other.end1_),
14500 current1_(other.current1_),
14501 begin2_(other.begin2_),
14502 end2_(other.end2_),
14503 current2_(other.current2_),
14504 begin3_(other.begin3_),
14505 end3_(other.end3_),
14506 current3_(other.current3_),
14507 begin4_(other.begin4_),
14508 end4_(other.end4_),
14509 current4_(other.current4_),
14510 begin5_(other.begin5_),
14511 end5_(other.end5_),
14512 current5_(other.current5_),
14513 begin6_(other.begin6_),
14514 end6_(other.end6_),
14515 current6_(other.current6_) {
14516 ComputeCurrentValue();
14519 void ComputeCurrentValue() {
14521 current_value_ = ParamType(*current1_, *current2_, *current3_,
14522 *current4_, *current5_, *current6_);
14524 bool AtEnd() const {
14525 // We must report iterator past the end of the range when either of the
14526 // component iterators has reached the end of its range.
14528 current1_ == end1_ ||
14529 current2_ == end2_ ||
14530 current3_ == end3_ ||
14531 current4_ == end4_ ||
14532 current5_ == end5_ ||
14533 current6_ == end6_;
14536 // No implementation - assignment is unsupported.
14537 void operator=(const Iterator& other);
14539 const ParamGeneratorInterface<ParamType>* const base_;
14540 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14541 // current[i]_ is the actual traversing iterator.
14542 const typename ParamGenerator<T1>::iterator begin1_;
14543 const typename ParamGenerator<T1>::iterator end1_;
14544 typename ParamGenerator<T1>::iterator current1_;
14545 const typename ParamGenerator<T2>::iterator begin2_;
14546 const typename ParamGenerator<T2>::iterator end2_;
14547 typename ParamGenerator<T2>::iterator current2_;
14548 const typename ParamGenerator<T3>::iterator begin3_;
14549 const typename ParamGenerator<T3>::iterator end3_;
14550 typename ParamGenerator<T3>::iterator current3_;
14551 const typename ParamGenerator<T4>::iterator begin4_;
14552 const typename ParamGenerator<T4>::iterator end4_;
14553 typename ParamGenerator<T4>::iterator current4_;
14554 const typename ParamGenerator<T5>::iterator begin5_;
14555 const typename ParamGenerator<T5>::iterator end5_;
14556 typename ParamGenerator<T5>::iterator current5_;
14557 const typename ParamGenerator<T6>::iterator begin6_;
14558 const typename ParamGenerator<T6>::iterator end6_;
14559 typename ParamGenerator<T6>::iterator current6_;
14560 ParamType current_value_;
14561 }; // class CartesianProductGenerator6::Iterator
14563 // No implementation - assignment is unsupported.
14564 void operator=(const CartesianProductGenerator6& other);
14566 const ParamGenerator<T1> g1_;
14567 const ParamGenerator<T2> g2_;
14568 const ParamGenerator<T3> g3_;
14569 const ParamGenerator<T4> g4_;
14570 const ParamGenerator<T5> g5_;
14571 const ParamGenerator<T6> g6_;
14572 }; // class CartesianProductGenerator6
14575 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14576 typename T6, typename T7>
14577 class CartesianProductGenerator7
14578 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14581 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
14583 CartesianProductGenerator7(const ParamGenerator<T1>& g1,
14584 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14585 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14586 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
14587 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
14588 virtual ~CartesianProductGenerator7() {}
14590 virtual ParamIteratorInterface<ParamType>* Begin() const {
14591 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14592 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14595 virtual ParamIteratorInterface<ParamType>* End() const {
14596 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14597 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
14601 class Iterator : public ParamIteratorInterface<ParamType> {
14603 Iterator(const ParamGeneratorInterface<ParamType>* base,
14604 const ParamGenerator<T1>& g1,
14605 const typename ParamGenerator<T1>::iterator& current1,
14606 const ParamGenerator<T2>& g2,
14607 const typename ParamGenerator<T2>::iterator& current2,
14608 const ParamGenerator<T3>& g3,
14609 const typename ParamGenerator<T3>::iterator& current3,
14610 const ParamGenerator<T4>& g4,
14611 const typename ParamGenerator<T4>::iterator& current4,
14612 const ParamGenerator<T5>& g5,
14613 const typename ParamGenerator<T5>::iterator& current5,
14614 const ParamGenerator<T6>& g6,
14615 const typename ParamGenerator<T6>::iterator& current6,
14616 const ParamGenerator<T7>& g7,
14617 const typename ParamGenerator<T7>::iterator& current7)
14619 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14620 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14621 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14622 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14623 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14624 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14625 begin7_(g7.begin()), end7_(g7.end()), current7_(current7) {
14626 ComputeCurrentValue();
14628 virtual ~Iterator() {}
14630 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14633 // Advance should not be called on beyond-of-range iterators
14634 // so no component iterators must be beyond end of range, either.
14635 virtual void Advance() {
14638 if (current7_ == end7_) {
14639 current7_ = begin7_;
14642 if (current6_ == end6_) {
14643 current6_ = begin6_;
14646 if (current5_ == end5_) {
14647 current5_ = begin5_;
14650 if (current4_ == end4_) {
14651 current4_ = begin4_;
14654 if (current3_ == end3_) {
14655 current3_ = begin3_;
14658 if (current2_ == end2_) {
14659 current2_ = begin2_;
14662 ComputeCurrentValue();
14664 virtual ParamIteratorInterface<ParamType>* Clone() const {
14665 return new Iterator(*this);
14667 virtual const ParamType* Current() const { return ¤t_value_; }
14668 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14669 // Having the same base generator guarantees that the other
14670 // iterator is of the same type and we can downcast.
14671 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14672 << "The program attempted to compare iterators "
14673 << "from different generators." << std::endl;
14674 const Iterator* typed_other =
14675 CheckedDowncastToActualType<const Iterator>(&other);
14676 // We must report iterators equal if they both point beyond their
14677 // respective ranges. That can happen in a variety of fashions,
14678 // so we have to consult AtEnd().
14679 return (AtEnd() && typed_other->AtEnd()) ||
14681 current1_ == typed_other->current1_ &&
14682 current2_ == typed_other->current2_ &&
14683 current3_ == typed_other->current3_ &&
14684 current4_ == typed_other->current4_ &&
14685 current5_ == typed_other->current5_ &&
14686 current6_ == typed_other->current6_ &&
14687 current7_ == typed_other->current7_);
14691 Iterator(const Iterator& other)
14692 : base_(other.base_),
14693 begin1_(other.begin1_),
14694 end1_(other.end1_),
14695 current1_(other.current1_),
14696 begin2_(other.begin2_),
14697 end2_(other.end2_),
14698 current2_(other.current2_),
14699 begin3_(other.begin3_),
14700 end3_(other.end3_),
14701 current3_(other.current3_),
14702 begin4_(other.begin4_),
14703 end4_(other.end4_),
14704 current4_(other.current4_),
14705 begin5_(other.begin5_),
14706 end5_(other.end5_),
14707 current5_(other.current5_),
14708 begin6_(other.begin6_),
14709 end6_(other.end6_),
14710 current6_(other.current6_),
14711 begin7_(other.begin7_),
14712 end7_(other.end7_),
14713 current7_(other.current7_) {
14714 ComputeCurrentValue();
14717 void ComputeCurrentValue() {
14719 current_value_ = ParamType(*current1_, *current2_, *current3_,
14720 *current4_, *current5_, *current6_, *current7_);
14722 bool AtEnd() const {
14723 // We must report iterator past the end of the range when either of the
14724 // component iterators has reached the end of its range.
14726 current1_ == end1_ ||
14727 current2_ == end2_ ||
14728 current3_ == end3_ ||
14729 current4_ == end4_ ||
14730 current5_ == end5_ ||
14731 current6_ == end6_ ||
14732 current7_ == end7_;
14735 // No implementation - assignment is unsupported.
14736 void operator=(const Iterator& other);
14738 const ParamGeneratorInterface<ParamType>* const base_;
14739 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14740 // current[i]_ is the actual traversing iterator.
14741 const typename ParamGenerator<T1>::iterator begin1_;
14742 const typename ParamGenerator<T1>::iterator end1_;
14743 typename ParamGenerator<T1>::iterator current1_;
14744 const typename ParamGenerator<T2>::iterator begin2_;
14745 const typename ParamGenerator<T2>::iterator end2_;
14746 typename ParamGenerator<T2>::iterator current2_;
14747 const typename ParamGenerator<T3>::iterator begin3_;
14748 const typename ParamGenerator<T3>::iterator end3_;
14749 typename ParamGenerator<T3>::iterator current3_;
14750 const typename ParamGenerator<T4>::iterator begin4_;
14751 const typename ParamGenerator<T4>::iterator end4_;
14752 typename ParamGenerator<T4>::iterator current4_;
14753 const typename ParamGenerator<T5>::iterator begin5_;
14754 const typename ParamGenerator<T5>::iterator end5_;
14755 typename ParamGenerator<T5>::iterator current5_;
14756 const typename ParamGenerator<T6>::iterator begin6_;
14757 const typename ParamGenerator<T6>::iterator end6_;
14758 typename ParamGenerator<T6>::iterator current6_;
14759 const typename ParamGenerator<T7>::iterator begin7_;
14760 const typename ParamGenerator<T7>::iterator end7_;
14761 typename ParamGenerator<T7>::iterator current7_;
14762 ParamType current_value_;
14763 }; // class CartesianProductGenerator7::Iterator
14765 // No implementation - assignment is unsupported.
14766 void operator=(const CartesianProductGenerator7& other);
14768 const ParamGenerator<T1> g1_;
14769 const ParamGenerator<T2> g2_;
14770 const ParamGenerator<T3> g3_;
14771 const ParamGenerator<T4> g4_;
14772 const ParamGenerator<T5> g5_;
14773 const ParamGenerator<T6> g6_;
14774 const ParamGenerator<T7> g7_;
14775 }; // class CartesianProductGenerator7
14778 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14779 typename T6, typename T7, typename T8>
14780 class CartesianProductGenerator8
14781 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14784 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
14786 CartesianProductGenerator8(const ParamGenerator<T1>& g1,
14787 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14788 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14789 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
14790 const ParamGenerator<T8>& g8)
14791 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
14793 virtual ~CartesianProductGenerator8() {}
14795 virtual ParamIteratorInterface<ParamType>* Begin() const {
14796 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14797 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14798 g7_.begin(), g8_, g8_.begin());
14800 virtual ParamIteratorInterface<ParamType>* End() const {
14801 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14802 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
14807 class Iterator : public ParamIteratorInterface<ParamType> {
14809 Iterator(const ParamGeneratorInterface<ParamType>* base,
14810 const ParamGenerator<T1>& g1,
14811 const typename ParamGenerator<T1>::iterator& current1,
14812 const ParamGenerator<T2>& g2,
14813 const typename ParamGenerator<T2>::iterator& current2,
14814 const ParamGenerator<T3>& g3,
14815 const typename ParamGenerator<T3>::iterator& current3,
14816 const ParamGenerator<T4>& g4,
14817 const typename ParamGenerator<T4>::iterator& current4,
14818 const ParamGenerator<T5>& g5,
14819 const typename ParamGenerator<T5>::iterator& current5,
14820 const ParamGenerator<T6>& g6,
14821 const typename ParamGenerator<T6>::iterator& current6,
14822 const ParamGenerator<T7>& g7,
14823 const typename ParamGenerator<T7>::iterator& current7,
14824 const ParamGenerator<T8>& g8,
14825 const typename ParamGenerator<T8>::iterator& current8)
14827 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14828 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14829 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14830 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14831 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14832 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14833 begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
14834 begin8_(g8.begin()), end8_(g8.end()), current8_(current8) {
14835 ComputeCurrentValue();
14837 virtual ~Iterator() {}
14839 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14842 // Advance should not be called on beyond-of-range iterators
14843 // so no component iterators must be beyond end of range, either.
14844 virtual void Advance() {
14847 if (current8_ == end8_) {
14848 current8_ = begin8_;
14851 if (current7_ == end7_) {
14852 current7_ = begin7_;
14855 if (current6_ == end6_) {
14856 current6_ = begin6_;
14859 if (current5_ == end5_) {
14860 current5_ = begin5_;
14863 if (current4_ == end4_) {
14864 current4_ = begin4_;
14867 if (current3_ == end3_) {
14868 current3_ = begin3_;
14871 if (current2_ == end2_) {
14872 current2_ = begin2_;
14875 ComputeCurrentValue();
14877 virtual ParamIteratorInterface<ParamType>* Clone() const {
14878 return new Iterator(*this);
14880 virtual const ParamType* Current() const { return ¤t_value_; }
14881 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14882 // Having the same base generator guarantees that the other
14883 // iterator is of the same type and we can downcast.
14884 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14885 << "The program attempted to compare iterators "
14886 << "from different generators." << std::endl;
14887 const Iterator* typed_other =
14888 CheckedDowncastToActualType<const Iterator>(&other);
14889 // We must report iterators equal if they both point beyond their
14890 // respective ranges. That can happen in a variety of fashions,
14891 // so we have to consult AtEnd().
14892 return (AtEnd() && typed_other->AtEnd()) ||
14894 current1_ == typed_other->current1_ &&
14895 current2_ == typed_other->current2_ &&
14896 current3_ == typed_other->current3_ &&
14897 current4_ == typed_other->current4_ &&
14898 current5_ == typed_other->current5_ &&
14899 current6_ == typed_other->current6_ &&
14900 current7_ == typed_other->current7_ &&
14901 current8_ == typed_other->current8_);
14905 Iterator(const Iterator& other)
14906 : base_(other.base_),
14907 begin1_(other.begin1_),
14908 end1_(other.end1_),
14909 current1_(other.current1_),
14910 begin2_(other.begin2_),
14911 end2_(other.end2_),
14912 current2_(other.current2_),
14913 begin3_(other.begin3_),
14914 end3_(other.end3_),
14915 current3_(other.current3_),
14916 begin4_(other.begin4_),
14917 end4_(other.end4_),
14918 current4_(other.current4_),
14919 begin5_(other.begin5_),
14920 end5_(other.end5_),
14921 current5_(other.current5_),
14922 begin6_(other.begin6_),
14923 end6_(other.end6_),
14924 current6_(other.current6_),
14925 begin7_(other.begin7_),
14926 end7_(other.end7_),
14927 current7_(other.current7_),
14928 begin8_(other.begin8_),
14929 end8_(other.end8_),
14930 current8_(other.current8_) {
14931 ComputeCurrentValue();
14934 void ComputeCurrentValue() {
14936 current_value_ = ParamType(*current1_, *current2_, *current3_,
14937 *current4_, *current5_, *current6_, *current7_, *current8_);
14939 bool AtEnd() const {
14940 // We must report iterator past the end of the range when either of the
14941 // component iterators has reached the end of its range.
14943 current1_ == end1_ ||
14944 current2_ == end2_ ||
14945 current3_ == end3_ ||
14946 current4_ == end4_ ||
14947 current5_ == end5_ ||
14948 current6_ == end6_ ||
14949 current7_ == end7_ ||
14950 current8_ == end8_;
14953 // No implementation - assignment is unsupported.
14954 void operator=(const Iterator& other);
14956 const ParamGeneratorInterface<ParamType>* const base_;
14957 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14958 // current[i]_ is the actual traversing iterator.
14959 const typename ParamGenerator<T1>::iterator begin1_;
14960 const typename ParamGenerator<T1>::iterator end1_;
14961 typename ParamGenerator<T1>::iterator current1_;
14962 const typename ParamGenerator<T2>::iterator begin2_;
14963 const typename ParamGenerator<T2>::iterator end2_;
14964 typename ParamGenerator<T2>::iterator current2_;
14965 const typename ParamGenerator<T3>::iterator begin3_;
14966 const typename ParamGenerator<T3>::iterator end3_;
14967 typename ParamGenerator<T3>::iterator current3_;
14968 const typename ParamGenerator<T4>::iterator begin4_;
14969 const typename ParamGenerator<T4>::iterator end4_;
14970 typename ParamGenerator<T4>::iterator current4_;
14971 const typename ParamGenerator<T5>::iterator begin5_;
14972 const typename ParamGenerator<T5>::iterator end5_;
14973 typename ParamGenerator<T5>::iterator current5_;
14974 const typename ParamGenerator<T6>::iterator begin6_;
14975 const typename ParamGenerator<T6>::iterator end6_;
14976 typename ParamGenerator<T6>::iterator current6_;
14977 const typename ParamGenerator<T7>::iterator begin7_;
14978 const typename ParamGenerator<T7>::iterator end7_;
14979 typename ParamGenerator<T7>::iterator current7_;
14980 const typename ParamGenerator<T8>::iterator begin8_;
14981 const typename ParamGenerator<T8>::iterator end8_;
14982 typename ParamGenerator<T8>::iterator current8_;
14983 ParamType current_value_;
14984 }; // class CartesianProductGenerator8::Iterator
14986 // No implementation - assignment is unsupported.
14987 void operator=(const CartesianProductGenerator8& other);
14989 const ParamGenerator<T1> g1_;
14990 const ParamGenerator<T2> g2_;
14991 const ParamGenerator<T3> g3_;
14992 const ParamGenerator<T4> g4_;
14993 const ParamGenerator<T5> g5_;
14994 const ParamGenerator<T6> g6_;
14995 const ParamGenerator<T7> g7_;
14996 const ParamGenerator<T8> g8_;
14997 }; // class CartesianProductGenerator8
15000 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15001 typename T6, typename T7, typename T8, typename T9>
15002 class CartesianProductGenerator9
15003 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15006 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
15008 CartesianProductGenerator9(const ParamGenerator<T1>& g1,
15009 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15010 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
15011 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
15012 const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
15013 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15015 virtual ~CartesianProductGenerator9() {}
15017 virtual ParamIteratorInterface<ParamType>* Begin() const {
15018 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15019 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
15020 g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
15022 virtual ParamIteratorInterface<ParamType>* End() const {
15023 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15024 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
15025 g8_.end(), g9_, g9_.end());
15029 class Iterator : public ParamIteratorInterface<ParamType> {
15031 Iterator(const ParamGeneratorInterface<ParamType>* base,
15032 const ParamGenerator<T1>& g1,
15033 const typename ParamGenerator<T1>::iterator& current1,
15034 const ParamGenerator<T2>& g2,
15035 const typename ParamGenerator<T2>::iterator& current2,
15036 const ParamGenerator<T3>& g3,
15037 const typename ParamGenerator<T3>::iterator& current3,
15038 const ParamGenerator<T4>& g4,
15039 const typename ParamGenerator<T4>::iterator& current4,
15040 const ParamGenerator<T5>& g5,
15041 const typename ParamGenerator<T5>::iterator& current5,
15042 const ParamGenerator<T6>& g6,
15043 const typename ParamGenerator<T6>::iterator& current6,
15044 const ParamGenerator<T7>& g7,
15045 const typename ParamGenerator<T7>::iterator& current7,
15046 const ParamGenerator<T8>& g8,
15047 const typename ParamGenerator<T8>::iterator& current8,
15048 const ParamGenerator<T9>& g9,
15049 const typename ParamGenerator<T9>::iterator& current9)
15051 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15052 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15053 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15054 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15055 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15056 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
15057 begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
15058 begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
15059 begin9_(g9.begin()), end9_(g9.end()), current9_(current9) {
15060 ComputeCurrentValue();
15062 virtual ~Iterator() {}
15064 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15067 // Advance should not be called on beyond-of-range iterators
15068 // so no component iterators must be beyond end of range, either.
15069 virtual void Advance() {
15072 if (current9_ == end9_) {
15073 current9_ = begin9_;
15076 if (current8_ == end8_) {
15077 current8_ = begin8_;
15080 if (current7_ == end7_) {
15081 current7_ = begin7_;
15084 if (current6_ == end6_) {
15085 current6_ = begin6_;
15088 if (current5_ == end5_) {
15089 current5_ = begin5_;
15092 if (current4_ == end4_) {
15093 current4_ = begin4_;
15096 if (current3_ == end3_) {
15097 current3_ = begin3_;
15100 if (current2_ == end2_) {
15101 current2_ = begin2_;
15104 ComputeCurrentValue();
15106 virtual ParamIteratorInterface<ParamType>* Clone() const {
15107 return new Iterator(*this);
15109 virtual const ParamType* Current() const { return ¤t_value_; }
15110 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15111 // Having the same base generator guarantees that the other
15112 // iterator is of the same type and we can downcast.
15113 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15114 << "The program attempted to compare iterators "
15115 << "from different generators." << std::endl;
15116 const Iterator* typed_other =
15117 CheckedDowncastToActualType<const Iterator>(&other);
15118 // We must report iterators equal if they both point beyond their
15119 // respective ranges. That can happen in a variety of fashions,
15120 // so we have to consult AtEnd().
15121 return (AtEnd() && typed_other->AtEnd()) ||
15123 current1_ == typed_other->current1_ &&
15124 current2_ == typed_other->current2_ &&
15125 current3_ == typed_other->current3_ &&
15126 current4_ == typed_other->current4_ &&
15127 current5_ == typed_other->current5_ &&
15128 current6_ == typed_other->current6_ &&
15129 current7_ == typed_other->current7_ &&
15130 current8_ == typed_other->current8_ &&
15131 current9_ == typed_other->current9_);
15135 Iterator(const Iterator& other)
15136 : base_(other.base_),
15137 begin1_(other.begin1_),
15138 end1_(other.end1_),
15139 current1_(other.current1_),
15140 begin2_(other.begin2_),
15141 end2_(other.end2_),
15142 current2_(other.current2_),
15143 begin3_(other.begin3_),
15144 end3_(other.end3_),
15145 current3_(other.current3_),
15146 begin4_(other.begin4_),
15147 end4_(other.end4_),
15148 current4_(other.current4_),
15149 begin5_(other.begin5_),
15150 end5_(other.end5_),
15151 current5_(other.current5_),
15152 begin6_(other.begin6_),
15153 end6_(other.end6_),
15154 current6_(other.current6_),
15155 begin7_(other.begin7_),
15156 end7_(other.end7_),
15157 current7_(other.current7_),
15158 begin8_(other.begin8_),
15159 end8_(other.end8_),
15160 current8_(other.current8_),
15161 begin9_(other.begin9_),
15162 end9_(other.end9_),
15163 current9_(other.current9_) {
15164 ComputeCurrentValue();
15167 void ComputeCurrentValue() {
15169 current_value_ = ParamType(*current1_, *current2_, *current3_,
15170 *current4_, *current5_, *current6_, *current7_, *current8_,
15173 bool AtEnd() const {
15174 // We must report iterator past the end of the range when either of the
15175 // component iterators has reached the end of its range.
15177 current1_ == end1_ ||
15178 current2_ == end2_ ||
15179 current3_ == end3_ ||
15180 current4_ == end4_ ||
15181 current5_ == end5_ ||
15182 current6_ == end6_ ||
15183 current7_ == end7_ ||
15184 current8_ == end8_ ||
15185 current9_ == end9_;
15188 // No implementation - assignment is unsupported.
15189 void operator=(const Iterator& other);
15191 const ParamGeneratorInterface<ParamType>* const base_;
15192 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15193 // current[i]_ is the actual traversing iterator.
15194 const typename ParamGenerator<T1>::iterator begin1_;
15195 const typename ParamGenerator<T1>::iterator end1_;
15196 typename ParamGenerator<T1>::iterator current1_;
15197 const typename ParamGenerator<T2>::iterator begin2_;
15198 const typename ParamGenerator<T2>::iterator end2_;
15199 typename ParamGenerator<T2>::iterator current2_;
15200 const typename ParamGenerator<T3>::iterator begin3_;
15201 const typename ParamGenerator<T3>::iterator end3_;
15202 typename ParamGenerator<T3>::iterator current3_;
15203 const typename ParamGenerator<T4>::iterator begin4_;
15204 const typename ParamGenerator<T4>::iterator end4_;
15205 typename ParamGenerator<T4>::iterator current4_;
15206 const typename ParamGenerator<T5>::iterator begin5_;
15207 const typename ParamGenerator<T5>::iterator end5_;
15208 typename ParamGenerator<T5>::iterator current5_;
15209 const typename ParamGenerator<T6>::iterator begin6_;
15210 const typename ParamGenerator<T6>::iterator end6_;
15211 typename ParamGenerator<T6>::iterator current6_;
15212 const typename ParamGenerator<T7>::iterator begin7_;
15213 const typename ParamGenerator<T7>::iterator end7_;
15214 typename ParamGenerator<T7>::iterator current7_;
15215 const typename ParamGenerator<T8>::iterator begin8_;
15216 const typename ParamGenerator<T8>::iterator end8_;
15217 typename ParamGenerator<T8>::iterator current8_;
15218 const typename ParamGenerator<T9>::iterator begin9_;
15219 const typename ParamGenerator<T9>::iterator end9_;
15220 typename ParamGenerator<T9>::iterator current9_;
15221 ParamType current_value_;
15222 }; // class CartesianProductGenerator9::Iterator
15224 // No implementation - assignment is unsupported.
15225 void operator=(const CartesianProductGenerator9& other);
15227 const ParamGenerator<T1> g1_;
15228 const ParamGenerator<T2> g2_;
15229 const ParamGenerator<T3> g3_;
15230 const ParamGenerator<T4> g4_;
15231 const ParamGenerator<T5> g5_;
15232 const ParamGenerator<T6> g6_;
15233 const ParamGenerator<T7> g7_;
15234 const ParamGenerator<T8> g8_;
15235 const ParamGenerator<T9> g9_;
15236 }; // class CartesianProductGenerator9
15239 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15240 typename T6, typename T7, typename T8, typename T9, typename T10>
15241 class CartesianProductGenerator10
15242 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15243 T7, T8, T9, T10> > {
15245 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
15247 CartesianProductGenerator10(const ParamGenerator<T1>& g1,
15248 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15249 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
15250 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
15251 const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
15252 const ParamGenerator<T10>& g10)
15253 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15254 g9_(g9), g10_(g10) {}
15255 virtual ~CartesianProductGenerator10() {}
15257 virtual ParamIteratorInterface<ParamType>* Begin() const {
15258 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15259 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
15260 g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
15262 virtual ParamIteratorInterface<ParamType>* End() const {
15263 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15264 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
15265 g8_.end(), g9_, g9_.end(), g10_, g10_.end());
15269 class Iterator : public ParamIteratorInterface<ParamType> {
15271 Iterator(const ParamGeneratorInterface<ParamType>* base,
15272 const ParamGenerator<T1>& g1,
15273 const typename ParamGenerator<T1>::iterator& current1,
15274 const ParamGenerator<T2>& g2,
15275 const typename ParamGenerator<T2>::iterator& current2,
15276 const ParamGenerator<T3>& g3,
15277 const typename ParamGenerator<T3>::iterator& current3,
15278 const ParamGenerator<T4>& g4,
15279 const typename ParamGenerator<T4>::iterator& current4,
15280 const ParamGenerator<T5>& g5,
15281 const typename ParamGenerator<T5>::iterator& current5,
15282 const ParamGenerator<T6>& g6,
15283 const typename ParamGenerator<T6>::iterator& current6,
15284 const ParamGenerator<T7>& g7,
15285 const typename ParamGenerator<T7>::iterator& current7,
15286 const ParamGenerator<T8>& g8,
15287 const typename ParamGenerator<T8>::iterator& current8,
15288 const ParamGenerator<T9>& g9,
15289 const typename ParamGenerator<T9>::iterator& current9,
15290 const ParamGenerator<T10>& g10,
15291 const typename ParamGenerator<T10>::iterator& current10)
15293 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15294 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15295 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15296 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15297 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15298 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
15299 begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
15300 begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
15301 begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
15302 begin10_(g10.begin()), end10_(g10.end()), current10_(current10) {
15303 ComputeCurrentValue();
15305 virtual ~Iterator() {}
15307 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15310 // Advance should not be called on beyond-of-range iterators
15311 // so no component iterators must be beyond end of range, either.
15312 virtual void Advance() {
15315 if (current10_ == end10_) {
15316 current10_ = begin10_;
15319 if (current9_ == end9_) {
15320 current9_ = begin9_;
15323 if (current8_ == end8_) {
15324 current8_ = begin8_;
15327 if (current7_ == end7_) {
15328 current7_ = begin7_;
15331 if (current6_ == end6_) {
15332 current6_ = begin6_;
15335 if (current5_ == end5_) {
15336 current5_ = begin5_;
15339 if (current4_ == end4_) {
15340 current4_ = begin4_;
15343 if (current3_ == end3_) {
15344 current3_ = begin3_;
15347 if (current2_ == end2_) {
15348 current2_ = begin2_;
15351 ComputeCurrentValue();
15353 virtual ParamIteratorInterface<ParamType>* Clone() const {
15354 return new Iterator(*this);
15356 virtual const ParamType* Current() const { return ¤t_value_; }
15357 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15358 // Having the same base generator guarantees that the other
15359 // iterator is of the same type and we can downcast.
15360 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15361 << "The program attempted to compare iterators "
15362 << "from different generators." << std::endl;
15363 const Iterator* typed_other =
15364 CheckedDowncastToActualType<const Iterator>(&other);
15365 // We must report iterators equal if they both point beyond their
15366 // respective ranges. That can happen in a variety of fashions,
15367 // so we have to consult AtEnd().
15368 return (AtEnd() && typed_other->AtEnd()) ||
15370 current1_ == typed_other->current1_ &&
15371 current2_ == typed_other->current2_ &&
15372 current3_ == typed_other->current3_ &&
15373 current4_ == typed_other->current4_ &&
15374 current5_ == typed_other->current5_ &&
15375 current6_ == typed_other->current6_ &&
15376 current7_ == typed_other->current7_ &&
15377 current8_ == typed_other->current8_ &&
15378 current9_ == typed_other->current9_ &&
15379 current10_ == typed_other->current10_);
15383 Iterator(const Iterator& other)
15384 : base_(other.base_),
15385 begin1_(other.begin1_),
15386 end1_(other.end1_),
15387 current1_(other.current1_),
15388 begin2_(other.begin2_),
15389 end2_(other.end2_),
15390 current2_(other.current2_),
15391 begin3_(other.begin3_),
15392 end3_(other.end3_),
15393 current3_(other.current3_),
15394 begin4_(other.begin4_),
15395 end4_(other.end4_),
15396 current4_(other.current4_),
15397 begin5_(other.begin5_),
15398 end5_(other.end5_),
15399 current5_(other.current5_),
15400 begin6_(other.begin6_),
15401 end6_(other.end6_),
15402 current6_(other.current6_),
15403 begin7_(other.begin7_),
15404 end7_(other.end7_),
15405 current7_(other.current7_),
15406 begin8_(other.begin8_),
15407 end8_(other.end8_),
15408 current8_(other.current8_),
15409 begin9_(other.begin9_),
15410 end9_(other.end9_),
15411 current9_(other.current9_),
15412 begin10_(other.begin10_),
15413 end10_(other.end10_),
15414 current10_(other.current10_) {
15415 ComputeCurrentValue();
15418 void ComputeCurrentValue() {
15420 current_value_ = ParamType(*current1_, *current2_, *current3_,
15421 *current4_, *current5_, *current6_, *current7_, *current8_,
15422 *current9_, *current10_);
15424 bool AtEnd() const {
15425 // We must report iterator past the end of the range when either of the
15426 // component iterators has reached the end of its range.
15428 current1_ == end1_ ||
15429 current2_ == end2_ ||
15430 current3_ == end3_ ||
15431 current4_ == end4_ ||
15432 current5_ == end5_ ||
15433 current6_ == end6_ ||
15434 current7_ == end7_ ||
15435 current8_ == end8_ ||
15436 current9_ == end9_ ||
15437 current10_ == end10_;
15440 // No implementation - assignment is unsupported.
15441 void operator=(const Iterator& other);
15443 const ParamGeneratorInterface<ParamType>* const base_;
15444 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15445 // current[i]_ is the actual traversing iterator.
15446 const typename ParamGenerator<T1>::iterator begin1_;
15447 const typename ParamGenerator<T1>::iterator end1_;
15448 typename ParamGenerator<T1>::iterator current1_;
15449 const typename ParamGenerator<T2>::iterator begin2_;
15450 const typename ParamGenerator<T2>::iterator end2_;
15451 typename ParamGenerator<T2>::iterator current2_;
15452 const typename ParamGenerator<T3>::iterator begin3_;
15453 const typename ParamGenerator<T3>::iterator end3_;
15454 typename ParamGenerator<T3>::iterator current3_;
15455 const typename ParamGenerator<T4>::iterator begin4_;
15456 const typename ParamGenerator<T4>::iterator end4_;
15457 typename ParamGenerator<T4>::iterator current4_;
15458 const typename ParamGenerator<T5>::iterator begin5_;
15459 const typename ParamGenerator<T5>::iterator end5_;
15460 typename ParamGenerator<T5>::iterator current5_;
15461 const typename ParamGenerator<T6>::iterator begin6_;
15462 const typename ParamGenerator<T6>::iterator end6_;
15463 typename ParamGenerator<T6>::iterator current6_;
15464 const typename ParamGenerator<T7>::iterator begin7_;
15465 const typename ParamGenerator<T7>::iterator end7_;
15466 typename ParamGenerator<T7>::iterator current7_;
15467 const typename ParamGenerator<T8>::iterator begin8_;
15468 const typename ParamGenerator<T8>::iterator end8_;
15469 typename ParamGenerator<T8>::iterator current8_;
15470 const typename ParamGenerator<T9>::iterator begin9_;
15471 const typename ParamGenerator<T9>::iterator end9_;
15472 typename ParamGenerator<T9>::iterator current9_;
15473 const typename ParamGenerator<T10>::iterator begin10_;
15474 const typename ParamGenerator<T10>::iterator end10_;
15475 typename ParamGenerator<T10>::iterator current10_;
15476 ParamType current_value_;
15477 }; // class CartesianProductGenerator10::Iterator
15479 // No implementation - assignment is unsupported.
15480 void operator=(const CartesianProductGenerator10& other);
15482 const ParamGenerator<T1> g1_;
15483 const ParamGenerator<T2> g2_;
15484 const ParamGenerator<T3> g3_;
15485 const ParamGenerator<T4> g4_;
15486 const ParamGenerator<T5> g5_;
15487 const ParamGenerator<T6> g6_;
15488 const ParamGenerator<T7> g7_;
15489 const ParamGenerator<T8> g8_;
15490 const ParamGenerator<T9> g9_;
15491 const ParamGenerator<T10> g10_;
15492 }; // class CartesianProductGenerator10
15495 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
15497 // Helper classes providing Combine() with polymorphic features. They allow
15498 // casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
15499 // convertible to U.
15501 template <class Generator1, class Generator2>
15502 class CartesianProductHolder2 {
15504 CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
15505 : g1_(g1), g2_(g2) {}
15506 template <typename T1, typename T2>
15507 operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
15508 return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
15509 new CartesianProductGenerator2<T1, T2>(
15510 static_cast<ParamGenerator<T1> >(g1_),
15511 static_cast<ParamGenerator<T2> >(g2_)));
15515 // No implementation - assignment is unsupported.
15516 void operator=(const CartesianProductHolder2& other);
15518 const Generator1 g1_;
15519 const Generator2 g2_;
15520 }; // class CartesianProductHolder2
15522 template <class Generator1, class Generator2, class Generator3>
15523 class CartesianProductHolder3 {
15525 CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
15526 const Generator3& g3)
15527 : g1_(g1), g2_(g2), g3_(g3) {}
15528 template <typename T1, typename T2, typename T3>
15529 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
15530 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
15531 new CartesianProductGenerator3<T1, T2, T3>(
15532 static_cast<ParamGenerator<T1> >(g1_),
15533 static_cast<ParamGenerator<T2> >(g2_),
15534 static_cast<ParamGenerator<T3> >(g3_)));
15538 // No implementation - assignment is unsupported.
15539 void operator=(const CartesianProductHolder3& other);
15541 const Generator1 g1_;
15542 const Generator2 g2_;
15543 const Generator3 g3_;
15544 }; // class CartesianProductHolder3
15546 template <class Generator1, class Generator2, class Generator3,
15548 class CartesianProductHolder4 {
15550 CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
15551 const Generator3& g3, const Generator4& g4)
15552 : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
15553 template <typename T1, typename T2, typename T3, typename T4>
15554 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
15555 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
15556 new CartesianProductGenerator4<T1, T2, T3, T4>(
15557 static_cast<ParamGenerator<T1> >(g1_),
15558 static_cast<ParamGenerator<T2> >(g2_),
15559 static_cast<ParamGenerator<T3> >(g3_),
15560 static_cast<ParamGenerator<T4> >(g4_)));
15564 // No implementation - assignment is unsupported.
15565 void operator=(const CartesianProductHolder4& other);
15567 const Generator1 g1_;
15568 const Generator2 g2_;
15569 const Generator3 g3_;
15570 const Generator4 g4_;
15571 }; // class CartesianProductHolder4
15573 template <class Generator1, class Generator2, class Generator3,
15574 class Generator4, class Generator5>
15575 class CartesianProductHolder5 {
15577 CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
15578 const Generator3& g3, const Generator4& g4, const Generator5& g5)
15579 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
15580 template <typename T1, typename T2, typename T3, typename T4, typename T5>
15581 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
15582 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
15583 new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
15584 static_cast<ParamGenerator<T1> >(g1_),
15585 static_cast<ParamGenerator<T2> >(g2_),
15586 static_cast<ParamGenerator<T3> >(g3_),
15587 static_cast<ParamGenerator<T4> >(g4_),
15588 static_cast<ParamGenerator<T5> >(g5_)));
15592 // No implementation - assignment is unsupported.
15593 void operator=(const CartesianProductHolder5& other);
15595 const Generator1 g1_;
15596 const Generator2 g2_;
15597 const Generator3 g3_;
15598 const Generator4 g4_;
15599 const Generator5 g5_;
15600 }; // class CartesianProductHolder5
15602 template <class Generator1, class Generator2, class Generator3,
15603 class Generator4, class Generator5, class Generator6>
15604 class CartesianProductHolder6 {
15606 CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
15607 const Generator3& g3, const Generator4& g4, const Generator5& g5,
15608 const Generator6& g6)
15609 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
15610 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15612 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
15613 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
15614 new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
15615 static_cast<ParamGenerator<T1> >(g1_),
15616 static_cast<ParamGenerator<T2> >(g2_),
15617 static_cast<ParamGenerator<T3> >(g3_),
15618 static_cast<ParamGenerator<T4> >(g4_),
15619 static_cast<ParamGenerator<T5> >(g5_),
15620 static_cast<ParamGenerator<T6> >(g6_)));
15624 // No implementation - assignment is unsupported.
15625 void operator=(const CartesianProductHolder6& other);
15627 const Generator1 g1_;
15628 const Generator2 g2_;
15629 const Generator3 g3_;
15630 const Generator4 g4_;
15631 const Generator5 g5_;
15632 const Generator6 g6_;
15633 }; // class CartesianProductHolder6
15635 template <class Generator1, class Generator2, class Generator3,
15636 class Generator4, class Generator5, class Generator6, class Generator7>
15637 class CartesianProductHolder7 {
15639 CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
15640 const Generator3& g3, const Generator4& g4, const Generator5& g5,
15641 const Generator6& g6, const Generator7& g7)
15642 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
15643 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15644 typename T6, typename T7>
15645 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15647 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
15648 new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
15649 static_cast<ParamGenerator<T1> >(g1_),
15650 static_cast<ParamGenerator<T2> >(g2_),
15651 static_cast<ParamGenerator<T3> >(g3_),
15652 static_cast<ParamGenerator<T4> >(g4_),
15653 static_cast<ParamGenerator<T5> >(g5_),
15654 static_cast<ParamGenerator<T6> >(g6_),
15655 static_cast<ParamGenerator<T7> >(g7_)));
15659 // No implementation - assignment is unsupported.
15660 void operator=(const CartesianProductHolder7& other);
15662 const Generator1 g1_;
15663 const Generator2 g2_;
15664 const Generator3 g3_;
15665 const Generator4 g4_;
15666 const Generator5 g5_;
15667 const Generator6 g6_;
15668 const Generator7 g7_;
15669 }; // class CartesianProductHolder7
15671 template <class Generator1, class Generator2, class Generator3,
15672 class Generator4, class Generator5, class Generator6, class Generator7,
15674 class CartesianProductHolder8 {
15676 CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
15677 const Generator3& g3, const Generator4& g4, const Generator5& g5,
15678 const Generator6& g6, const Generator7& g7, const Generator8& g8)
15679 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
15681 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15682 typename T6, typename T7, typename T8>
15683 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
15685 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
15686 new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
15687 static_cast<ParamGenerator<T1> >(g1_),
15688 static_cast<ParamGenerator<T2> >(g2_),
15689 static_cast<ParamGenerator<T3> >(g3_),
15690 static_cast<ParamGenerator<T4> >(g4_),
15691 static_cast<ParamGenerator<T5> >(g5_),
15692 static_cast<ParamGenerator<T6> >(g6_),
15693 static_cast<ParamGenerator<T7> >(g7_),
15694 static_cast<ParamGenerator<T8> >(g8_)));
15698 // No implementation - assignment is unsupported.
15699 void operator=(const CartesianProductHolder8& other);
15701 const Generator1 g1_;
15702 const Generator2 g2_;
15703 const Generator3 g3_;
15704 const Generator4 g4_;
15705 const Generator5 g5_;
15706 const Generator6 g6_;
15707 const Generator7 g7_;
15708 const Generator8 g8_;
15709 }; // class CartesianProductHolder8
15711 template <class Generator1, class Generator2, class Generator3,
15712 class Generator4, class Generator5, class Generator6, class Generator7,
15713 class Generator8, class Generator9>
15714 class CartesianProductHolder9 {
15716 CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
15717 const Generator3& g3, const Generator4& g4, const Generator5& g5,
15718 const Generator6& g6, const Generator7& g7, const Generator8& g8,
15719 const Generator9& g9)
15720 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15722 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15723 typename T6, typename T7, typename T8, typename T9>
15724 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15726 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15728 new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
15729 static_cast<ParamGenerator<T1> >(g1_),
15730 static_cast<ParamGenerator<T2> >(g2_),
15731 static_cast<ParamGenerator<T3> >(g3_),
15732 static_cast<ParamGenerator<T4> >(g4_),
15733 static_cast<ParamGenerator<T5> >(g5_),
15734 static_cast<ParamGenerator<T6> >(g6_),
15735 static_cast<ParamGenerator<T7> >(g7_),
15736 static_cast<ParamGenerator<T8> >(g8_),
15737 static_cast<ParamGenerator<T9> >(g9_)));
15741 // No implementation - assignment is unsupported.
15742 void operator=(const CartesianProductHolder9& other);
15744 const Generator1 g1_;
15745 const Generator2 g2_;
15746 const Generator3 g3_;
15747 const Generator4 g4_;
15748 const Generator5 g5_;
15749 const Generator6 g6_;
15750 const Generator7 g7_;
15751 const Generator8 g8_;
15752 const Generator9 g9_;
15753 }; // class CartesianProductHolder9
15755 template <class Generator1, class Generator2, class Generator3,
15756 class Generator4, class Generator5, class Generator6, class Generator7,
15757 class Generator8, class Generator9, class Generator10>
15758 class CartesianProductHolder10 {
15760 CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
15761 const Generator3& g3, const Generator4& g4, const Generator5& g5,
15762 const Generator6& g6, const Generator7& g7, const Generator8& g8,
15763 const Generator9& g9, const Generator10& g10)
15764 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15765 g9_(g9), g10_(g10) {}
15766 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15767 typename T6, typename T7, typename T8, typename T9, typename T10>
15768 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15769 T9, T10> >() const {
15770 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15772 new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
15774 static_cast<ParamGenerator<T1> >(g1_),
15775 static_cast<ParamGenerator<T2> >(g2_),
15776 static_cast<ParamGenerator<T3> >(g3_),
15777 static_cast<ParamGenerator<T4> >(g4_),
15778 static_cast<ParamGenerator<T5> >(g5_),
15779 static_cast<ParamGenerator<T6> >(g6_),
15780 static_cast<ParamGenerator<T7> >(g7_),
15781 static_cast<ParamGenerator<T8> >(g8_),
15782 static_cast<ParamGenerator<T9> >(g9_),
15783 static_cast<ParamGenerator<T10> >(g10_)));
15787 // No implementation - assignment is unsupported.
15788 void operator=(const CartesianProductHolder10& other);
15790 const Generator1 g1_;
15791 const Generator2 g2_;
15792 const Generator3 g3_;
15793 const Generator4 g4_;
15794 const Generator5 g5_;
15795 const Generator6 g6_;
15796 const Generator7 g7_;
15797 const Generator8 g8_;
15798 const Generator9 g9_;
15799 const Generator10 g10_;
15800 }; // class CartesianProductHolder10
15802 # endif // GTEST_HAS_COMBINE
15804 } // namespace internal
15805 } // namespace testing
15807 #endif // GTEST_HAS_PARAM_TEST
15809 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
15811 #if GTEST_HAS_PARAM_TEST
15813 namespace testing {
15815 // Functions producing parameter generators.
15817 // Google Test uses these generators to produce parameters for value-
15818 // parameterized tests. When a parameterized test case is instantiated
15819 // with a particular generator, Google Test creates and runs tests
15820 // for each element in the sequence produced by the generator.
15822 // In the following sample, tests from test case FooTest are instantiated
15823 // each three times with parameter values 3, 5, and 8:
15825 // class FooTest : public TestWithParam<int> { ... };
15827 // TEST_P(FooTest, TestThis) {
15829 // TEST_P(FooTest, TestThat) {
15831 // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
15834 // Range() returns generators providing sequences of values in a range.
15837 // Range(start, end)
15838 // - returns a generator producing a sequence of values {start, start+1,
15839 // start+2, ..., }.
15840 // Range(start, end, step)
15841 // - returns a generator producing a sequence of values {start, start+step,
15842 // start+step+step, ..., }.
15844 // * The generated sequences never include end. For example, Range(1, 5)
15845 // returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
15846 // returns a generator producing {1, 3, 5, 7}.
15847 // * start and end must have the same type. That type may be any integral or
15848 // floating-point type or a user defined type satisfying these conditions:
15849 // * It must be assignable (have operator=() defined).
15850 // * It must have operator+() (operator+(int-compatible type) for
15851 // two-operand version).
15852 // * It must have operator<() defined.
15853 // Elements in the resulting sequences will also have that type.
15854 // * Condition start < end must be satisfied in order for resulting sequences
15855 // to contain any elements.
15857 template <typename T, typename IncrementT>
15858 internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
15859 return internal::ParamGenerator<T>(
15860 new internal::RangeGenerator<T, IncrementT>(start, end, step));
15863 template <typename T>
15864 internal::ParamGenerator<T> Range(T start, T end) {
15865 return Range(start, end, 1);
15868 // ValuesIn() function allows generation of tests with parameters coming from
15872 // ValuesIn(const T (&array)[N])
15873 // - returns a generator producing sequences with elements from
15874 // a C-style array.
15875 // ValuesIn(const Container& container)
15876 // - returns a generator producing sequences with elements from
15877 // an STL-style container.
15878 // ValuesIn(Iterator begin, Iterator end)
15879 // - returns a generator producing sequences with elements from
15880 // a range [begin, end) defined by a pair of STL-style iterators. These
15881 // iterators can also be plain C pointers.
15883 // Please note that ValuesIn copies the values from the containers
15884 // passed in and keeps them to generate tests in RUN_ALL_TESTS().
15888 // This instantiates tests from test case StringTest
15889 // each with C-string values of "foo", "bar", and "baz":
15891 // const char* strings[] = {"foo", "bar", "baz"};
15892 // INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
15894 // This instantiates tests from test case StlStringTest
15895 // each with STL strings with values "a" and "b":
15897 // ::std::vector< ::std::string> GetParameterStrings() {
15898 // ::std::vector< ::std::string> v;
15899 // v.push_back("a");
15900 // v.push_back("b");
15904 // INSTANTIATE_TEST_CASE_P(CharSequence,
15906 // ValuesIn(GetParameterStrings()));
15909 // This will also instantiate tests from CharTest
15910 // each with parameter values 'a' and 'b':
15912 // ::std::list<char> GetParameterChars() {
15913 // ::std::list<char> list;
15914 // list.push_back('a');
15915 // list.push_back('b');
15918 // ::std::list<char> l = GetParameterChars();
15919 // INSTANTIATE_TEST_CASE_P(CharSequence2,
15921 // ValuesIn(l.begin(), l.end()));
15923 template <typename ForwardIterator>
15924 internal::ParamGenerator<
15925 typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
15926 ValuesIn(ForwardIterator begin, ForwardIterator end) {
15927 typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
15928 ::value_type ParamType;
15929 return internal::ParamGenerator<ParamType>(
15930 new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
15933 template <typename T, size_t N>
15934 internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
15935 return ValuesIn(array, array + N);
15938 template <class Container>
15939 internal::ParamGenerator<typename Container::value_type> ValuesIn(
15940 const Container& container) {
15941 return ValuesIn(container.begin(), container.end());
15944 // Values() allows generating tests from explicitly specified list of
15948 // Values(T v1, T v2, ..., T vN)
15949 // - returns a generator producing sequences with elements v1, v2, ..., vN.
15951 // For example, this instantiates tests from test case BarTest each
15952 // with values "one", "two", and "three":
15954 // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
15956 // This instantiates tests from test case BazTest each with values 1, 2, 3.5.
15957 // The exact type of values will depend on the type of parameter in BazTest.
15959 // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
15961 // Currently, Values() supports from 1 to 50 parameters.
15963 template <typename T1>
15964 internal::ValueArray1<T1> Values(T1 v1) {
15965 return internal::ValueArray1<T1>(v1);
15968 template <typename T1, typename T2>
15969 internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
15970 return internal::ValueArray2<T1, T2>(v1, v2);
15973 template <typename T1, typename T2, typename T3>
15974 internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
15975 return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
15978 template <typename T1, typename T2, typename T3, typename T4>
15979 internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
15980 return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
15983 template <typename T1, typename T2, typename T3, typename T4, typename T5>
15984 internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
15986 return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
15989 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15991 internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
15992 T4 v4, T5 v5, T6 v6) {
15993 return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
15996 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15997 typename T6, typename T7>
15998 internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
15999 T4 v4, T5 v5, T6 v6, T7 v7) {
16000 return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
16004 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16005 typename T6, typename T7, typename T8>
16006 internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
16007 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
16008 return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
16012 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16013 typename T6, typename T7, typename T8, typename T9>
16014 internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
16015 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
16016 return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
16017 v4, v5, v6, v7, v8, v9);
16020 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16021 typename T6, typename T7, typename T8, typename T9, typename T10>
16022 internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
16023 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
16024 return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
16025 v2, v3, v4, v5, v6, v7, v8, v9, v10);
16028 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16029 typename T6, typename T7, typename T8, typename T9, typename T10,
16031 internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
16032 T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16033 T10 v10, T11 v11) {
16034 return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
16035 T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
16038 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16039 typename T6, typename T7, typename T8, typename T9, typename T10,
16040 typename T11, typename T12>
16041 internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16042 T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16043 T10 v10, T11 v11, T12 v12) {
16044 return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16045 T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
16048 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16049 typename T6, typename T7, typename T8, typename T9, typename T10,
16050 typename T11, typename T12, typename T13>
16051 internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
16052 T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16053 T10 v10, T11 v11, T12 v12, T13 v13) {
16054 return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16055 T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
16058 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16059 typename T6, typename T7, typename T8, typename T9, typename T10,
16060 typename T11, typename T12, typename T13, typename T14>
16061 internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16062 T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16063 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
16064 return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16065 T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16069 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16070 typename T6, typename T7, typename T8, typename T9, typename T10,
16071 typename T11, typename T12, typename T13, typename T14, typename T15>
16072 internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16073 T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16074 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
16075 return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16076 T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16080 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16081 typename T6, typename T7, typename T8, typename T9, typename T10,
16082 typename T11, typename T12, typename T13, typename T14, typename T15,
16084 internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16085 T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16086 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16088 return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16089 T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16090 v12, v13, v14, v15, v16);
16093 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16094 typename T6, typename T7, typename T8, typename T9, typename T10,
16095 typename T11, typename T12, typename T13, typename T14, typename T15,
16096 typename T16, typename T17>
16097 internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16098 T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16099 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16100 T16 v16, T17 v17) {
16101 return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16102 T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16103 v11, v12, v13, v14, v15, v16, v17);
16106 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16107 typename T6, typename T7, typename T8, typename T9, typename T10,
16108 typename T11, typename T12, typename T13, typename T14, typename T15,
16109 typename T16, typename T17, typename T18>
16110 internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16111 T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16112 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16113 T16 v16, T17 v17, T18 v18) {
16114 return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16115 T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16116 v10, v11, v12, v13, v14, v15, v16, v17, v18);
16119 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16120 typename T6, typename T7, typename T8, typename T9, typename T10,
16121 typename T11, typename T12, typename T13, typename T14, typename T15,
16122 typename T16, typename T17, typename T18, typename T19>
16123 internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16124 T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16125 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16126 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
16127 return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16128 T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
16129 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
16132 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16133 typename T6, typename T7, typename T8, typename T9, typename T10,
16134 typename T11, typename T12, typename T13, typename T14, typename T15,
16135 typename T16, typename T17, typename T18, typename T19, typename T20>
16136 internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16137 T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16138 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16139 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
16140 return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16141 T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
16142 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
16145 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16146 typename T6, typename T7, typename T8, typename T9, typename T10,
16147 typename T11, typename T12, typename T13, typename T14, typename T15,
16148 typename T16, typename T17, typename T18, typename T19, typename T20,
16150 internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16151 T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16152 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16153 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
16154 return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16155 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
16156 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
16159 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16160 typename T6, typename T7, typename T8, typename T9, typename T10,
16161 typename T11, typename T12, typename T13, typename T14, typename T15,
16162 typename T16, typename T17, typename T18, typename T19, typename T20,
16163 typename T21, typename T22>
16164 internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16165 T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
16166 T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16167 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16168 T21 v21, T22 v22) {
16169 return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16170 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
16171 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16175 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16176 typename T6, typename T7, typename T8, typename T9, typename T10,
16177 typename T11, typename T12, typename T13, typename T14, typename T15,
16178 typename T16, typename T17, typename T18, typename T19, typename T20,
16179 typename T21, typename T22, typename T23>
16180 internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16181 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
16182 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16183 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16184 T21 v21, T22 v22, T23 v23) {
16185 return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16186 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
16187 v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16188 v20, v21, v22, v23);
16191 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16192 typename T6, typename T7, typename T8, typename T9, typename T10,
16193 typename T11, typename T12, typename T13, typename T14, typename T15,
16194 typename T16, typename T17, typename T18, typename T19, typename T20,
16195 typename T21, typename T22, typename T23, typename T24>
16196 internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16197 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
16198 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16199 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16200 T21 v21, T22 v22, T23 v23, T24 v24) {
16201 return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16202 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
16203 v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
16204 v19, v20, v21, v22, v23, v24);
16207 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16208 typename T6, typename T7, typename T8, typename T9, typename T10,
16209 typename T11, typename T12, typename T13, typename T14, typename T15,
16210 typename T16, typename T17, typename T18, typename T19, typename T20,
16211 typename T21, typename T22, typename T23, typename T24, typename T25>
16212 internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16213 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
16214 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
16215 T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
16216 T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
16217 return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16218 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
16219 v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
16220 v18, v19, v20, v21, v22, v23, v24, v25);
16223 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16224 typename T6, typename T7, typename T8, typename T9, typename T10,
16225 typename T11, typename T12, typename T13, typename T14, typename T15,
16226 typename T16, typename T17, typename T18, typename T19, typename T20,
16227 typename T21, typename T22, typename T23, typename T24, typename T25,
16229 internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16230 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16231 T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16232 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16233 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16235 return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16236 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16237 T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
16238 v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
16241 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16242 typename T6, typename T7, typename T8, typename T9, typename T10,
16243 typename T11, typename T12, typename T13, typename T14, typename T15,
16244 typename T16, typename T17, typename T18, typename T19, typename T20,
16245 typename T21, typename T22, typename T23, typename T24, typename T25,
16246 typename T26, typename T27>
16247 internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16248 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
16249 T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16250 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16251 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16252 T26 v26, T27 v27) {
16253 return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16254 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16255 T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
16256 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
16259 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16260 typename T6, typename T7, typename T8, typename T9, typename T10,
16261 typename T11, typename T12, typename T13, typename T14, typename T15,
16262 typename T16, typename T17, typename T18, typename T19, typename T20,
16263 typename T21, typename T22, typename T23, typename T24, typename T25,
16264 typename T26, typename T27, typename T28>
16265 internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16266 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
16267 T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16268 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16269 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16270 T26 v26, T27 v27, T28 v28) {
16271 return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16272 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16273 T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16274 v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
16278 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16279 typename T6, typename T7, typename T8, typename T9, typename T10,
16280 typename T11, typename T12, typename T13, typename T14, typename T15,
16281 typename T16, typename T17, typename T18, typename T19, typename T20,
16282 typename T21, typename T22, typename T23, typename T24, typename T25,
16283 typename T26, typename T27, typename T28, typename T29>
16284 internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16285 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16286 T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16287 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16288 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16289 T26 v26, T27 v27, T28 v28, T29 v29) {
16290 return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16291 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16292 T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16293 v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
16297 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16298 typename T6, typename T7, typename T8, typename T9, typename T10,
16299 typename T11, typename T12, typename T13, typename T14, typename T15,
16300 typename T16, typename T17, typename T18, typename T19, typename T20,
16301 typename T21, typename T22, typename T23, typename T24, typename T25,
16302 typename T26, typename T27, typename T28, typename T29, typename T30>
16303 internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16304 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16305 T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16306 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
16307 T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
16308 T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
16309 return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16310 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16311 T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16312 v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
16313 v26, v27, v28, v29, v30);
16316 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16317 typename T6, typename T7, typename T8, typename T9, typename T10,
16318 typename T11, typename T12, typename T13, typename T14, typename T15,
16319 typename T16, typename T17, typename T18, typename T19, typename T20,
16320 typename T21, typename T22, typename T23, typename T24, typename T25,
16321 typename T26, typename T27, typename T28, typename T29, typename T30,
16323 internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16324 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16325 T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16326 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16327 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16328 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
16329 return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16330 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16331 T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16332 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
16333 v25, v26, v27, v28, v29, v30, v31);
16336 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16337 typename T6, typename T7, typename T8, typename T9, typename T10,
16338 typename T11, typename T12, typename T13, typename T14, typename T15,
16339 typename T16, typename T17, typename T18, typename T19, typename T20,
16340 typename T21, typename T22, typename T23, typename T24, typename T25,
16341 typename T26, typename T27, typename T28, typename T29, typename T30,
16342 typename T31, typename T32>
16343 internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16344 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16345 T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16346 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16347 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16348 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16350 return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16351 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16352 T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16353 v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16354 v24, v25, v26, v27, v28, v29, v30, v31, v32);
16357 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16358 typename T6, typename T7, typename T8, typename T9, typename T10,
16359 typename T11, typename T12, typename T13, typename T14, typename T15,
16360 typename T16, typename T17, typename T18, typename T19, typename T20,
16361 typename T21, typename T22, typename T23, typename T24, typename T25,
16362 typename T26, typename T27, typename T28, typename T29, typename T30,
16363 typename T31, typename T32, typename T33>
16364 internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16365 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16366 T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16367 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16368 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16369 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16370 T32 v32, T33 v33) {
16371 return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16372 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16373 T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
16374 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16375 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
16378 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16379 typename T6, typename T7, typename T8, typename T9, typename T10,
16380 typename T11, typename T12, typename T13, typename T14, typename T15,
16381 typename T16, typename T17, typename T18, typename T19, typename T20,
16382 typename T21, typename T22, typename T23, typename T24, typename T25,
16383 typename T26, typename T27, typename T28, typename T29, typename T30,
16384 typename T31, typename T32, typename T33, typename T34>
16385 internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16386 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16387 T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16388 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16389 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
16390 T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
16391 T31 v31, T32 v32, T33 v33, T34 v34) {
16392 return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16393 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16394 T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
16395 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
16396 v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
16399 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16400 typename T6, typename T7, typename T8, typename T9, typename T10,
16401 typename T11, typename T12, typename T13, typename T14, typename T15,
16402 typename T16, typename T17, typename T18, typename T19, typename T20,
16403 typename T21, typename T22, typename T23, typename T24, typename T25,
16404 typename T26, typename T27, typename T28, typename T29, typename T30,
16405 typename T31, typename T32, typename T33, typename T34, typename T35>
16406 internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16407 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16408 T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16409 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16410 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16411 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16412 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
16413 return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16414 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16415 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
16416 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
16417 v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
16420 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16421 typename T6, typename T7, typename T8, typename T9, typename T10,
16422 typename T11, typename T12, typename T13, typename T14, typename T15,
16423 typename T16, typename T17, typename T18, typename T19, typename T20,
16424 typename T21, typename T22, typename T23, typename T24, typename T25,
16425 typename T26, typename T27, typename T28, typename T29, typename T30,
16426 typename T31, typename T32, typename T33, typename T34, typename T35,
16428 internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16429 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16430 T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16431 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16432 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16433 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16434 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
16435 return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16436 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16437 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
16438 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16439 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16443 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16444 typename T6, typename T7, typename T8, typename T9, typename T10,
16445 typename T11, typename T12, typename T13, typename T14, typename T15,
16446 typename T16, typename T17, typename T18, typename T19, typename T20,
16447 typename T21, typename T22, typename T23, typename T24, typename T25,
16448 typename T26, typename T27, typename T28, typename T29, typename T30,
16449 typename T31, typename T32, typename T33, typename T34, typename T35,
16450 typename T36, typename T37>
16451 internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16452 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16453 T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
16454 T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16455 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16456 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16457 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16459 return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16460 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16461 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
16462 v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16463 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16464 v34, v35, v36, v37);
16467 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16468 typename T6, typename T7, typename T8, typename T9, typename T10,
16469 typename T11, typename T12, typename T13, typename T14, typename T15,
16470 typename T16, typename T17, typename T18, typename T19, typename T20,
16471 typename T21, typename T22, typename T23, typename T24, typename T25,
16472 typename T26, typename T27, typename T28, typename T29, typename T30,
16473 typename T31, typename T32, typename T33, typename T34, typename T35,
16474 typename T36, typename T37, typename T38>
16475 internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16476 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16477 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
16478 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16479 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16480 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16481 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16482 T37 v37, T38 v38) {
16483 return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16484 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16485 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
16486 v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
16487 v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
16488 v33, v34, v35, v36, v37, v38);
16491 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16492 typename T6, typename T7, typename T8, typename T9, typename T10,
16493 typename T11, typename T12, typename T13, typename T14, typename T15,
16494 typename T16, typename T17, typename T18, typename T19, typename T20,
16495 typename T21, typename T22, typename T23, typename T24, typename T25,
16496 typename T26, typename T27, typename T28, typename T29, typename T30,
16497 typename T31, typename T32, typename T33, typename T34, typename T35,
16498 typename T36, typename T37, typename T38, typename T39>
16499 internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16500 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16501 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
16502 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16503 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16504 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16505 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16506 T37 v37, T38 v38, T39 v39) {
16507 return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16508 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16509 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
16510 v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
16511 v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
16512 v32, v33, v34, v35, v36, v37, v38, v39);
16515 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16516 typename T6, typename T7, typename T8, typename T9, typename T10,
16517 typename T11, typename T12, typename T13, typename T14, typename T15,
16518 typename T16, typename T17, typename T18, typename T19, typename T20,
16519 typename T21, typename T22, typename T23, typename T24, typename T25,
16520 typename T26, typename T27, typename T28, typename T29, typename T30,
16521 typename T31, typename T32, typename T33, typename T34, typename T35,
16522 typename T36, typename T37, typename T38, typename T39, typename T40>
16523 internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16524 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16525 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
16526 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
16527 T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
16528 T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
16529 T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
16530 T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
16531 return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16532 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16533 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16534 T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
16535 v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
16536 v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
16539 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16540 typename T6, typename T7, typename T8, typename T9, typename T10,
16541 typename T11, typename T12, typename T13, typename T14, typename T15,
16542 typename T16, typename T17, typename T18, typename T19, typename T20,
16543 typename T21, typename T22, typename T23, typename T24, typename T25,
16544 typename T26, typename T27, typename T28, typename T29, typename T30,
16545 typename T31, typename T32, typename T33, typename T34, typename T35,
16546 typename T36, typename T37, typename T38, typename T39, typename T40,
16548 internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16549 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16550 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
16551 T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16552 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16553 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16554 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16555 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
16556 return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16557 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16558 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16559 T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
16560 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
16561 v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
16564 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16565 typename T6, typename T7, typename T8, typename T9, typename T10,
16566 typename T11, typename T12, typename T13, typename T14, typename T15,
16567 typename T16, typename T17, typename T18, typename T19, typename T20,
16568 typename T21, typename T22, typename T23, typename T24, typename T25,
16569 typename T26, typename T27, typename T28, typename T29, typename T30,
16570 typename T31, typename T32, typename T33, typename T34, typename T35,
16571 typename T36, typename T37, typename T38, typename T39, typename T40,
16572 typename T41, typename T42>
16573 internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16574 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16575 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
16576 T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16577 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16578 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16579 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16580 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16582 return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16583 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16584 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16585 T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16586 v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
16587 v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
16591 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16592 typename T6, typename T7, typename T8, typename T9, typename T10,
16593 typename T11, typename T12, typename T13, typename T14, typename T15,
16594 typename T16, typename T17, typename T18, typename T19, typename T20,
16595 typename T21, typename T22, typename T23, typename T24, typename T25,
16596 typename T26, typename T27, typename T28, typename T29, typename T30,
16597 typename T31, typename T32, typename T33, typename T34, typename T35,
16598 typename T36, typename T37, typename T38, typename T39, typename T40,
16599 typename T41, typename T42, typename T43>
16600 internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16601 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16602 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
16603 T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16604 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16605 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16606 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16607 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16608 T42 v42, T43 v43) {
16609 return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16610 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16611 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16612 T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16613 v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
16614 v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
16618 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16619 typename T6, typename T7, typename T8, typename T9, typename T10,
16620 typename T11, typename T12, typename T13, typename T14, typename T15,
16621 typename T16, typename T17, typename T18, typename T19, typename T20,
16622 typename T21, typename T22, typename T23, typename T24, typename T25,
16623 typename T26, typename T27, typename T28, typename T29, typename T30,
16624 typename T31, typename T32, typename T33, typename T34, typename T35,
16625 typename T36, typename T37, typename T38, typename T39, typename T40,
16626 typename T41, typename T42, typename T43, typename T44>
16627 internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16628 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16629 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16630 T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16631 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16632 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16633 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16634 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16635 T42 v42, T43 v43, T44 v44) {
16636 return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16637 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16638 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16639 T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16640 v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
16641 v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
16642 v40, v41, v42, v43, v44);
16645 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16646 typename T6, typename T7, typename T8, typename T9, typename T10,
16647 typename T11, typename T12, typename T13, typename T14, typename T15,
16648 typename T16, typename T17, typename T18, typename T19, typename T20,
16649 typename T21, typename T22, typename T23, typename T24, typename T25,
16650 typename T26, typename T27, typename T28, typename T29, typename T30,
16651 typename T31, typename T32, typename T33, typename T34, typename T35,
16652 typename T36, typename T37, typename T38, typename T39, typename T40,
16653 typename T41, typename T42, typename T43, typename T44, typename T45>
16654 internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16655 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16656 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16657 T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16658 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
16659 T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
16660 T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
16661 T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
16662 T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
16663 return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16664 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16665 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16666 T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16667 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
16668 v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
16669 v39, v40, v41, v42, v43, v44, v45);
16672 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16673 typename T6, typename T7, typename T8, typename T9, typename T10,
16674 typename T11, typename T12, typename T13, typename T14, typename T15,
16675 typename T16, typename T17, typename T18, typename T19, typename T20,
16676 typename T21, typename T22, typename T23, typename T24, typename T25,
16677 typename T26, typename T27, typename T28, typename T29, typename T30,
16678 typename T31, typename T32, typename T33, typename T34, typename T35,
16679 typename T36, typename T37, typename T38, typename T39, typename T40,
16680 typename T41, typename T42, typename T43, typename T44, typename T45,
16682 internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16683 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16684 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16685 T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16686 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16687 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16688 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16689 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16690 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
16691 return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16692 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16693 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16694 T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16695 v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16696 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
16697 v38, v39, v40, v41, v42, v43, v44, v45, v46);
16700 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16701 typename T6, typename T7, typename T8, typename T9, typename T10,
16702 typename T11, typename T12, typename T13, typename T14, typename T15,
16703 typename T16, typename T17, typename T18, typename T19, typename T20,
16704 typename T21, typename T22, typename T23, typename T24, typename T25,
16705 typename T26, typename T27, typename T28, typename T29, typename T30,
16706 typename T31, typename T32, typename T33, typename T34, typename T35,
16707 typename T36, typename T37, typename T38, typename T39, typename T40,
16708 typename T41, typename T42, typename T43, typename T44, typename T45,
16709 typename T46, typename T47>
16710 internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16711 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16712 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16713 T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16714 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16715 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16716 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16717 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16718 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
16719 return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16720 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16721 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16722 T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
16723 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16724 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
16725 v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
16728 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16729 typename T6, typename T7, typename T8, typename T9, typename T10,
16730 typename T11, typename T12, typename T13, typename T14, typename T15,
16731 typename T16, typename T17, typename T18, typename T19, typename T20,
16732 typename T21, typename T22, typename T23, typename T24, typename T25,
16733 typename T26, typename T27, typename T28, typename T29, typename T30,
16734 typename T31, typename T32, typename T33, typename T34, typename T35,
16735 typename T36, typename T37, typename T38, typename T39, typename T40,
16736 typename T41, typename T42, typename T43, typename T44, typename T45,
16737 typename T46, typename T47, typename T48>
16738 internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16739 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16740 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16741 T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16742 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16743 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16744 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16745 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16746 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
16748 return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16749 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16750 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16751 T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
16752 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
16753 v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
16754 v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
16757 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16758 typename T6, typename T7, typename T8, typename T9, typename T10,
16759 typename T11, typename T12, typename T13, typename T14, typename T15,
16760 typename T16, typename T17, typename T18, typename T19, typename T20,
16761 typename T21, typename T22, typename T23, typename T24, typename T25,
16762 typename T26, typename T27, typename T28, typename T29, typename T30,
16763 typename T31, typename T32, typename T33, typename T34, typename T35,
16764 typename T36, typename T37, typename T38, typename T39, typename T40,
16765 typename T41, typename T42, typename T43, typename T44, typename T45,
16766 typename T46, typename T47, typename T48, typename T49>
16767 internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16768 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16769 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16770 T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16771 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16772 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
16773 T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
16774 T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
16775 T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
16776 T47 v47, T48 v48, T49 v49) {
16777 return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16778 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16779 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16780 T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
16781 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
16782 v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
16783 v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
16786 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16787 typename T6, typename T7, typename T8, typename T9, typename T10,
16788 typename T11, typename T12, typename T13, typename T14, typename T15,
16789 typename T16, typename T17, typename T18, typename T19, typename T20,
16790 typename T21, typename T22, typename T23, typename T24, typename T25,
16791 typename T26, typename T27, typename T28, typename T29, typename T30,
16792 typename T31, typename T32, typename T33, typename T34, typename T35,
16793 typename T36, typename T37, typename T38, typename T39, typename T40,
16794 typename T41, typename T42, typename T43, typename T44, typename T45,
16795 typename T46, typename T47, typename T48, typename T49, typename T50>
16796 internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16797 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16798 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16799 T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16800 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16801 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16802 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16803 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
16804 T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
16805 T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
16806 return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16807 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16808 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16809 T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
16810 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16811 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16812 v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
16816 // Bool() allows generating tests with parameters in a set of (false, true).
16820 // - returns a generator producing sequences with elements {false, true}.
16822 // It is useful when testing code that depends on Boolean flags. Combinations
16823 // of multiple flags can be tested when several Bool()'s are combined using
16824 // Combine() function.
16826 // In the following example all tests in the test case FlagDependentTest
16827 // will be instantiated twice with parameters false and true.
16829 // class FlagDependentTest : public testing::TestWithParam<bool> {
16830 // virtual void SetUp() {
16831 // external_flag = GetParam();
16834 // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
16836 inline internal::ParamGenerator<bool> Bool() {
16837 return Values(false, true);
16840 # if GTEST_HAS_COMBINE
16841 // Combine() allows the user to combine two or more sequences to produce
16842 // values of a Cartesian product of those sequences' elements.
16845 // Combine(gen1, gen2, ..., genN)
16846 // - returns a generator producing sequences with elements coming from
16847 // the Cartesian product of elements from the sequences generated by
16848 // gen1, gen2, ..., genN. The sequence elements will have a type of
16849 // tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
16850 // of elements from sequences produces by gen1, gen2, ..., genN.
16852 // Combine can have up to 10 arguments. This number is currently limited
16853 // by the maximum number of elements in the tuple implementation used by Google
16858 // This will instantiate tests in test case AnimalTest each one with
16859 // the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
16860 // tuple("dog", BLACK), and tuple("dog", WHITE):
16862 // enum Color { BLACK, GRAY, WHITE };
16863 // class AnimalTest
16864 // : public testing::TestWithParam<tuple<const char*, Color> > {...};
16866 // TEST_P(AnimalTest, AnimalLooksNice) {...}
16868 // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
16869 // Combine(Values("cat", "dog"),
16870 // Values(BLACK, WHITE)));
16872 // This will instantiate tests in FlagDependentTest with all variations of two
16875 // class FlagDependentTest
16876 // : public testing::TestWithParam<tuple<bool, bool> > {
16877 // virtual void SetUp() {
16878 // // Assigns external_flag_1 and external_flag_2 values from the tuple.
16879 // tie(external_flag_1, external_flag_2) = GetParam();
16883 // TEST_P(FlagDependentTest, TestFeature1) {
16884 // // Test your code using external_flag_1 and external_flag_2 here.
16886 // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
16887 // Combine(Bool(), Bool()));
16889 template <typename Generator1, typename Generator2>
16890 internal::CartesianProductHolder2<Generator1, Generator2> Combine(
16891 const Generator1& g1, const Generator2& g2) {
16892 return internal::CartesianProductHolder2<Generator1, Generator2>(
16896 template <typename Generator1, typename Generator2, typename Generator3>
16897 internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
16898 const Generator1& g1, const Generator2& g2, const Generator3& g3) {
16899 return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
16903 template <typename Generator1, typename Generator2, typename Generator3,
16904 typename Generator4>
16905 internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
16906 Generator4> Combine(
16907 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16908 const Generator4& g4) {
16909 return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
16914 template <typename Generator1, typename Generator2, typename Generator3,
16915 typename Generator4, typename Generator5>
16916 internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
16917 Generator4, Generator5> Combine(
16918 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16919 const Generator4& g4, const Generator5& g5) {
16920 return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
16921 Generator4, Generator5>(
16922 g1, g2, g3, g4, g5);
16925 template <typename Generator1, typename Generator2, typename Generator3,
16926 typename Generator4, typename Generator5, typename Generator6>
16927 internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
16928 Generator4, Generator5, Generator6> Combine(
16929 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16930 const Generator4& g4, const Generator5& g5, const Generator6& g6) {
16931 return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
16932 Generator4, Generator5, Generator6>(
16933 g1, g2, g3, g4, g5, g6);
16936 template <typename Generator1, typename Generator2, typename Generator3,
16937 typename Generator4, typename Generator5, typename Generator6,
16938 typename Generator7>
16939 internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
16940 Generator4, Generator5, Generator6, Generator7> Combine(
16941 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16942 const Generator4& g4, const Generator5& g5, const Generator6& g6,
16943 const Generator7& g7) {
16944 return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
16945 Generator4, Generator5, Generator6, Generator7>(
16946 g1, g2, g3, g4, g5, g6, g7);
16949 template <typename Generator1, typename Generator2, typename Generator3,
16950 typename Generator4, typename Generator5, typename Generator6,
16951 typename Generator7, typename Generator8>
16952 internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
16953 Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
16954 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16955 const Generator4& g4, const Generator5& g5, const Generator6& g6,
16956 const Generator7& g7, const Generator8& g8) {
16957 return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
16958 Generator4, Generator5, Generator6, Generator7, Generator8>(
16959 g1, g2, g3, g4, g5, g6, g7, g8);
16962 template <typename Generator1, typename Generator2, typename Generator3,
16963 typename Generator4, typename Generator5, typename Generator6,
16964 typename Generator7, typename Generator8, typename Generator9>
16965 internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
16966 Generator4, Generator5, Generator6, Generator7, Generator8,
16967 Generator9> Combine(
16968 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16969 const Generator4& g4, const Generator5& g5, const Generator6& g6,
16970 const Generator7& g7, const Generator8& g8, const Generator9& g9) {
16971 return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
16972 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
16973 g1, g2, g3, g4, g5, g6, g7, g8, g9);
16976 template <typename Generator1, typename Generator2, typename Generator3,
16977 typename Generator4, typename Generator5, typename Generator6,
16978 typename Generator7, typename Generator8, typename Generator9,
16979 typename Generator10>
16980 internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
16981 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
16982 Generator10> Combine(
16983 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16984 const Generator4& g4, const Generator5& g5, const Generator6& g6,
16985 const Generator7& g7, const Generator8& g8, const Generator9& g9,
16986 const Generator10& g10) {
16987 return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
16988 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
16990 g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
16992 # endif // GTEST_HAS_COMBINE
16996 # define TEST_P(test_case_name, test_name) \
16997 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
16998 : public test_case_name { \
17000 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
17001 virtual void TestBody(); \
17003 static int AddToRegistry() { \
17004 ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
17005 GetTestCasePatternHolder<test_case_name>(\
17006 #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
17009 new ::testing::internal::TestMetaFactory< \
17010 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
17013 static int gtest_registering_dummy_; \
17014 GTEST_DISALLOW_COPY_AND_ASSIGN_(\
17015 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
17017 int GTEST_TEST_CLASS_NAME_(test_case_name, \
17018 test_name)::gtest_registering_dummy_ = \
17019 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
17020 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
17022 # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
17023 ::testing::internal::ParamGenerator<test_case_name::ParamType> \
17024 gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
17025 int gtest_##prefix##test_case_name##_dummy_ = \
17026 ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
17027 GetTestCasePatternHolder<test_case_name>(\
17028 #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
17030 >est_##prefix##test_case_name##_EvalGenerator_, \
17031 __FILE__, __LINE__)
17033 } // namespace testing
17035 #endif // GTEST_HAS_PARAM_TEST
17037 #endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
17038 // Copyright 2006, Google Inc.
17039 // All rights reserved.
17041 // Redistribution and use in source and binary forms, with or without
17042 // modification, are permitted provided that the following conditions are
17045 // * Redistributions of source code must retain the above copyright
17046 // notice, this list of conditions and the following disclaimer.
17047 // * Redistributions in binary form must reproduce the above
17048 // copyright notice, this list of conditions and the following disclaimer
17049 // in the documentation and/or other materials provided with the
17051 // * Neither the name of Google Inc. nor the names of its
17052 // contributors may be used to endorse or promote products derived from
17053 // this software without specific prior written permission.
17055 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17056 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17057 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17058 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17059 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17060 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17061 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17062 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17063 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17064 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17065 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17067 // Author: wan@google.com (Zhanyong Wan)
17069 // Google C++ Testing Framework definitions useful in production code.
17071 #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17072 #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17074 // When you need to test the private or protected members of a class,
17075 // use the FRIEND_TEST macro to declare your tests as friends of the
17076 // class. For example:
17080 // void MyMethod();
17081 // FRIEND_TEST(MyClassTest, MyMethod);
17084 // class MyClassTest : public testing::Test {
17088 // TEST_F(MyClassTest, MyMethod) {
17089 // // Can call MyClass::MyMethod() here.
17092 #define FRIEND_TEST(test_case_name, test_name)\
17093 friend class test_case_name##_##test_name##_Test
17095 #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17096 // Copyright 2008, Google Inc.
17097 // All rights reserved.
17099 // Redistribution and use in source and binary forms, with or without
17100 // modification, are permitted provided that the following conditions are
17103 // * Redistributions of source code must retain the above copyright
17104 // notice, this list of conditions and the following disclaimer.
17105 // * Redistributions in binary form must reproduce the above
17106 // copyright notice, this list of conditions and the following disclaimer
17107 // in the documentation and/or other materials provided with the
17109 // * Neither the name of Google Inc. nor the names of its
17110 // contributors may be used to endorse or promote products derived from
17111 // this software without specific prior written permission.
17113 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17114 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17115 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17116 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17117 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17118 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17119 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17120 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17121 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17122 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17123 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17125 // Author: mheule@google.com (Markus Heule)
17128 #ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17129 #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17134 namespace testing {
17136 // A copyable object representing the result of a test part (i.e. an
17137 // assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
17139 // Don't inherit from TestPartResult as its destructor is not virtual.
17140 class GTEST_API_ TestPartResult {
17142 // The possible outcomes of a test part (i.e. an assertion or an
17143 // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
17145 kSuccess, // Succeeded.
17146 kNonFatalFailure, // Failed but the test can continue.
17147 kFatalFailure // Failed and the test should be terminated.
17150 // C'tor. TestPartResult does NOT have a default constructor.
17151 // Always use this constructor (with parameters) to create a
17152 // TestPartResult object.
17153 TestPartResult(Type a_type,
17154 const char* a_file_name,
17156 const char* a_message)
17158 file_name_(a_file_name == NULL ? "" : a_file_name),
17159 line_number_(a_line_number),
17160 summary_(ExtractSummary(a_message)),
17161 message_(a_message) {
17164 // Gets the outcome of the test part.
17165 Type type() const { return type_; }
17167 // Gets the name of the source file where the test part took place, or
17168 // NULL if it's unknown.
17169 const char* file_name() const {
17170 return file_name_.empty() ? NULL : file_name_.c_str();
17173 // Gets the line in the source file where the test part took place,
17174 // or -1 if it's unknown.
17175 int line_number() const { return line_number_; }
17177 // Gets the summary of the failure message.
17178 const char* summary() const { return summary_.c_str(); }
17180 // Gets the message associated with the test part.
17181 const char* message() const { return message_.c_str(); }
17183 // Returns true iff the test part passed.
17184 bool passed() const { return type_ == kSuccess; }
17186 // Returns true iff the test part failed.
17187 bool failed() const { return type_ != kSuccess; }
17189 // Returns true iff the test part non-fatally failed.
17190 bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
17192 // Returns true iff the test part fatally failed.
17193 bool fatally_failed() const { return type_ == kFatalFailure; }
17198 // Gets the summary of the failure message by omitting the stack
17200 static std::string ExtractSummary(const char* message);
17202 // The name of the source file where the test part took place, or
17203 // "" if the source file is unknown.
17204 std::string file_name_;
17205 // The line in the source file where the test part took place, or -1
17206 // if the line number is unknown.
17208 std::string summary_; // The test failure summary.
17209 std::string message_; // The test failure message.
17212 // Prints a TestPartResult object.
17213 std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
17215 // An array of TestPartResult objects.
17217 // Don't inherit from TestPartResultArray as its destructor is not
17219 class GTEST_API_ TestPartResultArray {
17221 TestPartResultArray() {}
17223 // Appends the given TestPartResult to the array.
17224 void Append(const TestPartResult& result);
17226 // Returns the TestPartResult at the given index (0-based).
17227 const TestPartResult& GetTestPartResult(int index) const;
17229 // Returns the number of TestPartResult objects in the array.
17233 std::vector<TestPartResult> array_;
17235 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
17238 // This interface knows how to report a test part result.
17239 class GTEST_API_ TestPartResultReporterInterface {
17241 virtual ~TestPartResultReporterInterface() {}
17243 virtual void ReportTestPartResult(const TestPartResult& result) = 0;
17246 namespace internal {
17248 // This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
17249 // statement generates new fatal failures. To do so it registers itself as the
17250 // current test part result reporter. Besides checking if fatal failures were
17251 // reported, it only delegates the reporting to the former result reporter.
17252 // The original result reporter is restored in the destructor.
17253 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
17254 class GTEST_API_ HasNewFatalFailureHelper
17255 : public TestPartResultReporterInterface {
17257 HasNewFatalFailureHelper();
17258 virtual ~HasNewFatalFailureHelper();
17259 virtual void ReportTestPartResult(const TestPartResult& result);
17260 bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
17262 bool has_new_fatal_failure_;
17263 TestPartResultReporterInterface* original_reporter_;
17265 GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
17268 } // namespace internal
17270 } // namespace testing
17272 #endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17273 // Copyright 2008 Google Inc.
17274 // All Rights Reserved.
17276 // Redistribution and use in source and binary forms, with or without
17277 // modification, are permitted provided that the following conditions are
17280 // * Redistributions of source code must retain the above copyright
17281 // notice, this list of conditions and the following disclaimer.
17282 // * Redistributions in binary form must reproduce the above
17283 // copyright notice, this list of conditions and the following disclaimer
17284 // in the documentation and/or other materials provided with the
17286 // * Neither the name of Google Inc. nor the names of its
17287 // contributors may be used to endorse or promote products derived from
17288 // this software without specific prior written permission.
17290 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17291 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17292 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17293 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17294 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17295 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17296 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17297 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17298 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17299 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17300 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17302 // Author: wan@google.com (Zhanyong Wan)
17304 #ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17305 #define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17307 // This header implements typed tests and type-parameterized tests.
17309 // Typed (aka type-driven) tests repeat the same test for types in a
17310 // list. You must know which types you want to test with when writing
17311 // typed tests. Here's how you do it:
17315 // First, define a fixture class template. It should be parameterized
17316 // by a type. Remember to derive it from testing::Test.
17317 template <typename T>
17318 class FooTest : public testing::Test {
17321 typedef std::list<T> List;
17326 // Next, associate a list of types with the test case, which will be
17327 // repeated for each type in the list. The typedef is necessary for
17328 // the macro to parse correctly.
17329 typedef testing::Types<char, int, unsigned int> MyTypes;
17330 TYPED_TEST_CASE(FooTest, MyTypes);
17332 // If the type list contains only one type, you can write that type
17333 // directly without Types<...>:
17334 // TYPED_TEST_CASE(FooTest, int);
17336 // Then, use TYPED_TEST() instead of TEST_F() to define as many typed
17337 // tests for this test case as you want.
17338 TYPED_TEST(FooTest, DoesBlah) {
17339 // Inside a test, refer to TypeParam to get the type parameter.
17340 // Since we are inside a derived class template, C++ requires use to
17341 // visit the members of FooTest via 'this'.
17342 TypeParam n = this->value_;
17344 // To visit static members of the fixture, add the TestFixture::
17346 n += TestFixture::shared_;
17348 // To refer to typedefs in the fixture, add the "typename
17349 // TestFixture::" prefix.
17350 typename TestFixture::List values;
17351 values.push_back(n);
17355 TYPED_TEST(FooTest, HasPropertyA) { ... }
17359 // Type-parameterized tests are abstract test patterns parameterized
17360 // by a type. Compared with typed tests, type-parameterized tests
17361 // allow you to define the test pattern without knowing what the type
17362 // parameters are. The defined pattern can be instantiated with
17363 // different types any number of times, in any number of translation
17366 // If you are designing an interface or concept, you can define a
17367 // suite of type-parameterized tests to verify properties that any
17368 // valid implementation of the interface/concept should have. Then,
17369 // each implementation can easily instantiate the test suite to verify
17370 // that it conforms to the requirements, without having to write
17371 // similar tests repeatedly. Here's an example:
17375 // First, define a fixture class template. It should be parameterized
17376 // by a type. Remember to derive it from testing::Test.
17377 template <typename T>
17378 class FooTest : public testing::Test {
17382 // Next, declare that you will define a type-parameterized test case
17383 // (the _P suffix is for "parameterized" or "pattern", whichever you
17385 TYPED_TEST_CASE_P(FooTest);
17387 // Then, use TYPED_TEST_P() to define as many type-parameterized tests
17388 // for this type-parameterized test case as you want.
17389 TYPED_TEST_P(FooTest, DoesBlah) {
17390 // Inside a test, refer to TypeParam to get the type parameter.
17395 TYPED_TEST_P(FooTest, HasPropertyA) { ... }
17397 // Now the tricky part: you need to register all test patterns before
17398 // you can instantiate them. The first argument of the macro is the
17399 // test case name; the rest are the names of the tests in this test
17401 REGISTER_TYPED_TEST_CASE_P(FooTest,
17402 DoesBlah, HasPropertyA);
17404 // Finally, you are free to instantiate the pattern with the types you
17405 // want. If you put the above code in a header file, you can #include
17406 // it in multiple C++ source files and instantiate it multiple times.
17408 // To distinguish different instances of the pattern, the first
17409 // argument to the INSTANTIATE_* macro is a prefix that will be added
17410 // to the actual test case name. Remember to pick unique prefixes for
17411 // different instances.
17412 typedef testing::Types<char, int, unsigned int> MyTypes;
17413 INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
17415 // If the type list contains only one type, you can write that type
17416 // directly without Types<...>:
17417 // INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
17422 // Implements typed tests.
17424 #if GTEST_HAS_TYPED_TEST
17426 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17428 // Expands to the name of the typedef for the type parameters of the
17429 // given test case.
17430 # define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
17432 // The 'Types' template argument below must have spaces around it
17433 // since some compilers may choke on '>>' when passing a template
17434 // instance (e.g. Types<int>)
17435 # define TYPED_TEST_CASE(CaseName, Types) \
17436 typedef ::testing::internal::TypeList< Types >::type \
17437 GTEST_TYPE_PARAMS_(CaseName)
17439 # define TYPED_TEST(CaseName, TestName) \
17440 template <typename gtest_TypeParam_> \
17441 class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
17442 : public CaseName<gtest_TypeParam_> { \
17444 typedef CaseName<gtest_TypeParam_> TestFixture; \
17445 typedef gtest_TypeParam_ TypeParam; \
17446 virtual void TestBody(); \
17448 bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
17449 ::testing::internal::TypeParameterizedTest< \
17451 ::testing::internal::TemplateSel< \
17452 GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
17453 GTEST_TYPE_PARAMS_(CaseName)>::Register(\
17454 "", #CaseName, #TestName, 0); \
17455 template <typename gtest_TypeParam_> \
17456 void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
17458 #endif // GTEST_HAS_TYPED_TEST
17460 // Implements type-parameterized tests.
17462 #if GTEST_HAS_TYPED_TEST_P
17464 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17466 // Expands to the namespace name that the type-parameterized tests for
17467 // the given type-parameterized test case are defined in. The exact
17468 // name of the namespace is subject to change without notice.
17469 # define GTEST_CASE_NAMESPACE_(TestCaseName) \
17470 gtest_case_##TestCaseName##_
17472 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17474 // Expands to the name of the variable used to remember the names of
17475 // the defined tests in the given test case.
17476 # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
17477 gtest_typed_test_case_p_state_##TestCaseName##_
17479 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
17481 // Expands to the name of the variable used to remember the names of
17482 // the registered tests in the given test case.
17483 # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
17484 gtest_registered_test_names_##TestCaseName##_
17486 // The variables defined in the type-parameterized test macros are
17487 // static as typically these macros are used in a .h file that can be
17488 // #included in multiple translation units linked together.
17489 # define TYPED_TEST_CASE_P(CaseName) \
17490 static ::testing::internal::TypedTestCasePState \
17491 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
17493 # define TYPED_TEST_P(CaseName, TestName) \
17494 namespace GTEST_CASE_NAMESPACE_(CaseName) { \
17495 template <typename gtest_TypeParam_> \
17496 class TestName : public CaseName<gtest_TypeParam_> { \
17498 typedef CaseName<gtest_TypeParam_> TestFixture; \
17499 typedef gtest_TypeParam_ TypeParam; \
17500 virtual void TestBody(); \
17502 static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
17503 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
17504 __FILE__, __LINE__, #CaseName, #TestName); \
17506 template <typename gtest_TypeParam_> \
17507 void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
17509 # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
17510 namespace GTEST_CASE_NAMESPACE_(CaseName) { \
17511 typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
17513 static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
17514 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
17515 __FILE__, __LINE__, #__VA_ARGS__)
17517 // The 'Types' template argument below must have spaces around it
17518 // since some compilers may choke on '>>' when passing a template
17519 // instance (e.g. Types<int>)
17520 # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
17521 bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
17522 ::testing::internal::TypeParameterizedTestCase<CaseName, \
17523 GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
17524 ::testing::internal::TypeList< Types >::type>::Register(\
17525 #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
17527 #endif // GTEST_HAS_TYPED_TEST_P
17529 #endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17531 // Depending on the platform, different string classes are available.
17532 // On Linux, in addition to ::std::string, Google also makes use of
17533 // class ::string, which has the same interface as ::std::string, but
17534 // has a different implementation.
17536 // The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
17537 // ::string is available AND is a distinct type to ::std::string, or
17538 // define it to 0 to indicate otherwise.
17540 // If the user's ::std::string and ::string are the same class due to
17541 // aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
17543 // If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
17546 namespace testing {
17548 // Declares the flags.
17550 // This flag temporary enables the disabled tests.
17551 GTEST_DECLARE_bool_(also_run_disabled_tests);
17553 // This flag brings the debugger on an assertion failure.
17554 GTEST_DECLARE_bool_(break_on_failure);
17556 // This flag controls whether Google Test catches all test-thrown exceptions
17557 // and logs them as failures.
17558 GTEST_DECLARE_bool_(catch_exceptions);
17560 // This flag enables using colors in terminal output. Available values are
17561 // "yes" to enable colors, "no" (disable colors), or "auto" (the default)
17562 // to let Google Test decide.
17563 GTEST_DECLARE_string_(color);
17565 // This flag sets up the filter to select by name using a glob pattern
17566 // the tests to run. If the filter is not given all tests are executed.
17567 GTEST_DECLARE_string_(filter);
17569 // OpenCV extension: same as filter, but for the parameters string.
17570 GTEST_DECLARE_string_(param_filter);
17572 // This flag causes the Google Test to list tests. None of the tests listed
17573 // are actually run if the flag is provided.
17574 GTEST_DECLARE_bool_(list_tests);
17576 // This flag controls whether Google Test emits a detailed XML report to a file
17577 // in addition to its normal textual output.
17578 GTEST_DECLARE_string_(output);
17580 // This flags control whether Google Test prints the elapsed time for each
17582 GTEST_DECLARE_bool_(print_time);
17584 // This flag specifies the random number seed.
17585 GTEST_DECLARE_int32_(random_seed);
17587 // This flag sets how many times the tests are repeated. The default value
17588 // is 1. If the value is -1 the tests are repeating forever.
17589 GTEST_DECLARE_int32_(repeat);
17591 // This flag controls whether Google Test includes Google Test internal
17592 // stack frames in failure stack traces.
17593 GTEST_DECLARE_bool_(show_internal_stack_frames);
17595 // When this flag is specified, tests' order is randomized on every iteration.
17596 GTEST_DECLARE_bool_(shuffle);
17598 // This flag specifies the maximum number of stack frames to be
17599 // printed in a failure message.
17600 GTEST_DECLARE_int32_(stack_trace_depth);
17602 // When this flag is specified, a failed assertion will throw an
17603 // exception if exceptions are enabled, or exit the program with a
17604 // non-zero code otherwise.
17605 GTEST_DECLARE_bool_(throw_on_failure);
17607 // When this flag is set with a "host:port" string, on supported
17608 // platforms test results are streamed to the specified port on
17609 // the specified host machine.
17610 GTEST_DECLARE_string_(stream_result_to);
17612 // The upper limit for valid stack trace depths.
17613 const int kMaxStackTraceDepth = 100;
17615 namespace internal {
17617 class AssertHelper;
17618 class DefaultGlobalTestPartResultReporter;
17619 class ExecDeathTest;
17620 class NoExecDeathTest;
17621 class FinalSuccessChecker;
17622 class GTestFlagSaver;
17623 class StreamingListenerTest;
17624 class TestResultAccessor;
17625 class TestEventListenersAccessor;
17626 class TestEventRepeater;
17627 class UnitTestRecordPropertyTestHelper;
17628 class WindowsDeathTest;
17629 class UnitTestImpl* GetUnitTestImpl();
17630 void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
17631 const std::string& message);
17633 } // namespace internal
17635 // The friend relationship of some of these classes is cyclic.
17636 // If we don't forward declare them the compiler might confuse the classes
17637 // in friendship clauses with same named classes on the scope.
17643 // A class for indicating whether an assertion was successful. When
17644 // the assertion wasn't successful, the AssertionResult object
17645 // remembers a non-empty message that describes how it failed.
17647 // To create an instance of this class, use one of the factory functions
17648 // (AssertionSuccess() and AssertionFailure()).
17650 // This class is useful for two purposes:
17651 // 1. Defining predicate functions to be used with Boolean test assertions
17652 // EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
17653 // 2. Defining predicate-format functions to be
17654 // used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
17656 // For example, if you define IsEven predicate:
17658 // testing::AssertionResult IsEven(int n) {
17659 // if ((n % 2) == 0)
17660 // return testing::AssertionSuccess();
17662 // return testing::AssertionFailure() << n << " is odd";
17665 // Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
17666 // will print the message
17668 // Value of: IsEven(Fib(5))
17669 // Actual: false (5 is odd)
17672 // instead of a more opaque
17674 // Value of: IsEven(Fib(5))
17678 // in case IsEven is a simple Boolean predicate.
17680 // If you expect your predicate to be reused and want to support informative
17681 // messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
17682 // about half as often as positive ones in our tests), supply messages for
17683 // both success and failure cases:
17685 // testing::AssertionResult IsEven(int n) {
17686 // if ((n % 2) == 0)
17687 // return testing::AssertionSuccess() << n << " is even";
17689 // return testing::AssertionFailure() << n << " is odd";
17692 // Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
17694 // Value of: IsEven(Fib(6))
17695 // Actual: true (8 is even)
17698 // NB: Predicates that support negative Boolean assertions have reduced
17699 // performance in positive ones so be careful not to use them in tests
17700 // that have lots (tens of thousands) of positive Boolean assertions.
17702 // To use this class with EXPECT_PRED_FORMAT assertions such as:
17704 // // Verifies that Foo() returns an even number.
17705 // EXPECT_PRED_FORMAT1(IsEven, Foo());
17707 // you need to define:
17709 // testing::AssertionResult IsEven(const char* expr, int n) {
17710 // if ((n % 2) == 0)
17711 // return testing::AssertionSuccess();
17713 // return testing::AssertionFailure()
17714 // << "Expected: " << expr << " is even\n Actual: it's " << n;
17717 // If Foo() returns 5, you will see the following message:
17719 // Expected: Foo() is even
17722 class GTEST_API_ AssertionResult {
17724 // Copy constructor.
17725 // Used in EXPECT_TRUE/FALSE(assertion_result).
17726 AssertionResult(const AssertionResult& other);
17727 // Used in the EXPECT_TRUE/FALSE(bool_expression).
17728 explicit AssertionResult(bool success) : success_(success) {}
17730 // Returns true iff the assertion succeeded.
17731 operator bool() const { return success_; } // NOLINT
17733 // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
17734 AssertionResult operator!() const;
17736 // Returns the text streamed into this AssertionResult. Test assertions
17737 // use it when they fail (i.e., the predicate's outcome doesn't match the
17738 // assertion's expectation). When nothing has been streamed into the
17739 // object, returns an empty string.
17740 const char* message() const {
17741 return message_.get() != NULL ? message_->c_str() : "";
17743 // TODO(vladl@google.com): Remove this after making sure no clients use it.
17744 // Deprecated; please use message() instead.
17745 const char* failure_message() const { return message(); }
17747 // Streams a custom failure message into this object.
17748 template <typename T> AssertionResult& operator<<(const T& value) {
17749 AppendMessage(Message() << value);
17753 // Allows streaming basic output manipulators such as endl or flush into
17755 AssertionResult& operator<<(
17756 ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
17757 AppendMessage(Message() << basic_manipulator);
17762 // Appends the contents of message to message_.
17763 void AppendMessage(const Message& a_message) {
17764 if (message_.get() == NULL)
17765 message_.reset(new ::std::string);
17766 message_->append(a_message.GetString().c_str());
17769 // Stores result of the assertion predicate.
17771 // Stores the message describing the condition in case the expectation
17772 // construct is not satisfied with the predicate's outcome.
17773 // Referenced via a pointer to avoid taking too much stack frame space
17774 // with test assertions.
17775 internal::scoped_ptr< ::std::string> message_;
17777 GTEST_DISALLOW_ASSIGN_(AssertionResult);
17780 // Makes a successful assertion result.
17781 GTEST_API_ AssertionResult AssertionSuccess();
17783 // Makes a failed assertion result.
17784 GTEST_API_ AssertionResult AssertionFailure();
17786 // Makes a failed assertion result with the given failure message.
17787 // Deprecated; use AssertionFailure() << msg.
17788 GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
17790 // The abstract class that all tests inherit from.
17792 // In Google Test, a unit test program contains one or many TestCases, and
17793 // each TestCase contains one or many Tests.
17795 // When you define a test using the TEST macro, you don't need to
17796 // explicitly derive from Test - the TEST macro automatically does
17799 // The only time you derive from Test is when defining a test fixture
17800 // to be used a TEST_F. For example:
17802 // class FooTest : public testing::Test {
17804 // virtual void SetUp() { ... }
17805 // virtual void TearDown() { ... }
17809 // TEST_F(FooTest, Bar) { ... }
17810 // TEST_F(FooTest, Baz) { ... }
17812 // Test is not copyable.
17813 class GTEST_API_ Test {
17815 friend class TestInfo;
17817 // Defines types for pointers to functions that set up and tear down
17819 typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
17820 typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
17822 // The d'tor is virtual as we intend to inherit from Test.
17825 // Sets up the stuff shared by all tests in this test case.
17827 // Google Test will call Foo::SetUpTestCase() before running the first
17828 // test in test case Foo. Hence a sub-class can define its own
17829 // SetUpTestCase() method to shadow the one defined in the super
17831 static void SetUpTestCase() {}
17833 // Tears down the stuff shared by all tests in this test case.
17835 // Google Test will call Foo::TearDownTestCase() after running the last
17836 // test in test case Foo. Hence a sub-class can define its own
17837 // TearDownTestCase() method to shadow the one defined in the super
17839 static void TearDownTestCase() {}
17841 // Returns true iff the current test has a fatal failure.
17842 static bool HasFatalFailure();
17844 // Returns true iff the current test has a non-fatal failure.
17845 static bool HasNonfatalFailure();
17847 // Returns true iff the current test has a (either fatal or
17848 // non-fatal) failure.
17849 static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
17851 // Logs a property for the current test, test case, or for the entire
17852 // invocation of the test program when used outside of the context of a
17853 // test case. Only the last value for a given key is remembered. These
17854 // are public static so they can be called from utility functions that are
17855 // not members of the test fixture. Calls to RecordProperty made during
17856 // lifespan of the test (from the moment its constructor starts to the
17857 // moment its destructor finishes) will be output in XML as attributes of
17858 // the <testcase> element. Properties recorded from fixture's
17859 // SetUpTestCase or TearDownTestCase are logged as attributes of the
17860 // corresponding <testsuite> element. Calls to RecordProperty made in the
17861 // global context (before or after invocation of RUN_ALL_TESTS and from
17862 // SetUp/TearDown method of Environment objects registered with Google
17863 // Test) will be output as attributes of the <testsuites> element.
17864 static void RecordProperty(const std::string& key, const std::string& value);
17865 static void RecordProperty(const std::string& key, int value);
17868 // Creates a Test object.
17871 // Sets up the test fixture.
17872 virtual void SetUp();
17874 // Tears down the test fixture.
17875 virtual void TearDown();
17878 // Returns true iff the current test has the same fixture class as
17879 // the first test in the current test case.
17880 static bool HasSameFixtureClass();
17882 // Runs the test after the test fixture has been set up.
17884 // A sub-class must implement this to define the test logic.
17886 // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
17887 // Instead, use the TEST or TEST_F macro.
17888 virtual void TestBody() = 0;
17890 // Sets up, executes, and tears down the test.
17893 // Deletes self. We deliberately pick an unusual name for this
17894 // internal method to avoid clashing with names used in user TESTs.
17895 void DeleteSelf_() { delete this; }
17897 // Uses a GTestFlagSaver to save and restore all Google Test flags.
17898 const internal::GTestFlagSaver* const gtest_flag_saver_;
17900 // Often a user mis-spells SetUp() as Setup() and spends a long time
17901 // wondering why it is never called by Google Test. The declaration of
17902 // the following method is solely for catching such an error at
17905 // - The return type is deliberately chosen to be not void, so it
17906 // will be a conflict if a user declares void Setup() in his test
17909 // - This method is private, so it will be another compiler error
17910 // if a user calls it from his test fixture.
17912 // DO NOT OVERRIDE THIS FUNCTION.
17914 // If you see an error about overriding the following function or
17915 // about it being private, you have mis-spelled SetUp() as Setup().
17916 struct Setup_should_be_spelled_SetUp {};
17917 virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
17919 // We disallow copying Tests.
17920 GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
17923 typedef internal::TimeInMillis TimeInMillis;
17925 // A copyable object representing a user specified test property which can be
17926 // output as a key/value string pair.
17928 // Don't inherit from TestProperty as its destructor is not virtual.
17929 class TestProperty {
17931 // C'tor. TestProperty does NOT have a default constructor.
17932 // Always use this constructor (with parameters) to create a
17933 // TestProperty object.
17934 TestProperty(const std::string& a_key, const std::string& a_value) :
17935 key_(a_key), value_(a_value) {
17938 // Gets the user supplied key.
17939 const char* key() const {
17940 return key_.c_str();
17943 // Gets the user supplied value.
17944 const char* value() const {
17945 return value_.c_str();
17948 // Sets a new value, overriding the one supplied in the constructor.
17949 void SetValue(const std::string& new_value) {
17950 value_ = new_value;
17954 // The key supplied by the user.
17956 // The value supplied by the user.
17957 std::string value_;
17960 // The result of a single Test. This includes a list of
17961 // TestPartResults, a list of TestProperties, a count of how many
17962 // death tests there are in the Test, and how much time it took to run
17965 // TestResult is not copyable.
17966 class GTEST_API_ TestResult {
17968 // Creates an empty TestResult.
17971 // D'tor. Do not inherit from TestResult.
17974 // Gets the number of all test parts. This is the sum of the number
17975 // of successful test parts and the number of failed test parts.
17976 int total_part_count() const;
17978 // Returns the number of the test properties.
17979 int test_property_count() const;
17981 // Returns true iff the test passed (i.e. no test part failed).
17982 bool Passed() const { return !Failed(); }
17984 // Returns true iff the test failed.
17985 bool Failed() const;
17987 // Returns true iff the test fatally failed.
17988 bool HasFatalFailure() const;
17990 // Returns true iff the test has a non-fatal failure.
17991 bool HasNonfatalFailure() const;
17993 // Returns the elapsed time, in milliseconds.
17994 TimeInMillis elapsed_time() const { return elapsed_time_; }
17996 // Returns the i-th test part result among all the results. i can range
17997 // from 0 to test_property_count() - 1. If i is not in that range, aborts
17999 const TestPartResult& GetTestPartResult(int i) const;
18001 // Returns the i-th test property. i can range from 0 to
18002 // test_property_count() - 1. If i is not in that range, aborts the
18004 const TestProperty& GetTestProperty(int i) const;
18007 friend class TestInfo;
18008 friend class TestCase;
18009 friend class UnitTest;
18010 friend class internal::DefaultGlobalTestPartResultReporter;
18011 friend class internal::ExecDeathTest;
18012 friend class internal::TestResultAccessor;
18013 friend class internal::UnitTestImpl;
18014 friend class internal::WindowsDeathTest;
18016 // Gets the vector of TestPartResults.
18017 const std::vector<TestPartResult>& test_part_results() const {
18018 return test_part_results_;
18021 // Gets the vector of TestProperties.
18022 const std::vector<TestProperty>& test_properties() const {
18023 return test_properties_;
18026 // Sets the elapsed time.
18027 void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
18029 // Adds a test property to the list. The property is validated and may add
18030 // a non-fatal failure if invalid (e.g., if it conflicts with reserved
18031 // key names). If a property is already recorded for the same key, the
18032 // value will be updated, rather than storing multiple values for the same
18033 // key. xml_element specifies the element for which the property is being
18034 // recorded and is used for validation.
18035 void RecordProperty(const std::string& xml_element,
18036 const TestProperty& test_property);
18038 // Adds a failure if the key is a reserved attribute of Google Test
18039 // testcase tags. Returns true if the property is valid.
18040 // TODO(russr): Validate attribute names are legal and human readable.
18041 static bool ValidateTestProperty(const std::string& xml_element,
18042 const TestProperty& test_property);
18044 // Adds a test part result to the list.
18045 void AddTestPartResult(const TestPartResult& test_part_result);
18047 // Returns the death test count.
18048 int death_test_count() const { return death_test_count_; }
18050 // Increments the death test count, returning the new count.
18051 int increment_death_test_count() { return ++death_test_count_; }
18053 // Clears the test part results.
18054 void ClearTestPartResults();
18056 // Clears the object.
18059 // Protects mutable state of the property vector and of owned
18060 // properties, whose values may be updated.
18061 internal::Mutex test_properites_mutex_;
18063 // The vector of TestPartResults
18064 std::vector<TestPartResult> test_part_results_;
18065 // The vector of TestProperties
18066 std::vector<TestProperty> test_properties_;
18067 // Running count of death tests.
18068 int death_test_count_;
18069 // The elapsed time, in milliseconds.
18070 TimeInMillis elapsed_time_;
18072 // We disallow copying TestResult.
18073 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
18074 }; // class TestResult
18076 // A TestInfo object stores the following information about a test:
18080 // Whether the test should be run
18081 // A function pointer that creates the test object when invoked
18084 // The constructor of TestInfo registers itself with the UnitTest
18085 // singleton such that the RUN_ALL_TESTS() macro knows which tests to
18087 class GTEST_API_ TestInfo {
18089 // Destructs a TestInfo object. This function is not virtual, so
18090 // don't inherit from TestInfo.
18093 // Returns the test case name.
18094 const char* test_case_name() const { return test_case_name_.c_str(); }
18096 // Returns the test name.
18097 const char* name() const { return name_.c_str(); }
18099 // Returns the name of the parameter type, or NULL if this is not a typed
18100 // or a type-parameterized test.
18101 const char* type_param() const {
18102 if (type_param_.get() != NULL)
18103 return type_param_->c_str();
18107 // Returns the text representation of the value parameter, or NULL if this
18108 // is not a value-parameterized test.
18109 const char* value_param() const {
18110 if (value_param_.get() != NULL)
18111 return value_param_->c_str();
18115 // Returns true if this test should run, that is if the test is not disabled
18116 // (or it is disabled but the also_run_disabled_tests flag has been specified)
18117 // and its full name matches the user-specified filter.
18119 // Google Test allows the user to filter the tests by their full names.
18120 // The full name of a test Bar in test case Foo is defined as
18121 // "Foo.Bar". Only the tests that match the filter will run.
18123 // A filter is a colon-separated list of glob (not regex) patterns,
18124 // optionally followed by a '-' and a colon-separated list of
18125 // negative patterns (tests to exclude). A test is run if it
18126 // matches one of the positive patterns and does not match any of
18127 // the negative patterns.
18129 // For example, *A*:Foo.* is a filter that matches any string that
18130 // contains the character 'A' or starts with "Foo.".
18131 bool should_run() const { return should_run_; }
18133 // Returns the result of the test.
18134 const TestResult* result() const { return &result_; }
18137 #if GTEST_HAS_DEATH_TEST
18138 friend class internal::DefaultDeathTestFactory;
18139 #endif // GTEST_HAS_DEATH_TEST
18141 friend class TestCase;
18142 friend class internal::UnitTestImpl;
18143 friend class internal::StreamingListenerTest;
18144 friend TestInfo* internal::MakeAndRegisterTestInfo(
18145 const char* test_case_name,
18147 const char* type_param,
18148 const char* value_param,
18149 internal::TypeId fixture_class_id,
18150 Test::SetUpTestCaseFunc set_up_tc,
18151 Test::TearDownTestCaseFunc tear_down_tc,
18152 internal::TestFactoryBase* factory);
18154 // Constructs a TestInfo object. The newly constructed instance assumes
18155 // ownership of the factory object.
18156 TestInfo(const std::string& test_case_name,
18157 const std::string& name,
18158 const char* a_type_param, // NULL if not a type-parameterized test
18159 const char* a_value_param, // NULL if not a value-parameterized test
18160 internal::TypeId fixture_class_id,
18161 internal::TestFactoryBase* factory);
18163 // Increments the number of death tests encountered in this test so
18165 int increment_death_test_count() {
18166 return result_.increment_death_test_count();
18169 // Creates the test object, runs it, records its result, and then
18173 static void ClearTestResult(TestInfo* test_info) {
18174 test_info->result_.Clear();
18177 // These fields are immutable properties of the test.
18178 const std::string test_case_name_; // Test case name
18179 const std::string name_; // Test name
18180 // Name of the parameter type, or NULL if this is not a typed or a
18181 // type-parameterized test.
18182 const internal::scoped_ptr<const ::std::string> type_param_;
18183 // Text representation of the value parameter, or NULL if this is not a
18184 // value-parameterized test.
18185 const internal::scoped_ptr<const ::std::string> value_param_;
18186 const internal::TypeId fixture_class_id_; // ID of the test fixture class
18187 bool should_run_; // True iff this test should run
18188 bool is_disabled_; // True iff this test is disabled
18189 bool matches_filter_; // True if this test matches the
18190 // user-specified filter.
18191 internal::TestFactoryBase* const factory_; // The factory that creates
18194 // This field is mutable and needs to be reset before running the
18195 // test for the second time.
18196 TestResult result_;
18198 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
18201 // A test case, which consists of a vector of TestInfos.
18203 // TestCase is not copyable.
18204 class GTEST_API_ TestCase {
18206 // Creates a TestCase with the given name.
18208 // TestCase does NOT have a default constructor. Always use this
18209 // constructor to create a TestCase object.
18213 // name: name of the test case
18214 // a_type_param: the name of the test's type parameter, or NULL if
18215 // this is not a type-parameterized test.
18216 // set_up_tc: pointer to the function that sets up the test case
18217 // tear_down_tc: pointer to the function that tears down the test case
18218 TestCase(const char* name, const char* a_type_param,
18219 Test::SetUpTestCaseFunc set_up_tc,
18220 Test::TearDownTestCaseFunc tear_down_tc);
18222 // Destructor of TestCase.
18223 virtual ~TestCase();
18225 // Gets the name of the TestCase.
18226 const char* name() const { return name_.c_str(); }
18228 // Returns the name of the parameter type, or NULL if this is not a
18229 // type-parameterized test case.
18230 const char* type_param() const {
18231 if (type_param_.get() != NULL)
18232 return type_param_->c_str();
18236 // Returns true if any test in this test case should run.
18237 bool should_run() const { return should_run_; }
18239 // Gets the number of successful tests in this test case.
18240 int successful_test_count() const;
18242 // Gets the number of failed tests in this test case.
18243 int failed_test_count() const;
18245 // Gets the number of disabled tests in this test case.
18246 int disabled_test_count() const;
18248 // Get the number of tests in this test case that should run.
18249 int test_to_run_count() const;
18251 // Gets the number of all tests in this test case.
18252 int total_test_count() const;
18254 // Returns true iff the test case passed.
18255 bool Passed() const { return !Failed(); }
18257 // Returns true iff the test case failed.
18258 bool Failed() const { return failed_test_count() > 0; }
18260 // Returns the elapsed time, in milliseconds.
18261 TimeInMillis elapsed_time() const { return elapsed_time_; }
18263 // Returns the i-th test among all the tests. i can range from 0 to
18264 // total_test_count() - 1. If i is not in that range, returns NULL.
18265 const TestInfo* GetTestInfo(int i) const;
18267 // Returns the TestResult that holds test properties recorded during
18268 // execution of SetUpTestCase and TearDownTestCase.
18269 const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
18273 friend class internal::UnitTestImpl;
18275 // Gets the (mutable) vector of TestInfos in this TestCase.
18276 std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
18278 // Gets the (immutable) vector of TestInfos in this TestCase.
18279 const std::vector<TestInfo*>& test_info_list() const {
18280 return test_info_list_;
18283 // Returns the i-th test among all the tests. i can range from 0 to
18284 // total_test_count() - 1. If i is not in that range, returns NULL.
18285 TestInfo* GetMutableTestInfo(int i);
18287 // Sets the should_run member.
18288 void set_should_run(bool should) { should_run_ = should; }
18290 // Adds a TestInfo to this test case. Will delete the TestInfo upon
18291 // destruction of the TestCase object.
18292 void AddTestInfo(TestInfo * test_info);
18294 // Clears the results of all tests in this test case.
18295 void ClearResult();
18297 // Clears the results of all tests in the given test case.
18298 static void ClearTestCaseResult(TestCase* test_case) {
18299 test_case->ClearResult();
18302 // Runs every test in this TestCase.
18305 // Runs SetUpTestCase() for this TestCase. This wrapper is needed
18306 // for catching exceptions thrown from SetUpTestCase().
18307 void RunSetUpTestCase() { (*set_up_tc_)(); }
18309 // Runs TearDownTestCase() for this TestCase. This wrapper is
18310 // needed for catching exceptions thrown from TearDownTestCase().
18311 void RunTearDownTestCase() { (*tear_down_tc_)(); }
18313 // Returns true iff test passed.
18314 static bool TestPassed(const TestInfo* test_info) {
18315 return test_info->should_run() && test_info->result()->Passed();
18318 // Returns true iff test failed.
18319 static bool TestFailed(const TestInfo* test_info) {
18320 return test_info->should_run() && test_info->result()->Failed();
18323 // Returns true iff test is disabled.
18324 static bool TestDisabled(const TestInfo* test_info) {
18325 return test_info->is_disabled_;
18328 // Returns true if the given test should run.
18329 static bool ShouldRunTest(const TestInfo* test_info) {
18330 return test_info->should_run();
18333 // Shuffles the tests in this test case.
18334 void ShuffleTests(internal::Random* random);
18336 // Restores the test order to before the first shuffle.
18337 void UnshuffleTests();
18339 // Name of the test case.
18341 // Name of the parameter type, or NULL if this is not a typed or a
18342 // type-parameterized test.
18343 const internal::scoped_ptr<const ::std::string> type_param_;
18344 // The vector of TestInfos in their original order. It owns the
18345 // elements in the vector.
18346 std::vector<TestInfo*> test_info_list_;
18347 // Provides a level of indirection for the test list to allow easy
18348 // shuffling and restoring the test order. The i-th element in this
18349 // vector is the index of the i-th test in the shuffled test list.
18350 std::vector<int> test_indices_;
18351 // Pointer to the function that sets up the test case.
18352 Test::SetUpTestCaseFunc set_up_tc_;
18353 // Pointer to the function that tears down the test case.
18354 Test::TearDownTestCaseFunc tear_down_tc_;
18355 // True iff any test in this test case should run.
18357 // Elapsed time, in milliseconds.
18358 TimeInMillis elapsed_time_;
18359 // Holds test properties recorded during execution of SetUpTestCase and
18360 // TearDownTestCase.
18361 TestResult ad_hoc_test_result_;
18363 // We disallow copying TestCases.
18364 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
18367 // An Environment object is capable of setting up and tearing down an
18368 // environment. The user should subclass this to define his own
18371 // An Environment object does the set-up and tear-down in virtual
18372 // methods SetUp() and TearDown() instead of the constructor and the
18375 // 1. You cannot safely throw from a destructor. This is a problem
18376 // as in some cases Google Test is used where exceptions are enabled, and
18377 // we may want to implement ASSERT_* using exceptions where they are
18379 // 2. You cannot use ASSERT_* directly in a constructor or
18381 class Environment {
18383 // The d'tor is virtual as we need to subclass Environment.
18384 virtual ~Environment() {}
18386 // Override this to define how to set up the environment.
18387 virtual void SetUp() {}
18389 // Override this to define how to tear down the environment.
18390 virtual void TearDown() {}
18392 // If you see an error about overriding the following function or
18393 // about it being private, you have mis-spelled SetUp() as Setup().
18394 struct Setup_should_be_spelled_SetUp {};
18395 virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
18398 // The interface for tracing execution of tests. The methods are organized in
18399 // the order the corresponding events are fired.
18400 class TestEventListener {
18402 virtual ~TestEventListener() {}
18404 // Fired before any test activity starts.
18405 virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
18407 // Fired before each iteration of tests starts. There may be more than
18408 // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
18409 // index, starting from 0.
18410 virtual void OnTestIterationStart(const UnitTest& unit_test,
18411 int iteration) = 0;
18413 // Fired before environment set-up for each iteration of tests starts.
18414 virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
18416 // Fired after environment set-up for each iteration of tests ends.
18417 virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
18419 // Fired before the test case starts.
18420 virtual void OnTestCaseStart(const TestCase& test_case) = 0;
18422 // Fired before the test starts.
18423 virtual void OnTestStart(const TestInfo& test_info) = 0;
18425 // Fired after a failed assertion or a SUCCEED() invocation.
18426 virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
18428 // Fired after the test ends.
18429 virtual void OnTestEnd(const TestInfo& test_info) = 0;
18431 // Fired after the test case ends.
18432 virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
18434 // Fired before environment tear-down for each iteration of tests starts.
18435 virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
18437 // Fired after environment tear-down for each iteration of tests ends.
18438 virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
18440 // Fired after each iteration of tests finishes.
18441 virtual void OnTestIterationEnd(const UnitTest& unit_test,
18442 int iteration) = 0;
18444 // Fired after all test activities have ended.
18445 virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
18448 // The convenience class for users who need to override just one or two
18449 // methods and are not concerned that a possible change to a signature of
18450 // the methods they override will not be caught during the build. For
18451 // comments about each method please see the definition of TestEventListener
18453 class EmptyTestEventListener : public TestEventListener {
18455 virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
18456 virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
18457 int /*iteration*/) {}
18458 virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
18459 virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
18460 virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
18461 virtual void OnTestStart(const TestInfo& /*test_info*/) {}
18462 virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
18463 virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
18464 virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
18465 virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
18466 virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
18467 virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
18468 int /*iteration*/) {}
18469 virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
18472 // TestEventListeners lets users add listeners to track events in Google Test.
18473 class GTEST_API_ TestEventListeners {
18475 TestEventListeners();
18476 ~TestEventListeners();
18478 // Appends an event listener to the end of the list. Google Test assumes
18479 // the ownership of the listener (i.e. it will delete the listener when
18480 // the test program finishes).
18481 void Append(TestEventListener* listener);
18483 // Removes the given event listener from the list and returns it. It then
18484 // becomes the caller's responsibility to delete the listener. Returns
18485 // NULL if the listener is not found in the list.
18486 TestEventListener* Release(TestEventListener* listener);
18488 // Returns the standard listener responsible for the default console
18489 // output. Can be removed from the listeners list to shut down default
18490 // console output. Note that removing this object from the listener list
18491 // with Release transfers its ownership to the caller and makes this
18492 // function return NULL the next time.
18493 TestEventListener* default_result_printer() const {
18494 return default_result_printer_;
18497 // Returns the standard listener responsible for the default XML output
18498 // controlled by the --gtest_output=xml flag. Can be removed from the
18499 // listeners list by users who want to shut down the default XML output
18500 // controlled by this flag and substitute it with custom one. Note that
18501 // removing this object from the listener list with Release transfers its
18502 // ownership to the caller and makes this function return NULL the next
18504 TestEventListener* default_xml_generator() const {
18505 return default_xml_generator_;
18509 friend class TestCase;
18510 friend class TestInfo;
18511 friend class internal::DefaultGlobalTestPartResultReporter;
18512 friend class internal::NoExecDeathTest;
18513 friend class internal::TestEventListenersAccessor;
18514 friend class internal::UnitTestImpl;
18516 // Returns repeater that broadcasts the TestEventListener events to all
18518 TestEventListener* repeater();
18520 // Sets the default_result_printer attribute to the provided listener.
18521 // The listener is also added to the listener list and previous
18522 // default_result_printer is removed from it and deleted. The listener can
18523 // also be NULL in which case it will not be added to the list. Does
18524 // nothing if the previous and the current listener objects are the same.
18525 void SetDefaultResultPrinter(TestEventListener* listener);
18527 // Sets the default_xml_generator attribute to the provided listener. The
18528 // listener is also added to the listener list and previous
18529 // default_xml_generator is removed from it and deleted. The listener can
18530 // also be NULL in which case it will not be added to the list. Does
18531 // nothing if the previous and the current listener objects are the same.
18532 void SetDefaultXmlGenerator(TestEventListener* listener);
18534 // Controls whether events will be forwarded by the repeater to the
18535 // listeners in the list.
18536 bool EventForwardingEnabled() const;
18537 void SuppressEventForwarding();
18539 // The actual list of listeners.
18540 internal::TestEventRepeater* repeater_;
18541 // Listener responsible for the standard result output.
18542 TestEventListener* default_result_printer_;
18543 // Listener responsible for the creation of the XML output file.
18544 TestEventListener* default_xml_generator_;
18546 // We disallow copying TestEventListeners.
18547 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
18550 // A UnitTest consists of a vector of TestCases.
18552 // This is a singleton class. The only instance of UnitTest is
18553 // created when UnitTest::GetInstance() is first called. This
18554 // instance is never deleted.
18556 // UnitTest is not copyable.
18558 // This class is thread-safe as long as the methods are called
18559 // according to their specification.
18560 class GTEST_API_ UnitTest {
18562 // Gets the singleton UnitTest object. The first time this method
18563 // is called, a UnitTest object is constructed and returned.
18564 // Consecutive calls will return the same object.
18565 static UnitTest* GetInstance();
18567 // Runs all tests in this UnitTest object and prints the result.
18568 // Returns 0 if successful, or 1 otherwise.
18570 // This method can only be called from the main thread.
18572 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18573 int Run() GTEST_MUST_USE_RESULT_;
18575 // Returns the working directory when the first TEST() or TEST_F()
18576 // was executed. The UnitTest object owns the string.
18577 const char* original_working_dir() const;
18579 // Returns the TestCase object for the test that's currently running,
18580 // or NULL if no test is running.
18581 const TestCase* current_test_case() const
18582 GTEST_LOCK_EXCLUDED_(mutex_);
18584 // Returns the TestInfo object for the test that's currently running,
18585 // or NULL if no test is running.
18586 const TestInfo* current_test_info() const
18587 GTEST_LOCK_EXCLUDED_(mutex_);
18589 // Returns the random seed used at the start of the current test run.
18590 int random_seed() const;
18592 #if GTEST_HAS_PARAM_TEST
18593 // Returns the ParameterizedTestCaseRegistry object used to keep track of
18594 // value-parameterized tests and instantiate and register them.
18596 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18597 internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
18598 GTEST_LOCK_EXCLUDED_(mutex_);
18599 #endif // GTEST_HAS_PARAM_TEST
18601 // Gets the number of successful test cases.
18602 int successful_test_case_count() const;
18604 // Gets the number of failed test cases.
18605 int failed_test_case_count() const;
18607 // Gets the number of all test cases.
18608 int total_test_case_count() const;
18610 // Gets the number of all test cases that contain at least one test
18611 // that should run.
18612 int test_case_to_run_count() const;
18614 // Gets the number of successful tests.
18615 int successful_test_count() const;
18617 // Gets the number of failed tests.
18618 int failed_test_count() const;
18620 // Gets the number of disabled tests.
18621 int disabled_test_count() const;
18623 // Gets the number of all tests.
18624 int total_test_count() const;
18626 // Gets the number of tests that should run.
18627 int test_to_run_count() const;
18629 // Gets the time of the test program start, in ms from the start of the
18631 TimeInMillis start_timestamp() const;
18633 // Gets the elapsed time, in milliseconds.
18634 TimeInMillis elapsed_time() const;
18636 // Returns true iff the unit test passed (i.e. all test cases passed).
18637 bool Passed() const;
18639 // Returns true iff the unit test failed (i.e. some test case failed
18640 // or something outside of all tests failed).
18641 bool Failed() const;
18643 // Gets the i-th test case among all the test cases. i can range from 0 to
18644 // total_test_case_count() - 1. If i is not in that range, returns NULL.
18645 const TestCase* GetTestCase(int i) const;
18647 // Returns the TestResult containing information on test failures and
18648 // properties logged outside of individual test cases.
18649 const TestResult& ad_hoc_test_result() const;
18651 // Returns the list of event listeners that can be used to track events
18652 // inside Google Test.
18653 TestEventListeners& listeners();
18656 // Registers and returns a global test environment. When a test
18657 // program is run, all global test environments will be set-up in
18658 // the order they were registered. After all tests in the program
18659 // have finished, all global test environments will be torn-down in
18660 // the *reverse* order they were registered.
18662 // The UnitTest object takes ownership of the given environment.
18664 // This method can only be called from the main thread.
18665 Environment* AddEnvironment(Environment* env);
18667 // Adds a TestPartResult to the current TestResult object. All
18668 // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
18669 // eventually call this to report their results. The user code
18670 // should use the assertion macros instead of calling this directly.
18671 void AddTestPartResult(TestPartResult::Type result_type,
18672 const char* file_name,
18674 const std::string& message,
18675 const std::string& os_stack_trace)
18676 GTEST_LOCK_EXCLUDED_(mutex_);
18678 // Adds a TestProperty to the current TestResult object when invoked from
18679 // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
18680 // from SetUpTestCase or TearDownTestCase, or to the global property set
18681 // when invoked elsewhere. If the result already contains a property with
18682 // the same key, the value will be updated.
18683 void RecordProperty(const std::string& key, const std::string& value);
18685 // Gets the i-th test case among all the test cases. i can range from 0 to
18686 // total_test_case_count() - 1. If i is not in that range, returns NULL.
18687 TestCase* GetMutableTestCase(int i);
18689 // Accessors for the implementation object.
18690 internal::UnitTestImpl* impl() { return impl_; }
18691 const internal::UnitTestImpl* impl() const { return impl_; }
18693 // These classes and funcions are friends as they need to access private
18694 // members of UnitTest.
18696 friend class internal::AssertHelper;
18697 friend class internal::ScopedTrace;
18698 friend class internal::StreamingListenerTest;
18699 friend class internal::UnitTestRecordPropertyTestHelper;
18700 friend Environment* AddGlobalTestEnvironment(Environment* env);
18701 friend internal::UnitTestImpl* internal::GetUnitTestImpl();
18702 friend void internal::ReportFailureInUnknownLocation(
18703 TestPartResult::Type result_type,
18704 const std::string& message);
18706 // Creates an empty UnitTest.
18710 virtual ~UnitTest();
18712 // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
18713 // Google Test trace stack.
18714 void PushGTestTrace(const internal::TraceInfo& trace)
18715 GTEST_LOCK_EXCLUDED_(mutex_);
18717 // Pops a trace from the per-thread Google Test trace stack.
18718 void PopGTestTrace()
18719 GTEST_LOCK_EXCLUDED_(mutex_);
18721 // Protects mutable state in *impl_. This is mutable as some const
18722 // methods need to lock it too.
18723 mutable internal::Mutex mutex_;
18725 // Opaque implementation object. This field is never changed once
18726 // the object is constructed. We don't mark it as const here, as
18727 // doing so will cause a warning in the constructor of UnitTest.
18728 // Mutable state in *impl_ is protected by mutex_.
18729 internal::UnitTestImpl* impl_;
18731 // We disallow copying UnitTest.
18732 GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
18735 // A convenient wrapper for adding an environment for the test
18738 // You should call this before RUN_ALL_TESTS() is called, probably in
18739 // main(). If you use gtest_main, you need to call this before main()
18740 // starts for it to take effect. For example, you can define a global
18741 // variable like this:
18743 // testing::Environment* const foo_env =
18744 // testing::AddGlobalTestEnvironment(new FooEnvironment);
18746 // However, we strongly recommend you to write your own main() and
18747 // call AddGlobalTestEnvironment() there, as relying on initialization
18748 // of global variables makes the code harder to read and may cause
18749 // problems when you register multiple environments from different
18750 // translation units and the environments have dependencies among them
18751 // (remember that the compiler doesn't guarantee the order in which
18752 // global variables from different translation units are initialized).
18753 inline Environment* AddGlobalTestEnvironment(Environment* env) {
18754 return UnitTest::GetInstance()->AddEnvironment(env);
18757 // Initializes Google Test. This must be called before calling
18758 // RUN_ALL_TESTS(). In particular, it parses a command line for the
18759 // flags that Google Test recognizes. Whenever a Google Test flag is
18760 // seen, it is removed from argv, and *argc is decremented.
18762 // No value is returned. Instead, the Google Test flag variables are
18765 // Calling the function for the second time has no user-visible effect.
18766 GTEST_API_ void InitGoogleTest(int* argc, char** argv);
18768 // This overloaded version can be used in Windows programs compiled in
18770 GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
18772 namespace internal {
18774 // FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
18775 // value of type ToPrint that is an operand of a comparison assertion
18776 // (e.g. ASSERT_EQ). OtherOperand is the type of the other operand in
18777 // the comparison, and is used to help determine the best way to
18778 // format the value. In particular, when the value is a C string
18779 // (char pointer) and the other operand is an STL string object, we
18780 // want to format the C string as a string, since we know it is
18781 // compared by value with the string object. If the value is a char
18782 // pointer but the other operand is not an STL string object, we don't
18783 // know whether the pointer is supposed to point to a NUL-terminated
18784 // string, and thus want to print it as a pointer to be safe.
18786 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18788 // The default case.
18789 template <typename ToPrint, typename OtherOperand>
18790 class FormatForComparison {
18792 static ::std::string Format(const ToPrint& value) {
18793 return ::testing::PrintToString(value);
18798 template <typename ToPrint, size_t N, typename OtherOperand>
18799 class FormatForComparison<ToPrint[N], OtherOperand> {
18801 static ::std::string Format(const ToPrint* value) {
18802 return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
18806 // By default, print C string as pointers to be safe, as we don't know
18807 // whether they actually point to a NUL-terminated string.
18809 #define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \
18810 template <typename OtherOperand> \
18811 class FormatForComparison<CharType*, OtherOperand> { \
18813 static ::std::string Format(CharType* value) { \
18814 return ::testing::PrintToString(static_cast<const void*>(value)); \
18818 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
18819 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
18820 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
18821 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
18823 #undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
18825 // If a C string is compared with an STL string object, we know it's meant
18826 // to point to a NUL-terminated string, and thus can print it as a string.
18828 #define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
18830 class FormatForComparison<CharType*, OtherStringType> { \
18832 static ::std::string Format(CharType* value) { \
18833 return ::testing::PrintToString(value); \
18837 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
18838 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
18840 #if GTEST_HAS_GLOBAL_STRING
18841 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
18842 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
18845 #if GTEST_HAS_GLOBAL_WSTRING
18846 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
18847 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
18850 #if GTEST_HAS_STD_WSTRING
18851 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
18852 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
18855 #undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
18857 // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
18858 // operand to be used in a failure message. The type (but not value)
18859 // of the other operand may affect the format. This allows us to
18860 // print a char* as a raw pointer when it is compared against another
18861 // char* or void*, and print it as a C string when it is compared
18862 // against an std::string object, for example.
18864 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18865 template <typename T1, typename T2>
18866 std::string FormatForComparisonFailureMessage(
18867 const T1& value, const T2& /* other_operand */) {
18868 return FormatForComparison<T1, T2>::Format(value);
18871 // The helper function for {ASSERT|EXPECT}_EQ.
18872 template <typename T1, typename T2>
18873 AssertionResult CmpHelperEQ(const char* expected_expression,
18874 const char* actual_expression,
18875 const T1& expected,
18876 const T2& actual) {
18878 # pragma warning(push) // Saves the current warning state.
18879 # pragma warning(disable:4389) // Temporarily disables warning on
18880 // signed/unsigned mismatch.
18883 if (expected == actual) {
18884 return AssertionSuccess();
18888 # pragma warning(pop) // Restores the warning state.
18891 return EqFailure(expected_expression,
18893 FormatForComparisonFailureMessage(expected, actual),
18894 FormatForComparisonFailureMessage(actual, expected),
18898 // With this overloaded version, we allow anonymous enums to be used
18899 // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
18900 // can be implicitly cast to BiggestInt.
18901 GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
18902 const char* actual_expression,
18903 BiggestInt expected,
18904 BiggestInt actual);
18906 // The helper class for {ASSERT|EXPECT}_EQ. The template argument
18907 // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
18908 // is a null pointer literal. The following default implementation is
18909 // for lhs_is_null_literal being false.
18910 template <bool lhs_is_null_literal>
18913 // This templatized version is for the general case.
18914 template <typename T1, typename T2>
18915 static AssertionResult Compare(const char* expected_expression,
18916 const char* actual_expression,
18917 const T1& expected,
18918 const T2& actual) {
18919 return CmpHelperEQ(expected_expression, actual_expression, expected,
18923 // With this overloaded version, we allow anonymous enums to be used
18924 // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
18925 // enums can be implicitly cast to BiggestInt.
18927 // Even though its body looks the same as the above version, we
18928 // cannot merge the two, as it will make anonymous enums unhappy.
18929 static AssertionResult Compare(const char* expected_expression,
18930 const char* actual_expression,
18931 BiggestInt expected,
18932 BiggestInt actual) {
18933 return CmpHelperEQ(expected_expression, actual_expression, expected,
18938 // This specialization is used when the first argument to ASSERT_EQ()
18939 // is a null pointer literal, like NULL, false, or 0.
18941 class EqHelper<true> {
18943 // We define two overloaded versions of Compare(). The first
18944 // version will be picked when the second argument to ASSERT_EQ() is
18945 // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
18946 // EXPECT_EQ(false, a_bool).
18947 template <typename T1, typename T2>
18948 static AssertionResult Compare(
18949 const char* expected_expression,
18950 const char* actual_expression,
18951 const T1& expected,
18953 // The following line prevents this overload from being considered if T2
18954 // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr)
18955 // expands to Compare("", "", NULL, my_ptr), which requires a conversion
18956 // to match the Secret* in the other overload, which would otherwise make
18957 // this template match better.
18958 typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
18959 return CmpHelperEQ(expected_expression, actual_expression, expected,
18963 // This version will be picked when the second argument to ASSERT_EQ() is a
18964 // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
18965 template <typename T>
18966 static AssertionResult Compare(
18967 const char* expected_expression,
18968 const char* actual_expression,
18969 // We used to have a second template parameter instead of Secret*. That
18970 // template parameter would deduce to 'long', making this a better match
18971 // than the first overload even without the first overload's EnableIf.
18972 // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
18973 // non-pointer argument" (even a deduced integral argument), so the old
18974 // implementation caused warnings in user code.
18975 Secret* /* expected (NULL) */,
18977 // We already know that 'expected' is a null pointer.
18978 return CmpHelperEQ(expected_expression, actual_expression,
18979 static_cast<T*>(NULL), actual);
18983 // A macro for implementing the helper functions needed to implement
18984 // ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
18985 // of similar code.
18987 // For each templatized helper function, we also define an overloaded
18988 // version for BiggestInt in order to reduce code bloat and allow
18989 // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
18992 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18993 #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
18994 template <typename T1, typename T2>\
18995 AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
18996 const T1& val1, const T2& val2) {\
18997 if (val1 op val2) {\
18998 return AssertionSuccess();\
19000 return AssertionFailure() \
19001 << "Expected: (" << expr1 << ") " #op " (" << expr2\
19002 << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
19003 << " vs " << FormatForComparisonFailureMessage(val2, val1);\
19006 GTEST_API_ AssertionResult CmpHelper##op_name(\
19007 const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
19009 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19011 // Implements the helper function for {ASSERT|EXPECT}_NE
19012 GTEST_IMPL_CMP_HELPER_(NE, !=);
19013 // Implements the helper function for {ASSERT|EXPECT}_LE
19014 GTEST_IMPL_CMP_HELPER_(LE, <=);
19015 // Implements the helper function for {ASSERT|EXPECT}_LT
19016 GTEST_IMPL_CMP_HELPER_(LT, <);
19017 // Implements the helper function for {ASSERT|EXPECT}_GE
19018 GTEST_IMPL_CMP_HELPER_(GE, >=);
19019 // Implements the helper function for {ASSERT|EXPECT}_GT
19020 GTEST_IMPL_CMP_HELPER_(GT, >);
19022 #undef GTEST_IMPL_CMP_HELPER_
19024 // The helper function for {ASSERT|EXPECT}_STREQ.
19026 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19027 GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
19028 const char* actual_expression,
19029 const char* expected,
19030 const char* actual);
19032 // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
19034 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19035 GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
19036 const char* actual_expression,
19037 const char* expected,
19038 const char* actual);
19040 // The helper function for {ASSERT|EXPECT}_STRNE.
19042 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19043 GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
19044 const char* s2_expression,
19048 // The helper function for {ASSERT|EXPECT}_STRCASENE.
19050 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19051 GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
19052 const char* s2_expression,
19057 // Helper function for *_STREQ on wide strings.
19059 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19060 GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
19061 const char* actual_expression,
19062 const wchar_t* expected,
19063 const wchar_t* actual);
19065 // Helper function for *_STRNE on wide strings.
19067 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19068 GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
19069 const char* s2_expression,
19071 const wchar_t* s2);
19073 } // namespace internal
19075 // IsSubstring() and IsNotSubstring() are intended to be used as the
19076 // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
19077 // themselves. They check whether needle is a substring of haystack
19078 // (NULL is considered a substring of itself only), and return an
19079 // appropriate error message when they fail.
19081 // The {needle,haystack}_expr arguments are the stringified
19082 // expressions that generated the two real arguments.
19083 GTEST_API_ AssertionResult IsSubstring(
19084 const char* needle_expr, const char* haystack_expr,
19085 const char* needle, const char* haystack);
19086 GTEST_API_ AssertionResult IsSubstring(
19087 const char* needle_expr, const char* haystack_expr,
19088 const wchar_t* needle, const wchar_t* haystack);
19089 GTEST_API_ AssertionResult IsNotSubstring(
19090 const char* needle_expr, const char* haystack_expr,
19091 const char* needle, const char* haystack);
19092 GTEST_API_ AssertionResult IsNotSubstring(
19093 const char* needle_expr, const char* haystack_expr,
19094 const wchar_t* needle, const wchar_t* haystack);
19095 GTEST_API_ AssertionResult IsSubstring(
19096 const char* needle_expr, const char* haystack_expr,
19097 const ::std::string& needle, const ::std::string& haystack);
19098 GTEST_API_ AssertionResult IsNotSubstring(
19099 const char* needle_expr, const char* haystack_expr,
19100 const ::std::string& needle, const ::std::string& haystack);
19102 #if GTEST_HAS_STD_WSTRING
19103 GTEST_API_ AssertionResult IsSubstring(
19104 const char* needle_expr, const char* haystack_expr,
19105 const ::std::wstring& needle, const ::std::wstring& haystack);
19106 GTEST_API_ AssertionResult IsNotSubstring(
19107 const char* needle_expr, const char* haystack_expr,
19108 const ::std::wstring& needle, const ::std::wstring& haystack);
19109 #endif // GTEST_HAS_STD_WSTRING
19111 namespace internal {
19113 // Helper template function for comparing floating-points.
19115 // Template parameter:
19117 // RawType: the raw floating-point type (either float or double)
19119 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19120 template <typename RawType>
19121 AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
19122 const char* actual_expression,
19125 const FloatingPoint<RawType> lhs(expected), rhs(actual);
19127 if (lhs.AlmostEquals(rhs)) {
19128 return AssertionSuccess();
19131 ::std::stringstream expected_ss;
19132 expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
19135 ::std::stringstream actual_ss;
19136 actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
19139 return EqFailure(expected_expression,
19141 StringStreamToString(&expected_ss),
19142 StringStreamToString(&actual_ss),
19146 // Helper function for implementing ASSERT_NEAR.
19148 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19149 GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
19151 const char* abs_error_expr,
19156 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
19157 // A class that enables one to stream messages to assertion macros
19158 class GTEST_API_ AssertHelper {
19161 AssertHelper(TestPartResult::Type type,
19164 const char* message);
19167 // Message assignment is a semantic trick to enable assertion
19168 // streaming; see the GTEST_MESSAGE_ macro below.
19169 void operator=(const Message& message) const;
19172 // We put our data in a struct so that the size of the AssertHelper class can
19173 // be as small as possible. This is important because gcc is incapable of
19174 // re-using stack space even for temporary variables, so every EXPECT_EQ
19175 // reserves stack space for another AssertHelper.
19176 struct AssertHelperData {
19177 AssertHelperData(TestPartResult::Type t,
19178 const char* srcfile,
19181 : type(t), file(srcfile), line(line_num), message(msg) { }
19183 TestPartResult::Type const type;
19184 const char* const file;
19186 std::string const message;
19189 GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
19192 AssertHelperData* const data_;
19194 GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
19197 } // namespace internal
19199 #if GTEST_HAS_PARAM_TEST
19200 // The pure interface class that all value-parameterized tests inherit from.
19201 // A value-parameterized class must inherit from both ::testing::Test and
19202 // ::testing::WithParamInterface. In most cases that just means inheriting
19203 // from ::testing::TestWithParam, but more complicated test hierarchies
19204 // may need to inherit from Test and WithParamInterface at different levels.
19206 // This interface has support for accessing the test parameter value via
19207 // the GetParam() method.
19209 // Use it with one of the parameter generator defining functions, like Range(),
19210 // Values(), ValuesIn(), Bool(), and Combine().
19212 // class FooTest : public ::testing::TestWithParam<int> {
19215 // // Can use GetParam() here.
19217 // virtual ~FooTest() {
19218 // // Can use GetParam() here.
19220 // virtual void SetUp() {
19221 // // Can use GetParam() here.
19223 // virtual void TearDown {
19224 // // Can use GetParam() here.
19227 // TEST_P(FooTest, DoesBar) {
19228 // // Can use GetParam() method here.
19230 // ASSERT_TRUE(foo.DoesBar(GetParam()));
19232 // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
19234 template <typename T>
19235 class WithParamInterface {
19237 typedef T ParamType;
19238 virtual ~WithParamInterface() {}
19240 // The current parameter value. Is also available in the test fixture's
19241 // constructor. This member function is non-static, even though it only
19242 // references static data, to reduce the opportunity for incorrect uses
19243 // like writing 'WithParamInterface<bool>::GetParam()' for a test that
19244 // uses a fixture whose parameter type is int.
19245 const ParamType& GetParam() const {
19246 GTEST_CHECK_(parameter_ != NULL)
19247 << "GetParam() can only be called inside a value-parameterized test "
19248 << "-- did you intend to write TEST_P instead of TEST_F?";
19249 return *parameter_;
19253 // Sets parameter value. The caller is responsible for making sure the value
19254 // remains alive and unchanged throughout the current test.
19255 static void SetParam(const ParamType* parameter) {
19256 parameter_ = parameter;
19259 // Static value used for accessing parameter during a test lifetime.
19260 static const ParamType* parameter_;
19262 // TestClass must be a subclass of WithParamInterface<T> and Test.
19263 template <class TestClass> friend class internal::ParameterizedTestFactory;
19266 template <typename T>
19267 const T* WithParamInterface<T>::parameter_ = NULL;
19269 // Most value-parameterized classes can ignore the existence of
19270 // WithParamInterface, and can just inherit from ::testing::TestWithParam.
19272 template <typename T>
19273 class TestWithParam : public Test, public WithParamInterface<T> {
19276 #endif // GTEST_HAS_PARAM_TEST
19278 // Macros for indicating success/failure in test code.
19280 // ADD_FAILURE unconditionally adds a failure to the current test.
19281 // SUCCEED generates a success - it doesn't automatically make the
19282 // current test successful, as a test is only successful when it has
19285 // EXPECT_* verifies that a certain condition is satisfied. If not,
19286 // it behaves like ADD_FAILURE. In particular:
19288 // EXPECT_TRUE verifies that a Boolean condition is true.
19289 // EXPECT_FALSE verifies that a Boolean condition is false.
19291 // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
19292 // that they will also abort the current function on failure. People
19293 // usually want the fail-fast behavior of FAIL and ASSERT_*, but those
19294 // writing data-driven tests often find themselves using ADD_FAILURE
19295 // and EXPECT_* more.
19297 // Generates a nonfatal failure with a generic message.
19298 #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
19300 // Generates a nonfatal failure at the given source file location with
19301 // a generic message.
19302 #define ADD_FAILURE_AT(file, line) \
19303 GTEST_MESSAGE_AT_(file, line, "Failed", \
19304 ::testing::TestPartResult::kNonFatalFailure)
19306 // Generates a fatal failure with a generic message.
19307 #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
19309 // Define this macro to 1 to omit the definition of FAIL(), which is a
19310 // generic name and clashes with some other libraries.
19311 #if !GTEST_DONT_DEFINE_FAIL
19312 # define FAIL() GTEST_FAIL()
19315 // Generates a success with a generic message.
19316 #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
19318 // Define this macro to 1 to omit the definition of SUCCEED(), which
19319 // is a generic name and clashes with some other libraries.
19320 #if !GTEST_DONT_DEFINE_SUCCEED
19321 # define SUCCEED() GTEST_SUCCEED()
19324 // Macros for testing exceptions.
19326 // * {ASSERT|EXPECT}_THROW(statement, expected_exception):
19327 // Tests that the statement throws the expected exception.
19328 // * {ASSERT|EXPECT}_NO_THROW(statement):
19329 // Tests that the statement doesn't throw any exception.
19330 // * {ASSERT|EXPECT}_ANY_THROW(statement):
19331 // Tests that the statement throws an exception.
19333 #define EXPECT_THROW(statement, expected_exception) \
19334 GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
19335 #define EXPECT_NO_THROW(statement) \
19336 GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
19337 #define EXPECT_ANY_THROW(statement) \
19338 GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
19339 #define ASSERT_THROW(statement, expected_exception) \
19340 GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
19341 #define ASSERT_NO_THROW(statement) \
19342 GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
19343 #define ASSERT_ANY_THROW(statement) \
19344 GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
19346 // Boolean assertions. Condition can be either a Boolean expression or an
19347 // AssertionResult. For more information on how to use AssertionResult with
19348 // these macros see comments on that class.
19349 #define EXPECT_TRUE(condition) \
19350 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
19351 GTEST_NONFATAL_FAILURE_)
19352 #define EXPECT_FALSE(condition) \
19353 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
19354 GTEST_NONFATAL_FAILURE_)
19355 #define ASSERT_TRUE(condition) \
19356 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
19357 GTEST_FATAL_FAILURE_)
19358 #define ASSERT_FALSE(condition) \
19359 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
19360 GTEST_FATAL_FAILURE_)
19362 // Includes the auto-generated header that implements a family of
19363 // generic predicate assertion macros.
19364 // Copyright 2006, Google Inc.
19365 // All rights reserved.
19367 // Redistribution and use in source and binary forms, with or without
19368 // modification, are permitted provided that the following conditions are
19371 // * Redistributions of source code must retain the above copyright
19372 // notice, this list of conditions and the following disclaimer.
19373 // * Redistributions in binary form must reproduce the above
19374 // copyright notice, this list of conditions and the following disclaimer
19375 // in the documentation and/or other materials provided with the
19377 // * Neither the name of Google Inc. nor the names of its
19378 // contributors may be used to endorse or promote products derived from
19379 // this software without specific prior written permission.
19381 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19382 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19383 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19384 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19385 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19386 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19387 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19388 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19389 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19390 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
19391 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19393 // This file is AUTOMATICALLY GENERATED on 10/31/2011 by command
19394 // 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
19396 // Implements a family of generic predicate assertion macros.
19398 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19399 #define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19401 // Makes sure this header is not included before gtest.h.
19402 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
19403 # error Do not include gtest_pred_impl.h directly. Include gtest.h instead.
19404 #endif // GTEST_INCLUDE_GTEST_GTEST_H_
19406 // This header implements a family of generic predicate assertion
19409 // ASSERT_PRED_FORMAT1(pred_format, v1)
19410 // ASSERT_PRED_FORMAT2(pred_format, v1, v2)
19413 // where pred_format is a function or functor that takes n (in the
19414 // case of ASSERT_PRED_FORMATn) values and their source expression
19415 // text, and returns a testing::AssertionResult. See the definition
19416 // of ASSERT_EQ in gtest.h for an example.
19418 // If you don't care about formatting, you can use the more
19419 // restrictive version:
19421 // ASSERT_PRED1(pred, v1)
19422 // ASSERT_PRED2(pred, v1, v2)
19425 // where pred is an n-ary function or functor that returns bool,
19426 // and the values v1, v2, ..., must support the << operator for
19427 // streaming to std::ostream.
19429 // We also define the EXPECT_* variations.
19431 // For now we only support predicates whose arity is at most 5.
19432 // Please email googletestframework@googlegroups.com if you need
19433 // support for higher arities.
19435 // GTEST_ASSERT_ is the basic statement to which all of the assertions
19436 // in this file reduce. Don't use this in your code.
19438 #define GTEST_ASSERT_(expression, on_failure) \
19439 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
19440 if (const ::testing::AssertionResult gtest_ar = (expression)) \
19443 on_failure(gtest_ar.failure_message())
19446 // Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use
19447 // this in your code.
19448 template <typename Pred,
19450 AssertionResult AssertPred1Helper(const char* pred_text,
19454 if (pred(v1)) return AssertionSuccess();
19456 return AssertionFailure() << pred_text << "("
19457 << e1 << ") evaluates to false, where"
19458 << "\n" << e1 << " evaluates to " << v1;
19461 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
19462 // Don't use this in your code.
19463 #define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
19464 GTEST_ASSERT_(pred_format(#v1, v1), \
19467 // Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use
19468 // this in your code.
19469 #define GTEST_PRED1_(pred, v1, on_failure)\
19470 GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
19475 // Unary predicate assertion macros.
19476 #define EXPECT_PRED_FORMAT1(pred_format, v1) \
19477 GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
19478 #define EXPECT_PRED1(pred, v1) \
19479 GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
19480 #define ASSERT_PRED_FORMAT1(pred_format, v1) \
19481 GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
19482 #define ASSERT_PRED1(pred, v1) \
19483 GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
19487 // Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use
19488 // this in your code.
19489 template <typename Pred,
19492 AssertionResult AssertPred2Helper(const char* pred_text,
19498 if (pred(v1, v2)) return AssertionSuccess();
19500 return AssertionFailure() << pred_text << "("
19502 << e2 << ") evaluates to false, where"
19503 << "\n" << e1 << " evaluates to " << v1
19504 << "\n" << e2 << " evaluates to " << v2;
19507 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
19508 // Don't use this in your code.
19509 #define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
19510 GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
19513 // Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use
19514 // this in your code.
19515 #define GTEST_PRED2_(pred, v1, v2, on_failure)\
19516 GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
19523 // Binary predicate assertion macros.
19524 #define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
19525 GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
19526 #define EXPECT_PRED2(pred, v1, v2) \
19527 GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
19528 #define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
19529 GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
19530 #define ASSERT_PRED2(pred, v1, v2) \
19531 GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
19535 // Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use
19536 // this in your code.
19537 template <typename Pred,
19541 AssertionResult AssertPred3Helper(const char* pred_text,
19549 if (pred(v1, v2, v3)) return AssertionSuccess();
19551 return AssertionFailure() << pred_text << "("
19554 << e3 << ") evaluates to false, where"
19555 << "\n" << e1 << " evaluates to " << v1
19556 << "\n" << e2 << " evaluates to " << v2
19557 << "\n" << e3 << " evaluates to " << v3;
19560 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
19561 // Don't use this in your code.
19562 #define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
19563 GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
19566 // Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use
19567 // this in your code.
19568 #define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
19569 GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
19578 // Ternary predicate assertion macros.
19579 #define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
19580 GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
19581 #define EXPECT_PRED3(pred, v1, v2, v3) \
19582 GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
19583 #define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
19584 GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
19585 #define ASSERT_PRED3(pred, v1, v2, v3) \
19586 GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
19590 // Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use
19591 // this in your code.
19592 template <typename Pred,
19597 AssertionResult AssertPred4Helper(const char* pred_text,
19607 if (pred(v1, v2, v3, v4)) return AssertionSuccess();
19609 return AssertionFailure() << pred_text << "("
19613 << e4 << ") evaluates to false, where"
19614 << "\n" << e1 << " evaluates to " << v1
19615 << "\n" << e2 << " evaluates to " << v2
19616 << "\n" << e3 << " evaluates to " << v3
19617 << "\n" << e4 << " evaluates to " << v4;
19620 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
19621 // Don't use this in your code.
19622 #define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
19623 GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
19626 // Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use
19627 // this in your code.
19628 #define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
19629 GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
19640 // 4-ary predicate assertion macros.
19641 #define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
19642 GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
19643 #define EXPECT_PRED4(pred, v1, v2, v3, v4) \
19644 GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
19645 #define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
19646 GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
19647 #define ASSERT_PRED4(pred, v1, v2, v3, v4) \
19648 GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
19652 // Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use
19653 // this in your code.
19654 template <typename Pred,
19660 AssertionResult AssertPred5Helper(const char* pred_text,
19672 if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
19674 return AssertionFailure() << pred_text << "("
19679 << e5 << ") evaluates to false, where"
19680 << "\n" << e1 << " evaluates to " << v1
19681 << "\n" << e2 << " evaluates to " << v2
19682 << "\n" << e3 << " evaluates to " << v3
19683 << "\n" << e4 << " evaluates to " << v4
19684 << "\n" << e5 << " evaluates to " << v5;
19687 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
19688 // Don't use this in your code.
19689 #define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
19690 GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
19693 // Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use
19694 // this in your code.
19695 #define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
19696 GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
19709 // 5-ary predicate assertion macros.
19710 #define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
19711 GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
19712 #define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
19713 GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
19714 #define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
19715 GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
19716 #define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
19717 GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
19721 #endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19723 // Macros for testing equalities and inequalities.
19725 // * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
19726 // * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
19727 // * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
19728 // * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
19729 // * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
19730 // * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
19732 // When they are not, Google Test prints both the tested expressions and
19733 // their actual values. The values must be compatible built-in types,
19734 // or you will get a compiler error. By "compatible" we mean that the
19735 // values can be compared by the respective operator.
19739 // 1. It is possible to make a user-defined type work with
19740 // {ASSERT|EXPECT}_??(), but that requires overloading the
19741 // comparison operators and is thus discouraged by the Google C++
19742 // Usage Guide. Therefore, you are advised to use the
19743 // {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
19746 // 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
19747 // pointers (in particular, C strings). Therefore, if you use it
19748 // with two C strings, you are testing how their locations in memory
19749 // are related, not how their content is related. To compare two C
19750 // strings by content, use {ASSERT|EXPECT}_STR*().
19752 // 3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
19753 // {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
19754 // what the actual value is when it fails, and similarly for the
19755 // other comparisons.
19757 // 4. Do not depend on the order in which {ASSERT|EXPECT}_??()
19758 // evaluate their arguments, which is undefined.
19760 // 5. These macros evaluate their arguments exactly once.
19764 // EXPECT_NE(5, Foo());
19765 // EXPECT_EQ(NULL, a_pointer);
19766 // ASSERT_LT(i, array_size);
19767 // ASSERT_GT(records.size(), 0) << "There is no record left.";
19769 #define EXPECT_EQ(expected, actual) \
19770 EXPECT_PRED_FORMAT2(::testing::internal:: \
19771 EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
19773 #define EXPECT_NE(expected, actual) \
19774 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
19775 #define EXPECT_LE(val1, val2) \
19776 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
19777 #define EXPECT_LT(val1, val2) \
19778 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
19779 #define EXPECT_GE(val1, val2) \
19780 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
19781 #define EXPECT_GT(val1, val2) \
19782 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19784 #define GTEST_ASSERT_EQ(expected, actual) \
19785 ASSERT_PRED_FORMAT2(::testing::internal:: \
19786 EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
19788 #define GTEST_ASSERT_NE(val1, val2) \
19789 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
19790 #define GTEST_ASSERT_LE(val1, val2) \
19791 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
19792 #define GTEST_ASSERT_LT(val1, val2) \
19793 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
19794 #define GTEST_ASSERT_GE(val1, val2) \
19795 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
19796 #define GTEST_ASSERT_GT(val1, val2) \
19797 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19799 // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
19800 // ASSERT_XY(), which clashes with some users' own code.
19802 #if !GTEST_DONT_DEFINE_ASSERT_EQ
19803 # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
19806 #if !GTEST_DONT_DEFINE_ASSERT_NE
19807 # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
19810 #if !GTEST_DONT_DEFINE_ASSERT_LE
19811 # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
19814 #if !GTEST_DONT_DEFINE_ASSERT_LT
19815 # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
19818 #if !GTEST_DONT_DEFINE_ASSERT_GE
19819 # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
19822 #if !GTEST_DONT_DEFINE_ASSERT_GT
19823 # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
19826 // C-string Comparisons. All tests treat NULL and any non-NULL string
19827 // as different. Two NULLs are equal.
19829 // * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2
19830 // * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2
19831 // * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
19832 // * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
19834 // For wide or narrow string objects, you can use the
19835 // {ASSERT|EXPECT}_??() macros.
19837 // Don't depend on the order in which the arguments are evaluated,
19838 // which is undefined.
19840 // These macros evaluate their arguments exactly once.
19842 #define EXPECT_STREQ(expected, actual) \
19843 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
19844 #define EXPECT_STRNE(s1, s2) \
19845 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
19846 #define EXPECT_STRCASEEQ(expected, actual) \
19847 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
19848 #define EXPECT_STRCASENE(s1, s2)\
19849 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
19851 #define ASSERT_STREQ(expected, actual) \
19852 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
19853 #define ASSERT_STRNE(s1, s2) \
19854 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
19855 #define ASSERT_STRCASEEQ(expected, actual) \
19856 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
19857 #define ASSERT_STRCASENE(s1, s2)\
19858 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
19860 // Macros for comparing floating-point numbers.
19862 // * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
19863 // Tests that two float values are almost equal.
19864 // * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
19865 // Tests that two double values are almost equal.
19866 // * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
19867 // Tests that v1 and v2 are within the given distance to each other.
19869 // Google Test uses ULP-based comparison to automatically pick a default
19870 // error bound that is appropriate for the operands. See the
19871 // FloatingPoint template class in gtest-internal.h if you are
19872 // interested in the implementation details.
19874 #define EXPECT_FLOAT_EQ(expected, actual)\
19875 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
19878 #define EXPECT_DOUBLE_EQ(expected, actual)\
19879 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
19882 #define ASSERT_FLOAT_EQ(expected, actual)\
19883 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
19886 #define ASSERT_DOUBLE_EQ(expected, actual)\
19887 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
19890 #define EXPECT_NEAR(val1, val2, abs_error)\
19891 EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
19892 val1, val2, abs_error)
19894 #define ASSERT_NEAR(val1, val2, abs_error)\
19895 ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
19896 val1, val2, abs_error)
19898 // These predicate format functions work on floating-point values, and
19899 // can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
19901 // EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
19903 // Asserts that val1 is less than, or almost equal to, val2. Fails
19904 // otherwise. In particular, it fails if either val1 or val2 is NaN.
19905 GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
19906 float val1, float val2);
19907 GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
19908 double val1, double val2);
19911 #if GTEST_OS_WINDOWS
19913 // Macros that test for HRESULT failure and success, these are only useful
19914 // on Windows, and rely on Windows SDK macros and APIs to compile.
19916 // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
19918 // When expr unexpectedly fails or succeeds, Google Test prints the
19919 // expected result and the actual result with both a human-readable
19920 // string representation of the error, if available, as well as the
19921 // hex result code.
19922 # define EXPECT_HRESULT_SUCCEEDED(expr) \
19923 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
19925 # define ASSERT_HRESULT_SUCCEEDED(expr) \
19926 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
19928 # define EXPECT_HRESULT_FAILED(expr) \
19929 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
19931 # define ASSERT_HRESULT_FAILED(expr) \
19932 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
19934 #endif // GTEST_OS_WINDOWS
19936 // Macros that execute statement and check that it doesn't generate new fatal
19937 // failures in the current thread.
19939 // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
19943 // EXPECT_NO_FATAL_FAILURE(Process());
19944 // ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
19946 #define ASSERT_NO_FATAL_FAILURE(statement) \
19947 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
19948 #define EXPECT_NO_FATAL_FAILURE(statement) \
19949 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
19951 // Causes a trace (including the source file path, the current line
19952 // number, and the given message) to be included in every test failure
19953 // message generated by code in the current scope. The effect is
19954 // undone when the control leaves the current scope.
19956 // The message argument can be anything streamable to std::ostream.
19958 // In the implementation, we include the current line number as part
19959 // of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
19960 // to appear in the same block - as long as they are on different
19962 #define SCOPED_TRACE(message) \
19963 ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
19964 __FILE__, __LINE__, ::testing::Message() << (message))
19966 // Compile-time assertion for type equality.
19967 // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
19968 // the same type. The value it returns is not interesting.
19970 // Instead of making StaticAssertTypeEq a class template, we make it a
19971 // function template that invokes a helper class template. This
19972 // prevents a user from misusing StaticAssertTypeEq<T1, T2> by
19973 // defining objects of that type.
19977 // When used inside a method of a class template,
19978 // StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
19979 // instantiated. For example, given:
19981 // template <typename T> class Foo {
19983 // void Bar() { testing::StaticAssertTypeEq<int, T>(); }
19988 // void Test1() { Foo<bool> foo; }
19990 // will NOT generate a compiler error, as Foo<bool>::Bar() is never
19991 // actually instantiated. Instead, you need:
19993 // void Test2() { Foo<bool> foo; foo.Bar(); }
19995 // to cause a compiler error.
19996 template <typename T1, typename T2>
19997 bool StaticAssertTypeEq() {
19998 (void)internal::StaticAssertTypeEqHelper<T1, T2>();
20004 // The first parameter is the name of the test case, and the second
20005 // parameter is the name of the test within the test case.
20007 // The convention is to end the test case name with "Test". For
20008 // example, a test case for the Foo class can be named FooTest.
20010 // The user should put his test code between braces after using this
20013 // TEST(FooTest, InitializesCorrectly) {
20015 // EXPECT_TRUE(foo.StatusIsOK());
20018 // Note that we call GetTestTypeId() instead of GetTypeId<
20019 // ::testing::Test>() here to get the type ID of testing::Test. This
20020 // is to work around a suspected linker bug when using Google Test as
20021 // a framework on Mac OS X. The bug causes GetTypeId<
20022 // ::testing::Test>() to return different values depending on whether
20023 // the call is from the Google Test framework itself or from user test
20024 // code. GetTestTypeId() is guaranteed to always return the same
20025 // value, as it always calls GetTypeId<>() from the Google Test
20027 #define GTEST_TEST(test_case_name, test_name)\
20028 GTEST_TEST_(test_case_name, test_name, \
20029 ::testing::Test, ::testing::internal::GetTestTypeId())
20031 // Define this macro to 1 to omit the definition of TEST(), which
20032 // is a generic name and clashes with some other libraries.
20033 #if !GTEST_DONT_DEFINE_TEST
20034 # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
20037 // Defines a test that uses a test fixture.
20039 // The first parameter is the name of the test fixture class, which
20040 // also doubles as the test case name. The second parameter is the
20041 // name of the test within the test case.
20043 // A test fixture class must be declared earlier. The user should put
20044 // his test code between braces after using this macro. Example:
20046 // class FooTest : public testing::Test {
20048 // virtual void SetUp() { b_.AddElement(3); }
20054 // TEST_F(FooTest, InitializesCorrectly) {
20055 // EXPECT_TRUE(a_.StatusIsOK());
20058 // TEST_F(FooTest, ReturnsElementCountCorrectly) {
20059 // EXPECT_EQ(0, a_.size());
20060 // EXPECT_EQ(1, b_.size());
20063 #define TEST_F(test_fixture, test_name)\
20064 GTEST_TEST_(test_fixture, test_name, test_fixture, \
20065 ::testing::internal::GetTypeId<test_fixture>())
20067 } // namespace testing
20069 // Use this function in main() to run all tests. It returns 0 if all
20070 // tests are successful, or 1 otherwise.
20072 // RUN_ALL_TESTS() should be invoked after the command line has been
20073 // parsed by InitGoogleTest().
20075 // This function was formerly a macro; thus, it is in the global
20076 // namespace and has an all-caps name.
20077 int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
20079 inline int RUN_ALL_TESTS() {
20080 return ::testing::UnitTest::GetInstance()->Run();
20083 #endif // GTEST_INCLUDE_GTEST_GTEST_H_