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_
57 // Copyright 2005, Google Inc.
58 // All rights reserved.
60 // Redistribution and use in source and binary forms, with or without
61 // modification, are permitted provided that the following conditions are
64 // * Redistributions of source code must retain the above copyright
65 // notice, this list of conditions and the following disclaimer.
66 // * Redistributions in binary form must reproduce the above
67 // copyright notice, this list of conditions and the following disclaimer
68 // in the documentation and/or other materials provided with the
70 // * Neither the name of Google Inc. nor the names of its
71 // contributors may be used to endorse or promote products derived from
72 // this software without specific prior written permission.
74 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
75 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
76 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
77 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
78 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
79 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
80 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
81 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
82 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
83 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
84 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
86 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
88 // The Google C++ Testing Framework (Google Test)
90 // This header file declares functions and macros used internally by
91 // Google Test. They are subject to change without notice.
93 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
94 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
96 // Copyright 2005, Google Inc.
97 // All rights reserved.
99 // Redistribution and use in source and binary forms, with or without
100 // modification, are permitted provided that the following conditions are
103 // * Redistributions of source code must retain the above copyright
104 // notice, this list of conditions and the following disclaimer.
105 // * Redistributions in binary form must reproduce the above
106 // copyright notice, this list of conditions and the following disclaimer
107 // in the documentation and/or other materials provided with the
109 // * Neither the name of Google Inc. nor the names of its
110 // contributors may be used to endorse or promote products derived from
111 // this software without specific prior written permission.
113 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
114 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
115 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
116 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
117 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
118 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
119 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
120 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
121 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
122 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
123 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
125 // Authors: wan@google.com (Zhanyong Wan)
127 // Low-level types and utilities for porting Google Test to various
128 // platforms. They are subject to change without notice. DO NOT USE
129 // THEM IN USER CODE.
131 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
132 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
134 // The user can define the following macros in the build script to
135 // control Google Test's behavior. If the user doesn't define a macro
136 // in this list, Google Test will define it.
138 // GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
139 // is/isn't available.
140 // GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
142 // GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
143 // is/isn't available (some systems define
144 // ::string, which is different to std::string).
145 // GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
146 // is/isn't available (some systems define
147 // ::wstring, which is different to std::wstring).
148 // GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
149 // expressions are/aren't available.
150 // GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
151 // is/isn't available.
152 // GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't
154 // GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
155 // std::wstring does/doesn't work (Google Test can
156 // be used where std::wstring is unavailable).
157 // GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
158 // is/isn't available.
159 // GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
160 // compiler supports Microsoft's "Structured
161 // Exception Handling".
162 // GTEST_HAS_STREAM_REDIRECTION
163 // - Define it to 1/0 to indicate whether the
164 // platform supports I/O stream redirection using
166 // GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
167 // Test's own tr1 tuple implementation should be
168 // used. Unused when the user sets
169 // GTEST_HAS_TR1_TUPLE to 0.
170 // GTEST_LINKED_AS_SHARED_LIBRARY
171 // - Define to 1 when compiling tests that use
172 // Google Test as a shared library (known as
174 // GTEST_CREATE_SHARED_LIBRARY
175 // - Define to 1 when compiling Google Test itself
176 // as a shared library.
178 // This header defines the following utilities:
180 // Macros indicating the current platform (defined to 1 if compiled on
181 // the given platform; otherwise undefined):
182 // GTEST_OS_AIX - IBM AIX
183 // GTEST_OS_CYGWIN - Cygwin
184 // GTEST_OS_HPUX - HP-UX
185 // GTEST_OS_LINUX - Linux
186 // GTEST_OS_LINUX_ANDROID - Google Android
187 // GTEST_OS_MAC - Mac OS X
188 // GTEST_OS_NACL - Google Native Client (NaCl)
189 // GTEST_OS_SOLARIS - Sun Solaris
190 // GTEST_OS_SYMBIAN - Symbian
191 // GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile)
192 // GTEST_OS_WINDOWS_DESKTOP - Windows Desktop
193 // GTEST_OS_WINDOWS_MINGW - MinGW
194 // GTEST_OS_WINDOWS_MOBILE - Windows Mobile
195 // GTEST_OS_ZOS - z/OS
197 // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
198 // most stable support. Since core members of the Google Test project
199 // don't have access to other platforms, support for them may be less
200 // stable. If you notice any problems on your platform, please notify
201 // googletestframework@googlegroups.com (patches for fixing them are
202 // even more welcome!).
204 // Note that it is possible that none of the GTEST_OS_* macros are defined.
206 // Macros indicating available Google Test features (defined to 1 if
207 // the corresponding feature is supported; otherwise undefined):
208 // GTEST_HAS_COMBINE - the Combine() function (for value-parameterized
210 // GTEST_HAS_DEATH_TEST - death tests
211 // GTEST_HAS_PARAM_TEST - value-parameterized tests
212 // GTEST_HAS_TYPED_TEST - typed tests
213 // GTEST_HAS_TYPED_TEST_P - type-parameterized tests
214 // GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with
215 // GTEST_HAS_POSIX_RE (see above) which users can
216 // define themselves.
217 // GTEST_USES_SIMPLE_RE - our own simple regex is used;
218 // the above two are mutually exclusive.
219 // GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
221 // Macros for basic C++ coding:
222 // GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
223 // GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a
224 // variable don't have to be used.
225 // GTEST_DISALLOW_ASSIGN_ - disables operator=.
226 // GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
227 // GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
230 // Mutex, MutexLock, ThreadLocal, GetThreadCount()
231 // - synchronization primitives.
232 // GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
233 // synchronization primitives have real implementations
234 // and Google Test is thread-safe; or 0 otherwise.
236 // Template meta programming:
237 // is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only.
238 // IteratorTraits - partial implementation of std::iterator_traits, which
239 // is not available in libCstd when compiled with Sun C++.
242 // scoped_ptr - as in TR2.
244 // Regular expressions:
245 // RE - a simple regular expression class using the POSIX
246 // Extended Regular Expression syntax on UNIX-like
247 // platforms, or a reduced regular exception syntax on
248 // other platforms, including Windows.
251 // GTEST_LOG_() - logs messages at the specified severity level.
252 // LogToStderr() - directs all log messages to stderr.
253 // FlushInfoLog() - flushes informational log messages.
255 // Stdout and stderr capturing:
256 // CaptureStdout() - starts capturing stdout.
257 // GetCapturedStdout() - stops capturing stdout and returns the captured
259 // CaptureStderr() - starts capturing stderr.
260 // GetCapturedStderr() - stops capturing stderr and returns the captured
264 // TypeWithSize - maps an integer to a int type.
265 // Int32, UInt32, Int64, UInt64, TimeInMillis
266 // - integers of known sizes.
267 // BiggestInt - the biggest signed integer type.
269 // Command-line utilities:
270 // GTEST_FLAG() - references a flag.
271 // GTEST_DECLARE_*() - declares a flag.
272 // GTEST_DEFINE_*() - defines a flag.
273 // GetArgvs() - returns the command line as a vector of strings.
275 // Environment variable utilities:
276 // GetEnv() - gets the value of an environment variable.
277 // BoolFromGTestEnv() - parses a bool environment variable.
278 // Int32FromGTestEnv() - parses an Int32 environment variable.
279 // StringFromGTestEnv() - parses a string environment variable.
281 #include <ctype.h> // for isspace, etc
282 #include <stddef.h> // for ptrdiff_t
287 # include <sys/types.h>
288 # include <sys/stat.h>
289 #endif // !_WIN32_WCE
291 #include <iostream> // NOLINT
292 #include <sstream> // NOLINT
293 #include <string> // NOLINT
295 #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
296 #define GTEST_FLAG_PREFIX_ "gtest_"
297 #define GTEST_FLAG_PREFIX_DASH_ "gtest-"
298 #define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
299 #define GTEST_NAME_ "Google Test"
300 #define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
302 // Determines the version of gcc that is used to compile this.
304 // 40302 means version 4.3.2.
305 # define GTEST_GCC_VER_ \
306 (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
309 // Determines the platform on which Google Test is compiled.
311 # define GTEST_OS_CYGWIN 1
312 #elif defined __SYMBIAN32__
313 # define GTEST_OS_SYMBIAN 1
315 # define GTEST_OS_WINDOWS 1
317 # define GTEST_OS_WINDOWS_MOBILE 1
318 # elif defined(__MINGW__) || defined(__MINGW32__)
319 # define GTEST_OS_WINDOWS_MINGW 1
321 # define GTEST_OS_WINDOWS_DESKTOP 1
322 # endif // _WIN32_WCE
323 #elif defined __APPLE__
324 # define GTEST_OS_MAC 1
325 #elif defined __linux__
326 # define GTEST_OS_LINUX 1
328 # define GTEST_OS_LINUX_ANDROID 1
330 #elif defined __MVS__
331 # define GTEST_OS_ZOS 1
332 #elif defined(__sun) && defined(__SVR4)
333 # define GTEST_OS_SOLARIS 1
335 # define GTEST_OS_AIX 1
336 #elif defined(__hpux)
337 # define GTEST_OS_HPUX 1
338 #elif defined __native_client__
339 # define GTEST_OS_NACL 1
342 // Brings in definitions for functions used in the testing::internal::posix
343 // namespace (read, write, close, chdir, isatty, stat). We do not currently
344 // use them on Windows Mobile.
345 #if !GTEST_OS_WINDOWS
346 // This assumes that non-Windows OSes provide unistd.h. For OSes where this
347 // is not the case, we need to include headers that provide the functions
351 // TODO(vladl@google.com): Remove this condition when Native Client SDK adds
352 // strings.h (tracked in
353 // http://code.google.com/p/nativeclient/issues/detail?id=1175).
354 # include <strings.h> // Native Client doesn't provide strings.h.
356 #elif !GTEST_OS_WINDOWS_MOBILE
361 // Defines this to true iff Google Test can use POSIX regular expressions.
362 #ifndef GTEST_HAS_POSIX_RE
363 # define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
366 #if GTEST_HAS_POSIX_RE
368 // On some platforms, <regex.h> needs someone to define size_t, and
369 // won't compile otherwise. We can #include it here as we already
370 // included <stdlib.h>, which is guaranteed to define size_t through
372 # include <regex.h> // NOLINT
374 # define GTEST_USES_POSIX_RE 1
376 #elif GTEST_OS_WINDOWS
378 // <regex.h> is not available on Windows. Use our own simple regex
379 // implementation instead.
380 # define GTEST_USES_SIMPLE_RE 1
384 // <regex.h> may not be available on this platform. Use our own
385 // simple regex implementation instead.
386 # define GTEST_USES_SIMPLE_RE 1
388 #endif // GTEST_HAS_POSIX_RE
390 #ifndef GTEST_HAS_EXCEPTIONS
391 // The user didn't tell us whether exceptions are enabled, so we need
393 # if defined(_MSC_VER) || defined(__BORLANDC__)
394 // MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
395 // macro to enable exceptions, so we'll do the same.
396 // Assumes that exceptions are enabled by default.
397 # ifndef _HAS_EXCEPTIONS
398 # define _HAS_EXCEPTIONS 1
399 # endif // _HAS_EXCEPTIONS
400 # define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
401 # elif defined(__GNUC__) && __EXCEPTIONS
402 // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
403 # define GTEST_HAS_EXCEPTIONS 1
404 # elif defined(__SUNPRO_CC)
405 // Sun Pro CC supports exceptions. However, there is no compile-time way of
406 // detecting whether they are enabled or not. Therefore, we assume that
407 // they are enabled unless the user tells us otherwise.
408 # define GTEST_HAS_EXCEPTIONS 1
409 # elif defined(__IBMCPP__) && __EXCEPTIONS
410 // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
411 # define GTEST_HAS_EXCEPTIONS 1
412 # elif defined(__HP_aCC)
413 // Exception handling is in effect by default in HP aCC compiler. It has to
414 // be turned of by +noeh compiler option if desired.
415 # define GTEST_HAS_EXCEPTIONS 1
417 // For other compilers, we assume exceptions are disabled to be
419 # define GTEST_HAS_EXCEPTIONS 0
420 # endif // defined(_MSC_VER) || defined(__BORLANDC__)
421 #endif // GTEST_HAS_EXCEPTIONS
423 #if !defined(GTEST_HAS_STD_STRING)
424 // Even though we don't use this macro any longer, we keep it in case
425 // some clients still depend on it.
426 # define GTEST_HAS_STD_STRING 1
427 #elif !GTEST_HAS_STD_STRING
428 // The user told us that ::std::string isn't available.
429 # error "Google Test cannot be used where ::std::string isn't available."
430 #endif // !defined(GTEST_HAS_STD_STRING)
432 #ifndef GTEST_HAS_GLOBAL_STRING
433 // The user didn't tell us whether ::string is available, so we need
436 # define GTEST_HAS_GLOBAL_STRING 0
438 #endif // GTEST_HAS_GLOBAL_STRING
440 #ifndef GTEST_HAS_STD_WSTRING
441 // The user didn't tell us whether ::std::wstring is available, so we need
443 // TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
446 // Cygwin 1.7 and below doesn't support ::std::wstring.
447 // Solaris' libc++ doesn't support it either. Android has
448 // no support for it at least as recent as Froyo (2.2).
449 # define GTEST_HAS_STD_WSTRING \
450 (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
452 #endif // GTEST_HAS_STD_WSTRING
454 #ifndef GTEST_HAS_GLOBAL_WSTRING
455 // The user didn't tell us whether ::wstring is available, so we need
457 # define GTEST_HAS_GLOBAL_WSTRING \
458 (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
459 #endif // GTEST_HAS_GLOBAL_WSTRING
461 // Determines whether RTTI is available.
462 #ifndef GTEST_HAS_RTTI
463 // The user didn't tell us whether RTTI is enabled, so we need to
468 # ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled.
469 # define GTEST_HAS_RTTI 1
471 # define GTEST_HAS_RTTI 0
474 // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
475 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
478 # define GTEST_HAS_RTTI 1
480 # define GTEST_HAS_RTTI 0
481 # endif // __GXX_RTTI
483 // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
484 // both the typeid and dynamic_cast features are present.
485 # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
488 # define GTEST_HAS_RTTI 1
490 # define GTEST_HAS_RTTI 0
495 // For all other compilers, we assume RTTI is enabled.
496 # define GTEST_HAS_RTTI 1
500 #endif // GTEST_HAS_RTTI
502 // It's this header's responsibility to #include <typeinfo> when RTTI
508 // Determines whether Google Test can use the pthreads library.
509 #ifndef GTEST_HAS_PTHREAD
510 // The user didn't tell us explicitly, so we assume pthreads support is
511 // available on Linux and Mac.
513 // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
514 // to your compiler flags.
515 # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX)
516 #endif // GTEST_HAS_PTHREAD
518 #if GTEST_HAS_PTHREAD
519 // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
521 # include <pthread.h> // NOLINT
523 // For timespec and nanosleep, used below.
524 # include <time.h> // NOLINT
527 // Determines whether Google Test can use tr1/tuple. You can define
528 // this macro to 0 to prevent Google Test from using tuple (any
529 // feature depending on tuple with be disabled in this mode).
530 #ifndef GTEST_HAS_TR1_TUPLE
531 // The user didn't tell us not to do it, so we assume it's OK.
532 # define GTEST_HAS_TR1_TUPLE 1
533 #endif // GTEST_HAS_TR1_TUPLE
535 // Determines whether Google Test's own tr1 tuple implementation
537 #ifndef GTEST_USE_OWN_TR1_TUPLE
538 // The user didn't tell us, so we need to figure it out.
540 // We use our own TR1 tuple if we aren't sure the user has an
541 // implementation of it already. At this time, GCC 4.0.0+ and MSVC
542 // 2010 are the only mainstream compilers that come with a TR1 tuple
543 // implementation. NVIDIA's CUDA NVCC compiler pretends to be GCC by
544 // defining __GNUC__ and friends, but cannot compile GCC's tuple
545 // implementation. MSVC 2008 (9.0) provides TR1 tuple in a 323 MB
546 // Feature Pack download, which we cannot assume the user has.
547 # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000)) \
549 # define GTEST_USE_OWN_TR1_TUPLE 0
551 # define GTEST_USE_OWN_TR1_TUPLE 1
554 #endif // GTEST_USE_OWN_TR1_TUPLE
556 // To avoid conditional compilation everywhere, we make it
557 // gtest-port.h's responsibility to #include the header implementing
559 #if GTEST_HAS_TR1_TUPLE
561 # if GTEST_USE_OWN_TR1_TUPLE
562 // This file was GENERATED by a script. DO NOT EDIT BY HAND!!!
564 // Copyright 2009 Google Inc.
565 // All Rights Reserved.
567 // Redistribution and use in source and binary forms, with or without
568 // modification, are permitted provided that the following conditions are
571 // * Redistributions of source code must retain the above copyright
572 // notice, this list of conditions and the following disclaimer.
573 // * Redistributions in binary form must reproduce the above
574 // copyright notice, this list of conditions and the following disclaimer
575 // in the documentation and/or other materials provided with the
577 // * Neither the name of Google Inc. nor the names of its
578 // contributors may be used to endorse or promote products derived from
579 // this software without specific prior written permission.
581 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
582 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
583 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
584 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
585 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
586 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
587 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
588 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
589 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
590 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
591 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
593 // Author: wan@google.com (Zhanyong Wan)
595 // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
597 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
598 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
600 #include <utility> // For ::std::pair.
602 // The compiler used in Symbian has a bug that prevents us from declaring the
603 // tuple template as a friend (it complains that tuple is redefined). This
604 // hack bypasses the bug by declaring the members that should otherwise be
605 // private as public.
606 // Sun Studio versions < 12 also have the above bug.
607 #if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
608 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
610 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
611 template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
615 // GTEST_n_TUPLE_(T) is the type of an n-tuple.
616 #define GTEST_0_TUPLE_(T) tuple<>
617 #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
619 #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
621 #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
623 #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
625 #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
627 #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
629 #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
631 #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
633 #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
635 #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
638 // GTEST_n_TYPENAMES_(T) declares a list of n typenames.
639 #define GTEST_0_TYPENAMES_(T)
640 #define GTEST_1_TYPENAMES_(T) typename T##0
641 #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
642 #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
643 #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
645 #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
646 typename T##3, typename T##4
647 #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
648 typename T##3, typename T##4, typename T##5
649 #define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
650 typename T##3, typename T##4, typename T##5, typename T##6
651 #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
652 typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
653 #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
654 typename T##3, typename T##4, typename T##5, typename T##6, \
655 typename T##7, typename T##8
656 #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
657 typename T##3, typename T##4, typename T##5, typename T##6, \
658 typename T##7, typename T##8, typename T##9
660 // In theory, defining stuff in the ::std namespace is undefined
661 // behavior. We can do this as we are playing the role of a standard
666 template <typename T0 = void, typename T1 = void, typename T2 = void,
667 typename T3 = void, typename T4 = void, typename T5 = void,
668 typename T6 = void, typename T7 = void, typename T8 = void,
672 // Anything in namespace gtest_internal is Google Test's INTERNAL
673 // IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
674 namespace gtest_internal {
676 // ByRef<T>::type is T if T is a reference; otherwise it's const T&.
677 template <typename T>
678 struct ByRef { typedef const T& type; }; // NOLINT
679 template <typename T>
680 struct ByRef<T&> { typedef T& type; }; // NOLINT
682 // A handy wrapper for ByRef.
683 #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
685 // AddRef<T>::type is T if T is a reference; otherwise it's T&. This
686 // is the same as tr1::add_reference<T>::type.
687 template <typename T>
688 struct AddRef { typedef T& type; }; // NOLINT
689 template <typename T>
690 struct AddRef<T&> { typedef T& type; }; // NOLINT
692 // A handy wrapper for AddRef.
693 #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
695 // A helper for implementing get<k>().
696 template <int k> class Get;
698 // A helper for implementing tuple_element<k, T>. kIndexValid is true
699 // iff k < the number of fields in tuple type T.
700 template <bool kIndexValid, int kIndex, class Tuple>
703 template <GTEST_10_TYPENAMES_(T)>
704 struct TupleElement<true, 0, GTEST_10_TUPLE_(T)> { typedef T0 type; };
706 template <GTEST_10_TYPENAMES_(T)>
707 struct TupleElement<true, 1, GTEST_10_TUPLE_(T)> { typedef T1 type; };
709 template <GTEST_10_TYPENAMES_(T)>
710 struct TupleElement<true, 2, GTEST_10_TUPLE_(T)> { typedef T2 type; };
712 template <GTEST_10_TYPENAMES_(T)>
713 struct TupleElement<true, 3, GTEST_10_TUPLE_(T)> { typedef T3 type; };
715 template <GTEST_10_TYPENAMES_(T)>
716 struct TupleElement<true, 4, GTEST_10_TUPLE_(T)> { typedef T4 type; };
718 template <GTEST_10_TYPENAMES_(T)>
719 struct TupleElement<true, 5, GTEST_10_TUPLE_(T)> { typedef T5 type; };
721 template <GTEST_10_TYPENAMES_(T)>
722 struct TupleElement<true, 6, GTEST_10_TUPLE_(T)> { typedef T6 type; };
724 template <GTEST_10_TYPENAMES_(T)>
725 struct TupleElement<true, 7, GTEST_10_TUPLE_(T)> { typedef T7 type; };
727 template <GTEST_10_TYPENAMES_(T)>
728 struct TupleElement<true, 8, GTEST_10_TUPLE_(T)> { typedef T8 type; };
730 template <GTEST_10_TYPENAMES_(T)>
731 struct TupleElement<true, 9, GTEST_10_TUPLE_(T)> { typedef T9 type; };
733 } // namespace gtest_internal
739 tuple(const tuple& /* t */) {}
740 tuple& operator=(const tuple& /* t */) { return *this; }
743 template <GTEST_1_TYPENAMES_(T)>
744 class GTEST_1_TUPLE_(T) {
746 template <int k> friend class gtest_internal::Get;
750 explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
752 tuple(const tuple& t) : f0_(t.f0_) {}
754 template <GTEST_1_TYPENAMES_(U)>
755 tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
757 tuple& operator=(const tuple& t) { return CopyFrom(t); }
759 template <GTEST_1_TYPENAMES_(U)>
760 tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
764 GTEST_DECLARE_TUPLE_AS_FRIEND_
766 template <GTEST_1_TYPENAMES_(U)>
767 tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
775 template <GTEST_2_TYPENAMES_(T)>
776 class GTEST_2_TUPLE_(T) {
778 template <int k> friend class gtest_internal::Get;
780 tuple() : f0_(), f1_() {}
782 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
785 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
787 template <GTEST_2_TYPENAMES_(U)>
788 tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
789 template <typename U0, typename U1>
790 tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
792 tuple& operator=(const tuple& t) { return CopyFrom(t); }
794 template <GTEST_2_TYPENAMES_(U)>
795 tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
798 template <typename U0, typename U1>
799 tuple& operator=(const ::std::pair<U0, U1>& p) {
805 GTEST_DECLARE_TUPLE_AS_FRIEND_
807 template <GTEST_2_TYPENAMES_(U)>
808 tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
818 template <GTEST_3_TYPENAMES_(T)>
819 class GTEST_3_TUPLE_(T) {
821 template <int k> friend class gtest_internal::Get;
823 tuple() : f0_(), f1_(), f2_() {}
825 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
826 GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
828 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
830 template <GTEST_3_TYPENAMES_(U)>
831 tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
833 tuple& operator=(const tuple& t) { return CopyFrom(t); }
835 template <GTEST_3_TYPENAMES_(U)>
836 tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
840 GTEST_DECLARE_TUPLE_AS_FRIEND_
842 template <GTEST_3_TYPENAMES_(U)>
843 tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
855 template <GTEST_4_TYPENAMES_(T)>
856 class GTEST_4_TUPLE_(T) {
858 template <int k> friend class gtest_internal::Get;
860 tuple() : f0_(), f1_(), f2_(), f3_() {}
862 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
863 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
866 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
868 template <GTEST_4_TYPENAMES_(U)>
869 tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
872 tuple& operator=(const tuple& t) { return CopyFrom(t); }
874 template <GTEST_4_TYPENAMES_(U)>
875 tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
879 GTEST_DECLARE_TUPLE_AS_FRIEND_
881 template <GTEST_4_TYPENAMES_(U)>
882 tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
896 template <GTEST_5_TYPENAMES_(T)>
897 class GTEST_5_TUPLE_(T) {
899 template <int k> friend class gtest_internal::Get;
901 tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
903 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
904 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
905 GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
907 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
910 template <GTEST_5_TYPENAMES_(U)>
911 tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
912 f3_(t.f3_), f4_(t.f4_) {}
914 tuple& operator=(const tuple& t) { return CopyFrom(t); }
916 template <GTEST_5_TYPENAMES_(U)>
917 tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
921 GTEST_DECLARE_TUPLE_AS_FRIEND_
923 template <GTEST_5_TYPENAMES_(U)>
924 tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
940 template <GTEST_6_TYPENAMES_(T)>
941 class GTEST_6_TUPLE_(T) {
943 template <int k> friend class gtest_internal::Get;
945 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
947 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
948 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
949 GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
952 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
953 f4_(t.f4_), f5_(t.f5_) {}
955 template <GTEST_6_TYPENAMES_(U)>
956 tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
957 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
959 tuple& operator=(const tuple& t) { return CopyFrom(t); }
961 template <GTEST_6_TYPENAMES_(U)>
962 tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
966 GTEST_DECLARE_TUPLE_AS_FRIEND_
968 template <GTEST_6_TYPENAMES_(U)>
969 tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
987 template <GTEST_7_TYPENAMES_(T)>
988 class GTEST_7_TUPLE_(T) {
990 template <int k> friend class gtest_internal::Get;
992 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
994 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
995 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
996 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
997 f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
999 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1000 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1002 template <GTEST_7_TYPENAMES_(U)>
1003 tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1004 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1006 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1008 template <GTEST_7_TYPENAMES_(U)>
1009 tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
1013 GTEST_DECLARE_TUPLE_AS_FRIEND_
1015 template <GTEST_7_TYPENAMES_(U)>
1016 tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
1036 template <GTEST_8_TYPENAMES_(T)>
1037 class GTEST_8_TUPLE_(T) {
1039 template <int k> friend class gtest_internal::Get;
1041 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
1043 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1044 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1045 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
1046 GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1047 f5_(f5), f6_(f6), f7_(f7) {}
1049 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1050 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1052 template <GTEST_8_TYPENAMES_(U)>
1053 tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1054 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1056 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1058 template <GTEST_8_TYPENAMES_(U)>
1059 tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
1063 GTEST_DECLARE_TUPLE_AS_FRIEND_
1065 template <GTEST_8_TYPENAMES_(U)>
1066 tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
1088 template <GTEST_9_TYPENAMES_(T)>
1089 class GTEST_9_TUPLE_(T) {
1091 template <int k> friend class gtest_internal::Get;
1093 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
1095 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1096 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1097 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1098 GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1099 f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
1101 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1102 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1104 template <GTEST_9_TYPENAMES_(U)>
1105 tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1106 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1108 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1110 template <GTEST_9_TYPENAMES_(U)>
1111 tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
1115 GTEST_DECLARE_TUPLE_AS_FRIEND_
1117 template <GTEST_9_TYPENAMES_(U)>
1118 tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
1142 template <GTEST_10_TYPENAMES_(T)>
1145 template <int k> friend class gtest_internal::Get;
1147 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
1150 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1151 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1152 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1153 GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
1154 f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
1156 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1157 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
1159 template <GTEST_10_TYPENAMES_(U)>
1160 tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1161 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
1164 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1166 template <GTEST_10_TYPENAMES_(U)>
1167 tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
1171 GTEST_DECLARE_TUPLE_AS_FRIEND_
1173 template <GTEST_10_TYPENAMES_(U)>
1174 tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
1200 // 6.1.3.2 Tuple creation functions.
1202 // Known limitations: we don't support passing an
1203 // std::tr1::reference_wrapper<T> to make_tuple(). And we don't
1206 inline tuple<> make_tuple() { return tuple<>(); }
1208 template <GTEST_1_TYPENAMES_(T)>
1209 inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
1210 return GTEST_1_TUPLE_(T)(f0);
1213 template <GTEST_2_TYPENAMES_(T)>
1214 inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
1215 return GTEST_2_TUPLE_(T)(f0, f1);
1218 template <GTEST_3_TYPENAMES_(T)>
1219 inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
1220 return GTEST_3_TUPLE_(T)(f0, f1, f2);
1223 template <GTEST_4_TYPENAMES_(T)>
1224 inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1226 return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
1229 template <GTEST_5_TYPENAMES_(T)>
1230 inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1231 const T3& f3, const T4& f4) {
1232 return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
1235 template <GTEST_6_TYPENAMES_(T)>
1236 inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1237 const T3& f3, const T4& f4, const T5& f5) {
1238 return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
1241 template <GTEST_7_TYPENAMES_(T)>
1242 inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1243 const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
1244 return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
1247 template <GTEST_8_TYPENAMES_(T)>
1248 inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1249 const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
1250 return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
1253 template <GTEST_9_TYPENAMES_(T)>
1254 inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1255 const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1257 return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
1260 template <GTEST_10_TYPENAMES_(T)>
1261 inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1262 const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1263 const T8& f8, const T9& f9) {
1264 return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
1267 // 6.1.3.3 Tuple helper classes.
1269 template <typename Tuple> struct tuple_size;
1271 template <GTEST_0_TYPENAMES_(T)>
1272 struct tuple_size<GTEST_0_TUPLE_(T)> { static const int value = 0; };
1274 template <GTEST_1_TYPENAMES_(T)>
1275 struct tuple_size<GTEST_1_TUPLE_(T)> { static const int value = 1; };
1277 template <GTEST_2_TYPENAMES_(T)>
1278 struct tuple_size<GTEST_2_TUPLE_(T)> { static const int value = 2; };
1280 template <GTEST_3_TYPENAMES_(T)>
1281 struct tuple_size<GTEST_3_TUPLE_(T)> { static const int value = 3; };
1283 template <GTEST_4_TYPENAMES_(T)>
1284 struct tuple_size<GTEST_4_TUPLE_(T)> { static const int value = 4; };
1286 template <GTEST_5_TYPENAMES_(T)>
1287 struct tuple_size<GTEST_5_TUPLE_(T)> { static const int value = 5; };
1289 template <GTEST_6_TYPENAMES_(T)>
1290 struct tuple_size<GTEST_6_TUPLE_(T)> { static const int value = 6; };
1292 template <GTEST_7_TYPENAMES_(T)>
1293 struct tuple_size<GTEST_7_TUPLE_(T)> { static const int value = 7; };
1295 template <GTEST_8_TYPENAMES_(T)>
1296 struct tuple_size<GTEST_8_TUPLE_(T)> { static const int value = 8; };
1298 template <GTEST_9_TYPENAMES_(T)>
1299 struct tuple_size<GTEST_9_TUPLE_(T)> { static const int value = 9; };
1301 template <GTEST_10_TYPENAMES_(T)>
1302 struct tuple_size<GTEST_10_TUPLE_(T)> { static const int value = 10; };
1304 template <int k, class Tuple>
1305 struct tuple_element {
1306 typedef typename gtest_internal::TupleElement<
1307 k < (tuple_size<Tuple>::value), k, Tuple>::type type;
1310 #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
1312 // 6.1.3.4 Element access.
1314 namespace gtest_internal {
1319 template <class Tuple>
1320 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1321 Field(Tuple& t) { return t.f0_; } // NOLINT
1323 template <class Tuple>
1324 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1325 ConstField(const Tuple& t) { return t.f0_; }
1331 template <class Tuple>
1332 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1333 Field(Tuple& t) { return t.f1_; } // NOLINT
1335 template <class Tuple>
1336 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1337 ConstField(const Tuple& t) { return t.f1_; }
1343 template <class Tuple>
1344 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1345 Field(Tuple& t) { return t.f2_; } // NOLINT
1347 template <class Tuple>
1348 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1349 ConstField(const Tuple& t) { return t.f2_; }
1355 template <class Tuple>
1356 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1357 Field(Tuple& t) { return t.f3_; } // NOLINT
1359 template <class Tuple>
1360 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1361 ConstField(const Tuple& t) { return t.f3_; }
1367 template <class Tuple>
1368 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1369 Field(Tuple& t) { return t.f4_; } // NOLINT
1371 template <class Tuple>
1372 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1373 ConstField(const Tuple& t) { return t.f4_; }
1379 template <class Tuple>
1380 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1381 Field(Tuple& t) { return t.f5_; } // NOLINT
1383 template <class Tuple>
1384 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1385 ConstField(const Tuple& t) { return t.f5_; }
1391 template <class Tuple>
1392 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1393 Field(Tuple& t) { return t.f6_; } // NOLINT
1395 template <class Tuple>
1396 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1397 ConstField(const Tuple& t) { return t.f6_; }
1403 template <class Tuple>
1404 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1405 Field(Tuple& t) { return t.f7_; } // NOLINT
1407 template <class Tuple>
1408 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1409 ConstField(const Tuple& t) { return t.f7_; }
1415 template <class Tuple>
1416 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1417 Field(Tuple& t) { return t.f8_; } // NOLINT
1419 template <class Tuple>
1420 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1421 ConstField(const Tuple& t) { return t.f8_; }
1427 template <class Tuple>
1428 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1429 Field(Tuple& t) { return t.f9_; } // NOLINT
1431 template <class Tuple>
1432 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1433 ConstField(const Tuple& t) { return t.f9_; }
1436 } // namespace gtest_internal
1438 template <int k, GTEST_10_TYPENAMES_(T)>
1439 GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
1440 get(GTEST_10_TUPLE_(T)& t) {
1441 return gtest_internal::Get<k>::Field(t);
1444 template <int k, GTEST_10_TYPENAMES_(T)>
1445 GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
1446 get(const GTEST_10_TUPLE_(T)& t) {
1447 return gtest_internal::Get<k>::ConstField(t);
1450 // 6.1.3.5 Relational operators
1452 // We only implement == and !=, as we don't have a need for the rest yet.
1454 namespace gtest_internal {
1456 // SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
1457 // first k fields of t1 equals the first k fields of t2.
1458 // SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
1460 template <int kSize1, int kSize2>
1461 struct SameSizeTuplePrefixComparator;
1464 struct SameSizeTuplePrefixComparator<0, 0> {
1465 template <class Tuple1, class Tuple2>
1466 static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
1472 struct SameSizeTuplePrefixComparator<k, k> {
1473 template <class Tuple1, class Tuple2>
1474 static bool Eq(const Tuple1& t1, const Tuple2& t2) {
1475 return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
1476 ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
1480 } // namespace gtest_internal
1482 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1483 inline bool operator==(const GTEST_10_TUPLE_(T)& t,
1484 const GTEST_10_TUPLE_(U)& u) {
1485 return gtest_internal::SameSizeTuplePrefixComparator<
1486 tuple_size<GTEST_10_TUPLE_(T)>::value,
1487 tuple_size<GTEST_10_TUPLE_(U)>::value>::Eq(t, u);
1490 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1491 inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
1492 const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
1500 #undef GTEST_0_TUPLE_
1501 #undef GTEST_1_TUPLE_
1502 #undef GTEST_2_TUPLE_
1503 #undef GTEST_3_TUPLE_
1504 #undef GTEST_4_TUPLE_
1505 #undef GTEST_5_TUPLE_
1506 #undef GTEST_6_TUPLE_
1507 #undef GTEST_7_TUPLE_
1508 #undef GTEST_8_TUPLE_
1509 #undef GTEST_9_TUPLE_
1510 #undef GTEST_10_TUPLE_
1512 #undef GTEST_0_TYPENAMES_
1513 #undef GTEST_1_TYPENAMES_
1514 #undef GTEST_2_TYPENAMES_
1515 #undef GTEST_3_TYPENAMES_
1516 #undef GTEST_4_TYPENAMES_
1517 #undef GTEST_5_TYPENAMES_
1518 #undef GTEST_6_TYPENAMES_
1519 #undef GTEST_7_TYPENAMES_
1520 #undef GTEST_8_TYPENAMES_
1521 #undef GTEST_9_TYPENAMES_
1522 #undef GTEST_10_TYPENAMES_
1524 #undef GTEST_DECLARE_TUPLE_AS_FRIEND_
1525 #undef GTEST_BY_REF_
1526 #undef GTEST_ADD_REF_
1527 #undef GTEST_TUPLE_ELEMENT_
1529 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
1530 # elif GTEST_OS_SYMBIAN
1532 // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
1533 // use STLport's tuple implementation, which unfortunately doesn't
1534 // work as the copy of STLport distributed with Symbian is incomplete.
1535 // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
1536 // use its own tuple implementation.
1537 # ifdef BOOST_HAS_TR1_TUPLE
1538 # undef BOOST_HAS_TR1_TUPLE
1539 # endif // BOOST_HAS_TR1_TUPLE
1541 // This prevents <boost/tr1/detail/config.hpp>, which defines
1542 // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
1543 # define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
1546 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
1547 // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
1548 // not conform to the TR1 spec, which requires the header to be <tuple>.
1550 # if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
1551 // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
1552 // which is #included by <tr1/tuple>, to not compile when RTTI is
1553 // disabled. _TR1_FUNCTIONAL is the header guard for
1554 // <tr1/functional>. Hence the following #define is a hack to prevent
1555 // <tr1/functional> from being included.
1556 # define _TR1_FUNCTIONAL 1
1557 # include <tr1/tuple>
1558 # undef _TR1_FUNCTIONAL // Allows the user to #include
1559 // <tr1/functional> if he chooses to.
1561 # include <tr1/tuple> // NOLINT
1562 # endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
1565 // If the compiler is not GCC 4.0+, we assume the user is using a
1566 // spec-conforming TR1 implementation.
1567 # include <tuple> // NOLINT
1568 # endif // GTEST_USE_OWN_TR1_TUPLE
1570 #endif // GTEST_HAS_TR1_TUPLE
1572 // Determines whether clone(2) is supported.
1573 // Usually it will only be available on Linux, excluding
1574 // Linux on the Itanium architecture.
1575 // Also see http://linux.die.net/man/2/clone.
1576 #ifndef GTEST_HAS_CLONE
1577 // The user didn't tell us, so we need to figure it out.
1579 # if GTEST_OS_LINUX && !defined(__ia64__)
1580 # define GTEST_HAS_CLONE 1
1582 # define GTEST_HAS_CLONE 0
1583 # endif // GTEST_OS_LINUX && !defined(__ia64__)
1585 #endif // GTEST_HAS_CLONE
1587 // Determines whether to support stream redirection. This is used to test
1588 // output correctness and to implement death tests.
1589 #ifndef GTEST_HAS_STREAM_REDIRECTION
1590 // By default, we assume that stream redirection is supported on all
1591 // platforms except known mobile ones.
1592 # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN
1593 # define GTEST_HAS_STREAM_REDIRECTION 0
1595 # define GTEST_HAS_STREAM_REDIRECTION 1
1596 # endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
1597 #endif // GTEST_HAS_STREAM_REDIRECTION
1599 // Determines whether to support death tests.
1600 // Google Test does not support death tests for VC 7.1 and earlier as
1601 // abort() in a VC 7.1 application compiled as GUI in debug config
1602 // pops up a dialog window that cannot be suppressed programmatically.
1603 #if (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
1604 (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
1605 GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX)
1606 # define GTEST_HAS_DEATH_TEST 1
1607 # include <vector> // NOLINT
1610 // We don't support MSVC 7.1 with exceptions disabled now. Therefore
1611 // all the compilers we care about are adequate for supporting
1612 // value-parameterized tests.
1613 #define GTEST_HAS_PARAM_TEST 1
1615 // Determines whether to support type-driven tests.
1617 // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
1618 // Sun Pro CC, IBM Visual Age, and HP aCC support.
1619 #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
1620 defined(__IBMCPP__) || defined(__HP_aCC)
1621 # define GTEST_HAS_TYPED_TEST 1
1622 # define GTEST_HAS_TYPED_TEST_P 1
1625 // Determines whether to support Combine(). This only makes sense when
1626 // value-parameterized tests are enabled. The implementation doesn't
1627 // work on Sun Studio since it doesn't understand templated conversion
1629 #if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
1630 # define GTEST_HAS_COMBINE 1
1633 // Determines whether the system compiler uses UTF-16 for encoding wide strings.
1634 #define GTEST_WIDE_STRING_USES_UTF16_ \
1635 (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
1637 // Determines whether test results can be streamed to a socket.
1639 # define GTEST_CAN_STREAM_RESULTS_ 1
1642 // Defines some utility macros.
1644 // The GNU compiler emits a warning if nested "if" statements are followed by
1645 // an "else" statement and braces are not used to explicitly disambiguate the
1646 // "else" binding. This leads to problems with code like:
1649 // ASSERT_*(condition) << "Some message";
1651 // The "switch (0) case 0:" idiom is used to suppress this.
1652 #ifdef __INTEL_COMPILER
1653 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_
1655 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT
1658 // Use this annotation at the end of a struct/class definition to
1659 // prevent the compiler from optimizing away instances that are never
1660 // used. This is useful when all interesting logic happens inside the
1661 // c'tor and / or d'tor. Example:
1665 // } GTEST_ATTRIBUTE_UNUSED_;
1667 // Also use it after a variable or parameter declaration to tell the
1668 // compiler the variable/parameter does not have to be used.
1669 #if defined(__GNUC__) && !defined(COMPILER_ICC)
1670 # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
1672 # define GTEST_ATTRIBUTE_UNUSED_
1675 // A macro to disallow operator=
1676 // This should be used in the private: declarations for a class.
1677 #define GTEST_DISALLOW_ASSIGN_(type)\
1678 void operator=(type const &)
1680 // A macro to disallow copy constructor and operator=
1681 // This should be used in the private: declarations for a class.
1682 #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
1683 type(type const &);\
1684 GTEST_DISALLOW_ASSIGN_(type)
1686 // Tell the compiler to warn about unused return values for functions declared
1687 // with this macro. The macro should be used on function declarations
1688 // following the argument list:
1690 // Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
1691 #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
1692 # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
1694 # define GTEST_MUST_USE_RESULT_
1695 #endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
1697 // Determine whether the compiler supports Microsoft's Structured Exception
1698 // Handling. This is supported by several Windows compilers but generally
1699 // does not exist on any other system.
1700 #ifndef GTEST_HAS_SEH
1701 // The user didn't tell us, so we need to figure it out.
1703 # if defined(_MSC_VER) || defined(__BORLANDC__)
1704 // These two compilers are known to support SEH.
1705 # define GTEST_HAS_SEH 1
1708 # define GTEST_HAS_SEH 0
1711 #endif // GTEST_HAS_SEH
1715 # if GTEST_LINKED_AS_SHARED_LIBRARY
1716 # define GTEST_API_ __declspec(dllimport)
1717 # elif GTEST_CREATE_SHARED_LIBRARY
1718 # define GTEST_API_ __declspec(dllexport)
1728 // Ask the compiler to never inline a given function.
1729 # define GTEST_NO_INLINE_ __attribute__((noinline))
1731 # define GTEST_NO_INLINE_
1738 namespace internal {
1742 // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
1743 // expression is true. For example, you could use it to verify the
1744 // size of a static array:
1746 // GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
1747 // content_type_names_incorrect_size);
1749 // or to make sure a struct is smaller than a certain size:
1751 // GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
1753 // The second argument to the macro is the name of the variable. If
1754 // the expression is false, most compilers will issue a warning/error
1755 // containing the name of the variable.
1758 struct CompileAssert {
1761 #define GTEST_COMPILE_ASSERT_(expr, msg) \
1762 typedef ::testing::internal::CompileAssert<(bool(expr))> \
1763 msg[bool(expr) ? 1 : -1]
1765 // Implementation details of GTEST_COMPILE_ASSERT_:
1767 // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
1768 // elements (and thus is invalid) when the expression is false.
1770 // - The simpler definition
1772 // #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
1774 // does not work, as gcc supports variable-length arrays whose sizes
1775 // are determined at run-time (this is gcc's extension and not part
1776 // of the C++ standard). As a result, gcc fails to reject the
1777 // following code with the simple definition:
1780 // GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
1781 // // not a compile-time constant.
1783 // - By using the type CompileAssert<(bool(expr))>, we ensures that
1784 // expr is a compile-time constant. (Template arguments must be
1785 // determined at compile-time.)
1787 // - The outter parentheses in CompileAssert<(bool(expr))> are necessary
1788 // to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
1790 // CompileAssert<bool(expr)>
1792 // instead, these compilers will refuse to compile
1794 // GTEST_COMPILE_ASSERT_(5 > 0, some_message);
1796 // (They seem to think the ">" in "5 > 0" marks the end of the
1797 // template argument list.)
1799 // - The array size is (bool(expr) ? 1 : -1), instead of simply
1801 // ((expr) ? 1 : -1).
1803 // This is to avoid running into a bug in MS VC 7.1, which
1804 // causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
1806 // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
1808 // This template is declared, but intentionally undefined.
1809 template <typename T1, typename T2>
1810 struct StaticAssertTypeEqHelper;
1812 template <typename T>
1813 struct StaticAssertTypeEqHelper<T, T> {};
1815 #if GTEST_HAS_GLOBAL_STRING
1816 typedef ::string string;
1818 typedef ::std::string string;
1819 #endif // GTEST_HAS_GLOBAL_STRING
1821 #if GTEST_HAS_GLOBAL_WSTRING
1822 typedef ::wstring wstring;
1823 #elif GTEST_HAS_STD_WSTRING
1824 typedef ::std::wstring wstring;
1825 #endif // GTEST_HAS_GLOBAL_WSTRING
1827 // A helper for suppressing warnings on constant condition. It just
1828 // returns 'condition'.
1829 GTEST_API_ bool IsTrue(bool condition);
1831 // Defines scoped_ptr.
1833 // This implementation of scoped_ptr is PARTIAL - it only contains
1834 // enough stuff to satisfy Google Test's need.
1835 template <typename T>
1838 typedef T element_type;
1840 explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
1841 ~scoped_ptr() { reset(); }
1843 T& operator*() const { return *ptr_; }
1844 T* operator->() const { return ptr_; }
1845 T* get() const { return ptr_; }
1848 T* const ptr = ptr_;
1853 void reset(T* p = NULL) {
1855 if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
1864 GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
1869 // A simple C++ wrapper for <regex.h>. It uses the POSIX Extended
1870 // Regular Expression syntax.
1871 class GTEST_API_ RE {
1873 // A copy constructor is required by the Standard to initialize object
1874 // references from r-values.
1875 RE(const RE& other) { Init(other.pattern()); }
1877 // Constructs an RE from a string.
1878 RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT
1880 #if GTEST_HAS_GLOBAL_STRING
1882 RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT
1884 #endif // GTEST_HAS_GLOBAL_STRING
1886 RE(const char* regex) { Init(regex); } // NOLINT
1889 // Returns the string representation of the regex.
1890 const char* pattern() const { return pattern_; }
1892 // FullMatch(str, re) returns true iff regular expression re matches
1894 // PartialMatch(str, re) returns true iff regular expression re
1895 // matches a substring of str (including str itself).
1897 // TODO(wan@google.com): make FullMatch() and PartialMatch() work
1898 // when str contains NUL characters.
1899 static bool FullMatch(const ::std::string& str, const RE& re) {
1900 return FullMatch(str.c_str(), re);
1902 static bool PartialMatch(const ::std::string& str, const RE& re) {
1903 return PartialMatch(str.c_str(), re);
1906 #if GTEST_HAS_GLOBAL_STRING
1908 static bool FullMatch(const ::string& str, const RE& re) {
1909 return FullMatch(str.c_str(), re);
1911 static bool PartialMatch(const ::string& str, const RE& re) {
1912 return PartialMatch(str.c_str(), re);
1915 #endif // GTEST_HAS_GLOBAL_STRING
1917 static bool FullMatch(const char* str, const RE& re);
1918 static bool PartialMatch(const char* str, const RE& re);
1921 void Init(const char* regex);
1923 // We use a const char* instead of a string, as Google Test may be used
1924 // where string is not available. We also do not use Google Test's own
1925 // String type here, in order to simplify dependencies between the
1927 const char* pattern_;
1930 #if GTEST_USES_POSIX_RE
1932 regex_t full_regex_; // For FullMatch().
1933 regex_t partial_regex_; // For PartialMatch().
1935 #else // GTEST_USES_SIMPLE_RE
1937 const char* full_pattern_; // For FullMatch();
1941 GTEST_DISALLOW_ASSIGN_(RE);
1944 // Formats a source file path and a line number as they would appear
1945 // in an error message from the compiler used to compile this code.
1946 GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
1948 // Formats a file location for compiler-independent XML output.
1949 // Although this function is not platform dependent, we put it next to
1950 // FormatFileLocation in order to contrast the two functions.
1951 GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
1954 // Defines logging utilities:
1955 // GTEST_LOG_(severity) - logs messages at the specified severity level. The
1956 // message itself is streamed into the macro.
1957 // LogToStderr() - directs all log messages to stderr.
1958 // FlushInfoLog() - flushes informational log messages.
1960 enum GTestLogSeverity {
1967 // Formats log entry severity, provides a stream object for streaming the
1968 // log message, and terminates the message with a newline when going out of
1970 class GTEST_API_ GTestLog {
1972 GTestLog(GTestLogSeverity severity, const char* file, int line);
1974 // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
1977 ::std::ostream& GetStream() { return ::std::cerr; }
1980 const GTestLogSeverity severity_;
1982 GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
1985 #define GTEST_LOG_(severity) \
1986 ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
1987 __FILE__, __LINE__).GetStream()
1989 inline void LogToStderr() {}
1990 inline void FlushInfoLog() { fflush(NULL); }
1992 // INTERNAL IMPLEMENTATION - DO NOT USE.
1994 // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
1995 // is not satisfied.
1997 // GTEST_CHECK_(boolean_condition);
1999 // GTEST_CHECK_(boolean_condition) << "Additional message";
2001 // This checks the condition and if the condition is not satisfied
2002 // it prints message about the condition violation, including the
2003 // condition itself, plus additional message streamed into it, if any,
2004 // and then it aborts the program. It aborts the program irrespective of
2005 // whether it is built in the debug mode or not.
2006 #define GTEST_CHECK_(condition) \
2007 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
2008 if (::testing::internal::IsTrue(condition)) \
2011 GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
2013 // An all-mode assert to verify that the given POSIX-style function
2014 // call returns 0 (indicating success). Known limitation: this
2015 // doesn't expand to a balanced 'if' statement, so enclose the macro
2016 // in {} if you need to use it as the only statement in an 'if'
2018 #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
2019 if (const int gtest_error = (posix_call)) \
2020 GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
2023 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
2025 // Use ImplicitCast_ as a safe version of static_cast for upcasting in
2026 // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
2027 // const Foo*). When you use ImplicitCast_, the compiler checks that
2028 // the cast is safe. Such explicit ImplicitCast_s are necessary in
2029 // surprisingly many situations where C++ demands an exact type match
2030 // instead of an argument type convertable to a target type.
2032 // The syntax for using ImplicitCast_ is the same as for static_cast:
2034 // ImplicitCast_<ToType>(expr)
2036 // ImplicitCast_ would have been part of the C++ standard library,
2037 // but the proposal was submitted too late. It will probably make
2038 // its way into the language in the future.
2040 // This relatively ugly name is intentional. It prevents clashes with
2041 // similar functions users may have (e.g., implicit_cast). The internal
2042 // namespace alone is not enough because the function can be found by ADL.
2043 template<typename To>
2044 inline To ImplicitCast_(To x) { return x; }
2046 // When you upcast (that is, cast a pointer from type Foo to type
2047 // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
2048 // always succeed. When you downcast (that is, cast a pointer from
2049 // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
2050 // how do you know the pointer is really of type SubclassOfFoo? It
2051 // could be a bare Foo, or of type DifferentSubclassOfFoo. Thus,
2052 // when you downcast, you should use this macro. In debug mode, we
2053 // use dynamic_cast<> to double-check the downcast is legal (we die
2054 // if it's not). In normal mode, we do the efficient static_cast<>
2055 // instead. Thus, it's important to test in debug mode to make sure
2056 // the cast is legal!
2057 // This is the only place in the code we should use dynamic_cast<>.
2058 // In particular, you SHOULDN'T be using dynamic_cast<> in order to
2059 // do RTTI (eg code like this:
2060 // if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
2061 // if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
2062 // You should design the code some other way not to need this.
2064 // This relatively ugly name is intentional. It prevents clashes with
2065 // similar functions users may have (e.g., down_cast). The internal
2066 // namespace alone is not enough because the function can be found by ADL.
2067 template<typename To, typename From> // use like this: DownCast_<T*>(foo);
2068 inline To DownCast_(From* f) { // so we only accept pointers
2069 // Ensures that To is a sub-type of From *. This test is here only
2070 // for compile-time type checking, and has no overhead in an
2071 // optimized build at run-time, as it will be optimized away
2075 ::testing::internal::ImplicitCast_<From*>(to);
2079 // RTTI: debug mode only!
2080 GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
2082 return static_cast<To>(f);
2085 // Downcasts the pointer of type Base to Derived.
2086 // Derived must be a subclass of Base. The parameter MUST
2087 // point to a class of type Derived, not any subclass of it.
2088 // When RTTI is available, the function performs a runtime
2089 // check to enforce this.
2090 template <class Derived, class Base>
2091 Derived* CheckedDowncastToActualType(Base* base) {
2093 GTEST_CHECK_(typeid(*base) == typeid(Derived));
2094 return dynamic_cast<Derived*>(base); // NOLINT
2096 return static_cast<Derived*>(base); // Poor man's downcast.
2100 #if GTEST_HAS_STREAM_REDIRECTION
2102 // Defines the stderr capturer:
2103 // CaptureStdout - starts capturing stdout.
2104 // GetCapturedStdout - stops capturing stdout and returns the captured string.
2105 // CaptureStderr - starts capturing stderr.
2106 // GetCapturedStderr - stops capturing stderr and returns the captured string.
2108 GTEST_API_ void CaptureStdout();
2109 GTEST_API_ String GetCapturedStdout();
2110 GTEST_API_ void CaptureStderr();
2111 GTEST_API_ String GetCapturedStderr();
2113 #endif // GTEST_HAS_STREAM_REDIRECTION
2116 #if GTEST_HAS_DEATH_TEST
2118 // A copy of all command line arguments. Set by InitGoogleTest().
2119 extern ::std::vector<String> g_argvs;
2121 // GTEST_HAS_DEATH_TEST implies we have ::std::string.
2122 const ::std::vector<String>& GetArgvs();
2124 #endif // GTEST_HAS_DEATH_TEST
2126 // Defines synchronization primitives.
2128 #if GTEST_HAS_PTHREAD
2130 // Sleeps for (roughly) n milli-seconds. This function is only for
2131 // testing Google Test's own constructs. Don't use it in user tests,
2132 // either directly or indirectly.
2133 inline void SleepMilliseconds(int n) {
2134 const timespec time = {
2136 n * 1000L * 1000L, // And n ms.
2138 nanosleep(&time, NULL);
2141 // Allows a controller thread to pause execution of newly created
2142 // threads until notified. Instances of this class must be created
2143 // and destroyed in the controller thread.
2145 // This class is only for testing Google Test's own constructs. Do not
2146 // use it in user tests, either directly or indirectly.
2147 class Notification {
2149 Notification() : notified_(false) {}
2151 // Notifies all threads created with this notification to start. Must
2152 // be called from the controller thread.
2153 void Notify() { notified_ = true; }
2155 // Blocks until the controller thread notifies. Must be called from a test
2157 void WaitForNotification() {
2159 SleepMilliseconds(10);
2164 volatile bool notified_;
2166 GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
2169 // As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
2170 // Consequently, it cannot select a correct instantiation of ThreadWithParam
2171 // in order to call its Run(). Introducing ThreadWithParamBase as a
2172 // non-templated base class for ThreadWithParam allows us to bypass this
2174 class ThreadWithParamBase {
2176 virtual ~ThreadWithParamBase() {}
2177 virtual void Run() = 0;
2180 // pthread_create() accepts a pointer to a function type with the C linkage.
2181 // According to the Standard (7.5/1), function types with different linkages
2182 // are different even if they are otherwise identical. Some compilers (for
2183 // example, SunStudio) treat them as different types. Since class methods
2184 // cannot be defined with C-linkage we need to define a free C-function to
2185 // pass into pthread_create().
2186 extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
2187 static_cast<ThreadWithParamBase*>(thread)->Run();
2191 // Helper class for testing Google Test's multi-threading constructs.
2192 // To use it, write:
2194 // void ThreadFunc(int param) { /* Do things with param */ }
2195 // Notification thread_can_start;
2197 // // The thread_can_start parameter is optional; you can supply NULL.
2198 // ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
2199 // thread_can_start.Notify();
2201 // These classes are only for testing Google Test's own constructs. Do
2202 // not use them in user tests, either directly or indirectly.
2203 template <typename T>
2204 class ThreadWithParam : public ThreadWithParamBase {
2206 typedef void (*UserThreadFunc)(T);
2209 UserThreadFunc func, T param, Notification* thread_can_start)
2212 thread_can_start_(thread_can_start),
2214 ThreadWithParamBase* const base = this;
2215 // The thread can be created only after all fields except thread_
2216 // have been initialized.
2217 GTEST_CHECK_POSIX_SUCCESS_(
2218 pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
2220 ~ThreadWithParam() { Join(); }
2224 GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
2229 virtual void Run() {
2230 if (thread_can_start_ != NULL)
2231 thread_can_start_->WaitForNotification();
2236 const UserThreadFunc func_; // User-supplied thread function.
2237 const T param_; // User-supplied parameter to the thread function.
2238 // When non-NULL, used to block execution until the controller thread
2240 Notification* const thread_can_start_;
2241 bool finished_; // true iff we know that the thread function has finished.
2242 pthread_t thread_; // The native thread object.
2244 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
2247 // MutexBase and Mutex implement mutex on pthreads-based platforms. They
2248 // are used in conjunction with class MutexLock:
2252 // MutexLock lock(&mutex); // Acquires the mutex and releases it at the end
2253 // // of the current scope.
2255 // MutexBase implements behavior for both statically and dynamically
2256 // allocated mutexes. Do not use MutexBase directly. Instead, write
2257 // the following to define a static mutex:
2259 // GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
2261 // You can forward declare a static mutex like this:
2263 // GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
2265 // To create a dynamic mutex, just define an object of type Mutex.
2268 // Acquires this mutex.
2270 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
2271 owner_ = pthread_self();
2274 // Releases this mutex.
2276 // We don't protect writing to owner_ here, as it's the caller's
2277 // responsibility to ensure that the current thread holds the
2278 // mutex when this is called.
2280 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
2283 // Does nothing if the current thread holds the mutex. Otherwise, crashes
2284 // with high probability.
2285 void AssertHeld() const {
2286 GTEST_CHECK_(owner_ == pthread_self())
2287 << "The current thread is not holding the mutex @" << this;
2290 // A static mutex may be used before main() is entered. It may even
2291 // be used before the dynamic initialization stage. Therefore we
2292 // must be able to initialize a static mutex object at link time.
2293 // This means MutexBase has to be a POD and its member variables
2294 // have to be public.
2296 pthread_mutex_t mutex_; // The underlying pthread mutex.
2297 pthread_t owner_; // The thread holding the mutex; 0 means no one holds it.
2300 // Forward-declares a static mutex.
2301 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
2302 extern ::testing::internal::MutexBase mutex
2304 // Defines and statically (i.e. at link time) initializes a static mutex.
2305 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
2306 ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, 0 }
2308 // The Mutex class can only be used for mutexes created at runtime. It
2309 // shares its API with MutexBase otherwise.
2310 class Mutex : public MutexBase {
2313 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
2317 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
2321 GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
2324 // We cannot name this class MutexLock as the ctor declaration would
2325 // conflict with a macro named MutexLock, which is defined on some
2326 // platforms. Hence the typedef trick below.
2327 class GTestMutexLock {
2329 explicit GTestMutexLock(MutexBase* mutex)
2330 : mutex_(mutex) { mutex_->Lock(); }
2332 ~GTestMutexLock() { mutex_->Unlock(); }
2335 MutexBase* const mutex_;
2337 GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
2340 typedef GTestMutexLock MutexLock;
2342 // Helpers for ThreadLocal.
2344 // pthread_key_create() requires DeleteThreadLocalValue() to have
2345 // C-linkage. Therefore it cannot be templatized to access
2346 // ThreadLocal<T>. Hence the need for class
2347 // ThreadLocalValueHolderBase.
2348 class ThreadLocalValueHolderBase {
2350 virtual ~ThreadLocalValueHolderBase() {}
2353 // Called by pthread to delete thread-local data stored by
2354 // pthread_setspecific().
2355 extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
2356 delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
2359 // Implements thread-local storage on pthreads-based systems.
2362 // ThreadLocal<int> tl(100); // 100 is the default value for each thread.
2365 // tl.set(150); // Changes the value for thread 2 only.
2366 // EXPECT_EQ(150, tl.get());
2369 // EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value.
2371 // EXPECT_EQ(200, tl.get());
2373 // The template type argument T must have a public copy constructor.
2374 // In addition, the default ThreadLocal constructor requires T to have
2375 // a public default constructor.
2377 // An object managed for a thread by a ThreadLocal instance is deleted
2378 // when the thread exits. Or, if the ThreadLocal instance dies in
2379 // that thread, when the ThreadLocal dies. It's the user's
2380 // responsibility to ensure that all other threads using a ThreadLocal
2381 // have exited when it dies, or the per-thread objects for those
2382 // threads will not be deleted.
2384 // Google Test only uses global ThreadLocal objects. That means they
2385 // will die after main() has returned. Therefore, no per-thread
2386 // object managed by Google Test will be leaked as long as all threads
2387 // using Google Test have exited when main() returns.
2388 template <typename T>
2391 ThreadLocal() : key_(CreateKey()),
2393 explicit ThreadLocal(const T& value) : key_(CreateKey()),
2397 // Destroys the managed object for the current thread, if any.
2398 DeleteThreadLocalValue(pthread_getspecific(key_));
2400 // Releases resources associated with the key. This will *not*
2401 // delete managed objects for other threads.
2402 GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
2405 T* pointer() { return GetOrCreateValue(); }
2406 const T* pointer() const { return GetOrCreateValue(); }
2407 const T& get() const { return *pointer(); }
2408 void set(const T& value) { *pointer() = value; }
2411 // Holds a value of type T.
2412 class ValueHolder : public ThreadLocalValueHolderBase {
2414 explicit ValueHolder(const T& value) : value_(value) {}
2416 T* pointer() { return &value_; }
2420 GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
2423 static pthread_key_t CreateKey() {
2425 // When a thread exits, DeleteThreadLocalValue() will be called on
2426 // the object managed for that thread.
2427 GTEST_CHECK_POSIX_SUCCESS_(
2428 pthread_key_create(&key, &DeleteThreadLocalValue));
2432 T* GetOrCreateValue() const {
2433 ThreadLocalValueHolderBase* const holder =
2434 static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
2435 if (holder != NULL) {
2436 return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
2439 ValueHolder* const new_holder = new ValueHolder(default_);
2440 ThreadLocalValueHolderBase* const holder_base = new_holder;
2441 GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
2442 return new_holder->pointer();
2445 // A key pthreads uses for looking up per-thread values.
2446 const pthread_key_t key_;
2447 const T default_; // The default value for each thread.
2449 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
2452 # define GTEST_IS_THREADSAFE 1
2454 #else // GTEST_HAS_PTHREAD
2456 // A dummy implementation of synchronization primitives (mutex, lock,
2457 // and thread-local variable). Necessary for compiling Google Test where
2458 // mutex is not supported - using Google Test in multiple threads is not
2459 // supported on such platforms.
2464 void AssertHeld() const {}
2467 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
2468 extern ::testing::internal::Mutex mutex
2470 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
2472 class GTestMutexLock {
2474 explicit GTestMutexLock(Mutex*) {} // NOLINT
2477 typedef GTestMutexLock MutexLock;
2479 template <typename T>
2482 ThreadLocal() : value_() {}
2483 explicit ThreadLocal(const T& value) : value_(value) {}
2484 T* pointer() { return &value_; }
2485 const T* pointer() const { return &value_; }
2486 const T& get() const { return value_; }
2487 void set(const T& value) { value_ = value; }
2492 // The above synchronization primitives have dummy implementations.
2493 // Therefore Google Test is not thread-safe.
2494 # define GTEST_IS_THREADSAFE 0
2496 #endif // GTEST_HAS_PTHREAD
2498 // Returns the number of threads running in the process, or 0 to indicate that
2499 // we cannot detect it.
2500 GTEST_API_ size_t GetThreadCount();
2502 // Passing non-POD classes through ellipsis (...) crashes the ARM
2503 // compiler and generates a warning in Sun Studio. The Nokia Symbian
2504 // and the IBM XL C/C++ compiler try to instantiate a copy constructor
2505 // for objects passed through ellipsis (...), failing for uncopyable
2506 // objects. We define this to ensure that only POD is passed through
2507 // ellipsis on these systems.
2508 #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
2509 // We lose support for NULL detection where the compiler doesn't like
2510 // passing non-POD classes through ellipsis (...).
2511 # define GTEST_ELLIPSIS_NEEDS_POD_ 1
2513 # define GTEST_CAN_COMPARE_NULL 1
2516 // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
2517 // const T& and const T* in a function template. These compilers
2518 // _can_ decide between class template specializations for T and T*,
2519 // so a tr1::type_traits-like is_pointer works.
2520 #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
2521 # define GTEST_NEEDS_IS_POINTER_ 1
2524 template <bool bool_value>
2525 struct bool_constant {
2526 typedef bool_constant<bool_value> type;
2527 static const bool value = bool_value;
2529 template <bool bool_value> const bool bool_constant<bool_value>::value;
2531 typedef bool_constant<false> false_type;
2532 typedef bool_constant<true> true_type;
2534 template <typename T>
2535 struct is_pointer : public false_type {};
2537 template <typename T>
2538 struct is_pointer<T*> : public true_type {};
2540 template <typename Iterator>
2541 struct IteratorTraits {
2542 typedef typename Iterator::value_type value_type;
2545 template <typename T>
2546 struct IteratorTraits<T*> {
2547 typedef T value_type;
2550 template <typename T>
2551 struct IteratorTraits<const T*> {
2552 typedef T value_type;
2555 #if GTEST_OS_WINDOWS
2556 # define GTEST_PATH_SEP_ "\\"
2557 # define GTEST_HAS_ALT_PATH_SEP_ 1
2558 // The biggest signed integer type the compiler supports.
2559 typedef __int64 BiggestInt;
2561 # define GTEST_PATH_SEP_ "/"
2562 # define GTEST_HAS_ALT_PATH_SEP_ 0
2563 typedef long long BiggestInt; // NOLINT
2564 #endif // GTEST_OS_WINDOWS
2566 // Utilities for char.
2568 // isspace(int ch) and friends accept an unsigned char or EOF. char
2569 // may be signed, depending on the compiler (or compiler flags).
2570 // Therefore we need to cast a char to unsigned char before calling
2573 inline bool IsAlpha(char ch) {
2574 return isalpha(static_cast<unsigned char>(ch)) != 0;
2576 inline bool IsAlNum(char ch) {
2577 return isalnum(static_cast<unsigned char>(ch)) != 0;
2579 inline bool IsDigit(char ch) {
2580 return isdigit(static_cast<unsigned char>(ch)) != 0;
2582 inline bool IsLower(char ch) {
2583 return islower(static_cast<unsigned char>(ch)) != 0;
2585 inline bool IsSpace(char ch) {
2586 return isspace(static_cast<unsigned char>(ch)) != 0;
2588 inline bool IsUpper(char ch) {
2589 return isupper(static_cast<unsigned char>(ch)) != 0;
2591 inline bool IsXDigit(char ch) {
2592 return isxdigit(static_cast<unsigned char>(ch)) != 0;
2595 inline char ToLower(char ch) {
2596 return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
2598 inline char ToUpper(char ch) {
2599 return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
2602 // The testing::internal::posix namespace holds wrappers for common
2603 // POSIX functions. These wrappers hide the differences between
2604 // Windows/MSVC and POSIX systems. Since some compilers define these
2605 // standard functions as macros, the wrapper cannot have the same name
2606 // as the wrapped function.
2610 // Functions with a different name on Windows.
2612 #if GTEST_OS_WINDOWS
2614 typedef struct _stat StatStruct;
2616 # ifdef __BORLANDC__
2617 inline int IsATTY(int fd) { return isatty(fd); }
2618 inline int StrCaseCmp(const char* s1, const char* s2) {
2619 return stricmp(s1, s2);
2621 inline char* StrDup(const char* src) { return strdup(src); }
2622 # else // !__BORLANDC__
2623 # if GTEST_OS_WINDOWS_MOBILE
2624 inline int IsATTY(int /* fd */) { return 0; }
2626 inline int IsATTY(int fd) { return _isatty(fd); }
2627 # endif // GTEST_OS_WINDOWS_MOBILE
2628 inline int StrCaseCmp(const char* s1, const char* s2) {
2629 return _stricmp(s1, s2);
2631 inline char* StrDup(const char* src) { return _strdup(src); }
2632 # endif // __BORLANDC__
2634 # if GTEST_OS_WINDOWS_MOBILE
2635 inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
2636 // Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
2637 // time and thus not defined there.
2639 inline int FileNo(FILE* file) { return _fileno(file); }
2640 inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
2641 inline int RmDir(const char* dir) { return _rmdir(dir); }
2642 inline bool IsDir(const StatStruct& st) {
2643 return (_S_IFDIR & st.st_mode) != 0;
2645 # endif // GTEST_OS_WINDOWS_MOBILE
2649 typedef struct stat StatStruct;
2651 inline int FileNo(FILE* file) { return fileno(file); }
2652 inline int IsATTY(int fd) { return isatty(fd); }
2653 inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
2654 inline int StrCaseCmp(const char* s1, const char* s2) {
2655 return strcasecmp(s1, s2);
2657 inline char* StrDup(const char* src) { return strdup(src); }
2658 inline int RmDir(const char* dir) { return rmdir(dir); }
2659 inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
2661 #endif // GTEST_OS_WINDOWS
2663 // Functions deprecated by MSVC 8.0.
2666 // Temporarily disable warning 4996 (deprecated function).
2667 # pragma warning(push)
2668 # pragma warning(disable:4996)
2671 inline const char* StrNCpy(char* dest, const char* src, size_t n) {
2672 return strncpy(dest, src, n);
2675 // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
2676 // StrError() aren't needed on Windows CE at this time and thus not
2679 #if !GTEST_OS_WINDOWS_MOBILE
2680 inline int ChDir(const char* dir) { return chdir(dir); }
2682 inline FILE* FOpen(const char* path, const char* mode) {
2683 return fopen(path, mode);
2685 #if !GTEST_OS_WINDOWS_MOBILE
2686 inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
2687 return freopen(path, mode, stream);
2689 inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
2691 inline int FClose(FILE* fp) { return fclose(fp); }
2692 #if !GTEST_OS_WINDOWS_MOBILE
2693 inline int Read(int fd, void* buf, unsigned int count) {
2694 return static_cast<int>(read(fd, buf, count));
2696 inline int Write(int fd, const void* buf, unsigned int count) {
2697 return static_cast<int>(write(fd, buf, count));
2699 inline int Close(int fd) { return close(fd); }
2700 inline const char* StrError(int errnum) { return strerror(errnum); }
2702 inline const char* GetEnv(const char* name) {
2703 #if GTEST_OS_WINDOWS_MOBILE
2704 // We are on Windows CE, which has no environment variables.
2706 #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
2707 // Environment variables which we programmatically clear will be set to the
2708 // empty string rather than unset (NULL). Handle that case.
2709 const char* const env = getenv(name);
2710 return (env != NULL && env[0] != '\0') ? env : NULL;
2712 return getenv(name);
2717 # pragma warning(pop) // Restores the warning state.
2720 #if GTEST_OS_WINDOWS_MOBILE
2721 // Windows CE has no C library. The abort() function is used in
2722 // several places in Google Test. This implementation provides a reasonable
2723 // imitation of standard behaviour.
2726 inline void Abort() { abort(); }
2727 #endif // GTEST_OS_WINDOWS_MOBILE
2729 } // namespace posix
2731 // The maximum number a BiggestInt can represent. This definition
2732 // works no matter BiggestInt is represented in one's complement or
2733 // two's complement.
2735 // We cannot rely on numeric_limits in STL, as __int64 and long long
2736 // are not part of standard C++ and numeric_limits doesn't need to be
2737 // defined for them.
2738 const BiggestInt kMaxBiggestInt =
2739 ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
2741 // This template class serves as a compile-time function from size to
2742 // type. It maps a size in bytes to a primitive type with that
2745 // TypeWithSize<4>::UInt
2747 // is typedef-ed to be unsigned int (unsigned integer made up of 4
2750 // Such functionality should belong to STL, but I cannot find it
2753 // Google Test uses this class in the implementation of floating-point
2756 // For now it only handles UInt (unsigned int) as that's all Google Test
2757 // needs. Other types can be easily added in the future if need
2759 template <size_t size>
2760 class TypeWithSize {
2762 // This prevents the user from using TypeWithSize<N> with incorrect
2767 // The specialization for size 4.
2769 class TypeWithSize<4> {
2771 // unsigned int has size 4 in both gcc and MSVC.
2773 // As base/basictypes.h doesn't compile on Windows, we cannot use
2774 // uint32, uint64, and etc here.
2776 typedef unsigned int UInt;
2779 // The specialization for size 8.
2781 class TypeWithSize<8> {
2784 #if GTEST_OS_WINDOWS
2785 typedef __int64 Int;
2786 typedef unsigned __int64 UInt;
2788 typedef long long Int; // NOLINT
2789 typedef unsigned long long UInt; // NOLINT
2790 #endif // GTEST_OS_WINDOWS
2793 // Integer types of known sizes.
2794 typedef TypeWithSize<4>::Int Int32;
2795 typedef TypeWithSize<4>::UInt UInt32;
2796 typedef TypeWithSize<8>::Int Int64;
2797 typedef TypeWithSize<8>::UInt UInt64;
2798 typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
2800 // Utilities for command line flags and environment variables.
2802 // Macro for referencing flags.
2803 #define GTEST_FLAG(name) FLAGS_gtest_##name
2805 // Macros for declaring flags.
2806 #define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
2807 #define GTEST_DECLARE_int32_(name) \
2808 GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
2809 #define GTEST_DECLARE_string_(name) \
2810 GTEST_API_ extern ::testing::internal::String GTEST_FLAG(name)
2812 // Macros for defining flags.
2813 #define GTEST_DEFINE_bool_(name, default_val, doc) \
2814 GTEST_API_ bool GTEST_FLAG(name) = (default_val)
2815 #define GTEST_DEFINE_int32_(name, default_val, doc) \
2816 GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
2817 #define GTEST_DEFINE_string_(name, default_val, doc) \
2818 GTEST_API_ ::testing::internal::String GTEST_FLAG(name) = (default_val)
2820 // Parses 'str' for a 32-bit signed integer. If successful, writes the result
2821 // to *value and returns true; otherwise leaves *value unchanged and returns
2823 // TODO(chandlerc): Find a better way to refactor flag and environment parsing
2824 // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
2826 bool ParseInt32(const Message& src_text, const char* str, Int32* value);
2828 // Parses a bool/Int32/string from the environment variable
2829 // corresponding to the given Google Test flag.
2830 bool BoolFromGTestEnv(const char* flag, bool default_val);
2831 GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
2832 const char* StringFromGTestEnv(const char* flag, const char* default_val);
2834 } // namespace internal
2835 } // namespace testing
2837 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
2840 # include <stdlib.h>
2841 # include <sys/types.h>
2842 # include <sys/wait.h>
2843 # include <unistd.h>
2844 #endif // GTEST_OS_LINUX
2852 // Copyright 2005, Google Inc.
2853 // All rights reserved.
2855 // Redistribution and use in source and binary forms, with or without
2856 // modification, are permitted provided that the following conditions are
2859 // * Redistributions of source code must retain the above copyright
2860 // notice, this list of conditions and the following disclaimer.
2861 // * Redistributions in binary form must reproduce the above
2862 // copyright notice, this list of conditions and the following disclaimer
2863 // in the documentation and/or other materials provided with the
2865 // * Neither the name of Google Inc. nor the names of its
2866 // contributors may be used to endorse or promote products derived from
2867 // this software without specific prior written permission.
2869 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2870 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2871 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2872 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2873 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2874 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2875 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2876 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2877 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2878 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2879 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2881 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
2883 // The Google C++ Testing Framework (Google Test)
2885 // This header file declares the String class and functions used internally by
2886 // Google Test. They are subject to change without notice. They should not used
2887 // by code external to Google Test.
2889 // This header file is #included by <gtest/internal/gtest-internal.h>.
2890 // It should not be #included by other files.
2892 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
2893 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
2896 // string.h is not guaranteed to provide strcpy on C++ Builder.
2905 namespace internal {
2907 // String - a UTF-8 string class.
2909 // For historic reasons, we don't use std::string.
2911 // TODO(wan@google.com): replace this class with std::string or
2912 // implement it in terms of the latter.
2914 // Note that String can represent both NULL and the empty string,
2915 // while std::string cannot represent NULL.
2917 // NULL and the empty string are considered different. NULL is less
2918 // than anything (including the empty string) except itself.
2920 // This class only provides minimum functionality necessary for
2921 // implementing Google Test. We do not intend to implement a full-fledged
2922 // string class here.
2924 // Since the purpose of this class is to provide a substitute for
2925 // std::string on platforms where it cannot be used, we define a copy
2926 // constructor and assignment operators such that we don't need
2927 // conditional compilation in a lot of places.
2929 // In order to make the representation efficient, the d'tor of String
2930 // is not virtual. Therefore DO NOT INHERIT FROM String.
2931 class GTEST_API_ String {
2933 // Static utility methods
2935 // Returns the input enclosed in double quotes if it's not NULL;
2936 // otherwise returns "(null)". For example, "\"Hello\"" is returned
2937 // for input "Hello".
2939 // This is useful for printing a C string in the syntax of a literal.
2941 // Known issue: escape sequences are not handled yet.
2942 static String ShowCStringQuoted(const char* c_str);
2944 // Clones a 0-terminated C string, allocating memory using new. The
2945 // caller is responsible for deleting the return value using
2946 // delete[]. Returns the cloned string, or NULL if the input is
2949 // This is different from strdup() in string.h, which allocates
2950 // memory using malloc().
2951 static const char* CloneCString(const char* c_str);
2953 #if GTEST_OS_WINDOWS_MOBILE
2954 // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
2955 // able to pass strings to Win32 APIs on CE we need to convert them
2956 // to 'Unicode', UTF-16.
2958 // Creates a UTF-16 wide string from the given ANSI string, allocating
2959 // memory using new. The caller is responsible for deleting the return
2960 // value using delete[]. Returns the wide string, or NULL if the
2963 // The wide string is created using the ANSI codepage (CP_ACP) to
2964 // match the behaviour of the ANSI versions of Win32 calls and the
2966 static LPCWSTR AnsiToUtf16(const char* c_str);
2968 // Creates an ANSI string from the given wide string, allocating
2969 // memory using new. The caller is responsible for deleting the return
2970 // value using delete[]. Returns the ANSI string, or NULL if the
2973 // The returned string is created using the ANSI codepage (CP_ACP) to
2974 // match the behaviour of the ANSI versions of Win32 calls and the
2976 static const char* Utf16ToAnsi(LPCWSTR utf16_str);
2979 // Compares two C strings. Returns true iff they have the same content.
2981 // Unlike strcmp(), this function can handle NULL argument(s). A
2982 // NULL C string is considered different to any non-NULL C string,
2983 // including the empty string.
2984 static bool CStringEquals(const char* lhs, const char* rhs);
2986 // Converts a wide C string to a String using the UTF-8 encoding.
2987 // NULL will be converted to "(null)". If an error occurred during
2988 // the conversion, "(failed to convert from wide string)" is
2990 static String ShowWideCString(const wchar_t* wide_c_str);
2992 // Similar to ShowWideCString(), except that this function encloses
2993 // the converted string in double quotes.
2994 static String ShowWideCStringQuoted(const wchar_t* wide_c_str);
2996 // Compares two wide C strings. Returns true iff they have the same
2999 // Unlike wcscmp(), this function can handle NULL argument(s). A
3000 // NULL C string is considered different to any non-NULL C string,
3001 // including the empty string.
3002 static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
3004 // Compares two C strings, ignoring case. Returns true iff they
3005 // have the same content.
3007 // Unlike strcasecmp(), this function can handle NULL argument(s).
3008 // A NULL C string is considered different to any non-NULL C string,
3009 // including the empty string.
3010 static bool CaseInsensitiveCStringEquals(const char* lhs,
3013 // Compares two wide C strings, ignoring case. Returns true iff they
3014 // have the same content.
3016 // Unlike wcscasecmp(), this function can handle NULL argument(s).
3017 // A NULL C string is considered different to any non-NULL wide C string,
3018 // including the empty string.
3019 // NB: The implementations on different platforms slightly differ.
3020 // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
3021 // environment variable. On GNU platform this method uses wcscasecmp
3022 // which compares according to LC_CTYPE category of the current locale.
3023 // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
3025 static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
3026 const wchar_t* rhs);
3028 // Formats a list of arguments to a String, using the same format
3029 // spec string as for printf.
3031 // We do not use the StringPrintf class as it is not universally
3034 // The result is limited to 4096 characters (including the tailing
3035 // 0). If 4096 characters are not enough to format the input,
3036 // "<buffer exceeded>" is returned.
3037 static String Format(const char* format, ...);
3041 // The default c'tor constructs a NULL string.
3042 String() : c_str_(NULL), length_(0) {}
3044 // Constructs a String by cloning a 0-terminated C string.
3045 String(const char* a_c_str) { // NOLINT
3046 if (a_c_str == NULL) {
3050 ConstructNonNull(a_c_str, strlen(a_c_str));
3054 // Constructs a String by copying a given number of chars from a
3055 // buffer. E.g. String("hello", 3) creates the string "hel",
3056 // String("a\0bcd", 4) creates "a\0bc", String(NULL, 0) creates "",
3057 // and String(NULL, 1) results in access violation.
3058 String(const char* buffer, size_t a_length) {
3059 ConstructNonNull(buffer, a_length);
3062 // The copy c'tor creates a new copy of the string. The two
3063 // String objects do not share content.
3064 String(const String& str) : c_str_(NULL), length_(0) { *this = str; }
3066 // D'tor. String is intended to be a final class, so the d'tor
3067 // doesn't need to be virtual.
3068 ~String() { delete[] c_str_; }
3070 // Allows a String to be implicitly converted to an ::std::string or
3071 // ::string, and vice versa. Converting a String containing a NULL
3072 // pointer to ::std::string or ::string is undefined behavior.
3073 // Converting a ::std::string or ::string containing an embedded NUL
3074 // character to a String will result in the prefix up to the first
3076 String(const ::std::string& str) {
3077 ConstructNonNull(str.c_str(), str.length());
3080 operator ::std::string() const { return ::std::string(c_str(), length()); }
3082 #if GTEST_HAS_GLOBAL_STRING
3083 String(const ::string& str) {
3084 ConstructNonNull(str.c_str(), str.length());
3087 operator ::string() const { return ::string(c_str(), length()); }
3088 #endif // GTEST_HAS_GLOBAL_STRING
3090 // Returns true iff this is an empty string (i.e. "").
3091 bool empty() const { return (c_str() != NULL) && (length() == 0); }
3093 // Compares this with another String.
3094 // Returns < 0 if this is less than rhs, 0 if this is equal to rhs, or > 0
3095 // if this is greater than rhs.
3096 int Compare(const String& rhs) const;
3098 // Returns true iff this String equals the given C string. A NULL
3099 // string and a non-NULL string are considered not equal.
3100 bool operator==(const char* a_c_str) const { return Compare(a_c_str) == 0; }
3102 // Returns true iff this String is less than the given String. A
3103 // NULL string is considered less than "".
3104 bool operator<(const String& rhs) const { return Compare(rhs) < 0; }
3106 // Returns true iff this String doesn't equal the given C string. A NULL
3107 // string and a non-NULL string are considered not equal.
3108 bool operator!=(const char* a_c_str) const { return !(*this == a_c_str); }
3110 // Returns true iff this String ends with the given suffix. *Any*
3111 // String is considered to end with a NULL or empty suffix.
3112 bool EndsWith(const char* suffix) const;
3114 // Returns true iff this String ends with the given suffix, not considering
3115 // case. Any String is considered to end with a NULL or empty suffix.
3116 bool EndsWithCaseInsensitive(const char* suffix) const;
3118 // Returns the length of the encapsulated string, or 0 if the
3120 size_t length() const { return length_; }
3122 // Gets the 0-terminated C string this String object represents.
3123 // The String object still owns the string. Therefore the caller
3124 // should NOT delete the return value.
3125 const char* c_str() const { return c_str_; }
3127 // Assigns a C string to this object. Self-assignment works.
3128 const String& operator=(const char* a_c_str) {
3129 return *this = String(a_c_str);
3132 // Assigns a String object to this object. Self-assignment works.
3133 const String& operator=(const String& rhs) {
3136 if (rhs.c_str() == NULL) {
3140 ConstructNonNull(rhs.c_str(), rhs.length());
3148 // Constructs a non-NULL String from the given content. This
3149 // function can only be called when c_str_ has not been allocated.
3150 // ConstructNonNull(NULL, 0) results in an empty string ("").
3151 // ConstructNonNull(NULL, non_zero) is undefined behavior.
3152 void ConstructNonNull(const char* buffer, size_t a_length) {
3153 char* const str = new char[a_length + 1];
3154 memcpy(str, buffer, a_length);
3155 str[a_length] = '\0';
3164 // Streams a String to an ostream. Each '\0' character in the String
3165 // is replaced with "\\0".
3166 inline ::std::ostream& operator<<(::std::ostream& os, const String& str) {
3167 if (str.c_str() == NULL) {
3170 const char* const c_str = str.c_str();
3171 for (size_t i = 0; i != str.length(); i++) {
3172 if (c_str[i] == '\0') {
3182 // Gets the content of the stringstream's buffer as a String. Each '\0'
3183 // character in the buffer is replaced with "\\0".
3184 GTEST_API_ String StringStreamToString(::std::stringstream* stream);
3186 // Converts a streamable value to a String. A NULL pointer is
3187 // converted to "(null)". When the input value is a ::string,
3188 // ::std::string, ::wstring, or ::std::wstring object, each NUL
3189 // character in it is replaced with "\\0".
3191 // Declared here but defined in gtest.h, so that it has access
3192 // to the definition of the Message class, required by the ARM
3194 template <typename T>
3195 String StreamableToString(const T& streamable);
3197 } // namespace internal
3198 } // namespace testing
3200 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
3201 // Copyright 2008, Google Inc.
3202 // All rights reserved.
3204 // Redistribution and use in source and binary forms, with or without
3205 // modification, are permitted provided that the following conditions are
3208 // * Redistributions of source code must retain the above copyright
3209 // notice, this list of conditions and the following disclaimer.
3210 // * Redistributions in binary form must reproduce the above
3211 // copyright notice, this list of conditions and the following disclaimer
3212 // in the documentation and/or other materials provided with the
3214 // * Neither the name of Google Inc. nor the names of its
3215 // contributors may be used to endorse or promote products derived from
3216 // this software without specific prior written permission.
3218 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3219 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3220 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3221 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3222 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3223 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3224 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3225 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3226 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3227 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3228 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3230 // Author: keith.ray@gmail.com (Keith Ray)
3232 // Google Test filepath utilities
3234 // This header file declares classes and functions used internally by
3235 // Google Test. They are subject to change without notice.
3237 // This file is #included in <gtest/internal/gtest-internal.h>.
3238 // Do not include this header file separately!
3240 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3241 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3245 namespace internal {
3247 // FilePath - a class for file and directory pathname manipulation which
3248 // handles platform-specific conventions (like the pathname separator).
3249 // Used for helper functions for naming files in a directory for xml output.
3250 // Except for Set methods, all methods are const or static, which provides an
3251 // "immutable value object" -- useful for peace of mind.
3252 // A FilePath with a value ending in a path separator ("like/this/") represents
3253 // a directory, otherwise it is assumed to represent a file. In either case,
3254 // it may or may not represent an actual file or directory in the file system.
3255 // Names are NOT checked for syntax correctness -- no checking for illegal
3256 // characters, malformed paths, etc.
3258 class GTEST_API_ FilePath {
3260 FilePath() : pathname_("") { }
3261 FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
3263 explicit FilePath(const char* pathname) : pathname_(pathname) {
3267 explicit FilePath(const String& pathname) : pathname_(pathname) {
3271 FilePath& operator=(const FilePath& rhs) {
3276 void Set(const FilePath& rhs) {
3277 pathname_ = rhs.pathname_;
3280 String ToString() const { return pathname_; }
3281 const char* c_str() const { return pathname_.c_str(); }
3283 // Returns the current working directory, or "" if unsuccessful.
3284 static FilePath GetCurrentDir();
3286 // Given directory = "dir", base_name = "test", number = 0,
3287 // extension = "xml", returns "dir/test.xml". If number is greater
3288 // than zero (e.g., 12), returns "dir/test_12.xml".
3289 // On Windows platform, uses \ as the separator rather than /.
3290 static FilePath MakeFileName(const FilePath& directory,
3291 const FilePath& base_name,
3293 const char* extension);
3295 // Given directory = "dir", relative_path = "test.xml",
3296 // returns "dir/test.xml".
3297 // On Windows, uses \ as the separator rather than /.
3298 static FilePath ConcatPaths(const FilePath& directory,
3299 const FilePath& relative_path);
3301 // Returns a pathname for a file that does not currently exist. The pathname
3302 // will be directory/base_name.extension or
3303 // directory/base_name_<number>.extension if directory/base_name.extension
3304 // already exists. The number will be incremented until a pathname is found
3305 // that does not already exist.
3306 // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
3307 // There could be a race condition if two or more processes are calling this
3308 // function at the same time -- they could both pick the same filename.
3309 static FilePath GenerateUniqueFileName(const FilePath& directory,
3310 const FilePath& base_name,
3311 const char* extension);
3313 // Returns true iff the path is NULL or "".
3314 bool IsEmpty() const { return c_str() == NULL || *c_str() == '\0'; }
3316 // If input name has a trailing separator character, removes it and returns
3317 // the name, otherwise return the name string unmodified.
3318 // On Windows platform, uses \ as the separator, other platforms use /.
3319 FilePath RemoveTrailingPathSeparator() const;
3321 // Returns a copy of the FilePath with the directory part removed.
3322 // Example: FilePath("path/to/file").RemoveDirectoryName() returns
3323 // FilePath("file"). If there is no directory part ("just_a_file"), it returns
3324 // the FilePath unmodified. If there is no file part ("just_a_dir/") it
3325 // returns an empty FilePath ("").
3326 // On Windows platform, '\' is the path separator, otherwise it is '/'.
3327 FilePath RemoveDirectoryName() const;
3329 // RemoveFileName returns the directory path with the filename removed.
3330 // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
3331 // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
3332 // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
3333 // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
3334 // On Windows platform, '\' is the path separator, otherwise it is '/'.
3335 FilePath RemoveFileName() const;
3337 // Returns a copy of the FilePath with the case-insensitive extension removed.
3338 // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
3339 // FilePath("dir/file"). If a case-insensitive extension is not
3340 // found, returns a copy of the original FilePath.
3341 FilePath RemoveExtension(const char* extension) const;
3343 // Creates directories so that path exists. Returns true if successful or if
3344 // the directories already exist; returns false if unable to create
3345 // directories for any reason. Will also return false if the FilePath does
3346 // not represent a directory (that is, it doesn't end with a path separator).
3347 bool CreateDirectoriesRecursively() const;
3349 // Create the directory so that path exists. Returns true if successful or
3350 // if the directory already exists; returns false if unable to create the
3351 // directory for any reason, including if the parent directory does not
3352 // exist. Not named "CreateDirectory" because that's a macro on Windows.
3353 bool CreateFolder() const;
3355 // Returns true if FilePath describes something in the file-system,
3356 // either a file, directory, or whatever, and that something exists.
3357 bool FileOrDirectoryExists() const;
3359 // Returns true if pathname describes a directory in the file-system
3361 bool DirectoryExists() const;
3363 // Returns true if FilePath ends with a path separator, which indicates that
3364 // it is intended to represent a directory. Returns false otherwise.
3365 // This does NOT check that a directory (or file) actually exists.
3366 bool IsDirectory() const;
3368 // Returns true if pathname describes a root directory. (Windows has one
3369 // root directory per disk drive.)
3370 bool IsRootDirectory() const;
3372 // Returns true if pathname describes an absolute path.
3373 bool IsAbsolutePath() const;
3376 // Replaces multiple consecutive separators with a single separator.
3377 // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
3378 // redundancies that might be in a pathname involving "." or "..".
3380 // A pathname with multiple consecutive separators may occur either through
3381 // user error or as a result of some scripts or APIs that generate a pathname
3382 // with a trailing separator. On other platforms the same API or script
3383 // may NOT generate a pathname with a trailing "/". Then elsewhere that
3384 // pathname may have another "/" and pathname components added to it,
3385 // without checking for the separator already being there.
3386 // The script language and operating system may allow paths like "foo//bar"
3387 // but some of the functions in FilePath will not handle that correctly. In
3388 // particular, RemoveTrailingPathSeparator() only removes one separator, and
3389 // it is called in CreateDirectoriesRecursively() assuming that it will change
3390 // a pathname from directory syntax (trailing separator) to filename syntax.
3392 // On Windows this method also replaces the alternate path separator '/' with
3393 // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
3398 // Returns a pointer to the last occurence of a valid path separator in
3399 // the FilePath. On Windows, for example, both '/' and '\' are valid path
3400 // separators. Returns NULL if no path separator was found.
3401 const char* FindLastPathSeparator() const;
3404 }; // class FilePath
3406 } // namespace internal
3407 } // namespace testing
3409 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3410 // This file was GENERATED by command:
3411 // pump.py gtest-type-util.h.pump
3412 // DO NOT EDIT BY HAND!!!
3414 // Copyright 2008 Google Inc.
3415 // All Rights Reserved.
3417 // Redistribution and use in source and binary forms, with or without
3418 // modification, are permitted provided that the following conditions are
3421 // * Redistributions of source code must retain the above copyright
3422 // notice, this list of conditions and the following disclaimer.
3423 // * Redistributions in binary form must reproduce the above
3424 // copyright notice, this list of conditions and the following disclaimer
3425 // in the documentation and/or other materials provided with the
3427 // * Neither the name of Google Inc. nor the names of its
3428 // contributors may be used to endorse or promote products derived from
3429 // this software without specific prior written permission.
3431 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3432 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3433 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3434 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3435 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3436 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3437 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3438 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3439 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3440 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3441 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3443 // Author: wan@google.com (Zhanyong Wan)
3445 // Type utilities needed for implementing typed and type-parameterized
3446 // tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
3448 // Currently we support at most 50 types in a list, and at most 50
3449 // type-parameterized tests in one type-parameterized test case.
3450 // Please contact googletestframework@googlegroups.com if you need
3453 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
3454 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
3457 // #ifdef __GNUC__ is too general here. It is possible to use gcc without using
3458 // libstdc++ (which is where cxxabi.h comes from).
3460 # include <cxxabi.h>
3461 # elif defined(__HP_aCC)
3462 # include <acxx_demangle.h>
3463 # endif // __GLIBCXX__
3466 namespace internal {
3468 // GetTypeName<T>() returns a human-readable name of type T.
3469 // NB: This function is also used in Google Mock, so don't move it inside of
3470 // the typed-test-only section below.
3471 template <typename T>
3472 String GetTypeName() {
3475 const char* const name = typeid(T).name();
3476 # if defined(__GLIBCXX__) || defined(__HP_aCC)
3478 // gcc's implementation of typeid(T).name() mangles the type name,
3479 // so we have to demangle it.
3481 using abi::__cxa_demangle;
3482 # endif // __GLIBCXX__
3483 char* const readable_name = __cxa_demangle(name, 0, 0, &status);
3484 const String name_str(status == 0 ? readable_name : name);
3485 free(readable_name);
3489 # endif // __GLIBCXX__ || __HP_aCC
3495 # endif // GTEST_HAS_RTTI
3498 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
3500 // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
3501 // type. This can be used as a compile-time assertion to ensure that
3502 // two types are equal.
3504 template <typename T1, typename T2>
3505 struct AssertTypeEq;
3507 template <typename T>
3508 struct AssertTypeEq<T, T> {
3512 // A unique type used as the default value for the arguments of class
3513 // template Types. This allows us to simulate variadic templates
3514 // (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
3515 // support directly.
3518 // The following family of struct and struct templates are used to
3519 // represent type lists. In particular, TypesN<T1, T2, ..., TN>
3520 // represents a type list with N types (T1, T2, ..., and TN) in it.
3521 // Except for Types0, every struct in the family has two member types:
3522 // Head for the first type in the list, and Tail for the rest of the
3525 // The empty type list.
3528 // Type lists of length 1, 2, 3, and so on.
3530 template <typename T1>
3533 typedef Types0 Tail;
3535 template <typename T1, typename T2>
3538 typedef Types1<T2> Tail;
3541 template <typename T1, typename T2, typename T3>
3544 typedef Types2<T2, T3> Tail;
3547 template <typename T1, typename T2, typename T3, typename T4>
3550 typedef Types3<T2, T3, T4> Tail;
3553 template <typename T1, typename T2, typename T3, typename T4, typename T5>
3556 typedef Types4<T2, T3, T4, T5> Tail;
3559 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3563 typedef Types5<T2, T3, T4, T5, T6> Tail;
3566 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3567 typename T6, typename T7>
3570 typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
3573 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3574 typename T6, typename T7, typename T8>
3577 typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
3580 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3581 typename T6, typename T7, typename T8, typename T9>
3584 typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
3587 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3588 typename T6, typename T7, typename T8, typename T9, typename T10>
3591 typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
3594 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3595 typename T6, typename T7, typename T8, typename T9, typename T10,
3599 typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
3602 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3603 typename T6, typename T7, typename T8, typename T9, typename T10,
3604 typename T11, typename T12>
3607 typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
3610 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3611 typename T6, typename T7, typename T8, typename T9, typename T10,
3612 typename T11, typename T12, typename T13>
3615 typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
3618 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3619 typename T6, typename T7, typename T8, typename T9, typename T10,
3620 typename T11, typename T12, typename T13, typename T14>
3623 typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
3626 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3627 typename T6, typename T7, typename T8, typename T9, typename T10,
3628 typename T11, typename T12, typename T13, typename T14, typename T15>
3631 typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
3635 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3636 typename T6, typename T7, typename T8, typename T9, typename T10,
3637 typename T11, typename T12, typename T13, typename T14, typename T15,
3641 typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3645 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3646 typename T6, typename T7, typename T8, typename T9, typename T10,
3647 typename T11, typename T12, typename T13, typename T14, typename T15,
3648 typename T16, typename T17>
3651 typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3655 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3656 typename T6, typename T7, typename T8, typename T9, typename T10,
3657 typename T11, typename T12, typename T13, typename T14, typename T15,
3658 typename T16, typename T17, typename T18>
3661 typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3662 T16, T17, T18> Tail;
3665 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3666 typename T6, typename T7, typename T8, typename T9, typename T10,
3667 typename T11, typename T12, typename T13, typename T14, typename T15,
3668 typename T16, typename T17, typename T18, typename T19>
3671 typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3672 T16, T17, T18, T19> Tail;
3675 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3676 typename T6, typename T7, typename T8, typename T9, typename T10,
3677 typename T11, typename T12, typename T13, typename T14, typename T15,
3678 typename T16, typename T17, typename T18, typename T19, typename T20>
3681 typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3682 T16, T17, T18, T19, T20> Tail;
3685 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3686 typename T6, typename T7, typename T8, typename T9, typename T10,
3687 typename T11, typename T12, typename T13, typename T14, typename T15,
3688 typename T16, typename T17, typename T18, typename T19, typename T20,
3692 typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3693 T16, T17, T18, T19, T20, T21> Tail;
3696 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3697 typename T6, typename T7, typename T8, typename T9, typename T10,
3698 typename T11, typename T12, typename T13, typename T14, typename T15,
3699 typename T16, typename T17, typename T18, typename T19, typename T20,
3700 typename T21, typename T22>
3703 typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3704 T16, T17, T18, T19, T20, T21, T22> Tail;
3707 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3708 typename T6, typename T7, typename T8, typename T9, typename T10,
3709 typename T11, typename T12, typename T13, typename T14, typename T15,
3710 typename T16, typename T17, typename T18, typename T19, typename T20,
3711 typename T21, typename T22, typename T23>
3714 typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3715 T16, T17, T18, T19, T20, T21, T22, T23> Tail;
3718 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3719 typename T6, typename T7, typename T8, typename T9, typename T10,
3720 typename T11, typename T12, typename T13, typename T14, typename T15,
3721 typename T16, typename T17, typename T18, typename T19, typename T20,
3722 typename T21, typename T22, typename T23, typename T24>
3725 typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3726 T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
3729 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3730 typename T6, typename T7, typename T8, typename T9, typename T10,
3731 typename T11, typename T12, typename T13, typename T14, typename T15,
3732 typename T16, typename T17, typename T18, typename T19, typename T20,
3733 typename T21, typename T22, typename T23, typename T24, typename T25>
3736 typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3737 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
3740 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3741 typename T6, typename T7, typename T8, typename T9, typename T10,
3742 typename T11, typename T12, typename T13, typename T14, typename T15,
3743 typename T16, typename T17, typename T18, typename T19, typename T20,
3744 typename T21, typename T22, typename T23, typename T24, typename T25,
3748 typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3749 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
3752 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3753 typename T6, typename T7, typename T8, typename T9, typename T10,
3754 typename T11, typename T12, typename T13, typename T14, typename T15,
3755 typename T16, typename T17, typename T18, typename T19, typename T20,
3756 typename T21, typename T22, typename T23, typename T24, typename T25,
3757 typename T26, typename T27>
3760 typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3761 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
3764 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3765 typename T6, typename T7, typename T8, typename T9, typename T10,
3766 typename T11, typename T12, typename T13, typename T14, typename T15,
3767 typename T16, typename T17, typename T18, typename T19, typename T20,
3768 typename T21, typename T22, typename T23, typename T24, typename T25,
3769 typename T26, typename T27, typename T28>
3772 typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3773 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
3776 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3777 typename T6, typename T7, typename T8, typename T9, typename T10,
3778 typename T11, typename T12, typename T13, typename T14, typename T15,
3779 typename T16, typename T17, typename T18, typename T19, typename T20,
3780 typename T21, typename T22, typename T23, typename T24, typename T25,
3781 typename T26, typename T27, typename T28, typename T29>
3784 typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3785 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
3789 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3790 typename T6, typename T7, typename T8, typename T9, typename T10,
3791 typename T11, typename T12, typename T13, typename T14, typename T15,
3792 typename T16, typename T17, typename T18, typename T19, typename T20,
3793 typename T21, typename T22, typename T23, typename T24, typename T25,
3794 typename T26, typename T27, typename T28, typename T29, typename T30>
3797 typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3798 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3802 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3803 typename T6, typename T7, typename T8, typename T9, typename T10,
3804 typename T11, typename T12, typename T13, typename T14, typename T15,
3805 typename T16, typename T17, typename T18, typename T19, typename T20,
3806 typename T21, typename T22, typename T23, typename T24, typename T25,
3807 typename T26, typename T27, typename T28, typename T29, typename T30,
3811 typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3812 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3816 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3817 typename T6, typename T7, typename T8, typename T9, typename T10,
3818 typename T11, typename T12, typename T13, typename T14, typename T15,
3819 typename T16, typename T17, typename T18, typename T19, typename T20,
3820 typename T21, typename T22, typename T23, typename T24, typename T25,
3821 typename T26, typename T27, typename T28, typename T29, typename T30,
3822 typename T31, typename T32>
3825 typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3826 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3827 T30, T31, T32> Tail;
3830 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3831 typename T6, typename T7, typename T8, typename T9, typename T10,
3832 typename T11, typename T12, typename T13, typename T14, typename T15,
3833 typename T16, typename T17, typename T18, typename T19, typename T20,
3834 typename T21, typename T22, typename T23, typename T24, typename T25,
3835 typename T26, typename T27, typename T28, typename T29, typename T30,
3836 typename T31, typename T32, typename T33>
3839 typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3840 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3841 T30, T31, T32, T33> Tail;
3844 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3845 typename T6, typename T7, typename T8, typename T9, typename T10,
3846 typename T11, typename T12, typename T13, typename T14, typename T15,
3847 typename T16, typename T17, typename T18, typename T19, typename T20,
3848 typename T21, typename T22, typename T23, typename T24, typename T25,
3849 typename T26, typename T27, typename T28, typename T29, typename T30,
3850 typename T31, typename T32, typename T33, typename T34>
3853 typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3854 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3855 T30, T31, T32, T33, T34> Tail;
3858 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3859 typename T6, typename T7, typename T8, typename T9, typename T10,
3860 typename T11, typename T12, typename T13, typename T14, typename T15,
3861 typename T16, typename T17, typename T18, typename T19, typename T20,
3862 typename T21, typename T22, typename T23, typename T24, typename T25,
3863 typename T26, typename T27, typename T28, typename T29, typename T30,
3864 typename T31, typename T32, typename T33, typename T34, typename T35>
3867 typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3868 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3869 T30, T31, T32, T33, T34, T35> Tail;
3872 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3873 typename T6, typename T7, typename T8, typename T9, typename T10,
3874 typename T11, typename T12, typename T13, typename T14, typename T15,
3875 typename T16, typename T17, typename T18, typename T19, typename T20,
3876 typename T21, typename T22, typename T23, typename T24, typename T25,
3877 typename T26, typename T27, typename T28, typename T29, typename T30,
3878 typename T31, typename T32, typename T33, typename T34, typename T35,
3882 typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3883 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3884 T30, T31, T32, T33, T34, T35, T36> Tail;
3887 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3888 typename T6, typename T7, typename T8, typename T9, typename T10,
3889 typename T11, typename T12, typename T13, typename T14, typename T15,
3890 typename T16, typename T17, typename T18, typename T19, typename T20,
3891 typename T21, typename T22, typename T23, typename T24, typename T25,
3892 typename T26, typename T27, typename T28, typename T29, typename T30,
3893 typename T31, typename T32, typename T33, typename T34, typename T35,
3894 typename T36, typename T37>
3897 typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3898 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3899 T30, T31, T32, T33, T34, T35, T36, T37> Tail;
3902 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3903 typename T6, typename T7, typename T8, typename T9, typename T10,
3904 typename T11, typename T12, typename T13, typename T14, typename T15,
3905 typename T16, typename T17, typename T18, typename T19, typename T20,
3906 typename T21, typename T22, typename T23, typename T24, typename T25,
3907 typename T26, typename T27, typename T28, typename T29, typename T30,
3908 typename T31, typename T32, typename T33, typename T34, typename T35,
3909 typename T36, typename T37, typename T38>
3912 typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3913 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3914 T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
3917 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3918 typename T6, typename T7, typename T8, typename T9, typename T10,
3919 typename T11, typename T12, typename T13, typename T14, typename T15,
3920 typename T16, typename T17, typename T18, typename T19, typename T20,
3921 typename T21, typename T22, typename T23, typename T24, typename T25,
3922 typename T26, typename T27, typename T28, typename T29, typename T30,
3923 typename T31, typename T32, typename T33, typename T34, typename T35,
3924 typename T36, typename T37, typename T38, typename T39>
3927 typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3928 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3929 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
3932 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3933 typename T6, typename T7, typename T8, typename T9, typename T10,
3934 typename T11, typename T12, typename T13, typename T14, typename T15,
3935 typename T16, typename T17, typename T18, typename T19, typename T20,
3936 typename T21, typename T22, typename T23, typename T24, typename T25,
3937 typename T26, typename T27, typename T28, typename T29, typename T30,
3938 typename T31, typename T32, typename T33, typename T34, typename T35,
3939 typename T36, typename T37, typename T38, typename T39, typename T40>
3942 typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3943 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3944 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
3947 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3948 typename T6, typename T7, typename T8, typename T9, typename T10,
3949 typename T11, typename T12, typename T13, typename T14, typename T15,
3950 typename T16, typename T17, typename T18, typename T19, typename T20,
3951 typename T21, typename T22, typename T23, typename T24, typename T25,
3952 typename T26, typename T27, typename T28, typename T29, typename T30,
3953 typename T31, typename T32, typename T33, typename T34, typename T35,
3954 typename T36, typename T37, typename T38, typename T39, typename T40,
3958 typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3959 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3960 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
3963 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3964 typename T6, typename T7, typename T8, typename T9, typename T10,
3965 typename T11, typename T12, typename T13, typename T14, typename T15,
3966 typename T16, typename T17, typename T18, typename T19, typename T20,
3967 typename T21, typename T22, typename T23, typename T24, typename T25,
3968 typename T26, typename T27, typename T28, typename T29, typename T30,
3969 typename T31, typename T32, typename T33, typename T34, typename T35,
3970 typename T36, typename T37, typename T38, typename T39, typename T40,
3971 typename T41, typename T42>
3974 typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3975 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3976 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
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, typename T18, typename T19, typename T20,
3983 typename T21, typename T22, typename T23, typename T24, typename T25,
3984 typename T26, typename T27, typename T28, typename T29, typename T30,
3985 typename T31, typename T32, typename T33, typename T34, typename T35,
3986 typename T36, typename T37, typename T38, typename T39, typename T40,
3987 typename T41, typename T42, typename T43>
3990 typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3991 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3992 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
3996 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3997 typename T6, typename T7, typename T8, typename T9, typename T10,
3998 typename T11, typename T12, typename T13, typename T14, typename T15,
3999 typename T16, typename T17, typename T18, typename T19, typename T20,
4000 typename T21, typename T22, typename T23, typename T24, typename T25,
4001 typename T26, typename T27, typename T28, typename T29, typename T30,
4002 typename T31, typename T32, typename T33, typename T34, typename T35,
4003 typename T36, typename T37, typename T38, typename T39, typename T40,
4004 typename T41, typename T42, typename T43, typename T44>
4007 typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4008 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4009 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4013 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4014 typename T6, typename T7, typename T8, typename T9, typename T10,
4015 typename T11, typename T12, typename T13, typename T14, typename T15,
4016 typename T16, typename T17, typename T18, typename T19, typename T20,
4017 typename T21, typename T22, typename T23, typename T24, typename T25,
4018 typename T26, typename T27, typename T28, typename T29, typename T30,
4019 typename T31, typename T32, typename T33, typename T34, typename T35,
4020 typename T36, typename T37, typename T38, typename T39, typename T40,
4021 typename T41, typename T42, typename T43, typename T44, typename T45>
4024 typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4025 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4026 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
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, typename T23, typename T24, typename T25,
4035 typename T26, typename T27, typename T28, typename T29, typename T30,
4036 typename T31, typename T32, typename T33, typename T34, typename T35,
4037 typename T36, typename T37, typename T38, typename T39, typename T40,
4038 typename T41, typename T42, typename T43, typename T44, typename T45,
4042 typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4043 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4044 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4045 T44, T45, T46> Tail;
4048 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4049 typename T6, typename T7, typename T8, typename T9, typename T10,
4050 typename T11, typename T12, typename T13, typename T14, typename T15,
4051 typename T16, typename T17, typename T18, typename T19, typename T20,
4052 typename T21, typename T22, typename T23, typename T24, typename T25,
4053 typename T26, typename T27, typename T28, typename T29, typename T30,
4054 typename T31, typename T32, typename T33, typename T34, typename T35,
4055 typename T36, typename T37, typename T38, typename T39, typename T40,
4056 typename T41, typename T42, typename T43, typename T44, typename T45,
4057 typename T46, typename T47>
4060 typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4061 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4062 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4063 T44, T45, T46, T47> Tail;
4066 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4067 typename T6, typename T7, typename T8, typename T9, typename T10,
4068 typename T11, typename T12, typename T13, typename T14, typename T15,
4069 typename T16, typename T17, typename T18, typename T19, typename T20,
4070 typename T21, typename T22, typename T23, typename T24, typename T25,
4071 typename T26, typename T27, typename T28, typename T29, typename T30,
4072 typename T31, typename T32, typename T33, typename T34, typename T35,
4073 typename T36, typename T37, typename T38, typename T39, typename T40,
4074 typename T41, typename T42, typename T43, typename T44, typename T45,
4075 typename T46, typename T47, typename T48>
4078 typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4079 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4080 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4081 T44, T45, T46, T47, T48> Tail;
4084 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4085 typename T6, typename T7, typename T8, typename T9, typename T10,
4086 typename T11, typename T12, typename T13, typename T14, typename T15,
4087 typename T16, typename T17, typename T18, typename T19, typename T20,
4088 typename T21, typename T22, typename T23, typename T24, typename T25,
4089 typename T26, typename T27, typename T28, typename T29, typename T30,
4090 typename T31, typename T32, typename T33, typename T34, typename T35,
4091 typename T36, typename T37, typename T38, typename T39, typename T40,
4092 typename T41, typename T42, typename T43, typename T44, typename T45,
4093 typename T46, typename T47, typename T48, typename T49>
4096 typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4097 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4098 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4099 T44, T45, T46, T47, T48, T49> Tail;
4102 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4103 typename T6, typename T7, typename T8, typename T9, typename T10,
4104 typename T11, typename T12, typename T13, typename T14, typename T15,
4105 typename T16, typename T17, typename T18, typename T19, typename T20,
4106 typename T21, typename T22, typename T23, typename T24, typename T25,
4107 typename T26, typename T27, typename T28, typename T29, typename T30,
4108 typename T31, typename T32, typename T33, typename T34, typename T35,
4109 typename T36, typename T37, typename T38, typename T39, typename T40,
4110 typename T41, typename T42, typename T43, typename T44, typename T45,
4111 typename T46, typename T47, typename T48, typename T49, typename T50>
4114 typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4115 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4116 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4117 T44, T45, T46, T47, T48, T49, T50> Tail;
4121 } // namespace internal
4123 // We don't want to require the users to write TypesN<...> directly,
4124 // as that would require them to count the length. Types<...> is much
4125 // easier to write, but generates horrible messages when there is a
4126 // compiler error, as gcc insists on printing out each template
4127 // argument, even if it has the default value (this means Types<int>
4128 // will appear as Types<int, None, None, ..., None> in the compiler
4131 // Our solution is to combine the best part of the two approaches: a
4132 // user would write Types<T1, ..., TN>, and Google Test will translate
4133 // that to TypesN<T1, ..., TN> internally to make error messages
4134 // readable. The translation is done by the 'type' member of the
4136 template <typename T1 = internal::None, typename T2 = internal::None,
4137 typename T3 = internal::None, typename T4 = internal::None,
4138 typename T5 = internal::None, typename T6 = internal::None,
4139 typename T7 = internal::None, typename T8 = internal::None,
4140 typename T9 = internal::None, typename T10 = internal::None,
4141 typename T11 = internal::None, typename T12 = internal::None,
4142 typename T13 = internal::None, typename T14 = internal::None,
4143 typename T15 = internal::None, typename T16 = internal::None,
4144 typename T17 = internal::None, typename T18 = internal::None,
4145 typename T19 = internal::None, typename T20 = internal::None,
4146 typename T21 = internal::None, typename T22 = internal::None,
4147 typename T23 = internal::None, typename T24 = internal::None,
4148 typename T25 = internal::None, typename T26 = internal::None,
4149 typename T27 = internal::None, typename T28 = internal::None,
4150 typename T29 = internal::None, typename T30 = internal::None,
4151 typename T31 = internal::None, typename T32 = internal::None,
4152 typename T33 = internal::None, typename T34 = internal::None,
4153 typename T35 = internal::None, typename T36 = internal::None,
4154 typename T37 = internal::None, typename T38 = internal::None,
4155 typename T39 = internal::None, typename T40 = internal::None,
4156 typename T41 = internal::None, typename T42 = internal::None,
4157 typename T43 = internal::None, typename T44 = internal::None,
4158 typename T45 = internal::None, typename T46 = internal::None,
4159 typename T47 = internal::None, typename T48 = internal::None,
4160 typename T49 = internal::None, typename T50 = internal::None>
4162 typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4163 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4164 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4165 T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
4169 struct Types<internal::None, internal::None, internal::None, internal::None,
4170 internal::None, internal::None, internal::None, internal::None,
4171 internal::None, internal::None, internal::None, internal::None,
4172 internal::None, internal::None, internal::None, internal::None,
4173 internal::None, internal::None, internal::None, internal::None,
4174 internal::None, internal::None, internal::None, internal::None,
4175 internal::None, internal::None, internal::None, internal::None,
4176 internal::None, internal::None, internal::None, internal::None,
4177 internal::None, internal::None, internal::None, internal::None,
4178 internal::None, internal::None, internal::None, internal::None,
4179 internal::None, internal::None, internal::None, internal::None,
4180 internal::None, internal::None, internal::None, internal::None,
4181 internal::None, internal::None> {
4182 typedef internal::Types0 type;
4184 template <typename T1>
4185 struct Types<T1, internal::None, internal::None, internal::None,
4186 internal::None, internal::None, internal::None, internal::None,
4187 internal::None, internal::None, internal::None, internal::None,
4188 internal::None, internal::None, internal::None, internal::None,
4189 internal::None, internal::None, internal::None, internal::None,
4190 internal::None, internal::None, internal::None, internal::None,
4191 internal::None, internal::None, internal::None, internal::None,
4192 internal::None, internal::None, internal::None, internal::None,
4193 internal::None, internal::None, internal::None, internal::None,
4194 internal::None, internal::None, internal::None, internal::None,
4195 internal::None, internal::None, internal::None, internal::None,
4196 internal::None, internal::None, internal::None, internal::None,
4197 internal::None, internal::None> {
4198 typedef internal::Types1<T1> type;
4200 template <typename T1, typename T2>
4201 struct Types<T1, T2, internal::None, internal::None, internal::None,
4202 internal::None, internal::None, internal::None, internal::None,
4203 internal::None, internal::None, internal::None, internal::None,
4204 internal::None, internal::None, internal::None, internal::None,
4205 internal::None, internal::None, internal::None, internal::None,
4206 internal::None, internal::None, internal::None, internal::None,
4207 internal::None, internal::None, internal::None, internal::None,
4208 internal::None, internal::None, internal::None, internal::None,
4209 internal::None, internal::None, internal::None, internal::None,
4210 internal::None, internal::None, internal::None, internal::None,
4211 internal::None, internal::None, internal::None, internal::None,
4212 internal::None, internal::None, internal::None, internal::None,
4214 typedef internal::Types2<T1, T2> type;
4216 template <typename T1, typename T2, typename T3>
4217 struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
4218 internal::None, internal::None, internal::None, internal::None,
4219 internal::None, internal::None, internal::None, internal::None,
4220 internal::None, internal::None, internal::None, internal::None,
4221 internal::None, internal::None, internal::None, internal::None,
4222 internal::None, internal::None, internal::None, internal::None,
4223 internal::None, internal::None, internal::None, internal::None,
4224 internal::None, internal::None, internal::None, internal::None,
4225 internal::None, internal::None, internal::None, internal::None,
4226 internal::None, internal::None, internal::None, internal::None,
4227 internal::None, internal::None, internal::None, internal::None,
4228 internal::None, internal::None, internal::None, internal::None> {
4229 typedef internal::Types3<T1, T2, T3> type;
4231 template <typename T1, typename T2, typename T3, typename T4>
4232 struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
4233 internal::None, internal::None, internal::None, internal::None,
4234 internal::None, internal::None, internal::None, internal::None,
4235 internal::None, internal::None, internal::None, internal::None,
4236 internal::None, internal::None, internal::None, internal::None,
4237 internal::None, internal::None, internal::None, internal::None,
4238 internal::None, internal::None, internal::None, internal::None,
4239 internal::None, internal::None, internal::None, internal::None,
4240 internal::None, internal::None, internal::None, internal::None,
4241 internal::None, internal::None, internal::None, internal::None,
4242 internal::None, internal::None, internal::None, internal::None,
4243 internal::None, internal::None, internal::None> {
4244 typedef internal::Types4<T1, T2, T3, T4> type;
4246 template <typename T1, typename T2, typename T3, typename T4, typename T5>
4247 struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
4248 internal::None, internal::None, internal::None, internal::None,
4249 internal::None, internal::None, internal::None, internal::None,
4250 internal::None, internal::None, internal::None, internal::None,
4251 internal::None, internal::None, internal::None, internal::None,
4252 internal::None, internal::None, internal::None, internal::None,
4253 internal::None, internal::None, internal::None, internal::None,
4254 internal::None, internal::None, internal::None, internal::None,
4255 internal::None, internal::None, internal::None, internal::None,
4256 internal::None, internal::None, internal::None, internal::None,
4257 internal::None, internal::None, internal::None, internal::None,
4258 internal::None, internal::None, internal::None> {
4259 typedef internal::Types5<T1, T2, T3, T4, T5> type;
4261 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4263 struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
4264 internal::None, internal::None, internal::None, internal::None,
4265 internal::None, internal::None, internal::None, internal::None,
4266 internal::None, internal::None, internal::None, internal::None,
4267 internal::None, internal::None, internal::None, internal::None,
4268 internal::None, internal::None, internal::None, internal::None,
4269 internal::None, internal::None, internal::None, internal::None,
4270 internal::None, internal::None, internal::None, internal::None,
4271 internal::None, internal::None, internal::None, internal::None,
4272 internal::None, internal::None, internal::None, internal::None,
4273 internal::None, internal::None, internal::None, internal::None,
4274 internal::None, internal::None> {
4275 typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
4277 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4278 typename T6, typename T7>
4279 struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
4280 internal::None, internal::None, internal::None, internal::None,
4281 internal::None, internal::None, internal::None, internal::None,
4282 internal::None, internal::None, internal::None, internal::None,
4283 internal::None, internal::None, internal::None, internal::None,
4284 internal::None, internal::None, internal::None, internal::None,
4285 internal::None, internal::None, internal::None, internal::None,
4286 internal::None, internal::None, internal::None, internal::None,
4287 internal::None, internal::None, internal::None, internal::None,
4288 internal::None, internal::None, internal::None, internal::None,
4289 internal::None, internal::None, internal::None, internal::None,
4291 typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
4293 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4294 typename T6, typename T7, typename T8>
4295 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
4296 internal::None, internal::None, internal::None, internal::None,
4297 internal::None, internal::None, internal::None, internal::None,
4298 internal::None, internal::None, internal::None, internal::None,
4299 internal::None, internal::None, internal::None, internal::None,
4300 internal::None, internal::None, internal::None, internal::None,
4301 internal::None, internal::None, internal::None, internal::None,
4302 internal::None, internal::None, internal::None, internal::None,
4303 internal::None, internal::None, internal::None, internal::None,
4304 internal::None, internal::None, internal::None, internal::None,
4305 internal::None, internal::None, internal::None, internal::None> {
4306 typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
4308 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4309 typename T6, typename T7, typename T8, typename T9>
4310 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
4311 internal::None, internal::None, internal::None, internal::None,
4312 internal::None, internal::None, internal::None, internal::None,
4313 internal::None, internal::None, internal::None, internal::None,
4314 internal::None, internal::None, internal::None, internal::None,
4315 internal::None, internal::None, internal::None, internal::None,
4316 internal::None, internal::None, internal::None, internal::None,
4317 internal::None, internal::None, internal::None, internal::None,
4318 internal::None, internal::None, internal::None, internal::None,
4319 internal::None, internal::None, internal::None, internal::None,
4320 internal::None, internal::None, internal::None, internal::None> {
4321 typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
4323 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4324 typename T6, typename T7, typename T8, typename T9, typename T10>
4325 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
4326 internal::None, internal::None, internal::None, internal::None,
4327 internal::None, internal::None, internal::None, internal::None,
4328 internal::None, internal::None, internal::None, internal::None,
4329 internal::None, internal::None, internal::None, internal::None,
4330 internal::None, internal::None, internal::None, internal::None,
4331 internal::None, internal::None, internal::None, internal::None,
4332 internal::None, internal::None, internal::None, internal::None,
4333 internal::None, internal::None, internal::None, internal::None,
4334 internal::None, internal::None, internal::None, internal::None,
4335 internal::None, internal::None, internal::None> {
4336 typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
4338 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4339 typename T6, typename T7, typename T8, typename T9, typename T10,
4341 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
4342 internal::None, internal::None, internal::None, internal::None,
4343 internal::None, internal::None, internal::None, internal::None,
4344 internal::None, internal::None, internal::None, internal::None,
4345 internal::None, internal::None, internal::None, internal::None,
4346 internal::None, internal::None, internal::None, internal::None,
4347 internal::None, internal::None, internal::None, internal::None,
4348 internal::None, internal::None, internal::None, internal::None,
4349 internal::None, internal::None, internal::None, internal::None,
4350 internal::None, internal::None, internal::None, internal::None,
4351 internal::None, internal::None> {
4352 typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
4354 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4355 typename T6, typename T7, typename T8, typename T9, typename T10,
4356 typename T11, typename T12>
4357 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
4358 internal::None, internal::None, internal::None, internal::None,
4359 internal::None, internal::None, internal::None, internal::None,
4360 internal::None, internal::None, internal::None, internal::None,
4361 internal::None, internal::None, internal::None, internal::None,
4362 internal::None, internal::None, internal::None, internal::None,
4363 internal::None, internal::None, internal::None, internal::None,
4364 internal::None, internal::None, internal::None, internal::None,
4365 internal::None, internal::None, internal::None, internal::None,
4366 internal::None, internal::None, internal::None, internal::None,
4368 typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
4371 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4372 typename T6, typename T7, typename T8, typename T9, typename T10,
4373 typename T11, typename T12, typename T13>
4374 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
4375 internal::None, internal::None, internal::None, internal::None,
4376 internal::None, internal::None, internal::None, internal::None,
4377 internal::None, internal::None, internal::None, internal::None,
4378 internal::None, internal::None, internal::None, internal::None,
4379 internal::None, internal::None, internal::None, internal::None,
4380 internal::None, internal::None, internal::None, internal::None,
4381 internal::None, internal::None, internal::None, internal::None,
4382 internal::None, internal::None, internal::None, internal::None,
4383 internal::None, internal::None, internal::None, internal::None,
4385 typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4388 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4389 typename T6, typename T7, typename T8, typename T9, typename T10,
4390 typename T11, typename T12, typename T13, typename T14>
4391 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4392 internal::None, internal::None, internal::None, internal::None,
4393 internal::None, internal::None, internal::None, internal::None,
4394 internal::None, internal::None, internal::None, internal::None,
4395 internal::None, internal::None, internal::None, internal::None,
4396 internal::None, internal::None, internal::None, internal::None,
4397 internal::None, internal::None, internal::None, internal::None,
4398 internal::None, internal::None, internal::None, internal::None,
4399 internal::None, internal::None, internal::None, internal::None,
4400 internal::None, internal::None, internal::None, internal::None> {
4401 typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4404 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4405 typename T6, typename T7, typename T8, typename T9, typename T10,
4406 typename T11, typename T12, typename T13, typename T14, typename T15>
4407 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4408 internal::None, internal::None, internal::None, internal::None,
4409 internal::None, internal::None, internal::None, internal::None,
4410 internal::None, internal::None, internal::None, internal::None,
4411 internal::None, internal::None, internal::None, internal::None,
4412 internal::None, internal::None, internal::None, internal::None,
4413 internal::None, internal::None, internal::None, internal::None,
4414 internal::None, internal::None, internal::None, internal::None,
4415 internal::None, internal::None, internal::None, internal::None,
4416 internal::None, internal::None, internal::None> {
4417 typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4418 T13, T14, T15> type;
4420 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4421 typename T6, typename T7, typename T8, typename T9, typename T10,
4422 typename T11, typename T12, typename T13, typename T14, typename T15,
4424 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4425 T16, internal::None, internal::None, internal::None, internal::None,
4426 internal::None, internal::None, internal::None, internal::None,
4427 internal::None, internal::None, internal::None, internal::None,
4428 internal::None, internal::None, internal::None, internal::None,
4429 internal::None, internal::None, internal::None, internal::None,
4430 internal::None, internal::None, internal::None, internal::None,
4431 internal::None, internal::None, internal::None, internal::None,
4432 internal::None, internal::None, internal::None, internal::None,
4433 internal::None, internal::None> {
4434 typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4435 T13, T14, T15, T16> type;
4437 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4438 typename T6, typename T7, typename T8, typename T9, typename T10,
4439 typename T11, typename T12, typename T13, typename T14, typename T15,
4440 typename T16, typename T17>
4441 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4442 T16, T17, internal::None, internal::None, internal::None, internal::None,
4443 internal::None, internal::None, internal::None, internal::None,
4444 internal::None, internal::None, internal::None, internal::None,
4445 internal::None, internal::None, internal::None, internal::None,
4446 internal::None, internal::None, internal::None, internal::None,
4447 internal::None, internal::None, internal::None, internal::None,
4448 internal::None, internal::None, internal::None, internal::None,
4449 internal::None, internal::None, internal::None, internal::None,
4451 typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4452 T13, T14, T15, T16, T17> type;
4454 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4455 typename T6, typename T7, typename T8, typename T9, typename T10,
4456 typename T11, typename T12, typename T13, typename T14, typename T15,
4457 typename T16, typename T17, typename T18>
4458 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4459 T16, T17, T18, internal::None, internal::None, internal::None,
4460 internal::None, internal::None, internal::None, internal::None,
4461 internal::None, internal::None, internal::None, internal::None,
4462 internal::None, internal::None, internal::None, internal::None,
4463 internal::None, internal::None, internal::None, internal::None,
4464 internal::None, internal::None, internal::None, internal::None,
4465 internal::None, internal::None, internal::None, internal::None,
4466 internal::None, internal::None, internal::None, internal::None,
4468 typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4469 T13, T14, T15, T16, T17, T18> type;
4471 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4472 typename T6, typename T7, typename T8, typename T9, typename T10,
4473 typename T11, typename T12, typename T13, typename T14, typename T15,
4474 typename T16, typename T17, typename T18, typename T19>
4475 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4476 T16, T17, T18, T19, internal::None, internal::None, internal::None,
4477 internal::None, internal::None, internal::None, internal::None,
4478 internal::None, internal::None, internal::None, internal::None,
4479 internal::None, internal::None, internal::None, internal::None,
4480 internal::None, internal::None, internal::None, internal::None,
4481 internal::None, internal::None, internal::None, internal::None,
4482 internal::None, internal::None, internal::None, internal::None,
4483 internal::None, internal::None, internal::None, internal::None> {
4484 typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4485 T13, T14, T15, T16, T17, T18, T19> type;
4487 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4488 typename T6, typename T7, typename T8, typename T9, typename T10,
4489 typename T11, typename T12, typename T13, typename T14, typename T15,
4490 typename T16, typename T17, typename T18, typename T19, typename T20>
4491 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4492 T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
4493 internal::None, internal::None, internal::None, internal::None,
4494 internal::None, internal::None, internal::None, internal::None,
4495 internal::None, internal::None, internal::None, internal::None,
4496 internal::None, internal::None, internal::None, internal::None,
4497 internal::None, internal::None, internal::None, internal::None,
4498 internal::None, internal::None, internal::None, internal::None,
4499 internal::None, internal::None, internal::None> {
4500 typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4501 T13, T14, T15, T16, T17, T18, T19, T20> type;
4503 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4504 typename T6, typename T7, typename T8, typename T9, typename T10,
4505 typename T11, typename T12, typename T13, typename T14, typename T15,
4506 typename T16, typename T17, typename T18, typename T19, typename T20,
4508 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4509 T16, T17, T18, T19, T20, T21, 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, internal::None, internal::None,
4516 internal::None, internal::None, internal::None> {
4517 typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4518 T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
4520 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4521 typename T6, typename T7, typename T8, typename T9, typename T10,
4522 typename T11, typename T12, typename T13, typename T14, typename T15,
4523 typename T16, typename T17, typename T18, typename T19, typename T20,
4524 typename T21, typename T22>
4525 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4526 T16, T17, T18, T19, T20, T21, T22, 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, internal::None, internal::None,
4532 internal::None, internal::None, internal::None, internal::None,
4533 internal::None, internal::None> {
4534 typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4535 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
4537 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4538 typename T6, typename T7, typename T8, typename T9, typename T10,
4539 typename T11, typename T12, typename T13, typename T14, typename T15,
4540 typename T16, typename T17, typename T18, typename T19, typename T20,
4541 typename T21, typename T22, typename T23>
4542 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4543 T16, T17, T18, T19, T20, T21, T22, T23, 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,
4547 internal::None, internal::None, internal::None, internal::None,
4548 internal::None, internal::None, internal::None, internal::None,
4549 internal::None, internal::None, internal::None, internal::None,
4551 typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4552 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
4554 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4555 typename T6, typename T7, typename T8, typename T9, typename T10,
4556 typename T11, typename T12, typename T13, typename T14, typename T15,
4557 typename T16, typename T17, typename T18, typename T19, typename T20,
4558 typename T21, typename T22, typename T23, typename T24>
4559 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4560 T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
4561 internal::None, internal::None, internal::None, internal::None,
4562 internal::None, internal::None, internal::None, internal::None,
4563 internal::None, internal::None, internal::None, internal::None,
4564 internal::None, internal::None, internal::None, internal::None,
4565 internal::None, internal::None, internal::None, internal::None,
4566 internal::None, internal::None, internal::None, internal::None,
4568 typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4569 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
4571 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4572 typename T6, typename T7, typename T8, typename T9, typename T10,
4573 typename T11, typename T12, typename T13, typename T14, typename T15,
4574 typename T16, typename T17, typename T18, typename T19, typename T20,
4575 typename T21, typename T22, typename T23, typename T24, typename T25>
4576 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4577 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
4578 internal::None, internal::None, internal::None, internal::None,
4579 internal::None, internal::None, internal::None, internal::None,
4580 internal::None, internal::None, internal::None, internal::None,
4581 internal::None, internal::None, internal::None, internal::None,
4582 internal::None, internal::None, internal::None, internal::None,
4583 internal::None, internal::None, internal::None, internal::None> {
4584 typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4585 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
4587 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4588 typename T6, typename T7, typename T8, typename T9, typename T10,
4589 typename T11, typename T12, typename T13, typename T14, typename T15,
4590 typename T16, typename T17, typename T18, typename T19, typename T20,
4591 typename T21, typename T22, typename T23, typename T24, typename T25,
4593 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4594 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
4595 internal::None, internal::None, internal::None, internal::None,
4596 internal::None, internal::None, internal::None, internal::None,
4597 internal::None, internal::None, internal::None, internal::None,
4598 internal::None, internal::None, internal::None, internal::None,
4599 internal::None, internal::None, internal::None, internal::None,
4600 internal::None, internal::None, internal::None> {
4601 typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4602 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
4605 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4606 typename T6, typename T7, typename T8, typename T9, typename T10,
4607 typename T11, typename T12, typename T13, typename T14, typename T15,
4608 typename T16, typename T17, typename T18, typename T19, typename T20,
4609 typename T21, typename T22, typename T23, typename T24, typename T25,
4610 typename T26, typename T27>
4611 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4612 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
4613 internal::None, internal::None, internal::None, internal::None,
4614 internal::None, internal::None, internal::None, internal::None,
4615 internal::None, internal::None, internal::None, internal::None,
4616 internal::None, internal::None, internal::None, internal::None,
4617 internal::None, internal::None, internal::None, internal::None,
4618 internal::None, internal::None> {
4619 typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4620 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4623 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4624 typename T6, typename T7, typename T8, typename T9, typename T10,
4625 typename T11, typename T12, typename T13, typename T14, typename T15,
4626 typename T16, typename T17, typename T18, typename T19, typename T20,
4627 typename T21, typename T22, typename T23, typename T24, typename T25,
4628 typename T26, typename T27, typename T28>
4629 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4630 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
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> {
4637 typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4638 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4641 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4642 typename T6, typename T7, typename T8, typename T9, typename T10,
4643 typename T11, typename T12, typename T13, typename T14, typename T15,
4644 typename T16, typename T17, typename T18, typename T19, typename T20,
4645 typename T21, typename T22, typename T23, typename T24, typename T25,
4646 typename T26, typename T27, typename T28, typename T29>
4647 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4648 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
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,
4655 typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4656 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4657 T27, T28, T29> type;
4659 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4660 typename T6, typename T7, typename T8, typename T9, typename T10,
4661 typename T11, typename T12, typename T13, typename T14, typename T15,
4662 typename T16, typename T17, typename T18, typename T19, typename T20,
4663 typename T21, typename T22, typename T23, typename T24, typename T25,
4664 typename T26, typename T27, typename T28, typename T29, typename T30>
4665 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4666 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
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, internal::None,
4670 internal::None, internal::None, internal::None, internal::None,
4671 internal::None, internal::None, internal::None, internal::None> {
4672 typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4673 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4674 T27, T28, T29, T30> type;
4676 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4677 typename T6, typename T7, typename T8, typename T9, typename T10,
4678 typename T11, typename T12, typename T13, typename T14, typename T15,
4679 typename T16, typename T17, typename T18, typename T19, typename T20,
4680 typename T21, typename T22, typename T23, typename T24, typename T25,
4681 typename T26, typename T27, typename T28, typename T29, typename T30,
4683 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4684 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4685 T31, internal::None, internal::None, internal::None, internal::None,
4686 internal::None, internal::None, internal::None, internal::None,
4687 internal::None, internal::None, internal::None, internal::None,
4688 internal::None, internal::None, internal::None, internal::None,
4689 internal::None, internal::None, internal::None> {
4690 typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4691 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4692 T27, T28, T29, T30, T31> type;
4694 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4695 typename T6, typename T7, typename T8, typename T9, typename T10,
4696 typename T11, typename T12, typename T13, typename T14, typename T15,
4697 typename T16, typename T17, typename T18, typename T19, typename T20,
4698 typename T21, typename T22, typename T23, typename T24, typename T25,
4699 typename T26, typename T27, typename T28, typename T29, typename T30,
4700 typename T31, typename T32>
4701 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4702 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4703 T31, T32, internal::None, internal::None, internal::None, internal::None,
4704 internal::None, internal::None, internal::None, internal::None,
4705 internal::None, internal::None, internal::None, internal::None,
4706 internal::None, internal::None, internal::None, internal::None,
4707 internal::None, internal::None> {
4708 typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4709 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4710 T27, T28, T29, T30, T31, T32> type;
4712 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4713 typename T6, typename T7, typename T8, typename T9, typename T10,
4714 typename T11, typename T12, typename T13, typename T14, typename T15,
4715 typename T16, typename T17, typename T18, typename T19, typename T20,
4716 typename T21, typename T22, typename T23, typename T24, typename T25,
4717 typename T26, typename T27, typename T28, typename T29, typename T30,
4718 typename T31, typename T32, typename T33>
4719 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4720 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4721 T31, T32, T33, internal::None, internal::None, internal::None,
4722 internal::None, internal::None, internal::None, internal::None,
4723 internal::None, internal::None, internal::None, internal::None,
4724 internal::None, internal::None, internal::None, internal::None,
4725 internal::None, internal::None> {
4726 typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4727 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4728 T27, T28, T29, T30, T31, T32, T33> type;
4730 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4731 typename T6, typename T7, typename T8, typename T9, typename T10,
4732 typename T11, typename T12, typename T13, typename T14, typename T15,
4733 typename T16, typename T17, typename T18, typename T19, typename T20,
4734 typename T21, typename T22, typename T23, typename T24, typename T25,
4735 typename T26, typename T27, typename T28, typename T29, typename T30,
4736 typename T31, typename T32, typename T33, typename T34>
4737 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4738 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4739 T31, T32, T33, T34, internal::None, internal::None, internal::None,
4740 internal::None, internal::None, internal::None, internal::None,
4741 internal::None, internal::None, internal::None, internal::None,
4742 internal::None, internal::None, internal::None, internal::None,
4744 typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4745 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4746 T27, T28, T29, T30, T31, T32, T33, T34> type;
4748 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4749 typename T6, typename T7, typename T8, typename T9, typename T10,
4750 typename T11, typename T12, typename T13, typename T14, typename T15,
4751 typename T16, typename T17, typename T18, typename T19, typename T20,
4752 typename T21, typename T22, typename T23, typename T24, typename T25,
4753 typename T26, typename T27, typename T28, typename T29, typename T30,
4754 typename T31, typename T32, typename T33, typename T34, typename T35>
4755 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4756 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4757 T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
4758 internal::None, internal::None, internal::None, internal::None,
4759 internal::None, internal::None, internal::None, internal::None,
4760 internal::None, internal::None, internal::None, internal::None> {
4761 typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4762 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4763 T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
4765 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4766 typename T6, typename T7, typename T8, typename T9, typename T10,
4767 typename T11, typename T12, typename T13, typename T14, typename T15,
4768 typename T16, typename T17, typename T18, typename T19, typename T20,
4769 typename T21, typename T22, typename T23, typename T24, typename T25,
4770 typename T26, typename T27, typename T28, typename T29, typename T30,
4771 typename T31, typename T32, typename T33, typename T34, typename T35,
4773 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4774 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4775 T31, T32, T33, T34, T35, T36, internal::None, internal::None,
4776 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 typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4780 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4781 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
4783 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4784 typename T6, typename T7, typename T8, typename T9, typename T10,
4785 typename T11, typename T12, typename T13, typename T14, typename T15,
4786 typename T16, typename T17, typename T18, typename T19, typename T20,
4787 typename T21, typename T22, typename T23, typename T24, typename T25,
4788 typename T26, typename T27, typename T28, typename T29, typename T30,
4789 typename T31, typename T32, typename T33, typename T34, typename T35,
4790 typename T36, typename T37>
4791 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4792 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4793 T31, T32, T33, T34, T35, T36, T37, 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> {
4797 typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4798 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4799 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
4801 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4802 typename T6, typename T7, typename T8, typename T9, typename T10,
4803 typename T11, typename T12, typename T13, typename T14, typename T15,
4804 typename T16, typename T17, typename T18, typename T19, typename T20,
4805 typename T21, typename T22, typename T23, typename T24, typename T25,
4806 typename T26, typename T27, typename T28, typename T29, typename T30,
4807 typename T31, typename T32, typename T33, typename T34, typename T35,
4808 typename T36, typename T37, typename T38>
4809 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4810 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4811 T31, T32, T33, T34, T35, T36, T37, T38, 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> {
4815 typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4816 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4817 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
4819 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4820 typename T6, typename T7, typename T8, typename T9, typename T10,
4821 typename T11, typename T12, typename T13, typename T14, typename T15,
4822 typename T16, typename T17, typename T18, typename T19, typename T20,
4823 typename T21, typename T22, typename T23, typename T24, typename T25,
4824 typename T26, typename T27, typename T28, typename T29, typename T30,
4825 typename T31, typename T32, typename T33, typename T34, typename T35,
4826 typename T36, typename T37, typename T38, typename T39>
4827 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4828 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4829 T31, T32, T33, T34, T35, T36, T37, T38, T39, 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> {
4833 typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4834 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4835 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> 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,
4841 typename T21, typename T22, typename T23, typename T24, typename T25,
4842 typename T26, typename T27, typename T28, typename T29, typename T30,
4843 typename T31, typename T32, typename T33, typename T34, typename T35,
4844 typename T36, typename T37, typename T38, typename T39, typename T40>
4845 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4846 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4847 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
4848 internal::None, internal::None, internal::None, internal::None,
4849 internal::None, internal::None, internal::None, internal::None,
4851 typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4852 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4853 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
4856 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4857 typename T6, typename T7, typename T8, typename T9, typename T10,
4858 typename T11, typename T12, typename T13, typename T14, typename T15,
4859 typename T16, typename T17, typename T18, typename T19, typename T20,
4860 typename T21, typename T22, typename T23, typename T24, typename T25,
4861 typename T26, typename T27, typename T28, typename T29, typename T30,
4862 typename T31, typename T32, typename T33, typename T34, typename T35,
4863 typename T36, typename T37, typename T38, typename T39, typename T40,
4865 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4866 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4867 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
4868 internal::None, internal::None, internal::None, internal::None,
4869 internal::None, internal::None, internal::None, internal::None> {
4870 typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4871 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4872 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4875 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4876 typename T6, typename T7, typename T8, typename T9, typename T10,
4877 typename T11, typename T12, typename T13, typename T14, typename T15,
4878 typename T16, typename T17, typename T18, typename T19, typename T20,
4879 typename T21, typename T22, typename T23, typename T24, typename T25,
4880 typename T26, typename T27, typename T28, typename T29, typename T30,
4881 typename T31, typename T32, typename T33, typename T34, typename T35,
4882 typename T36, typename T37, typename T38, typename T39, typename T40,
4883 typename T41, typename T42>
4884 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4885 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4886 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
4887 internal::None, internal::None, internal::None, internal::None,
4888 internal::None, internal::None, internal::None> {
4889 typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4890 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4891 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4894 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4895 typename T6, typename T7, typename T8, typename T9, typename T10,
4896 typename T11, typename T12, typename T13, typename T14, typename T15,
4897 typename T16, typename T17, typename T18, typename T19, typename T20,
4898 typename T21, typename T22, typename T23, typename T24, typename T25,
4899 typename T26, typename T27, typename T28, typename T29, typename T30,
4900 typename T31, typename T32, typename T33, typename T34, typename T35,
4901 typename T36, typename T37, typename T38, typename T39, typename T40,
4902 typename T41, typename T42, typename T43>
4903 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4904 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4905 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4906 internal::None, internal::None, internal::None, internal::None,
4907 internal::None, internal::None, internal::None> {
4908 typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4909 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4910 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4911 T41, T42, T43> type;
4913 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4914 typename T6, typename T7, typename T8, typename T9, typename T10,
4915 typename T11, typename T12, typename T13, typename T14, typename T15,
4916 typename T16, typename T17, typename T18, typename T19, typename T20,
4917 typename T21, typename T22, typename T23, typename T24, typename T25,
4918 typename T26, typename T27, typename T28, typename T29, typename T30,
4919 typename T31, typename T32, typename T33, typename T34, typename T35,
4920 typename T36, typename T37, typename T38, typename T39, typename T40,
4921 typename T41, typename T42, typename T43, typename T44>
4922 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4923 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4924 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
4925 internal::None, internal::None, internal::None, internal::None,
4926 internal::None, internal::None> {
4927 typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4928 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4929 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4930 T41, T42, T43, T44> type;
4932 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4933 typename T6, typename T7, typename T8, typename T9, typename T10,
4934 typename T11, typename T12, typename T13, typename T14, typename T15,
4935 typename T16, typename T17, typename T18, typename T19, typename T20,
4936 typename T21, typename T22, typename T23, typename T24, typename T25,
4937 typename T26, typename T27, typename T28, typename T29, typename T30,
4938 typename T31, typename T32, typename T33, typename T34, typename T35,
4939 typename T36, typename T37, typename T38, typename T39, typename T40,
4940 typename T41, typename T42, typename T43, typename T44, typename T45>
4941 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4942 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4943 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
4944 internal::None, internal::None, internal::None, internal::None,
4946 typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4947 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4948 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4949 T41, T42, T43, T44, T45> type;
4951 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4952 typename T6, typename T7, typename T8, typename T9, typename T10,
4953 typename T11, typename T12, typename T13, typename T14, typename T15,
4954 typename T16, typename T17, typename T18, typename T19, typename T20,
4955 typename T21, typename T22, typename T23, typename T24, typename T25,
4956 typename T26, typename T27, typename T28, typename T29, typename T30,
4957 typename T31, typename T32, typename T33, typename T34, typename T35,
4958 typename T36, typename T37, typename T38, typename T39, typename T40,
4959 typename T41, typename T42, typename T43, typename T44, typename T45,
4961 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4962 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4963 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
4964 T46, internal::None, internal::None, internal::None, internal::None> {
4965 typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4966 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4967 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4968 T41, T42, T43, T44, T45, T46> type;
4970 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4971 typename T6, typename T7, typename T8, typename T9, typename T10,
4972 typename T11, typename T12, typename T13, typename T14, typename T15,
4973 typename T16, typename T17, typename T18, typename T19, typename T20,
4974 typename T21, typename T22, typename T23, typename T24, typename T25,
4975 typename T26, typename T27, typename T28, typename T29, typename T30,
4976 typename T31, typename T32, typename T33, typename T34, typename T35,
4977 typename T36, typename T37, typename T38, typename T39, typename T40,
4978 typename T41, typename T42, typename T43, typename T44, typename T45,
4979 typename T46, typename T47>
4980 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4981 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4982 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
4983 T46, T47, internal::None, internal::None, internal::None> {
4984 typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4985 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4986 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4987 T41, T42, T43, T44, T45, T46, T47> type;
4989 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4990 typename T6, typename T7, typename T8, typename T9, typename T10,
4991 typename T11, typename T12, typename T13, typename T14, typename T15,
4992 typename T16, typename T17, typename T18, typename T19, typename T20,
4993 typename T21, typename T22, typename T23, typename T24, typename T25,
4994 typename T26, typename T27, typename T28, typename T29, typename T30,
4995 typename T31, typename T32, typename T33, typename T34, typename T35,
4996 typename T36, typename T37, typename T38, typename T39, typename T40,
4997 typename T41, typename T42, typename T43, typename T44, typename T45,
4998 typename T46, typename T47, typename T48>
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 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5002 T46, T47, T48, internal::None, internal::None> {
5003 typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5004 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5005 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5006 T41, T42, T43, T44, T45, T46, T47, T48> type;
5008 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5009 typename T6, typename T7, typename T8, typename T9, typename T10,
5010 typename T11, typename T12, typename T13, typename T14, typename T15,
5011 typename T16, typename T17, typename T18, typename T19, typename T20,
5012 typename T21, typename T22, typename T23, typename T24, typename T25,
5013 typename T26, typename T27, typename T28, typename T29, typename T30,
5014 typename T31, typename T32, typename T33, typename T34, typename T35,
5015 typename T36, typename T37, typename T38, typename T39, typename T40,
5016 typename T41, typename T42, typename T43, typename T44, typename T45,
5017 typename T46, typename T47, typename T48, typename T49>
5018 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5019 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5020 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5021 T46, T47, T48, T49, internal::None> {
5022 typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5023 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5024 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5025 T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
5028 namespace internal {
5030 # define GTEST_TEMPLATE_ template <typename T> class
5032 // The template "selector" struct TemplateSel<Tmpl> is used to
5033 // represent Tmpl, which must be a class template with one type
5034 // parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined
5035 // as the type Tmpl<T>. This allows us to actually instantiate the
5036 // template "selected" by TemplateSel<Tmpl>.
5038 // This trick is necessary for simulating typedef for class templates,
5039 // which C++ doesn't support directly.
5040 template <GTEST_TEMPLATE_ Tmpl>
5041 struct TemplateSel {
5042 template <typename T>
5044 typedef Tmpl<T> type;
5048 # define GTEST_BIND_(TmplSel, T) \
5049 TmplSel::template Bind<T>::type
5051 // A unique struct template used as the default value for the
5052 // arguments of class template Templates. This allows us to simulate
5053 // variadic templates (e.g. Templates<int>, Templates<int, double>,
5054 // and etc), which C++ doesn't support directly.
5055 template <typename T>
5058 // The following family of struct and struct templates are used to
5059 // represent template lists. In particular, TemplatesN<T1, T2, ...,
5060 // TN> represents a list of N templates (T1, T2, ..., and TN). Except
5061 // for Templates0, every struct in the family has two member types:
5062 // Head for the selector of the first template in the list, and Tail
5063 // for the rest of the list.
5065 // The empty template list.
5066 struct Templates0 {};
5068 // Template lists of length 1, 2, 3, and so on.
5070 template <GTEST_TEMPLATE_ T1>
5072 typedef TemplateSel<T1> Head;
5073 typedef Templates0 Tail;
5075 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
5077 typedef TemplateSel<T1> Head;
5078 typedef Templates1<T2> Tail;
5081 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
5083 typedef TemplateSel<T1> Head;
5084 typedef Templates2<T2, T3> Tail;
5087 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5090 typedef TemplateSel<T1> Head;
5091 typedef Templates3<T2, T3, T4> Tail;
5094 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5095 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
5097 typedef TemplateSel<T1> Head;
5098 typedef Templates4<T2, T3, T4, T5> Tail;
5101 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5102 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
5104 typedef TemplateSel<T1> Head;
5105 typedef Templates5<T2, T3, T4, T5, T6> Tail;
5108 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5109 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5112 typedef TemplateSel<T1> Head;
5113 typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
5116 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5117 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5118 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
5120 typedef TemplateSel<T1> Head;
5121 typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
5124 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5125 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5126 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
5128 typedef TemplateSel<T1> Head;
5129 typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
5132 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5133 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5134 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5135 GTEST_TEMPLATE_ T10>
5136 struct Templates10 {
5137 typedef TemplateSel<T1> Head;
5138 typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
5141 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5142 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5143 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5144 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
5145 struct Templates11 {
5146 typedef TemplateSel<T1> Head;
5147 typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
5150 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5151 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5152 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5153 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
5154 struct Templates12 {
5155 typedef TemplateSel<T1> Head;
5156 typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
5159 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5160 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5161 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5162 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5163 GTEST_TEMPLATE_ T13>
5164 struct Templates13 {
5165 typedef TemplateSel<T1> Head;
5166 typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
5169 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5170 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5171 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5172 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5173 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
5174 struct Templates14 {
5175 typedef TemplateSel<T1> Head;
5176 typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5180 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5181 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5182 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5183 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5184 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
5185 struct Templates15 {
5186 typedef TemplateSel<T1> Head;
5187 typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5191 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5192 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5193 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5194 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5195 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5196 GTEST_TEMPLATE_ T16>
5197 struct Templates16 {
5198 typedef TemplateSel<T1> Head;
5199 typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5203 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5204 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5205 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5206 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5207 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5208 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
5209 struct Templates17 {
5210 typedef TemplateSel<T1> Head;
5211 typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5212 T15, T16, T17> Tail;
5215 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5216 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5217 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5218 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5219 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5220 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
5221 struct Templates18 {
5222 typedef TemplateSel<T1> Head;
5223 typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5224 T15, T16, T17, T18> Tail;
5227 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5228 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5229 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5230 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5231 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5232 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5233 GTEST_TEMPLATE_ T19>
5234 struct Templates19 {
5235 typedef TemplateSel<T1> Head;
5236 typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5237 T15, T16, T17, T18, T19> Tail;
5240 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5241 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5242 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5243 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5244 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5245 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5246 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
5247 struct Templates20 {
5248 typedef TemplateSel<T1> Head;
5249 typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5250 T15, T16, T17, T18, T19, T20> Tail;
5253 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5254 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5255 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5256 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5257 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5258 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5259 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
5260 struct Templates21 {
5261 typedef TemplateSel<T1> Head;
5262 typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5263 T15, T16, T17, T18, T19, T20, T21> Tail;
5266 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5267 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5268 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5269 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5270 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5271 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5272 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5273 GTEST_TEMPLATE_ T22>
5274 struct Templates22 {
5275 typedef TemplateSel<T1> Head;
5276 typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5277 T15, T16, T17, T18, T19, T20, T21, T22> Tail;
5280 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5281 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5282 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5283 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5284 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5285 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5286 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5287 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
5288 struct Templates23 {
5289 typedef TemplateSel<T1> Head;
5290 typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5291 T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
5294 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5295 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5296 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5297 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5298 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5299 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5300 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5301 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
5302 struct Templates24 {
5303 typedef TemplateSel<T1> Head;
5304 typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5305 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
5308 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5309 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5310 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5311 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5312 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5313 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5314 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5315 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5316 GTEST_TEMPLATE_ T25>
5317 struct Templates25 {
5318 typedef TemplateSel<T1> Head;
5319 typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5320 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
5323 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5324 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5325 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5326 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5327 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5328 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5329 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5330 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5331 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
5332 struct Templates26 {
5333 typedef TemplateSel<T1> Head;
5334 typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5335 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
5338 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5339 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5340 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5341 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5342 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5343 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5344 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5345 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5346 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
5347 struct Templates27 {
5348 typedef TemplateSel<T1> Head;
5349 typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5350 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
5353 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5354 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5355 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5356 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5357 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5358 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5359 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5360 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5361 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5362 GTEST_TEMPLATE_ T28>
5363 struct Templates28 {
5364 typedef TemplateSel<T1> Head;
5365 typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5366 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
5370 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5371 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5372 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5373 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5374 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5375 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5376 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5377 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5378 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5379 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
5380 struct Templates29 {
5381 typedef TemplateSel<T1> Head;
5382 typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5383 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5387 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5388 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5389 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5390 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5391 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5392 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5393 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5394 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5395 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5396 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
5397 struct Templates30 {
5398 typedef TemplateSel<T1> Head;
5399 typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5400 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5404 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5405 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5406 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5407 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5408 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5409 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5410 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5411 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5412 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5413 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5414 GTEST_TEMPLATE_ T31>
5415 struct Templates31 {
5416 typedef TemplateSel<T1> Head;
5417 typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5418 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5419 T29, T30, T31> Tail;
5422 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5423 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5424 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5425 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5426 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5427 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5428 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5429 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5430 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5431 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5432 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
5433 struct Templates32 {
5434 typedef TemplateSel<T1> Head;
5435 typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5436 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5437 T29, T30, T31, T32> Tail;
5440 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5441 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5442 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5443 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5444 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5445 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5446 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5447 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5448 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5449 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5450 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
5451 struct Templates33 {
5452 typedef TemplateSel<T1> Head;
5453 typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5454 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5455 T29, T30, T31, T32, T33> 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,
5461 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5462 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5463 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5464 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5465 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5466 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5467 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5468 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5469 GTEST_TEMPLATE_ T34>
5470 struct Templates34 {
5471 typedef TemplateSel<T1> Head;
5472 typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5473 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5474 T29, T30, T31, T32, T33, T34> Tail;
5477 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5478 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5479 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5480 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5481 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5482 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5483 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5484 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5485 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5486 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5487 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5488 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
5489 struct Templates35 {
5490 typedef TemplateSel<T1> Head;
5491 typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5492 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5493 T29, T30, T31, T32, T33, T34, T35> Tail;
5496 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5497 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5498 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5499 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5500 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5501 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5502 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5503 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5504 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5505 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5506 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5507 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
5508 struct Templates36 {
5509 typedef TemplateSel<T1> Head;
5510 typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5511 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5512 T29, T30, T31, T32, T33, T34, T35, T36> Tail;
5515 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5516 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5517 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5518 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5519 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5520 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5521 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5522 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5523 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5524 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5525 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5526 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5527 GTEST_TEMPLATE_ T37>
5528 struct Templates37 {
5529 typedef TemplateSel<T1> Head;
5530 typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5531 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5532 T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
5535 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5536 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5537 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5538 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5539 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5540 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5541 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5542 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5543 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5544 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5545 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5546 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5547 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
5548 struct Templates38 {
5549 typedef TemplateSel<T1> Head;
5550 typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5551 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5552 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
5555 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5556 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5557 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5558 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5559 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5560 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5561 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5562 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5563 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5564 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5565 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5566 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5567 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
5568 struct Templates39 {
5569 typedef TemplateSel<T1> Head;
5570 typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5571 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5572 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
5575 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5576 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5577 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5578 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5579 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5580 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5581 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5582 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5583 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5584 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5585 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5586 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5587 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5588 GTEST_TEMPLATE_ T40>
5589 struct Templates40 {
5590 typedef TemplateSel<T1> Head;
5591 typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5592 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5593 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
5596 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5597 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5598 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5599 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5600 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5601 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5602 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5603 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5604 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5605 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5606 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5607 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5608 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5609 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
5610 struct Templates41 {
5611 typedef TemplateSel<T1> Head;
5612 typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5613 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5614 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
5617 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5618 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5619 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5620 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5621 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5622 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5623 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5624 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5625 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5626 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5627 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5628 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5629 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5630 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
5631 struct Templates42 {
5632 typedef TemplateSel<T1> Head;
5633 typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5634 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5635 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
5639 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5640 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5641 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5642 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5643 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5644 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5645 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5646 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5647 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5648 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5649 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5650 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5651 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5652 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5653 GTEST_TEMPLATE_ T43>
5654 struct Templates43 {
5655 typedef TemplateSel<T1> Head;
5656 typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5657 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5658 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5662 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5663 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5664 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5665 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5666 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5667 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5668 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5669 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5670 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5671 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5672 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5673 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5674 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5675 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5676 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
5677 struct Templates44 {
5678 typedef TemplateSel<T1> Head;
5679 typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5680 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5681 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5685 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5686 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5687 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5688 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5689 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5690 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5691 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5692 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5693 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5694 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5695 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5696 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5697 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5698 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5699 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
5700 struct Templates45 {
5701 typedef TemplateSel<T1> Head;
5702 typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5703 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5704 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5705 T43, T44, T45> Tail;
5708 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5709 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5710 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5711 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5712 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5713 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5714 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5715 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5716 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5717 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5718 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5719 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5720 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5721 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5722 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
5723 GTEST_TEMPLATE_ T46>
5724 struct Templates46 {
5725 typedef TemplateSel<T1> Head;
5726 typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5727 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5728 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5729 T43, T44, T45, T46> Tail;
5732 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5733 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5734 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5735 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5736 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5737 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5738 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5739 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5740 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5741 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5742 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5743 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5744 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5745 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5746 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
5747 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
5748 struct Templates47 {
5749 typedef TemplateSel<T1> Head;
5750 typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5751 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5752 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5753 T43, T44, T45, T46, T47> 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, GTEST_TEMPLATE_ T33,
5767 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5768 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5769 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5770 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
5771 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
5772 struct Templates48 {
5773 typedef TemplateSel<T1> Head;
5774 typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5775 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5776 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5777 T43, T44, T45, T46, T47, T48> Tail;
5780 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5781 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5782 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5783 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5784 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5785 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5786 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5787 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5788 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5789 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5790 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5791 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5792 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5793 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5794 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
5795 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
5796 GTEST_TEMPLATE_ T49>
5797 struct Templates49 {
5798 typedef TemplateSel<T1> Head;
5799 typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5800 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5801 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5802 T43, T44, T45, T46, T47, T48, T49> Tail;
5805 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5806 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5807 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5808 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5809 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5810 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5811 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5812 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5813 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5814 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5815 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5816 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5817 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5818 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5819 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
5820 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
5821 GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
5822 struct Templates50 {
5823 typedef TemplateSel<T1> Head;
5824 typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5825 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5826 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5827 T43, T44, T45, T46, T47, T48, T49, T50> Tail;
5831 // We don't want to require the users to write TemplatesN<...> directly,
5832 // as that would require them to count the length. Templates<...> is much
5833 // easier to write, but generates horrible messages when there is a
5834 // compiler error, as gcc insists on printing out each template
5835 // argument, even if it has the default value (this means Templates<list>
5836 // will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
5839 // Our solution is to combine the best part of the two approaches: a
5840 // user would write Templates<T1, ..., TN>, and Google Test will translate
5841 // that to TemplatesN<T1, ..., TN> internally to make error messages
5842 // readable. The translation is done by the 'type' member of the
5843 // Templates template.
5844 template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
5845 GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
5846 GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
5847 GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
5848 GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
5849 GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
5850 GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
5851 GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
5852 GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
5853 GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
5854 GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
5855 GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
5856 GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
5857 GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
5858 GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
5859 GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
5860 GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
5861 GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
5862 GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
5863 GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
5864 GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
5865 GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
5866 GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
5867 GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
5868 GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
5870 typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5871 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
5872 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
5873 T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
5877 struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5878 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5879 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5880 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5881 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5883 typedef Templates0 type;
5885 template <GTEST_TEMPLATE_ T1>
5886 struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5887 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5888 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5889 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5890 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5892 typedef Templates1<T1> type;
5894 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
5895 struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5896 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5897 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5898 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5899 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5901 typedef Templates2<T1, T2> type;
5903 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
5904 struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5905 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5906 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5907 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5908 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5909 typedef Templates3<T1, T2, T3> type;
5911 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5913 struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5914 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5915 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5916 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5917 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5918 typedef Templates4<T1, T2, T3, T4> type;
5920 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5921 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
5922 struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5923 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5924 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5925 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5926 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5927 typedef Templates5<T1, T2, T3, T4, T5> type;
5929 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5930 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
5931 struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
5932 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5933 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5934 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5935 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5936 typedef Templates6<T1, T2, T3, T4, T5, T6> type;
5938 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5939 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5941 struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
5942 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5943 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5944 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5945 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5946 typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
5948 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5949 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5950 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
5951 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
5952 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5953 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5954 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5955 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5956 typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
5958 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5959 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5960 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
5961 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
5962 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5963 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5964 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5965 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5966 typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
5968 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5969 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5970 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5971 GTEST_TEMPLATE_ T10>
5972 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
5973 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5974 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5975 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5976 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5977 typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
5979 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5980 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5981 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5982 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
5983 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
5984 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5985 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5986 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5987 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5988 typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
5990 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5991 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5992 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5993 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
5994 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
5995 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5996 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5997 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5998 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5999 typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
6001 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6002 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6003 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6004 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6005 GTEST_TEMPLATE_ T13>
6006 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
6007 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6008 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6009 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6010 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6011 typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6014 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6015 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6016 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6017 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6018 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
6019 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6020 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6021 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6022 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6023 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6024 typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6027 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6028 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6029 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6030 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6031 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
6032 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6033 T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6034 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6035 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6036 NoneT, NoneT, NoneT, NoneT, NoneT> {
6037 typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6040 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6041 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6042 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6043 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6044 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6045 GTEST_TEMPLATE_ T16>
6046 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6047 T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6048 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6049 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6050 NoneT, NoneT, NoneT, NoneT, NoneT> {
6051 typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6052 T14, T15, T16> type;
6054 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6055 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6056 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6057 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6058 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6059 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
6060 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6061 T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6062 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6063 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6064 NoneT, NoneT, NoneT, NoneT, NoneT> {
6065 typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6066 T14, T15, T16, T17> type;
6068 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6069 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6070 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6071 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6072 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6073 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
6074 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6075 T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6076 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6077 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6078 NoneT, NoneT, NoneT, NoneT> {
6079 typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6080 T14, T15, T16, T17, T18> type;
6082 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6083 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6084 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6085 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6086 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6087 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6088 GTEST_TEMPLATE_ T19>
6089 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6090 T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6091 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6092 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6093 NoneT, NoneT, NoneT, NoneT> {
6094 typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6095 T14, T15, T16, T17, T18, T19> type;
6097 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6098 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6099 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6100 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6101 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6102 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6103 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
6104 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6105 T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6106 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6107 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6108 NoneT, NoneT, NoneT, NoneT> {
6109 typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6110 T14, T15, T16, T17, T18, T19, T20> type;
6112 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6113 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6114 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6115 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6116 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6117 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6118 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
6119 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6120 T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
6121 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6122 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6123 NoneT, NoneT, NoneT, NoneT> {
6124 typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6125 T14, T15, T16, T17, T18, T19, T20, T21> type;
6127 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6128 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6129 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6130 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6131 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6132 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6133 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6134 GTEST_TEMPLATE_ T22>
6135 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6136 T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
6137 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6138 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6139 NoneT, NoneT, NoneT> {
6140 typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6141 T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
6143 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6144 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6145 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6146 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6147 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6148 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6149 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6150 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
6151 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6152 T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
6153 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6154 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6155 NoneT, NoneT, NoneT> {
6156 typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6157 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
6159 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6160 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6161 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6162 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6163 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6164 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6165 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6166 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
6167 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6168 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
6169 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6170 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6171 NoneT, NoneT, NoneT> {
6172 typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6173 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
6175 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6176 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6177 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6178 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6179 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6180 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6181 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6182 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6183 GTEST_TEMPLATE_ T25>
6184 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6185 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
6186 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6187 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6189 typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6190 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
6192 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6193 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6194 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6195 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6196 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6197 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6198 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6199 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6200 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
6201 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6202 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
6203 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6204 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6206 typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6207 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
6209 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6210 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6211 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6212 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6213 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6214 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6215 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6216 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6217 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
6218 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6219 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
6220 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6221 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6223 typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6224 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6227 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6228 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6229 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6230 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6231 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6232 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6233 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6234 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6235 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6236 GTEST_TEMPLATE_ T28>
6237 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6238 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6239 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6240 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6242 typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6243 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6246 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6247 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6248 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6249 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6250 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6251 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6252 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6253 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6254 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6255 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
6256 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6257 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6258 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6259 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6261 typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6262 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6265 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6266 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6267 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6268 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6269 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6270 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6271 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6272 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6273 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6274 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
6275 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6276 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6277 T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6278 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6279 typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6280 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6281 T28, T29, T30> type;
6283 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6284 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6285 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6286 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6287 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6288 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6289 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6290 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6291 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6292 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6293 GTEST_TEMPLATE_ T31>
6294 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6295 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6296 T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6297 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6298 typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6299 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6300 T28, T29, T30, T31> 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, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6306 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6307 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6308 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6309 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6310 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6311 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6312 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
6313 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6314 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6315 T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6316 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6317 typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6318 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6319 T28, T29, T30, T31, T32> type;
6321 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6322 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6323 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6324 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6325 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6326 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6327 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6328 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6329 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6330 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6331 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
6332 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6333 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6334 T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6335 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6336 typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6337 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6338 T28, T29, T30, T31, T32, T33> type;
6340 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6341 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6342 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6343 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6344 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6345 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6346 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6347 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6348 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6349 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6350 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6351 GTEST_TEMPLATE_ T34>
6352 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6353 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6354 T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6355 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6356 typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6357 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6358 T28, T29, T30, T31, T32, T33, T34> type;
6360 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6361 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6362 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6363 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6364 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6365 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6366 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6367 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6368 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6369 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6370 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6371 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
6372 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6373 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6374 T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6375 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6376 typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6377 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6378 T28, T29, T30, T31, T32, T33, T34, T35> type;
6380 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6381 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6382 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6383 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6384 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6385 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6386 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6387 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6388 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6389 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6390 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6391 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
6392 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6393 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6394 T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
6395 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6396 typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6397 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6398 T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
6400 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6401 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6402 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6403 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6404 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6405 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6406 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6407 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6408 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6409 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6410 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6411 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6412 GTEST_TEMPLATE_ T37>
6413 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6414 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6415 T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
6416 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6417 typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6418 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6419 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
6421 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6422 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6423 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6424 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6425 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6426 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6427 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6428 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6429 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6430 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6431 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6432 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6433 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
6434 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6435 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6436 T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
6437 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6438 typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6439 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6440 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
6442 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6443 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6444 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6445 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6446 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6447 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6448 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6449 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6450 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6451 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6452 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6453 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6454 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
6455 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6456 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6457 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
6458 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6459 typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6460 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6461 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
6463 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6464 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6465 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6466 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6467 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6468 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6469 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6470 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6471 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6472 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6473 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6474 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6475 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6476 GTEST_TEMPLATE_ T40>
6477 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6478 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6479 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
6480 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6481 typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6482 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6483 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
6485 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6486 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6487 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6488 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6489 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6490 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6491 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6492 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6493 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6494 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6495 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6496 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6497 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6498 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
6499 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6500 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6501 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
6502 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6503 typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6504 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6505 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6508 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6509 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6510 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6511 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6512 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6513 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6514 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6515 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6516 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6517 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6518 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6519 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6520 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6521 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
6522 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6523 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6524 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
6525 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6526 typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6527 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6528 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6531 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6532 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6533 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6534 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6535 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6536 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6537 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6538 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6539 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6540 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6541 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6542 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6543 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6544 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6545 GTEST_TEMPLATE_ T43>
6546 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6547 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6548 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
6549 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6550 typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6551 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6552 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6555 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6556 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6557 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6558 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6559 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6560 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6561 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6562 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6563 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6564 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6565 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6566 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6567 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6568 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6569 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
6570 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6571 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6572 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6573 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6574 typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6575 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6576 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6577 T42, T43, T44> type;
6579 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6580 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6581 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6582 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6583 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6584 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6585 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6586 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6587 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6588 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6589 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6590 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6591 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6592 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6593 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
6594 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6595 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6596 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6597 T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
6598 typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6599 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6600 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6601 T42, T43, T44, T45> type;
6603 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6604 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6605 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6606 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6607 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6608 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6609 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6610 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6611 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6612 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6613 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6614 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6615 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6616 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6617 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6618 GTEST_TEMPLATE_ T46>
6619 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6620 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6621 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6622 T45, T46, NoneT, NoneT, NoneT, NoneT> {
6623 typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6624 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6625 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6626 T42, T43, T44, T45, T46> type;
6628 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6629 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6630 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6631 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6632 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6633 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6634 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6635 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6636 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6637 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6638 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6639 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6640 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6641 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6642 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6643 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
6644 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6645 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6646 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6647 T45, T46, T47, NoneT, NoneT, NoneT> {
6648 typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6649 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6650 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6651 T42, T43, T44, T45, T46, T47> type;
6653 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6654 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6655 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6656 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6657 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6658 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6659 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6660 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6661 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6662 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6663 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6664 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6665 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6666 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6667 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6668 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
6669 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6670 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6671 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6672 T45, T46, T47, T48, NoneT, NoneT> {
6673 typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6674 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6675 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6676 T42, T43, T44, T45, T46, T47, T48> type;
6678 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6679 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6680 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6681 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6682 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6683 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6684 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6685 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6686 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6687 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6688 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6689 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6690 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6691 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6692 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6693 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
6694 GTEST_TEMPLATE_ T49>
6695 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6696 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6697 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6698 T45, T46, T47, T48, T49, NoneT> {
6699 typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6700 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6701 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6702 T42, T43, T44, T45, T46, T47, T48, T49> type;
6705 // The TypeList template makes it possible to use either a single type
6706 // or a Types<...> list in TYPED_TEST_CASE() and
6707 // INSTANTIATE_TYPED_TEST_CASE_P().
6709 template <typename T>
6710 struct TypeList { typedef Types1<T> type; };
6712 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6713 typename T6, typename T7, typename T8, typename T9, typename T10,
6714 typename T11, typename T12, typename T13, typename T14, typename T15,
6715 typename T16, typename T17, typename T18, typename T19, typename T20,
6716 typename T21, typename T22, typename T23, typename T24, typename T25,
6717 typename T26, typename T27, typename T28, typename T29, typename T30,
6718 typename T31, typename T32, typename T33, typename T34, typename T35,
6719 typename T36, typename T37, typename T38, typename T39, typename T40,
6720 typename T41, typename T42, typename T43, typename T44, typename T45,
6721 typename T46, typename T47, typename T48, typename T49, typename T50>
6722 struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6723 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6724 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
6725 T44, T45, T46, T47, T48, T49, T50> > {
6726 typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6727 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6728 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6729 T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
6732 #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
6734 } // namespace internal
6735 } // namespace testing
6737 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
6739 // Due to C++ preprocessor weirdness, we need double indirection to
6740 // concatenate two tokens when one of them is __LINE__. Writing
6744 // will result in the token foo__LINE__, instead of foo followed by
6745 // the current line number. For more details, see
6746 // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
6747 #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
6748 #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
6750 // Google Test defines the testing::Message class to allow construction of
6751 // test messages via the << operator. The idea is that anything
6752 // streamable to std::ostream can be streamed to a testing::Message.
6753 // This allows a user to use his own types in Google Test assertions by
6754 // overloading the << operator.
6756 // util/gtl/stl_logging-inl.h overloads << for STL containers. These
6757 // overloads cannot be defined in the std namespace, as that will be
6758 // undefined behavior. Therefore, they are defined in the global
6759 // namespace instead.
6761 // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
6762 // overloads are visible in either the std namespace or the global
6763 // namespace, but not other namespaces, including the testing
6764 // namespace which Google Test's Message class is in.
6766 // To allow STL containers (and other types that has a << operator
6767 // defined in the global namespace) to be used in Google Test assertions,
6768 // testing::Message must access the custom << operator from the global
6769 // namespace. Hence this helper function.
6771 // Note: Jeffrey Yasskin suggested an alternative fix by "using
6772 // ::operator<<;" in the definition of Message's operator<<. That fix
6773 // doesn't require a helper function, but unfortunately doesn't
6774 // compile with MSVC.
6775 template <typename T>
6776 inline void GTestStreamToHelper(std::ostream* os, const T& val) {
6780 class ProtocolMessage;
6781 namespace proto2 { class Message; }
6785 // Forward declarations.
6787 class AssertionResult; // Result of an assertion.
6788 class Message; // Represents a failure message.
6789 class Test; // Represents a test.
6790 class TestInfo; // Information about a test.
6791 class TestPartResult; // Result of a test part.
6792 class UnitTest; // A collection of test cases.
6794 template <typename T>
6795 ::std::string PrintToString(const T& value);
6797 namespace internal {
6799 struct TraceInfo; // Information about a trace point.
6800 class ScopedTrace; // Implements scoped trace.
6801 class TestInfoImpl; // Opaque implementation of TestInfo
6802 class UnitTestImpl; // Opaque implementation of UnitTest
6804 // How many times InitGoogleTest() has been called.
6805 extern int g_init_gtest_count;
6807 // The text used in failure messages to indicate the start of the
6809 GTEST_API_ extern const char kStackTraceMarker[];
6811 // A secret type that Google Test users don't know about. It has no
6812 // definition on purpose. Therefore it's impossible to create a
6813 // Secret object, which is what we want.
6816 // Two overloaded helpers for checking at compile time whether an
6817 // expression is a null pointer literal (i.e. NULL or any 0-valued
6818 // compile-time integral constant). Their return values have
6819 // different sizes, so we can use sizeof() to test which version is
6820 // picked by the compiler. These helpers have no implementations, as
6821 // we only need their signatures.
6823 // Given IsNullLiteralHelper(x), the compiler will pick the first
6824 // version if x can be implicitly converted to Secret*, and pick the
6825 // second version otherwise. Since Secret is a secret and incomplete
6826 // type, the only expression a user can write that has type Secret* is
6827 // a null pointer literal. Therefore, we know that x is a null
6828 // pointer literal if and only if the first version is picked by the
6830 char IsNullLiteralHelper(Secret* p);
6831 char (&IsNullLiteralHelper(...))[2]; // NOLINT
6833 // A compile-time bool constant that is true if and only if x is a
6834 // null pointer literal (i.e. NULL or any 0-valued compile-time
6835 // integral constant).
6836 #ifdef GTEST_ELLIPSIS_NEEDS_POD_
6837 // We lose support for NULL detection where the compiler doesn't like
6838 // passing non-POD classes through ellipsis (...).
6839 # define GTEST_IS_NULL_LITERAL_(x) false
6841 # define GTEST_IS_NULL_LITERAL_(x) \
6842 (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
6843 #endif // GTEST_ELLIPSIS_NEEDS_POD_
6845 // Appends the user-supplied message to the Google-Test-generated message.
6846 GTEST_API_ String AppendUserMessage(const String& gtest_msg,
6847 const Message& user_msg);
6849 // A helper class for creating scoped traces in user programs.
6850 class GTEST_API_ ScopedTrace {
6852 // The c'tor pushes the given source file location and message onto
6853 // a trace stack maintained by Google Test.
6854 ScopedTrace(const char* file, int line, const Message& message);
6856 // The d'tor pops the info pushed by the c'tor.
6858 // Note that the d'tor is not virtual in order to be efficient.
6859 // Don't inherit from ScopedTrace!
6863 GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
6864 } GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its
6865 // c'tor and d'tor. Therefore it doesn't
6866 // need to be used otherwise.
6868 // Converts a streamable value to a String. A NULL pointer is
6869 // converted to "(null)". When the input value is a ::string,
6870 // ::std::string, ::wstring, or ::std::wstring object, each NUL
6871 // character in it is replaced with "\\0".
6872 // Declared here but defined in gtest.h, so that it has access
6873 // to the definition of the Message class, required by the ARM
6875 template <typename T>
6876 String StreamableToString(const T& streamable);
6878 // The Symbian compiler has a bug that prevents it from selecting the
6879 // correct overload of FormatForComparisonFailureMessage (see below)
6880 // unless we pass the first argument by reference. If we do that,
6881 // however, Visual Age C++ 10.1 generates a compiler error. Therefore
6882 // we only apply the work-around for Symbian.
6883 #if defined(__SYMBIAN32__)
6884 # define GTEST_CREF_WORKAROUND_ const&
6886 # define GTEST_CREF_WORKAROUND_
6889 // When this operand is a const char* or char*, if the other operand
6890 // is a ::std::string or ::string, we print this operand as a C string
6891 // rather than a pointer (we do the same for wide strings); otherwise
6892 // we print it as a pointer to be safe.
6894 // This internal macro is used to avoid duplicated code.
6895 #define GTEST_FORMAT_IMPL_(operand2_type, operand1_printer)\
6896 inline String FormatForComparisonFailureMessage(\
6897 operand2_type::value_type* GTEST_CREF_WORKAROUND_ str, \
6898 const operand2_type& /*operand2*/) {\
6899 return operand1_printer(str);\
6901 inline String FormatForComparisonFailureMessage(\
6902 const operand2_type::value_type* GTEST_CREF_WORKAROUND_ str, \
6903 const operand2_type& /*operand2*/) {\
6904 return operand1_printer(str);\
6907 GTEST_FORMAT_IMPL_(::std::string, String::ShowCStringQuoted)
6908 #if GTEST_HAS_STD_WSTRING
6909 GTEST_FORMAT_IMPL_(::std::wstring, String::ShowWideCStringQuoted)
6910 #endif // GTEST_HAS_STD_WSTRING
6912 #if GTEST_HAS_GLOBAL_STRING
6913 GTEST_FORMAT_IMPL_(::string, String::ShowCStringQuoted)
6914 #endif // GTEST_HAS_GLOBAL_STRING
6915 #if GTEST_HAS_GLOBAL_WSTRING
6916 GTEST_FORMAT_IMPL_(::wstring, String::ShowWideCStringQuoted)
6917 #endif // GTEST_HAS_GLOBAL_WSTRING
6919 #undef GTEST_FORMAT_IMPL_
6921 // The next four overloads handle the case where the operand being
6922 // printed is a char/wchar_t pointer and the other operand is not a
6923 // string/wstring object. In such cases, we just print the operand as
6924 // a pointer to be safe.
6925 #define GTEST_FORMAT_CHAR_PTR_IMPL_(CharType) \
6926 template <typename T> \
6927 String FormatForComparisonFailureMessage(CharType* GTEST_CREF_WORKAROUND_ p, \
6929 return PrintToString(static_cast<const void*>(p)); \
6932 GTEST_FORMAT_CHAR_PTR_IMPL_(char)
6933 GTEST_FORMAT_CHAR_PTR_IMPL_(const char)
6934 GTEST_FORMAT_CHAR_PTR_IMPL_(wchar_t)
6935 GTEST_FORMAT_CHAR_PTR_IMPL_(const wchar_t)
6937 #undef GTEST_FORMAT_CHAR_PTR_IMPL_
6939 // Constructs and returns the message for an equality assertion
6940 // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
6942 // The first four parameters are the expressions used in the assertion
6943 // and their values, as strings. For example, for ASSERT_EQ(foo, bar)
6944 // where foo is 5 and bar is 6, we have:
6946 // expected_expression: "foo"
6947 // actual_expression: "bar"
6948 // expected_value: "5"
6949 // actual_value: "6"
6951 // The ignoring_case parameter is true iff the assertion is a
6952 // *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
6953 // be inserted into the message.
6954 GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
6955 const char* actual_expression,
6956 const String& expected_value,
6957 const String& actual_value,
6958 bool ignoring_case);
6960 // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
6961 GTEST_API_ String GetBoolAssertionFailureMessage(
6962 const AssertionResult& assertion_result,
6963 const char* expression_text,
6964 const char* actual_predicate_value,
6965 const char* expected_predicate_value);
6967 // This template class represents an IEEE floating-point number
6968 // (either single-precision or double-precision, depending on the
6969 // template parameters).
6971 // The purpose of this class is to do more sophisticated number
6972 // comparison. (Due to round-off error, etc, it's very unlikely that
6973 // two floating-points will be equal exactly. Hence a naive
6974 // comparison by the == operation often doesn't work.)
6976 // Format of IEEE floating-point:
6978 // The most-significant bit being the leftmost, an IEEE
6979 // floating-point looks like
6981 // sign_bit exponent_bits fraction_bits
6983 // Here, sign_bit is a single bit that designates the sign of the
6986 // For float, there are 8 exponent bits and 23 fraction bits.
6988 // For double, there are 11 exponent bits and 52 fraction bits.
6990 // More details can be found at
6991 // http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
6993 // Template parameter:
6995 // RawType: the raw floating-point type (either float or double)
6996 template <typename RawType>
6997 class FloatingPoint {
6999 // Defines the unsigned integer type that has the same size as the
7000 // floating point number.
7001 typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
7005 // # of bits in a number.
7006 static const size_t kBitCount = 8*sizeof(RawType);
7008 // # of fraction bits in a number.
7009 static const size_t kFractionBitCount =
7010 std::numeric_limits<RawType>::digits - 1;
7012 // # of exponent bits in a number.
7013 static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
7015 // The mask for the sign bit.
7016 static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
7018 // The mask for the fraction bits.
7019 static const Bits kFractionBitMask =
7020 ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
7022 // The mask for the exponent bits.
7023 static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
7025 // How many ULP's (Units in the Last Place) we want to tolerate when
7026 // comparing two numbers. The larger the value, the more error we
7027 // allow. A 0 value means that two numbers must be exactly the same
7028 // to be considered equal.
7030 // The maximum error of a single floating-point operation is 0.5
7031 // units in the last place. On Intel CPU's, all floating-point
7032 // calculations are done with 80-bit precision, while double has 64
7033 // bits. Therefore, 4 should be enough for ordinary use.
7035 // See the following article for more details on ULP:
7036 // http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm.
7037 static const size_t kMaxUlps = 4;
7039 // Constructs a FloatingPoint from a raw floating-point number.
7041 // On an Intel CPU, passing a non-normalized NAN (Not a Number)
7042 // around may change its bits, although the new value is guaranteed
7043 // to be also a NAN. Therefore, don't expect this constructor to
7044 // preserve the bits in x when x is a NAN.
7045 explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
7049 // Reinterprets a bit pattern as a floating-point number.
7051 // This function is needed to test the AlmostEquals() method.
7052 static RawType ReinterpretBits(const Bits bits) {
7053 FloatingPoint fp(0);
7055 return fp.u_.value_;
7058 // Returns the floating-point number that represent positive infinity.
7059 static RawType Infinity() {
7060 return ReinterpretBits(kExponentBitMask);
7063 // Non-static methods
7065 // Returns the bits that represents this number.
7066 const Bits &bits() const { return u_.bits_; }
7068 // Returns the exponent bits of this number.
7069 Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
7071 // Returns the fraction bits of this number.
7072 Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
7074 // Returns the sign bit of this number.
7075 Bits sign_bit() const { return kSignBitMask & u_.bits_; }
7077 // Returns true iff this is NAN (not a number).
7078 bool is_nan() const {
7079 // It's a NAN if the exponent bits are all ones and the fraction
7080 // bits are not entirely zeros.
7081 return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
7084 // Returns true iff this number is at most kMaxUlps ULP's away from
7085 // rhs. In particular, this function:
7087 // - returns false if either number is (or both are) NAN.
7088 // - treats really large numbers as almost equal to infinity.
7089 // - thinks +0.0 and -0.0 are 0 DLP's apart.
7090 bool AlmostEquals(const FloatingPoint& rhs) const {
7091 // The IEEE standard says that any comparison operation involving
7092 // a NAN must return false.
7093 if (is_nan() || rhs.is_nan()) return false;
7095 return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
7100 // The data type used to store the actual floating-point number.
7101 union FloatingPointUnion {
7102 RawType value_; // The raw floating-point number.
7103 Bits bits_; // The bits that represent the number.
7106 // Converts an integer from the sign-and-magnitude representation to
7107 // the biased representation. More precisely, let N be 2 to the
7108 // power of (kBitCount - 1), an integer x is represented by the
7109 // unsigned number x + N.
7113 // -N + 1 (the most negative number representable using
7114 // sign-and-magnitude) is represented by 1;
7115 // 0 is represented by N; and
7116 // N - 1 (the biggest number representable using
7117 // sign-and-magnitude) is represented by 2N - 1.
7119 // Read http://en.wikipedia.org/wiki/Signed_number_representations
7120 // for more details on signed number representations.
7121 static Bits SignAndMagnitudeToBiased(const Bits &sam) {
7122 if (kSignBitMask & sam) {
7123 // sam represents a negative number.
7126 // sam represents a positive number.
7127 return kSignBitMask | sam;
7131 // Given two numbers in the sign-and-magnitude representation,
7132 // returns the distance between them as an unsigned number.
7133 static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
7135 const Bits biased1 = SignAndMagnitudeToBiased(sam1);
7136 const Bits biased2 = SignAndMagnitudeToBiased(sam2);
7137 return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
7140 FloatingPointUnion u_;
7143 // Typedefs the instances of the FloatingPoint template class that we
7145 typedef FloatingPoint<float> Float;
7146 typedef FloatingPoint<double> Double;
7148 // In order to catch the mistake of putting tests that use different
7149 // test fixture classes in the same test case, we need to assign
7150 // unique IDs to fixture classes and compare them. The TypeId type is
7151 // used to hold such IDs. The user should treat TypeId as an opaque
7152 // type: the only operation allowed on TypeId values is to compare
7153 // them for equality using the == operator.
7154 typedef const void* TypeId;
7156 template <typename T>
7157 class TypeIdHelper {
7159 // dummy_ must not have a const type. Otherwise an overly eager
7160 // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
7161 // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
7165 template <typename T>
7166 bool TypeIdHelper<T>::dummy_ = false;
7168 // GetTypeId<T>() returns the ID of type T. Different values will be
7169 // returned for different types. Calling the function twice with the
7170 // same type argument is guaranteed to return the same ID.
7171 template <typename T>
7172 TypeId GetTypeId() {
7173 // The compiler is required to allocate a different
7174 // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
7175 // the template. Therefore, the address of dummy_ is guaranteed to
7177 return &(TypeIdHelper<T>::dummy_);
7180 // Returns the type ID of ::testing::Test. Always call this instead
7181 // of GetTypeId< ::testing::Test>() to get the type ID of
7182 // ::testing::Test, as the latter may give the wrong result due to a
7183 // suspected linker bug when compiling Google Test as a Mac OS X
7185 GTEST_API_ TypeId GetTestTypeId();
7187 // Defines the abstract factory interface that creates instances
7188 // of a Test object.
7189 class TestFactoryBase {
7191 virtual ~TestFactoryBase() {}
7193 // Creates a test instance to run. The instance is both created and destroyed
7194 // within TestInfoImpl::Run()
7195 virtual Test* CreateTest() = 0;
7198 TestFactoryBase() {}
7201 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
7204 // This class provides implementation of TeastFactoryBase interface.
7205 // It is used in TEST and TEST_F macros.
7206 template <class TestClass>
7207 class TestFactoryImpl : public TestFactoryBase {
7209 virtual Test* CreateTest() { return new TestClass; }
7212 #if GTEST_OS_WINDOWS
7214 // Predicate-formatters for implementing the HRESULT checking macros
7215 // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
7216 // We pass a long instead of HRESULT to avoid causing an
7217 // include dependency for the HRESULT type.
7218 GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
7220 GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
7223 #endif // GTEST_OS_WINDOWS
7225 // Types of SetUpTestCase() and TearDownTestCase() functions.
7226 typedef void (*SetUpTestCaseFunc)();
7227 typedef void (*TearDownTestCaseFunc)();
7229 // Creates a new TestInfo object and registers it with Google Test;
7230 // returns the created object.
7234 // test_case_name: name of the test case
7235 // name: name of the test
7236 // type_param the name of the test's type parameter, or NULL if
7237 // this is not a typed or a type-parameterized test.
7238 // value_param text representation of the test's value parameter,
7239 // or NULL if this is not a type-parameterized test.
7240 // fixture_class_id: ID of the test fixture class
7241 // set_up_tc: pointer to the function that sets up the test case
7242 // tear_down_tc: pointer to the function that tears down the test case
7243 // factory: pointer to the factory that creates a test object.
7244 // The newly created TestInfo instance will assume
7245 // ownership of the factory object.
7246 GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
7247 const char* test_case_name, const char* name,
7248 const char* type_param,
7249 const char* value_param,
7250 TypeId fixture_class_id,
7251 SetUpTestCaseFunc set_up_tc,
7252 TearDownTestCaseFunc tear_down_tc,
7253 TestFactoryBase* factory);
7255 // If *pstr starts with the given prefix, modifies *pstr to be right
7256 // past the prefix and returns true; otherwise leaves *pstr unchanged
7257 // and returns false. None of pstr, *pstr, and prefix can be NULL.
7258 GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
7260 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7262 // State of the definition of a type-parameterized test case.
7263 class GTEST_API_ TypedTestCasePState {
7265 TypedTestCasePState() : registered_(false) {}
7267 // Adds the given test name to defined_test_names_ and return true
7268 // if the test case hasn't been registered; otherwise aborts the
7270 bool AddTestName(const char* file, int line, const char* case_name,
7271 const char* test_name) {
7273 fprintf(stderr, "%s Test %s must be defined before "
7274 "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
7275 FormatFileLocation(file, line).c_str(), test_name, case_name);
7279 defined_test_names_.insert(test_name);
7283 // Verifies that registered_tests match the test names in
7284 // defined_test_names_; returns registered_tests if successful, or
7285 // aborts the program otherwise.
7286 const char* VerifyRegisteredTestNames(
7287 const char* file, int line, const char* registered_tests);
7291 ::std::set<const char*> defined_test_names_;
7294 // Skips to the first non-space char after the first comma in 'str';
7295 // returns NULL if no comma is found in 'str'.
7296 inline const char* SkipComma(const char* str) {
7297 const char* comma = strchr(str, ',');
7298 if (comma == NULL) {
7301 while (IsSpace(*(++comma))) {}
7305 // Returns the prefix of 'str' before the first comma in it; returns
7306 // the entire string if it contains no comma.
7307 inline String GetPrefixUntilComma(const char* str) {
7308 const char* comma = strchr(str, ',');
7309 return comma == NULL ? String(str) : String(str, comma - str);
7312 // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
7313 // registers a list of type-parameterized tests with Google Test. The
7314 // return value is insignificant - we just need to return something
7315 // such that we can call this function in a namespace scope.
7317 // Implementation note: The GTEST_TEMPLATE_ macro declares a template
7318 // template parameter. It's defined in gtest-type-util.h.
7319 template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
7320 class TypeParameterizedTest {
7322 // 'index' is the index of the test in the type list 'Types'
7323 // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
7324 // Types). Valid values for 'index' are [0, N - 1] where N is the
7326 static bool Register(const char* prefix, const char* case_name,
7327 const char* test_names, int index) {
7328 typedef typename Types::Head Type;
7329 typedef Fixture<Type> FixtureClass;
7330 typedef typename GTEST_BIND_(TestSel, Type) TestClass;
7332 // First, registers the first type-parameterized test in the type
7334 MakeAndRegisterTestInfo(
7335 String::Format("%s%s%s/%d", prefix, prefix[0] == '\0' ? "" : "/",
7336 case_name, index).c_str(),
7337 GetPrefixUntilComma(test_names).c_str(),
7338 GetTypeName<Type>().c_str(),
7339 NULL, // No value parameter.
7340 GetTypeId<FixtureClass>(),
7341 TestClass::SetUpTestCase,
7342 TestClass::TearDownTestCase,
7343 new TestFactoryImpl<TestClass>);
7345 // Next, recurses (at compile time) with the tail of the type list.
7346 return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
7347 ::Register(prefix, case_name, test_names, index + 1);
7351 // The base case for the compile time recursion.
7352 template <GTEST_TEMPLATE_ Fixture, class TestSel>
7353 class TypeParameterizedTest<Fixture, TestSel, Types0> {
7355 static bool Register(const char* /*prefix*/, const char* /*case_name*/,
7356 const char* /*test_names*/, int /*index*/) {
7361 // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
7362 // registers *all combinations* of 'Tests' and 'Types' with Google
7363 // Test. The return value is insignificant - we just need to return
7364 // something such that we can call this function in a namespace scope.
7365 template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
7366 class TypeParameterizedTestCase {
7368 static bool Register(const char* prefix, const char* case_name,
7369 const char* test_names) {
7370 typedef typename Tests::Head Head;
7372 // First, register the first test in 'Test' for each type in 'Types'.
7373 TypeParameterizedTest<Fixture, Head, Types>::Register(
7374 prefix, case_name, test_names, 0);
7376 // Next, recurses (at compile time) with the tail of the test list.
7377 return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
7378 ::Register(prefix, case_name, SkipComma(test_names));
7382 // The base case for the compile time recursion.
7383 template <GTEST_TEMPLATE_ Fixture, typename Types>
7384 class TypeParameterizedTestCase<Fixture, Templates0, Types> {
7386 static bool Register(const char* /*prefix*/, const char* /*case_name*/,
7387 const char* /*test_names*/) {
7392 #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7394 // Returns the current OS stack trace as a String.
7396 // The maximum number of stack frames to be included is specified by
7397 // the gtest_stack_trace_depth flag. The skip_count parameter
7398 // specifies the number of top frames to be skipped, which doesn't
7399 // count against the number of frames to be included.
7401 // For example, if Foo() calls Bar(), which in turn calls
7402 // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
7403 // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
7404 GTEST_API_ String GetCurrentOsStackTraceExceptTop(UnitTest* unit_test,
7407 // Helpers for suppressing warnings on unreachable code or constant
7410 // Always returns true.
7411 GTEST_API_ bool AlwaysTrue();
7413 // Always returns false.
7414 inline bool AlwaysFalse() { return !AlwaysTrue(); }
7416 // Helper for suppressing false warning from Clang on a const char*
7417 // variable declared in a conditional expression always being NULL in
7419 struct GTEST_API_ ConstCharPtr {
7420 ConstCharPtr(const char* str) : value(str) {}
7421 operator bool() const { return true; }
7425 // A simple Linear Congruential Generator for generating random
7426 // numbers with a uniform distribution. Unlike rand() and srand(), it
7427 // doesn't use global state (and therefore can't interfere with user
7428 // code). Unlike rand_r(), it's portable. An LCG isn't very random,
7429 // but it's good enough for our purposes.
7430 class GTEST_API_ Random {
7432 static const UInt32 kMaxRange = 1u << 31;
7434 explicit Random(UInt32 seed) : state_(seed) {}
7436 void Reseed(UInt32 seed) { state_ = seed; }
7438 // Generates a random number from [0, range). Crashes if 'range' is
7439 // 0 or greater than kMaxRange.
7440 UInt32 Generate(UInt32 range);
7444 GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
7447 // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
7448 // compiler error iff T1 and T2 are different types.
7449 template <typename T1, typename T2>
7450 struct CompileAssertTypesEqual;
7452 template <typename T>
7453 struct CompileAssertTypesEqual<T, T> {
7456 // Removes the reference from a type if it is a reference type,
7457 // otherwise leaves it unchanged. This is the same as
7458 // tr1::remove_reference, which is not widely available yet.
7459 template <typename T>
7460 struct RemoveReference { typedef T type; }; // NOLINT
7461 template <typename T>
7462 struct RemoveReference<T&> { typedef T type; }; // NOLINT
7464 // A handy wrapper around RemoveReference that works when the argument
7465 // T depends on template parameters.
7466 #define GTEST_REMOVE_REFERENCE_(T) \
7467 typename ::testing::internal::RemoveReference<T>::type
7469 // Removes const from a type if it is a const type, otherwise leaves
7470 // it unchanged. This is the same as tr1::remove_const, which is not
7471 // widely available yet.
7472 template <typename T>
7473 struct RemoveConst { typedef T type; }; // NOLINT
7474 template <typename T>
7475 struct RemoveConst<const T> { typedef T type; }; // NOLINT
7477 // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
7478 // definition to fail to remove the const in 'const int[3]' and 'const
7479 // char[3][4]'. The following specialization works around the bug.
7480 // However, it causes trouble with GCC and thus needs to be
7481 // conditionally compiled.
7482 #if defined(_MSC_VER) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
7483 template <typename T, size_t N>
7484 struct RemoveConst<const T[N]> {
7485 typedef typename RemoveConst<T>::type type[N];
7489 // A handy wrapper around RemoveConst that works when the argument
7490 // T depends on template parameters.
7491 #define GTEST_REMOVE_CONST_(T) \
7492 typename ::testing::internal::RemoveConst<T>::type
7494 // Turns const U&, U&, const U, and U all into U.
7495 #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
7496 GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
7498 // Adds reference to a type if it is not a reference type,
7499 // otherwise leaves it unchanged. This is the same as
7500 // tr1::add_reference, which is not widely available yet.
7501 template <typename T>
7502 struct AddReference { typedef T& type; }; // NOLINT
7503 template <typename T>
7504 struct AddReference<T&> { typedef T& type; }; // NOLINT
7506 // A handy wrapper around AddReference that works when the argument T
7507 // depends on template parameters.
7508 #define GTEST_ADD_REFERENCE_(T) \
7509 typename ::testing::internal::AddReference<T>::type
7511 // Adds a reference to const on top of T as necessary. For example,
7514 // char ==> const char&
7515 // const char ==> const char&
7516 // char& ==> const char&
7517 // const char& ==> const char&
7519 // The argument T must depend on some template parameters.
7520 #define GTEST_REFERENCE_TO_CONST_(T) \
7521 GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
7523 // ImplicitlyConvertible<From, To>::value is a compile-time bool
7524 // constant that's true iff type From can be implicitly converted to
7526 template <typename From, typename To>
7527 class ImplicitlyConvertible {
7529 // We need the following helper functions only for their types.
7530 // They have no implementations.
7532 // MakeFrom() is an expression whose type is From. We cannot simply
7533 // use From(), as the type From may not have a public default
7535 static From MakeFrom();
7537 // These two functions are overloaded. Given an expression
7538 // Helper(x), the compiler will pick the first version if x can be
7539 // implicitly converted to type To; otherwise it will pick the
7542 // The first version returns a value of size 1, and the second
7543 // version returns a value of size 2. Therefore, by checking the
7544 // size of Helper(x), which can be done at compile time, we can tell
7545 // which version of Helper() is used, and hence whether x can be
7546 // implicitly converted to type To.
7547 static char Helper(To);
7548 static char (&Helper(...))[2]; // NOLINT
7550 // We have to put the 'public' section after the 'private' section,
7551 // or MSVC refuses to compile the code.
7553 // MSVC warns about implicitly converting from double to int for
7554 // possible loss of data, so we need to temporarily disable the
7557 # pragma warning(push) // Saves the current warning state.
7558 # pragma warning(disable:4244) // Temporarily disables warning 4244.
7560 static const bool value =
7561 sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
7562 # pragma warning(pop) // Restores the warning state.
7563 #elif defined(__BORLANDC__)
7564 // C++Builder cannot use member overload resolution during template
7565 // instantiation. The simplest workaround is to use its C++0x type traits
7566 // functions (C++Builder 2009 and above only).
7567 static const bool value = __is_convertible(From, To);
7569 static const bool value =
7570 sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
7573 template <typename From, typename To>
7574 const bool ImplicitlyConvertible<From, To>::value;
7576 // IsAProtocolMessage<T>::value is a compile-time bool constant that's
7577 // true iff T is type ProtocolMessage, proto2::Message, or a subclass
7579 template <typename T>
7580 struct IsAProtocolMessage
7581 : public bool_constant<
7582 ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
7583 ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
7586 // When the compiler sees expression IsContainerTest<C>(0), if C is an
7587 // STL-style container class, the first overload of IsContainerTest
7588 // will be viable (since both C::iterator* and C::const_iterator* are
7589 // valid types and NULL can be implicitly converted to them). It will
7590 // be picked over the second overload as 'int' is a perfect match for
7591 // the type of argument 0. If C::iterator or C::const_iterator is not
7592 // a valid type, the first overload is not viable, and the second
7593 // overload will be picked. Therefore, we can determine whether C is
7594 // a container class by checking the type of IsContainerTest<C>(0).
7595 // The value of the expression is insignificant.
7597 // Note that we look for both C::iterator and C::const_iterator. The
7598 // reason is that C++ injects the name of a class as a member of the
7599 // class itself (e.g. you can refer to class iterator as either
7600 // 'iterator' or 'iterator::iterator'). If we look for C::iterator
7601 // only, for example, we would mistakenly think that a class named
7602 // iterator is an STL container.
7604 // Also note that the simpler approach of overloading
7605 // IsContainerTest(typename C::const_iterator*) and
7606 // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
7607 typedef int IsContainer;
7609 IsContainer IsContainerTest(int /* dummy */,
7610 typename C::iterator* /* it */ = NULL,
7611 typename C::const_iterator* /* const_it */ = NULL) {
7615 typedef char IsNotContainer;
7617 IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
7619 // EnableIf<condition>::type is void when 'Cond' is true, and
7620 // undefined when 'Cond' is false. To use SFINAE to make a function
7621 // overload only apply when a particular expression is true, add
7622 // "typename EnableIf<expression>::type* = 0" as the last parameter.
7623 template<bool> struct EnableIf;
7624 template<> struct EnableIf<true> { typedef void type; }; // NOLINT
7626 // Utilities for native arrays.
7628 // ArrayEq() compares two k-dimensional native arrays using the
7629 // elements' operator==, where k can be any integer >= 0. When k is
7630 // 0, ArrayEq() degenerates into comparing a single pair of values.
7632 template <typename T, typename U>
7633 bool ArrayEq(const T* lhs, size_t size, const U* rhs);
7635 // This generic version is used when k is 0.
7636 template <typename T, typename U>
7637 inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
7639 // This overload is used when k >= 1.
7640 template <typename T, typename U, size_t N>
7641 inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
7642 return internal::ArrayEq(lhs, N, rhs);
7645 // This helper reduces code bloat. If we instead put its logic inside
7646 // the previous ArrayEq() function, arrays with different sizes would
7647 // lead to different copies of the template code.
7648 template <typename T, typename U>
7649 bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
7650 for (size_t i = 0; i != size; i++) {
7651 if (!internal::ArrayEq(lhs[i], rhs[i]))
7657 // Finds the first element in the iterator range [begin, end) that
7658 // equals elem. Element may be a native array type itself.
7659 template <typename Iter, typename Element>
7660 Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
7661 for (Iter it = begin; it != end; ++it) {
7662 if (internal::ArrayEq(*it, elem))
7668 // CopyArray() copies a k-dimensional native array using the elements'
7669 // operator=, where k can be any integer >= 0. When k is 0,
7670 // CopyArray() degenerates into copying a single value.
7672 template <typename T, typename U>
7673 void CopyArray(const T* from, size_t size, U* to);
7675 // This generic version is used when k is 0.
7676 template <typename T, typename U>
7677 inline void CopyArray(const T& from, U* to) { *to = from; }
7679 // This overload is used when k >= 1.
7680 template <typename T, typename U, size_t N>
7681 inline void CopyArray(const T(&from)[N], U(*to)[N]) {
7682 internal::CopyArray(from, N, *to);
7685 // This helper reduces code bloat. If we instead put its logic inside
7686 // the previous CopyArray() function, arrays with different sizes
7687 // would lead to different copies of the template code.
7688 template <typename T, typename U>
7689 void CopyArray(const T* from, size_t size, U* to) {
7690 for (size_t i = 0; i != size; i++) {
7691 internal::CopyArray(from[i], to + i);
7695 // The relation between an NativeArray object (see below) and the
7696 // native array it represents.
7697 enum RelationToSource {
7698 kReference, // The NativeArray references the native array.
7699 kCopy // The NativeArray makes a copy of the native array and
7703 // Adapts a native array to a read-only STL-style container. Instead
7704 // of the complete STL container concept, this adaptor only implements
7705 // members useful for Google Mock's container matchers. New members
7706 // should be added as needed. To simplify the implementation, we only
7707 // support Element being a raw type (i.e. having no top-level const or
7708 // reference modifier). It's the client's responsibility to satisfy
7709 // this requirement. Element can be an array type itself (hence
7710 // multi-dimensional arrays are supported).
7711 template <typename Element>
7714 // STL-style container typedefs.
7715 typedef Element value_type;
7716 typedef Element* iterator;
7717 typedef const Element* const_iterator;
7719 // Constructs from a native array.
7720 NativeArray(const Element* array, size_t count, RelationToSource relation) {
7721 Init(array, count, relation);
7724 // Copy constructor.
7725 NativeArray(const NativeArray& rhs) {
7726 Init(rhs.array_, rhs.size_, rhs.relation_to_source_);
7730 // Ensures that the user doesn't instantiate NativeArray with a
7731 // const or reference type.
7732 static_cast<void>(StaticAssertTypeEqHelper<Element,
7733 GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
7734 if (relation_to_source_ == kCopy)
7738 // STL-style container methods.
7739 size_t size() const { return size_; }
7740 const_iterator begin() const { return array_; }
7741 const_iterator end() const { return array_ + size_; }
7742 bool operator==(const NativeArray& rhs) const {
7743 return size() == rhs.size() &&
7744 ArrayEq(begin(), size(), rhs.begin());
7748 // Initializes this object; makes a copy of the input array if
7749 // 'relation' is kCopy.
7750 void Init(const Element* array, size_t a_size, RelationToSource relation) {
7751 if (relation == kReference) {
7754 Element* const copy = new Element[a_size];
7755 CopyArray(array, a_size, copy);
7759 relation_to_source_ = relation;
7762 const Element* array_;
7764 RelationToSource relation_to_source_;
7766 GTEST_DISALLOW_ASSIGN_(NativeArray);
7769 } // namespace internal
7770 } // namespace testing
7772 #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
7773 ::testing::internal::AssertHelper(result_type, file, line, message) \
7774 = ::testing::Message()
7776 #define GTEST_MESSAGE_(message, result_type) \
7777 GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
7779 #define GTEST_FATAL_FAILURE_(message) \
7780 return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
7782 #define GTEST_NONFATAL_FAILURE_(message) \
7783 GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
7785 #define GTEST_SUCCESS_(message) \
7786 GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
7788 // Suppresses MSVC warnings 4072 (unreachable code) for the code following
7789 // statement if it returns or throws (or doesn't return or throw in some
7791 #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
7792 if (::testing::internal::AlwaysTrue()) { statement; }
7794 #define GTEST_TEST_THROW_(statement, expected_exception, fail) \
7795 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7796 if (::testing::internal::ConstCharPtr gtest_msg = "") { \
7797 bool gtest_caught_expected = false; \
7799 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
7801 catch (expected_exception const&) { \
7802 gtest_caught_expected = true; \
7806 "Expected: " #statement " throws an exception of type " \
7807 #expected_exception ".\n Actual: it throws a different type."; \
7808 goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
7810 if (!gtest_caught_expected) { \
7812 "Expected: " #statement " throws an exception of type " \
7813 #expected_exception ".\n Actual: it throws nothing."; \
7814 goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
7817 GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
7818 fail(gtest_msg.value)
7820 #define GTEST_TEST_NO_THROW_(statement, fail) \
7821 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7822 if (::testing::internal::AlwaysTrue()) { \
7824 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
7827 goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
7830 GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
7831 fail("Expected: " #statement " doesn't throw an exception.\n" \
7832 " Actual: it throws.")
7834 #define GTEST_TEST_ANY_THROW_(statement, fail) \
7835 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7836 if (::testing::internal::AlwaysTrue()) { \
7837 bool gtest_caught_any = false; \
7839 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
7842 gtest_caught_any = true; \
7844 if (!gtest_caught_any) { \
7845 goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
7848 GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
7849 fail("Expected: " #statement " throws an exception.\n" \
7850 " Actual: it doesn't.")
7853 // Implements Boolean test assertions such as EXPECT_TRUE. expression can be
7854 // either a boolean expression or an AssertionResult. text is a textual
7855 // represenation of expression as it was passed into the EXPECT_TRUE.
7856 #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
7857 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7858 if (const ::testing::AssertionResult gtest_ar_ = \
7859 ::testing::AssertionResult(expression)) \
7862 fail(::testing::internal::GetBoolAssertionFailureMessage(\
7863 gtest_ar_, text, #actual, #expected).c_str())
7865 #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
7866 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7867 if (::testing::internal::AlwaysTrue()) { \
7868 ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
7869 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
7870 if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
7871 goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
7874 GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
7875 fail("Expected: " #statement " doesn't generate new fatal " \
7876 "failures in the current thread.\n" \
7877 " Actual: it does.")
7879 // Expands to the name of the class that implements the given test.
7880 #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
7881 test_case_name##_##test_name##_Test
7883 // Helper macro for defining tests.
7884 #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
7885 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
7887 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
7889 virtual void TestBody();\
7890 static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
7891 GTEST_DISALLOW_COPY_AND_ASSIGN_(\
7892 GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
7895 ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
7897 ::testing::internal::MakeAndRegisterTestInfo(\
7898 #test_case_name, #test_name, NULL, NULL, \
7900 parent_class::SetUpTestCase, \
7901 parent_class::TearDownTestCase, \
7902 new ::testing::internal::TestFactoryImpl<\
7903 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
7904 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
7906 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
7907 // Copyright 2005, Google Inc.
7908 // All rights reserved.
7910 // Redistribution and use in source and binary forms, with or without
7911 // modification, are permitted provided that the following conditions are
7914 // * Redistributions of source code must retain the above copyright
7915 // notice, this list of conditions and the following disclaimer.
7916 // * Redistributions in binary form must reproduce the above
7917 // copyright notice, this list of conditions and the following disclaimer
7918 // in the documentation and/or other materials provided with the
7920 // * Neither the name of Google Inc. nor the names of its
7921 // contributors may be used to endorse or promote products derived from
7922 // this software without specific prior written permission.
7924 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
7925 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7926 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7927 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7928 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
7929 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
7930 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
7931 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
7932 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7933 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7934 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7936 // Author: wan@google.com (Zhanyong Wan)
7938 // The Google C++ Testing Framework (Google Test)
7940 // This header file defines the public API for death tests. It is
7941 // #included by gtest.h so a user doesn't need to include this
7944 #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
7945 #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
7947 // Copyright 2005, Google Inc.
7948 // All rights reserved.
7950 // Redistribution and use in source and binary forms, with or without
7951 // modification, are permitted provided that the following conditions are
7954 // * Redistributions of source code must retain the above copyright
7955 // notice, this list of conditions and the following disclaimer.
7956 // * Redistributions in binary form must reproduce the above
7957 // copyright notice, this list of conditions and the following disclaimer
7958 // in the documentation and/or other materials provided with the
7960 // * Neither the name of Google Inc. nor the names of its
7961 // contributors may be used to endorse or promote products derived from
7962 // this software without specific prior written permission.
7964 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
7965 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7966 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7967 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7968 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
7969 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
7970 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
7971 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
7972 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7973 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7974 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7976 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
7978 // The Google C++ Testing Framework (Google Test)
7980 // This header file defines internal utilities needed for implementing
7981 // death tests. They are subject to change without notice.
7983 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
7984 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
7990 namespace internal {
7992 GTEST_DECLARE_string_(internal_run_death_test);
7994 // Names of the flags (needed for parsing Google Test flags).
7995 const char kDeathTestStyleFlag[] = "death_test_style";
7996 const char kDeathTestUseFork[] = "death_test_use_fork";
7997 const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
7999 #if GTEST_HAS_DEATH_TEST
8001 // DeathTest is a class that hides much of the complexity of the
8002 // GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
8003 // returns a concrete class that depends on the prevailing death test
8004 // style, as defined by the --gtest_death_test_style and/or
8005 // --gtest_internal_run_death_test flags.
8007 // In describing the results of death tests, these terms are used with
8008 // the corresponding definitions:
8010 // exit status: The integer exit information in the format specified
8012 // exit code: The integer code passed to exit(3), _exit(2), or
8013 // returned from main()
8014 class GTEST_API_ DeathTest {
8016 // Create returns false if there was an error determining the
8017 // appropriate action to take for the current death test; for example,
8018 // if the gtest_death_test_style flag is set to an invalid value.
8019 // The LastMessage method will return a more detailed message in that
8020 // case. Otherwise, the DeathTest pointer pointed to by the "test"
8021 // argument is set. If the death test should be skipped, the pointer
8022 // is set to NULL; otherwise, it is set to the address of a new concrete
8023 // DeathTest object that controls the execution of the current test.
8024 static bool Create(const char* statement, const RE* regex,
8025 const char* file, int line, DeathTest** test);
8027 virtual ~DeathTest() { }
8029 // A helper class that aborts a death test when it's deleted.
8030 class ReturnSentinel {
8032 explicit ReturnSentinel(DeathTest* test) : test_(test) { }
8033 ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
8035 DeathTest* const test_;
8036 GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
8037 } GTEST_ATTRIBUTE_UNUSED_;
8039 // An enumeration of possible roles that may be taken when a death
8040 // test is encountered. EXECUTE means that the death test logic should
8041 // be executed immediately. OVERSEE means that the program should prepare
8042 // the appropriate environment for a child process to execute the death
8043 // test, then wait for it to complete.
8044 enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
8046 // An enumeration of the three reasons that a test might be aborted.
8048 TEST_ENCOUNTERED_RETURN_STATEMENT,
8049 TEST_THREW_EXCEPTION,
8053 // Assumes one of the above roles.
8054 virtual TestRole AssumeRole() = 0;
8056 // Waits for the death test to finish and returns its status.
8057 virtual int Wait() = 0;
8059 // Returns true if the death test passed; that is, the test process
8060 // exited during the test, its exit status matches a user-supplied
8061 // predicate, and its stderr output matches a user-supplied regular
8063 // The user-supplied predicate may be a macro expression rather
8064 // than a function pointer or functor, or else Wait and Passed could
8066 virtual bool Passed(bool exit_status_ok) = 0;
8068 // Signals that the death test did not die as expected.
8069 virtual void Abort(AbortReason reason) = 0;
8071 // Returns a human-readable outcome message regarding the outcome of
8072 // the last death test.
8073 static const char* LastMessage();
8075 static void set_last_death_test_message(const String& message);
8078 // A string containing a description of the outcome of the last death test.
8079 static String last_death_test_message_;
8081 GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
8084 // Factory interface for death tests. May be mocked out for testing.
8085 class DeathTestFactory {
8087 virtual ~DeathTestFactory() { }
8088 virtual bool Create(const char* statement, const RE* regex,
8089 const char* file, int line, DeathTest** test) = 0;
8092 // A concrete DeathTestFactory implementation for normal use.
8093 class DefaultDeathTestFactory : public DeathTestFactory {
8095 virtual bool Create(const char* statement, const RE* regex,
8096 const char* file, int line, DeathTest** test);
8099 // Returns true if exit_status describes a process that was terminated
8100 // by a signal, or exited normally with a nonzero exit code.
8101 GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
8103 // Traps C++ exceptions escaping statement and reports them as test
8104 // failures. Note that trapping SEH exceptions is not implemented here.
8105 # if GTEST_HAS_EXCEPTIONS
8106 # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
8108 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8109 } catch (const ::std::exception& gtest_exception) { \
8112 "\n%s: Caught std::exception-derived exception escaping the " \
8113 "death test statement. Exception message: %s\n", \
8114 ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
8115 gtest_exception.what()); \
8117 death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
8119 death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
8123 # define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
8124 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
8128 // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
8129 // ASSERT_EXIT*, and EXPECT_EXIT*.
8130 # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
8131 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8132 if (::testing::internal::AlwaysTrue()) { \
8133 const ::testing::internal::RE& gtest_regex = (regex); \
8134 ::testing::internal::DeathTest* gtest_dt; \
8135 if (!::testing::internal::DeathTest::Create(#statement, >est_regex, \
8136 __FILE__, __LINE__, >est_dt)) { \
8137 goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
8139 if (gtest_dt != NULL) { \
8140 ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
8141 gtest_dt_ptr(gtest_dt); \
8142 switch (gtest_dt->AssumeRole()) { \
8143 case ::testing::internal::DeathTest::OVERSEE_TEST: \
8144 if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
8145 goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
8148 case ::testing::internal::DeathTest::EXECUTE_TEST: { \
8149 ::testing::internal::DeathTest::ReturnSentinel \
8150 gtest_sentinel(gtest_dt); \
8151 GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
8152 gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
8160 GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
8161 fail(::testing::internal::DeathTest::LastMessage())
8162 // The symbol "fail" here expands to something into which a message
8165 // A class representing the parsed contents of the
8166 // --gtest_internal_run_death_test flag, as it existed when
8167 // RUN_ALL_TESTS was called.
8168 class InternalRunDeathTestFlag {
8170 InternalRunDeathTestFlag(const String& a_file,
8174 : file_(a_file), line_(a_line), index_(an_index),
8175 write_fd_(a_write_fd) {}
8177 ~InternalRunDeathTestFlag() {
8179 posix::Close(write_fd_);
8182 String file() const { return file_; }
8183 int line() const { return line_; }
8184 int index() const { return index_; }
8185 int write_fd() const { return write_fd_; }
8193 GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
8196 // Returns a newly created InternalRunDeathTestFlag object with fields
8197 // initialized from the GTEST_FLAG(internal_run_death_test) flag if
8198 // the flag is specified; otherwise returns NULL.
8199 InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
8201 #else // GTEST_HAS_DEATH_TEST
8203 // This macro is used for implementing macros such as
8204 // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
8205 // death tests are not supported. Those macros must compile on such systems
8206 // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
8207 // systems that support death tests. This allows one to write such a macro
8208 // on a system that does not support death tests and be sure that it will
8209 // compile on a death-test supporting system.
8212 // statement - A statement that a macro such as EXPECT_DEATH would test
8213 // for program termination. This macro has to make sure this
8214 // statement is compiled but not executed, to ensure that
8215 // EXPECT_DEATH_IF_SUPPORTED compiles with a certain
8216 // parameter iff EXPECT_DEATH compiles with it.
8217 // regex - A regex that a macro such as EXPECT_DEATH would use to test
8218 // the output of statement. This parameter has to be
8219 // compiled but not evaluated by this macro, to ensure that
8220 // this macro only accepts expressions that a macro such as
8221 // EXPECT_DEATH would accept.
8222 // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
8223 // and a return statement for ASSERT_DEATH_IF_SUPPORTED.
8224 // This ensures that ASSERT_DEATH_IF_SUPPORTED will not
8225 // compile inside functions where ASSERT_DEATH doesn't
8228 // The branch that has an always false condition is used to ensure that
8229 // statement and regex are compiled (and thus syntactically correct) but
8230 // never executed. The unreachable code macro protects the terminator
8231 // statement from generating an 'unreachable code' warning in case
8232 // statement unconditionally returns or throws. The Message constructor at
8233 // the end allows the syntax of streaming additional messages into the
8234 // macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
8235 # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
8236 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8237 if (::testing::internal::AlwaysTrue()) { \
8238 GTEST_LOG_(WARNING) \
8239 << "Death tests are not supported on this platform.\n" \
8240 << "Statement '" #statement "' cannot be verified."; \
8241 } else if (::testing::internal::AlwaysFalse()) { \
8242 ::testing::internal::RE::PartialMatch(".*", (regex)); \
8243 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8246 ::testing::Message()
8248 #endif // GTEST_HAS_DEATH_TEST
8250 } // namespace internal
8251 } // namespace testing
8253 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
8257 // This flag controls the style of death tests. Valid values are "threadsafe",
8258 // meaning that the death test child process will re-execute the test binary
8259 // from the start, running only a single death test, or "fast",
8260 // meaning that the child process will execute the test logic immediately
8262 GTEST_DECLARE_string_(death_test_style);
8264 #if GTEST_HAS_DEATH_TEST
8266 // The following macros are useful for writing death tests.
8268 // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
8271 // 1. It generates a warning if there is more than one active
8272 // thread. This is because it's safe to fork() or clone() only
8273 // when there is a single thread.
8275 // 2. The parent process clone()s a sub-process and runs the death
8276 // test in it; the sub-process exits with code 0 at the end of the
8277 // death test, if it hasn't exited already.
8279 // 3. The parent process waits for the sub-process to terminate.
8281 // 4. The parent process checks the exit code and error message of
8286 // ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
8287 // for (int i = 0; i < 5; i++) {
8288 // EXPECT_DEATH(server.ProcessRequest(i),
8289 // "Invalid request .* in ProcessRequest()")
8290 // << "Failed to die on request " << i);
8293 // ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
8295 // bool KilledBySIGHUP(int exit_code) {
8296 // return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
8299 // ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
8301 // On the regular expressions used in death tests:
8303 // On POSIX-compliant systems (*nix), we use the <regex.h> library,
8304 // which uses the POSIX extended regex syntax.
8306 // On other platforms (e.g. Windows), we only support a simple regex
8307 // syntax implemented as part of Google Test. This limited
8308 // implementation should be enough most of the time when writing
8309 // death tests; though it lacks many features you can find in PCRE
8310 // or POSIX extended regex syntax. For example, we don't support
8311 // union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
8312 // repetition count ("x{5,7}"), among others.
8314 // Below is the syntax that we do support. We chose it to be a
8315 // subset of both PCRE and POSIX extended regex, so it's easy to
8316 // learn wherever you come from. In the following: 'A' denotes a
8317 // literal character, period (.), or a single \\ escape sequence;
8318 // 'x' and 'y' denote regular expressions; 'm' and 'n' are for
8321 // c matches any literal character c
8322 // \\d matches any decimal digit
8323 // \\D matches any character that's not a decimal digit
8327 // \\s matches any ASCII whitespace, including \n
8328 // \\S matches any character that's not a whitespace
8331 // \\w matches any letter, _, or decimal digit
8332 // \\W matches any character that \\w doesn't match
8333 // \\c matches any literal character c, which must be a punctuation
8334 // . matches any single character except \n
8335 // A? matches 0 or 1 occurrences of A
8336 // A* matches 0 or many occurrences of A
8337 // A+ matches 1 or many occurrences of A
8338 // ^ matches the beginning of a string (not that of each line)
8339 // $ matches the end of a string (not that of each line)
8340 // xy matches x followed by y
8342 // If you accidentally use PCRE or POSIX extended regex features
8343 // not implemented by us, you will get a run-time failure. In that
8344 // case, please try to rewrite your regular expression within the
8347 // This implementation is *not* meant to be as highly tuned or robust
8348 // as a compiled regex library, but should perform well enough for a
8349 // death test, which already incurs significant overhead by launching
8354 // A "threadsafe" style death test obtains the path to the test
8355 // program from argv[0] and re-executes it in the sub-process. For
8356 // simplicity, the current implementation doesn't search the PATH
8357 // when launching the sub-process. This means that the user must
8358 // invoke the test program via a path that contains at least one
8359 // path separator (e.g. path/to/foo_test and
8360 // /absolute/path/to/bar_test are fine, but foo_test is not). This
8361 // is rarely a problem as people usually don't put the test binary
8362 // directory in PATH.
8364 // TODO(wan@google.com): make thread-safe death tests search the PATH.
8366 // Asserts that a given statement causes the program to exit, with an
8367 // integer exit status that satisfies predicate, and emitting error output
8368 // that matches regex.
8369 # define ASSERT_EXIT(statement, predicate, regex) \
8370 GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
8372 // Like ASSERT_EXIT, but continues on to successive tests in the
8373 // test case, if any:
8374 # define EXPECT_EXIT(statement, predicate, regex) \
8375 GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
8377 // Asserts that a given statement causes the program to exit, either by
8378 // explicitly exiting with a nonzero exit code or being killed by a
8379 // signal, and emitting error output that matches regex.
8380 # define ASSERT_DEATH(statement, regex) \
8381 ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
8383 // Like ASSERT_DEATH, but continues on to successive tests in the
8384 // test case, if any:
8385 # define EXPECT_DEATH(statement, regex) \
8386 EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
8388 // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
8390 // Tests that an exit code describes a normal exit with a given exit code.
8391 class GTEST_API_ ExitedWithCode {
8393 explicit ExitedWithCode(int exit_code);
8394 bool operator()(int exit_status) const;
8396 // No implementation - assignment is unsupported.
8397 void operator=(const ExitedWithCode& other);
8399 const int exit_code_;
8402 # if !GTEST_OS_WINDOWS
8403 // Tests that an exit code describes an exit due to termination by a
8405 class GTEST_API_ KilledBySignal {
8407 explicit KilledBySignal(int signum);
8408 bool operator()(int exit_status) const;
8412 # endif // !GTEST_OS_WINDOWS
8414 // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
8415 // The death testing framework causes this to have interesting semantics,
8416 // since the sideeffects of the call are only visible in opt mode, and not
8419 // In practice, this can be used to test functions that utilize the
8420 // LOG(DFATAL) macro using the following style:
8422 // int DieInDebugOr12(int* sideeffect) {
8423 // if (sideeffect) {
8424 // *sideeffect = 12;
8426 // LOG(DFATAL) << "death";
8430 // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
8431 // int sideeffect = 0;
8432 // // Only asserts in dbg.
8433 // EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
8436 // // opt-mode has sideeffect visible.
8437 // EXPECT_EQ(12, sideeffect);
8439 // // dbg-mode no visible sideeffect.
8440 // EXPECT_EQ(0, sideeffect);
8444 // This will assert that DieInDebugReturn12InOpt() crashes in debug
8445 // mode, usually due to a DCHECK or LOG(DFATAL), but returns the
8446 // appropriate fallback value (12 in this case) in opt mode. If you
8447 // need to test that a function has appropriate side-effects in opt
8448 // mode, include assertions against the side-effects. A general
8449 // pattern for this is:
8451 // EXPECT_DEBUG_DEATH({
8452 // // Side-effects here will have an effect after this statement in
8453 // // opt mode, but none in debug mode.
8454 // EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
8459 # define EXPECT_DEBUG_DEATH(statement, regex) \
8460 do { statement; } while (::testing::internal::AlwaysFalse())
8462 # define ASSERT_DEBUG_DEATH(statement, regex) \
8463 do { statement; } while (::testing::internal::AlwaysFalse())
8467 # define EXPECT_DEBUG_DEATH(statement, regex) \
8468 EXPECT_DEATH(statement, regex)
8470 # define ASSERT_DEBUG_DEATH(statement, regex) \
8471 ASSERT_DEATH(statement, regex)
8473 # endif // NDEBUG for EXPECT_DEBUG_DEATH
8474 #endif // GTEST_HAS_DEATH_TEST
8476 // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
8477 // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
8478 // death tests are supported; otherwise they just issue a warning. This is
8479 // useful when you are combining death test assertions with normal test
8480 // assertions in one test.
8481 #if GTEST_HAS_DEATH_TEST
8482 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
8483 EXPECT_DEATH(statement, regex)
8484 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
8485 ASSERT_DEATH(statement, regex)
8487 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
8488 GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
8489 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
8490 GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
8493 } // namespace testing
8495 #endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
8496 // Copyright 2005, Google Inc.
8497 // All rights reserved.
8499 // Redistribution and use in source and binary forms, with or without
8500 // modification, are permitted provided that the following conditions are
8503 // * Redistributions of source code must retain the above copyright
8504 // notice, this list of conditions and the following disclaimer.
8505 // * Redistributions in binary form must reproduce the above
8506 // copyright notice, this list of conditions and the following disclaimer
8507 // in the documentation and/or other materials provided with the
8509 // * Neither the name of Google Inc. nor the names of its
8510 // contributors may be used to endorse or promote products derived from
8511 // this software without specific prior written permission.
8513 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8514 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8515 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8516 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8517 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8518 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8519 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8520 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8521 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8522 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8523 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8525 // Author: wan@google.com (Zhanyong Wan)
8527 // The Google C++ Testing Framework (Google Test)
8529 // This header file defines the Message class.
8531 // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
8532 // leave some internal implementation details in this header file.
8533 // They are clearly marked by comments like this:
8535 // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
8537 // Such code is NOT meant to be used by a user directly, and is subject
8538 // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
8541 #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
8542 #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
8549 // The Message class works like an ostream repeater.
8553 // 1. You stream a bunch of values to a Message object.
8554 // It will remember the text in a stringstream.
8555 // 2. Then you stream the Message object to an ostream.
8556 // This causes the text in the Message to be streamed
8561 // testing::Message foo;
8562 // foo << 1 << " != " << 2;
8563 // std::cout << foo;
8565 // will print "1 != 2".
8567 // Message is not intended to be inherited from. In particular, its
8568 // destructor is not virtual.
8570 // Note that stringstream behaves differently in gcc and in MSVC. You
8571 // can stream a NULL char pointer to it in the former, but not in the
8572 // latter (it causes an access violation if you do). The Message
8573 // class hides this difference by treating a NULL char pointer as
8575 class GTEST_API_ Message {
8577 // The type of basic IO manipulators (endl, ends, and flush) for
8579 typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
8582 // Constructs an empty Message.
8583 // We allocate the stringstream separately because otherwise each use of
8584 // ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's
8585 // stack frame leading to huge stack frames in some cases; gcc does not reuse
8587 Message() : ss_(new ::std::stringstream) {
8588 // By default, we want there to be enough precision when printing
8589 // a double to a Message.
8590 *ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);
8593 // Copy constructor.
8594 Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT
8595 *ss_ << msg.GetString();
8598 // Constructs a Message from a C-string.
8599 explicit Message(const char* str) : ss_(new ::std::stringstream) {
8603 #if GTEST_OS_SYMBIAN
8604 // Streams a value (either a pointer or not) to this object.
8605 template <typename T>
8606 inline Message& operator <<(const T& value) {
8607 StreamHelper(typename internal::is_pointer<T>::type(), value);
8611 // Streams a non-pointer value to this object.
8612 template <typename T>
8613 inline Message& operator <<(const T& val) {
8614 ::GTestStreamToHelper(ss_.get(), val);
8618 // Streams a pointer value to this object.
8620 // This function is an overload of the previous one. When you
8621 // stream a pointer to a Message, this definition will be used as it
8622 // is more specialized. (The C++ Standard, section
8623 // [temp.func.order].) If you stream a non-pointer, then the
8624 // previous definition will be used.
8626 // The reason for this overload is that streaming a NULL pointer to
8627 // ostream is undefined behavior. Depending on the compiler, you
8628 // may get "0", "(nil)", "(null)", or an access violation. To
8629 // ensure consistent result across compilers, we always treat NULL
8631 template <typename T>
8632 inline Message& operator <<(T* const& pointer) { // NOLINT
8633 if (pointer == NULL) {
8636 ::GTestStreamToHelper(ss_.get(), pointer);
8640 #endif // GTEST_OS_SYMBIAN
8642 // Since the basic IO manipulators are overloaded for both narrow
8643 // and wide streams, we have to provide this specialized definition
8644 // of operator <<, even though its body is the same as the
8645 // templatized version above. Without this definition, streaming
8646 // endl or other basic IO manipulators to Message will confuse the
8648 Message& operator <<(BasicNarrowIoManip val) {
8653 // Instead of 1/0, we want to see true/false for bool values.
8654 Message& operator <<(bool b) {
8655 return *this << (b ? "true" : "false");
8658 // These two overloads allow streaming a wide C string to a Message
8659 // using the UTF-8 encoding.
8660 Message& operator <<(const wchar_t* wide_c_str) {
8661 return *this << internal::String::ShowWideCString(wide_c_str);
8663 Message& operator <<(wchar_t* wide_c_str) {
8664 return *this << internal::String::ShowWideCString(wide_c_str);
8667 #if GTEST_HAS_STD_WSTRING
8668 // Converts the given wide string to a narrow string using the UTF-8
8669 // encoding, and streams the result to this Message object.
8670 Message& operator <<(const ::std::wstring& wstr);
8671 #endif // GTEST_HAS_STD_WSTRING
8673 #if GTEST_HAS_GLOBAL_WSTRING
8674 // Converts the given wide string to a narrow string using the UTF-8
8675 // encoding, and streams the result to this Message object.
8676 Message& operator <<(const ::wstring& wstr);
8677 #endif // GTEST_HAS_GLOBAL_WSTRING
8679 // Gets the text streamed to this object so far as a String.
8680 // Each '\0' character in the buffer is replaced with "\\0".
8682 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
8683 internal::String GetString() const {
8684 return internal::StringStreamToString(ss_.get());
8689 #if GTEST_OS_SYMBIAN
8690 // These are needed as the Nokia Symbian Compiler cannot decide between
8691 // const T& and const T* in a function template. The Nokia compiler _can_
8692 // decide between class template specializations for T and T*, so a
8693 // tr1::type_traits-like is_pointer works, and we can overload on that.
8694 template <typename T>
8695 inline void StreamHelper(internal::true_type /*dummy*/, T* pointer) {
8696 if (pointer == NULL) {
8699 ::GTestStreamToHelper(ss_.get(), pointer);
8702 template <typename T>
8703 inline void StreamHelper(internal::false_type /*dummy*/, const T& value) {
8704 ::GTestStreamToHelper(ss_.get(), value);
8706 #endif // GTEST_OS_SYMBIAN
8708 // We'll hold the text streamed to this object here.
8709 const internal::scoped_ptr< ::std::stringstream> ss_;
8711 // We declare (but don't implement) this to prevent the compiler
8712 // from implementing the assignment operator.
8713 void operator=(const Message&);
8716 // Streams a Message to an ostream.
8717 inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
8718 return os << sb.GetString();
8721 } // namespace testing
8723 #endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
8724 // This file was GENERATED by command:
8725 // pump.py gtest-param-test.h.pump
8726 // DO NOT EDIT BY HAND!!!
8728 // Copyright 2008, Google Inc.
8729 // All rights reserved.
8731 // Redistribution and use in source and binary forms, with or without
8732 // modification, are permitted provided that the following conditions are
8735 // * Redistributions of source code must retain the above copyright
8736 // notice, this list of conditions and the following disclaimer.
8737 // * Redistributions in binary form must reproduce the above
8738 // copyright notice, this list of conditions and the following disclaimer
8739 // in the documentation and/or other materials provided with the
8741 // * Neither the name of Google Inc. nor the names of its
8742 // contributors may be used to endorse or promote products derived from
8743 // this software without specific prior written permission.
8745 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8746 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8747 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8748 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8749 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8750 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8751 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8752 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8753 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8754 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8755 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8757 // Authors: vladl@google.com (Vlad Losev)
8759 // Macros and functions for implementing parameterized tests
8760 // in Google C++ Testing Framework (Google Test)
8762 // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
8764 #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
8765 #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
8768 // Value-parameterized tests allow you to test your code with different
8769 // parameters without writing multiple copies of the same test.
8771 // Here is how you use value-parameterized tests:
8775 // To write value-parameterized tests, first you should define a fixture
8776 // class. It is usually derived from testing::TestWithParam<T> (see below for
8777 // another inheritance scheme that's sometimes useful in more complicated
8778 // class hierarchies), where the type of your parameter values.
8779 // TestWithParam<T> is itself derived from testing::Test. T can be any
8780 // copyable type. If it's a raw pointer, you are responsible for managing the
8781 // lifespan of the pointed values.
8783 class FooTest : public ::testing::TestWithParam<const char*> {
8784 // You can implement all the usual class fixture members here.
8787 // Then, use the TEST_P macro to define as many parameterized tests
8788 // for this fixture as you want. The _P suffix is for "parameterized"
8789 // or "pattern", whichever you prefer to think.
8791 TEST_P(FooTest, DoesBlah) {
8792 // Inside a test, access the test parameter with the GetParam() method
8793 // of the TestWithParam<T> class:
8794 EXPECT_TRUE(foo.Blah(GetParam()));
8798 TEST_P(FooTest, HasBlahBlah) {
8802 // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
8803 // case with any set of parameters you want. Google Test defines a number
8804 // of functions for generating test parameters. They return what we call
8805 // (surprise!) parameter generators. Here is a summary of them, which
8806 // are all in the testing namespace:
8809 // Range(begin, end [, step]) - Yields values {begin, begin+step,
8810 // begin+step+step, ...}. The values do not
8811 // include end. step defaults to 1.
8812 // Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
8813 // ValuesIn(container) - Yields values from a C-style array, an STL
8814 // ValuesIn(begin,end) container, or an iterator range [begin, end).
8815 // Bool() - Yields sequence {false, true}.
8816 // Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
8817 // for the math savvy) of the values generated
8818 // by the N generators.
8820 // For more details, see comments at the definitions of these functions below
8823 // The following statement will instantiate tests from the FooTest test case
8824 // each with parameter values "meeny", "miny", and "moe".
8826 INSTANTIATE_TEST_CASE_P(InstantiationName,
8828 Values("meeny", "miny", "moe"));
8830 // To distinguish different instances of the pattern, (yes, you
8831 // can instantiate it more then once) the first argument to the
8832 // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
8833 // actual test case name. Remember to pick unique prefixes for different
8834 // instantiations. The tests from the instantiation above will have
8837 // * InstantiationName/FooTest.DoesBlah/0 for "meeny"
8838 // * InstantiationName/FooTest.DoesBlah/1 for "miny"
8839 // * InstantiationName/FooTest.DoesBlah/2 for "moe"
8840 // * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
8841 // * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
8842 // * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
8844 // You can use these names in --gtest_filter.
8846 // This statement will instantiate all tests from FooTest again, each
8847 // with parameter values "cat" and "dog":
8849 const char* pets[] = {"cat", "dog"};
8850 INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
8852 // The tests from the instantiation above will have these names:
8854 // * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
8855 // * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
8856 // * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
8857 // * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
8859 // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
8860 // in the given test case, whether their definitions come before or
8861 // AFTER the INSTANTIATE_TEST_CASE_P statement.
8863 // Please also note that generator expressions (including parameters to the
8864 // generators) are evaluated in InitGoogleTest(), after main() has started.
8865 // This allows the user on one hand, to adjust generator parameters in order
8866 // to dynamically determine a set of tests to run and on the other hand,
8867 // give the user a chance to inspect the generated tests with Google Test
8868 // reflection API before RUN_ALL_TESTS() is executed.
8870 // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
8871 // for more examples.
8873 // In the future, we plan to publish the API for defining new parameter
8874 // generators. But for now this interface remains part of the internal
8875 // implementation and is subject to change.
8878 // A parameterized test fixture must be derived from testing::Test and from
8879 // testing::WithParamInterface<T>, where T is the type of the parameter
8880 // values. Inheriting from TestWithParam<T> satisfies that requirement because
8881 // TestWithParam<T> inherits from both Test and WithParamInterface. In more
8882 // complicated hierarchies, however, it is occasionally useful to inherit
8883 // separately from Test and WithParamInterface. For example:
8885 class BaseTest : public ::testing::Test {
8886 // You can inherit all the usual members for a non-parameterized test
8890 class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
8891 // The usual test fixture members go here too.
8894 TEST_F(BaseTest, HasFoo) {
8895 // This is an ordinary non-parameterized test.
8898 TEST_P(DerivedTest, DoesBlah) {
8899 // GetParam works just the same here as if you inherit from TestWithParam.
8900 EXPECT_TRUE(foo.Blah(GetParam()));
8906 #if !GTEST_OS_SYMBIAN
8910 // scripts/fuse_gtest.py depends on gtest's own header being #included
8911 // *unconditionally*. Therefore these #includes cannot be moved
8912 // inside #if GTEST_HAS_PARAM_TEST.
8913 // Copyright 2008 Google Inc.
8914 // All Rights Reserved.
8916 // Redistribution and use in source and binary forms, with or without
8917 // modification, are permitted provided that the following conditions are
8920 // * Redistributions of source code must retain the above copyright
8921 // notice, this list of conditions and the following disclaimer.
8922 // * Redistributions in binary form must reproduce the above
8923 // copyright notice, this list of conditions and the following disclaimer
8924 // in the documentation and/or other materials provided with the
8926 // * Neither the name of Google Inc. nor the names of its
8927 // contributors may be used to endorse or promote products derived from
8928 // this software without specific prior written permission.
8930 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8931 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8932 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8933 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8934 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8935 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8936 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8937 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8938 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8939 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8940 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8942 // Author: vladl@google.com (Vlad Losev)
8944 // Type and function utilities for implementing parameterized tests.
8946 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
8947 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
8953 // scripts/fuse_gtest.py depends on gtest's own header being #included
8954 // *unconditionally*. Therefore these #includes cannot be moved
8955 // inside #if GTEST_HAS_PARAM_TEST.
8956 // Copyright 2003 Google Inc.
8957 // All rights reserved.
8959 // Redistribution and use in source and binary forms, with or without
8960 // modification, are permitted provided that the following conditions are
8963 // * Redistributions of source code must retain the above copyright
8964 // notice, this list of conditions and the following disclaimer.
8965 // * Redistributions in binary form must reproduce the above
8966 // copyright notice, this list of conditions and the following disclaimer
8967 // in the documentation and/or other materials provided with the
8969 // * Neither the name of Google Inc. nor the names of its
8970 // contributors may be used to endorse or promote products derived from
8971 // this software without specific prior written permission.
8973 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8974 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8975 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8976 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8977 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8978 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8979 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8980 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8981 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8982 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8983 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8985 // Authors: Dan Egnor (egnor@google.com)
8987 // A "smart" pointer type with reference tracking. Every pointer to a
8988 // particular object is kept on a circular linked list. When the last pointer
8989 // to an object is destroyed or reassigned, the object is deleted.
8991 // Used properly, this deletes the object when the last reference goes away.
8992 // There are several caveats:
8993 // - Like all reference counting schemes, cycles lead to leaks.
8994 // - Each smart pointer is actually two pointers (8 bytes instead of 4).
8995 // - Every time a pointer is assigned, the entire list of pointers to that
8996 // object is traversed. This class is therefore NOT SUITABLE when there
8997 // will often be more than two or three pointers to a particular object.
8998 // - References are only tracked as long as linked_ptr<> objects are copied.
8999 // If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
9000 // will happen (double deletion).
9002 // A good use of this class is storing object references in STL containers.
9003 // You can safely put linked_ptr<> in a vector<>.
9004 // Other uses may not be as good.
9006 // Note: If you use an incomplete type with linked_ptr<>, the class
9007 // *containing* linked_ptr<> must have a constructor and destructor (even
9008 // if they do nothing!).
9010 // Bill Gibbons suggested we use something like this.
9013 // Unlike other linked_ptr implementations, in this implementation
9014 // a linked_ptr object is thread-safe in the sense that:
9015 // - it's safe to copy linked_ptr objects concurrently,
9016 // - it's safe to copy *from* a linked_ptr and read its underlying
9017 // raw pointer (e.g. via get()) concurrently, and
9018 // - it's safe to write to two linked_ptrs that point to the same
9019 // shared object concurrently.
9020 // TODO(wan@google.com): rename this to safe_linked_ptr to avoid
9021 // confusion with normal linked_ptr.
9023 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9024 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9031 namespace internal {
9033 // Protects copying of all linked_ptr objects.
9034 GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
9036 // This is used internally by all instances of linked_ptr<>. It needs to be
9037 // a non-template class because different types of linked_ptr<> can refer to
9038 // the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
9039 // So, it needs to be possible for different types of linked_ptr to participate
9040 // in the same circular linked list, so we need a single class type here.
9042 // DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr<T>.
9043 class linked_ptr_internal {
9045 // Create a new circle that includes only this instance.
9050 // Many linked_ptr operations may change p.link_ for some linked_ptr
9051 // variable p in the same circle as this object. Therefore we need
9052 // to prevent two such operations from occurring concurrently.
9054 // Note that different types of linked_ptr objects can coexist in a
9055 // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
9056 // linked_ptr<Derived2>). Therefore we must use a single mutex to
9057 // protect all linked_ptr objects. This can create serious
9058 // contention in production code, but is acceptable in a testing
9061 // Join an existing circle.
9062 // L < g_linked_ptr_mutex
9063 void join(linked_ptr_internal const* ptr) {
9064 MutexLock lock(&g_linked_ptr_mutex);
9066 linked_ptr_internal const* p = ptr;
9067 while (p->next_ != ptr) p = p->next_;
9072 // Leave whatever circle we're part of. Returns true if we were the
9073 // last member of the circle. Once this is done, you can join() another.
9074 // L < g_linked_ptr_mutex
9076 MutexLock lock(&g_linked_ptr_mutex);
9078 if (next_ == this) return true;
9079 linked_ptr_internal const* p = next_;
9080 while (p->next_ != this) p = p->next_;
9086 mutable linked_ptr_internal const* next_;
9089 template <typename T>
9092 typedef T element_type;
9094 // Take over ownership of a raw pointer. This should happen as soon as
9095 // possible after the object is created.
9096 explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
9097 ~linked_ptr() { depart(); }
9099 // Copy an existing linked_ptr<>, adding ourselves to the list of references.
9100 template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
9101 linked_ptr(linked_ptr const& ptr) { // NOLINT
9102 assert(&ptr != this);
9106 // Assignment releases the old value and acquires the new.
9107 template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
9113 linked_ptr& operator=(linked_ptr const& ptr) {
9121 // Smart pointer members.
9122 void reset(T* ptr = NULL) {
9126 T* get() const { return value_; }
9127 T* operator->() const { return value_; }
9128 T& operator*() const { return *value_; }
9130 bool operator==(T* p) const { return value_ == p; }
9131 bool operator!=(T* p) const { return value_ != p; }
9132 template <typename U>
9133 bool operator==(linked_ptr<U> const& ptr) const {
9134 return value_ == ptr.get();
9136 template <typename U>
9137 bool operator!=(linked_ptr<U> const& ptr) const {
9138 return value_ != ptr.get();
9142 template <typename U>
9143 friend class linked_ptr;
9146 linked_ptr_internal link_;
9149 if (link_.depart()) delete value_;
9152 void capture(T* ptr) {
9157 template <typename U> void copy(linked_ptr<U> const* ptr) {
9158 value_ = ptr->get();
9160 link_.join(&ptr->link_);
9166 template<typename T> inline
9167 bool operator==(T* ptr, const linked_ptr<T>& x) {
9168 return ptr == x.get();
9171 template<typename T> inline
9172 bool operator!=(T* ptr, const linked_ptr<T>& x) {
9173 return ptr != x.get();
9176 // A function to convert T* into linked_ptr<T>
9177 // Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
9178 // for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
9179 template <typename T>
9180 linked_ptr<T> make_linked_ptr(T* ptr) {
9181 return linked_ptr<T>(ptr);
9184 } // namespace internal
9185 } // namespace testing
9187 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9188 // Copyright 2007, Google Inc.
9189 // All rights reserved.
9191 // Redistribution and use in source and binary forms, with or without
9192 // modification, are permitted provided that the following conditions are
9195 // * Redistributions of source code must retain the above copyright
9196 // notice, this list of conditions and the following disclaimer.
9197 // * Redistributions in binary form must reproduce the above
9198 // copyright notice, this list of conditions and the following disclaimer
9199 // in the documentation and/or other materials provided with the
9201 // * Neither the name of Google Inc. nor the names of its
9202 // contributors may be used to endorse or promote products derived from
9203 // this software without specific prior written permission.
9205 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9206 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9207 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9208 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9209 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9210 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9211 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9212 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9213 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9214 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9215 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9217 // Author: wan@google.com (Zhanyong Wan)
9219 // Google Test - The Google C++ Testing Framework
9221 // This file implements a universal value printer that can print a
9222 // value of any type T:
9224 // void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
9226 // A user can teach this function how to print a class type T by
9227 // defining either operator<<() or PrintTo() in the namespace that
9228 // defines T. More specifically, the FIRST defined function in the
9229 // following list will be used (assuming T is defined in namespace
9232 // 1. foo::PrintTo(const T&, ostream*)
9233 // 2. operator<<(ostream&, const T&) defined in either foo or the
9234 // global namespace.
9236 // If none of the above is defined, it will print the debug string of
9237 // the value if it is a protocol buffer, or print the raw bytes in the
9240 // To aid debugging: when T is a reference type, the address of the
9241 // value is also printed; when T is a (const) char pointer, both the
9242 // pointer value and the NUL-terminated string it points to are
9245 // We also provide some convenient wrappers:
9247 // // Prints a value to a string. For a (const or not) char
9248 // // pointer, the NUL-terminated string (but not the pointer) is
9250 // std::string ::testing::PrintToString(const T& value);
9252 // // Prints a value tersely: for a reference type, the referenced
9253 // // value (but not the address) is printed; for a (const or not) char
9254 // // pointer, the NUL-terminated string (but not the pointer) is
9256 // void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
9258 // // Prints value using the type inferred by the compiler. The difference
9259 // // from UniversalTersePrint() is that this function prints both the
9260 // // pointer and the NUL-terminated string for a (const or not) char pointer.
9261 // void ::testing::internal::UniversalPrint(const T& value, ostream*);
9263 // // Prints the fields of a tuple tersely to a string vector, one
9264 // // element for each field. Tuple support must be enabled in
9266 // std::vector<string> UniversalTersePrintTupleFieldsToStrings(
9267 // const Tuple& value);
9269 // Known limitation:
9271 // The print primitives print the elements of an STL-style container
9272 // using the compiler-inferred type of *iter where iter is a
9273 // const_iterator of the container. When const_iterator is an input
9274 // iterator but not a forward iterator, this inferred type may not
9275 // match value_type, and the print output may be incorrect. In
9276 // practice, this is rarely a problem as for most containers
9277 // const_iterator is a forward iterator. We'll fix this if there's an
9278 // actual need for it. Note that this fix cannot rely on value_type
9279 // being defined as many user-defined container types don't have
9282 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
9283 #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
9285 #include <ostream> // NOLINT
9293 // Definitions in the 'internal' and 'internal2' name spaces are
9294 // subject to change without notice. DO NOT USE THEM IN USER CODE!
9295 namespace internal2 {
9297 // Prints the given number of bytes in the given object to the given
9299 GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
9301 ::std::ostream* os);
9303 // For selecting which printer to use when a given type has neither <<
9306 kProtobuf, // a protobuf type
9307 kConvertibleToInteger, // a type implicitly convertible to BiggestInt
9308 // (e.g. a named or unnamed enum type)
9309 kOtherType // anything else
9312 // TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
9313 // by the universal printer to print a value of type T when neither
9314 // operator<< nor PrintTo() is defined for T, where kTypeKind is the
9315 // "kind" of T as defined by enum TypeKind.
9316 template <typename T, TypeKind kTypeKind>
9317 class TypeWithoutFormatter {
9319 // This default version is called when kTypeKind is kOtherType.
9320 static void PrintValue(const T& value, ::std::ostream* os) {
9321 PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
9326 // We print a protobuf using its ShortDebugString() when the string
9327 // doesn't exceed this many characters; otherwise we print it using
9328 // DebugString() for better readability.
9329 const size_t kProtobufOneLinerMaxLength = 50;
9331 template <typename T>
9332 class TypeWithoutFormatter<T, kProtobuf> {
9334 static void PrintValue(const T& value, ::std::ostream* os) {
9335 const ::testing::internal::string short_str = value.ShortDebugString();
9336 const ::testing::internal::string pretty_str =
9337 short_str.length() <= kProtobufOneLinerMaxLength ?
9338 short_str : ("\n" + value.DebugString());
9339 *os << ("<" + pretty_str + ">");
9343 template <typename T>
9344 class TypeWithoutFormatter<T, kConvertibleToInteger> {
9346 // Since T has no << operator or PrintTo() but can be implicitly
9347 // converted to BiggestInt, we print it as a BiggestInt.
9349 // Most likely T is an enum type (either named or unnamed), in which
9350 // case printing it as an integer is the desired behavior. In case
9351 // T is not an enum, printing it as an integer is the best we can do
9352 // given that it has no user-defined printer.
9353 static void PrintValue(const T& value, ::std::ostream* os) {
9354 const internal::BiggestInt kBigInt = value;
9359 // Prints the given value to the given ostream. If the value is a
9360 // protocol message, its debug string is printed; if it's an enum or
9361 // of a type implicitly convertible to BiggestInt, it's printed as an
9362 // integer; otherwise the bytes in the value are printed. This is
9363 // what UniversalPrinter<T>::Print() does when it knows nothing about
9364 // type T and T has neither << operator nor PrintTo().
9366 // A user can override this behavior for a class type Foo by defining
9367 // a << operator in the namespace where Foo is defined.
9369 // We put this operator in namespace 'internal2' instead of 'internal'
9370 // to simplify the implementation, as much code in 'internal' needs to
9371 // use << in STL, which would conflict with our own << were it defined
9374 // Note that this operator<< takes a generic std::basic_ostream<Char,
9375 // CharTraits> type instead of the more restricted std::ostream. If
9376 // we define it to take an std::ostream instead, we'll get an
9377 // "ambiguous overloads" compiler error when trying to print a type
9378 // Foo that supports streaming to std::basic_ostream<Char,
9379 // CharTraits>, as the compiler cannot tell whether
9380 // operator<<(std::ostream&, const T&) or
9381 // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
9383 template <typename Char, typename CharTraits, typename T>
9384 ::std::basic_ostream<Char, CharTraits>& operator<<(
9385 ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
9386 TypeWithoutFormatter<T,
9387 (internal::IsAProtocolMessage<T>::value ? kProtobuf :
9388 internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
9389 kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
9393 } // namespace internal2
9394 } // namespace testing
9396 // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
9397 // magic needed for implementing UniversalPrinter won't work.
9398 namespace testing_internal {
9400 // Used to print a value that is not an STL-style container when the
9401 // user doesn't define PrintTo() for it.
9402 template <typename T>
9403 void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
9404 // With the following statement, during unqualified name lookup,
9405 // testing::internal2::operator<< appears as if it was declared in
9406 // the nearest enclosing namespace that contains both
9407 // ::testing_internal and ::testing::internal2, i.e. the global
9408 // namespace. For more details, refer to the C++ Standard section
9409 // 7.3.4-1 [namespace.udir]. This allows us to fall back onto
9410 // testing::internal2::operator<< in case T doesn't come with a <<
9413 // We cannot write 'using ::testing::internal2::operator<<;', which
9414 // gcc 3.3 fails to compile due to a compiler bug.
9415 using namespace ::testing::internal2; // NOLINT
9417 // Assuming T is defined in namespace foo, in the next statement,
9418 // the compiler will consider all of:
9420 // 1. foo::operator<< (thanks to Koenig look-up),
9421 // 2. ::operator<< (as the current namespace is enclosed in ::),
9422 // 3. testing::internal2::operator<< (thanks to the using statement above).
9424 // The operator<< whose type matches T best will be picked.
9426 // We deliberately allow #2 to be a candidate, as sometimes it's
9427 // impossible to define #1 (e.g. when foo is ::std, defining
9428 // anything in it is undefined behavior unless you are a compiler
9433 } // namespace testing_internal
9436 namespace internal {
9438 // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
9439 // value to the given ostream. The caller must ensure that
9440 // 'ostream_ptr' is not NULL, or the behavior is undefined.
9442 // We define UniversalPrinter as a class template (as opposed to a
9443 // function template), as we need to partially specialize it for
9444 // reference types, which cannot be done with function templates.
9445 template <typename T>
9446 class UniversalPrinter;
9448 template <typename T>
9449 void UniversalPrint(const T& value, ::std::ostream* os);
9451 // Used to print an STL-style container when the user doesn't define
9452 // a PrintTo() for it.
9453 template <typename C>
9454 void DefaultPrintTo(IsContainer /* dummy */,
9455 false_type /* is not a pointer */,
9456 const C& container, ::std::ostream* os) {
9457 const size_t kMaxCount = 32; // The maximum number of elements to print.
9460 for (typename C::const_iterator it = container.begin();
9461 it != container.end(); ++it, ++count) {
9464 if (count == kMaxCount) { // Enough has been printed.
9470 // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
9471 // handle *it being a native array.
9472 internal::UniversalPrint(*it, os);
9481 // Used to print a pointer that is neither a char pointer nor a member
9482 // pointer, when the user doesn't define PrintTo() for it. (A member
9483 // variable pointer or member function pointer doesn't really point to
9484 // a location in the address space. Their representation is
9485 // implementation-defined. Therefore they will be printed as raw
9487 template <typename T>
9488 void DefaultPrintTo(IsNotContainer /* dummy */,
9489 true_type /* is a pointer */,
9490 T* p, ::std::ostream* os) {
9494 // C++ doesn't allow casting from a function pointer to any object
9497 // IsTrue() silences warnings: "Condition is always true",
9498 // "unreachable code".
9499 if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
9500 // T is not a function type. We just call << to print p,
9501 // relying on ADL to pick up user-defined << for their pointer
9505 // T is a function type, so '*os << p' doesn't do what we want
9506 // (it just prints p as bool). We want to print p as a const
9507 // void*. However, we cannot cast it to const void* directly,
9508 // even using reinterpret_cast, as earlier versions of gcc
9509 // (e.g. 3.4.5) cannot compile the cast when p is a function
9510 // pointer. Casting to UInt64 first solves the problem.
9511 *os << reinterpret_cast<const void*>(
9512 reinterpret_cast<internal::UInt64>(p));
9517 // Used to print a non-container, non-pointer value when the user
9518 // doesn't define PrintTo() for it.
9519 template <typename T>
9520 void DefaultPrintTo(IsNotContainer /* dummy */,
9521 false_type /* is not a pointer */,
9522 const T& value, ::std::ostream* os) {
9523 ::testing_internal::DefaultPrintNonContainerTo(value, os);
9526 // Prints the given value using the << operator if it has one;
9527 // otherwise prints the bytes in it. This is what
9528 // UniversalPrinter<T>::Print() does when PrintTo() is not specialized
9529 // or overloaded for type T.
9531 // A user can override this behavior for a class type Foo by defining
9532 // an overload of PrintTo() in the namespace where Foo is defined. We
9533 // give the user this option as sometimes defining a << operator for
9534 // Foo is not desirable (e.g. the coding style may prevent doing it,
9535 // or there is already a << operator but it doesn't do what the user
9537 template <typename T>
9538 void PrintTo(const T& value, ::std::ostream* os) {
9539 // DefaultPrintTo() is overloaded. The type of its first two
9540 // arguments determine which version will be picked. If T is an
9541 // STL-style container, the version for container will be called; if
9542 // T is a pointer, the pointer version will be called; otherwise the
9543 // generic version will be called.
9545 // Note that we check for container types here, prior to we check
9546 // for protocol message types in our operator<<. The rationale is:
9548 // For protocol messages, we want to give people a chance to
9549 // override Google Mock's format by defining a PrintTo() or
9550 // operator<<. For STL containers, other formats can be
9551 // incompatible with Google Mock's format for the container
9552 // elements; therefore we check for container types here to ensure
9553 // that our format is used.
9555 // The second argument of DefaultPrintTo() is needed to bypass a bug
9556 // in Symbian's C++ compiler that prevents it from picking the right
9557 // overload between:
9559 // PrintTo(const T& x, ...);
9560 // PrintTo(T* x, ...);
9561 DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
9564 // The following list of PrintTo() overloads tells
9565 // UniversalPrinter<T>::Print() how to print standard types (built-in
9566 // types, strings, plain arrays, and pointers).
9568 // Overloads for various char types.
9569 GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
9570 GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
9571 inline void PrintTo(char c, ::std::ostream* os) {
9572 // When printing a plain char, we always treat it as unsigned. This
9573 // way, the output won't be affected by whether the compiler thinks
9574 // char is signed or not.
9575 PrintTo(static_cast<unsigned char>(c), os);
9578 // Overloads for other simple built-in types.
9579 inline void PrintTo(bool x, ::std::ostream* os) {
9580 *os << (x ? "true" : "false");
9583 // Overload for wchar_t type.
9584 // Prints a wchar_t as a symbol if it is printable or as its internal
9585 // code otherwise and also as its decimal code (except for L'\0').
9586 // The L'\0' char is printed as "L'\\0'". The decimal code is printed
9587 // as signed integer when wchar_t is implemented by the compiler
9588 // as a signed type and is printed as an unsigned integer when wchar_t
9589 // is implemented as an unsigned type.
9590 GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
9592 // Overloads for C strings.
9593 GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
9594 inline void PrintTo(char* s, ::std::ostream* os) {
9595 PrintTo(ImplicitCast_<const char*>(s), os);
9598 // signed/unsigned char is often used for representing binary data, so
9599 // we print pointers to it as void* to be safe.
9600 inline void PrintTo(const signed char* s, ::std::ostream* os) {
9601 PrintTo(ImplicitCast_<const void*>(s), os);
9603 inline void PrintTo(signed char* s, ::std::ostream* os) {
9604 PrintTo(ImplicitCast_<const void*>(s), os);
9606 inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
9607 PrintTo(ImplicitCast_<const void*>(s), os);
9609 inline void PrintTo(unsigned char* s, ::std::ostream* os) {
9610 PrintTo(ImplicitCast_<const void*>(s), os);
9613 // MSVC can be configured to define wchar_t as a typedef of unsigned
9614 // short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
9615 // type. When wchar_t is a typedef, defining an overload for const
9616 // wchar_t* would cause unsigned short* be printed as a wide string,
9617 // possibly causing invalid memory accesses.
9618 #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
9619 // Overloads for wide C strings
9620 GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
9621 inline void PrintTo(wchar_t* s, ::std::ostream* os) {
9622 PrintTo(ImplicitCast_<const wchar_t*>(s), os);
9626 // Overload for C arrays. Multi-dimensional arrays are printed
9629 // Prints the given number of elements in an array, without printing
9630 // the curly braces.
9631 template <typename T>
9632 void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
9633 UniversalPrint(a[0], os);
9634 for (size_t i = 1; i != count; i++) {
9636 UniversalPrint(a[i], os);
9640 // Overloads for ::string and ::std::string.
9641 #if GTEST_HAS_GLOBAL_STRING
9642 GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
9643 inline void PrintTo(const ::string& s, ::std::ostream* os) {
9644 PrintStringTo(s, os);
9646 #endif // GTEST_HAS_GLOBAL_STRING
9648 GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
9649 inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
9650 PrintStringTo(s, os);
9653 // Overloads for ::wstring and ::std::wstring.
9654 #if GTEST_HAS_GLOBAL_WSTRING
9655 GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
9656 inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
9657 PrintWideStringTo(s, os);
9659 #endif // GTEST_HAS_GLOBAL_WSTRING
9661 #if GTEST_HAS_STD_WSTRING
9662 GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
9663 inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
9664 PrintWideStringTo(s, os);
9666 #endif // GTEST_HAS_STD_WSTRING
9668 #if GTEST_HAS_TR1_TUPLE
9669 // Overload for ::std::tr1::tuple. Needed for printing function arguments,
9670 // which are packed as tuples.
9672 // Helper function for printing a tuple. T must be instantiated with
9674 template <typename T>
9675 void PrintTupleTo(const T& t, ::std::ostream* os);
9677 // Overloaded PrintTo() for tuples of various arities. We support
9678 // tuples of up-to 10 fields. The following implementation works
9679 // regardless of whether tr1::tuple is implemented using the
9680 // non-standard variadic template feature or not.
9682 inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
9683 PrintTupleTo(t, os);
9686 template <typename T1>
9687 void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
9688 PrintTupleTo(t, os);
9691 template <typename T1, typename T2>
9692 void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
9693 PrintTupleTo(t, os);
9696 template <typename T1, typename T2, typename T3>
9697 void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
9698 PrintTupleTo(t, os);
9701 template <typename T1, typename T2, typename T3, typename T4>
9702 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
9703 PrintTupleTo(t, os);
9706 template <typename T1, typename T2, typename T3, typename T4, typename T5>
9707 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
9708 ::std::ostream* os) {
9709 PrintTupleTo(t, os);
9712 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9714 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
9715 ::std::ostream* os) {
9716 PrintTupleTo(t, os);
9719 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9720 typename T6, typename T7>
9721 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
9722 ::std::ostream* os) {
9723 PrintTupleTo(t, os);
9726 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9727 typename T6, typename T7, typename T8>
9728 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
9729 ::std::ostream* os) {
9730 PrintTupleTo(t, os);
9733 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9734 typename T6, typename T7, typename T8, typename T9>
9735 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
9736 ::std::ostream* os) {
9737 PrintTupleTo(t, os);
9740 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9741 typename T6, typename T7, typename T8, typename T9, typename T10>
9743 const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
9744 ::std::ostream* os) {
9745 PrintTupleTo(t, os);
9747 #endif // GTEST_HAS_TR1_TUPLE
9749 // Overload for std::pair.
9750 template <typename T1, typename T2>
9751 void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
9753 // We cannot use UniversalPrint(value.first, os) here, as T1 may be
9754 // a reference type. The same for printing value.second.
9755 UniversalPrinter<T1>::Print(value.first, os);
9757 UniversalPrinter<T2>::Print(value.second, os);
9761 // Implements printing a non-reference type T by letting the compiler
9762 // pick the right overload of PrintTo() for T.
9763 template <typename T>
9764 class UniversalPrinter {
9766 // MSVC warns about adding const to a function type, so we want to
9767 // disable the warning.
9769 # pragma warning(push) // Saves the current warning state.
9770 # pragma warning(disable:4180) // Temporarily disables warning 4180.
9773 // Note: we deliberately don't call this PrintTo(), as that name
9774 // conflicts with ::testing::internal::PrintTo in the body of the
9776 static void Print(const T& value, ::std::ostream* os) {
9777 // By default, ::testing::internal::PrintTo() is used for printing
9780 // Thanks to Koenig look-up, if T is a class and has its own
9781 // PrintTo() function defined in its namespace, that function will
9782 // be visible here. Since it is more specific than the generic ones
9783 // in ::testing::internal, it will be picked by the compiler in the
9784 // following statement - exactly what we want.
9789 # pragma warning(pop) // Restores the warning state.
9793 // UniversalPrintArray(begin, len, os) prints an array of 'len'
9794 // elements, starting at address 'begin'.
9795 template <typename T>
9796 void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
9801 const size_t kThreshold = 18;
9802 const size_t kChunkSize = 8;
9803 // If the array has more than kThreshold elements, we'll have to
9804 // omit some details by printing only the first and the last
9805 // kChunkSize elements.
9806 // TODO(wan@google.com): let the user control the threshold using a flag.
9807 if (len <= kThreshold) {
9808 PrintRawArrayTo(begin, len, os);
9810 PrintRawArrayTo(begin, kChunkSize, os);
9812 PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
9817 // This overload prints a (const) char array compactly.
9818 GTEST_API_ void UniversalPrintArray(const char* begin,
9820 ::std::ostream* os);
9822 // Implements printing an array type T[N].
9823 template <typename T, size_t N>
9824 class UniversalPrinter<T[N]> {
9826 // Prints the given array, omitting some elements when there are too
9828 static void Print(const T (&a)[N], ::std::ostream* os) {
9829 UniversalPrintArray(a, N, os);
9833 // Implements printing a reference type T&.
9834 template <typename T>
9835 class UniversalPrinter<T&> {
9837 // MSVC warns about adding const to a function type, so we want to
9838 // disable the warning.
9840 # pragma warning(push) // Saves the current warning state.
9841 # pragma warning(disable:4180) // Temporarily disables warning 4180.
9844 static void Print(const T& value, ::std::ostream* os) {
9845 // Prints the address of the value. We use reinterpret_cast here
9846 // as static_cast doesn't compile when T is a function type.
9847 *os << "@" << reinterpret_cast<const void*>(&value) << " ";
9849 // Then prints the value itself.
9850 UniversalPrint(value, os);
9854 # pragma warning(pop) // Restores the warning state.
9858 // Prints a value tersely: for a reference type, the referenced value
9859 // (but not the address) is printed; for a (const) char pointer, the
9860 // NUL-terminated string (but not the pointer) is printed.
9861 template <typename T>
9862 void UniversalTersePrint(const T& value, ::std::ostream* os) {
9863 UniversalPrint(value, os);
9865 inline void UniversalTersePrint(const char* str, ::std::ostream* os) {
9869 UniversalPrint(string(str), os);
9872 inline void UniversalTersePrint(char* str, ::std::ostream* os) {
9873 UniversalTersePrint(static_cast<const char*>(str), os);
9876 // Prints a value using the type inferred by the compiler. The
9877 // difference between this and UniversalTersePrint() is that for a
9878 // (const) char pointer, this prints both the pointer and the
9879 // NUL-terminated string.
9880 template <typename T>
9881 void UniversalPrint(const T& value, ::std::ostream* os) {
9882 UniversalPrinter<T>::Print(value, os);
9885 #if GTEST_HAS_TR1_TUPLE
9886 typedef ::std::vector<string> Strings;
9888 // This helper template allows PrintTo() for tuples and
9889 // UniversalTersePrintTupleFieldsToStrings() to be defined by
9890 // induction on the number of tuple fields. The idea is that
9891 // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
9892 // fields in tuple t, and can be defined in terms of
9893 // TuplePrefixPrinter<N - 1>.
9895 // The inductive case.
9897 struct TuplePrefixPrinter {
9898 // Prints the first N fields of a tuple.
9899 template <typename Tuple>
9900 static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
9901 TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
9903 UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
9904 ::Print(::std::tr1::get<N - 1>(t), os);
9907 // Tersely prints the first N fields of a tuple to a string vector,
9908 // one element for each field.
9909 template <typename Tuple>
9910 static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
9911 TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
9912 ::std::stringstream ss;
9913 UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
9914 strings->push_back(ss.str());
9920 struct TuplePrefixPrinter<0> {
9921 template <typename Tuple>
9922 static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
9924 template <typename Tuple>
9925 static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
9927 // We have to specialize the entire TuplePrefixPrinter<> class
9928 // template here, even though the definition of
9929 // TersePrintPrefixToStrings() is the same as the generic version, as
9930 // Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
9931 // support specializing a method template of a class template.
9933 struct TuplePrefixPrinter<1> {
9934 template <typename Tuple>
9935 static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
9936 UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
9937 Print(::std::tr1::get<0>(t), os);
9940 template <typename Tuple>
9941 static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
9942 ::std::stringstream ss;
9943 UniversalTersePrint(::std::tr1::get<0>(t), &ss);
9944 strings->push_back(ss.str());
9948 // Helper function for printing a tuple. T must be instantiated with
9950 template <typename T>
9951 void PrintTupleTo(const T& t, ::std::ostream* os) {
9953 TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
9954 PrintPrefixTo(t, os);
9958 // Prints the fields of a tuple tersely to a string vector, one
9959 // element for each field. See the comment before
9960 // UniversalTersePrint() for how we define "tersely".
9961 template <typename Tuple>
9962 Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
9964 TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
9965 TersePrintPrefixToStrings(value, &result);
9968 #endif // GTEST_HAS_TR1_TUPLE
9970 } // namespace internal
9972 template <typename T>
9973 ::std::string PrintToString(const T& value) {
9974 ::std::stringstream ss;
9975 internal::UniversalTersePrint(value, &ss);
9979 } // namespace testing
9981 #endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
9983 #if GTEST_HAS_PARAM_TEST
9986 namespace internal {
9988 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
9990 // Outputs a message explaining invalid registration of different
9991 // fixture class for the same test case. This may happen when
9992 // TEST_P macro is used to define two tests with the same name
9993 // but in different namespaces.
9994 GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
9995 const char* file, int line);
9997 template <typename> class ParamGeneratorInterface;
9998 template <typename> class ParamGenerator;
10000 // Interface for iterating over elements provided by an implementation
10001 // of ParamGeneratorInterface<T>.
10002 template <typename T>
10003 class ParamIteratorInterface {
10005 virtual ~ParamIteratorInterface() {}
10006 // A pointer to the base generator instance.
10007 // Used only for the purposes of iterator comparison
10008 // to make sure that two iterators belong to the same generator.
10009 virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
10010 // Advances iterator to point to the next element
10011 // provided by the generator. The caller is responsible
10012 // for not calling Advance() on an iterator equal to
10013 // BaseGenerator()->End().
10014 virtual void Advance() = 0;
10015 // Clones the iterator object. Used for implementing copy semantics
10016 // of ParamIterator<T>.
10017 virtual ParamIteratorInterface* Clone() const = 0;
10018 // Dereferences the current iterator and provides (read-only) access
10019 // to the pointed value. It is the caller's responsibility not to call
10020 // Current() on an iterator equal to BaseGenerator()->End().
10021 // Used for implementing ParamGenerator<T>::operator*().
10022 virtual const T* Current() const = 0;
10023 // Determines whether the given iterator and other point to the same
10024 // element in the sequence generated by the generator.
10025 // Used for implementing ParamGenerator<T>::operator==().
10026 virtual bool Equals(const ParamIteratorInterface& other) const = 0;
10029 // Class iterating over elements provided by an implementation of
10030 // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
10031 // and implements the const forward iterator concept.
10032 template <typename T>
10033 class ParamIterator {
10035 typedef T value_type;
10036 typedef const T& reference;
10037 typedef ptrdiff_t difference_type;
10039 // ParamIterator assumes ownership of the impl_ pointer.
10040 ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
10041 ParamIterator& operator=(const ParamIterator& other) {
10042 if (this != &other)
10043 impl_.reset(other.impl_->Clone());
10047 const T& operator*() const { return *impl_->Current(); }
10048 const T* operator->() const { return impl_->Current(); }
10049 // Prefix version of operator++.
10050 ParamIterator& operator++() {
10054 // Postfix version of operator++.
10055 ParamIterator operator++(int /*unused*/) {
10056 ParamIteratorInterface<T>* clone = impl_->Clone();
10058 return ParamIterator(clone);
10060 bool operator==(const ParamIterator& other) const {
10061 return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
10063 bool operator!=(const ParamIterator& other) const {
10064 return !(*this == other);
10068 friend class ParamGenerator<T>;
10069 explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
10070 scoped_ptr<ParamIteratorInterface<T> > impl_;
10073 // ParamGeneratorInterface<T> is the binary interface to access generators
10074 // defined in other translation units.
10075 template <typename T>
10076 class ParamGeneratorInterface {
10078 typedef T ParamType;
10080 virtual ~ParamGeneratorInterface() {}
10082 // Generator interface definition
10083 virtual ParamIteratorInterface<T>* Begin() const = 0;
10084 virtual ParamIteratorInterface<T>* End() const = 0;
10087 // Wraps ParamGeneratorInterface<T> and provides general generator syntax
10088 // compatible with the STL Container concept.
10089 // This class implements copy initialization semantics and the contained
10090 // ParamGeneratorInterface<T> instance is shared among all copies
10091 // of the original object. This is possible because that instance is immutable.
10092 template<typename T>
10093 class ParamGenerator {
10095 typedef ParamIterator<T> iterator;
10097 explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
10098 ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
10100 ParamGenerator& operator=(const ParamGenerator& other) {
10101 impl_ = other.impl_;
10105 iterator begin() const { return iterator(impl_->Begin()); }
10106 iterator end() const { return iterator(impl_->End()); }
10109 linked_ptr<const ParamGeneratorInterface<T> > impl_;
10112 // Generates values from a range of two comparable values. Can be used to
10113 // generate sequences of user-defined types that implement operator+() and
10115 // This class is used in the Range() function.
10116 template <typename T, typename IncrementT>
10117 class RangeGenerator : public ParamGeneratorInterface<T> {
10119 RangeGenerator(T begin, T end, IncrementT step)
10120 : begin_(begin), end_(end),
10121 step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
10122 virtual ~RangeGenerator() {}
10124 virtual ParamIteratorInterface<T>* Begin() const {
10125 return new Iterator(this, begin_, 0, step_);
10127 virtual ParamIteratorInterface<T>* End() const {
10128 return new Iterator(this, end_, end_index_, step_);
10132 class Iterator : public ParamIteratorInterface<T> {
10134 Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
10136 : base_(base), value_(value), index_(index), step_(step) {}
10137 virtual ~Iterator() {}
10139 virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
10142 virtual void Advance() {
10143 value_ = value_ + step_;
10146 virtual ParamIteratorInterface<T>* Clone() const {
10147 return new Iterator(*this);
10149 virtual const T* Current() const { return &value_; }
10150 virtual bool Equals(const ParamIteratorInterface<T>& other) const {
10151 // Having the same base generator guarantees that the other
10152 // iterator is of the same type and we can downcast.
10153 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
10154 << "The program attempted to compare iterators "
10155 << "from different generators." << std::endl;
10156 const int other_index =
10157 CheckedDowncastToActualType<const Iterator>(&other)->index_;
10158 return index_ == other_index;
10162 Iterator(const Iterator& other)
10163 : ParamIteratorInterface<T>(),
10164 base_(other.base_), value_(other.value_), index_(other.index_),
10165 step_(other.step_) {}
10167 // No implementation - assignment is unsupported.
10168 void operator=(const Iterator& other);
10170 const ParamGeneratorInterface<T>* const base_;
10173 const IncrementT step_;
10174 }; // class RangeGenerator::Iterator
10176 static int CalculateEndIndex(const T& begin,
10178 const IncrementT& step) {
10180 for (T i = begin; i < end; i = i + step)
10185 // No implementation - assignment is unsupported.
10186 void operator=(const RangeGenerator& other);
10190 const IncrementT step_;
10191 // The index for the end() iterator. All the elements in the generated
10192 // sequence are indexed (0-based) to aid iterator comparison.
10193 const int end_index_;
10194 }; // class RangeGenerator
10197 // Generates values from a pair of STL-style iterators. Used in the
10198 // ValuesIn() function. The elements are copied from the source range
10199 // since the source can be located on the stack, and the generator
10200 // is likely to persist beyond that stack frame.
10201 template <typename T>
10202 class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
10204 template <typename ForwardIterator>
10205 ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
10206 : container_(begin, end) {}
10207 virtual ~ValuesInIteratorRangeGenerator() {}
10209 virtual ParamIteratorInterface<T>* Begin() const {
10210 return new Iterator(this, container_.begin());
10212 virtual ParamIteratorInterface<T>* End() const {
10213 return new Iterator(this, container_.end());
10217 typedef typename ::std::vector<T> ContainerType;
10219 class Iterator : public ParamIteratorInterface<T> {
10221 Iterator(const ParamGeneratorInterface<T>* base,
10222 typename ContainerType::const_iterator iterator)
10223 : base_(base), iterator_(iterator) {}
10224 virtual ~Iterator() {}
10226 virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
10229 virtual void Advance() {
10233 virtual ParamIteratorInterface<T>* Clone() const {
10234 return new Iterator(*this);
10236 // We need to use cached value referenced by iterator_ because *iterator_
10237 // can return a temporary object (and of type other then T), so just
10238 // having "return &*iterator_;" doesn't work.
10239 // value_ is updated here and not in Advance() because Advance()
10240 // can advance iterator_ beyond the end of the range, and we cannot
10241 // detect that fact. The client code, on the other hand, is
10242 // responsible for not calling Current() on an out-of-range iterator.
10243 virtual const T* Current() const {
10244 if (value_.get() == NULL)
10245 value_.reset(new T(*iterator_));
10246 return value_.get();
10248 virtual bool Equals(const ParamIteratorInterface<T>& other) const {
10249 // Having the same base generator guarantees that the other
10250 // iterator is of the same type and we can downcast.
10251 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
10252 << "The program attempted to compare iterators "
10253 << "from different generators." << std::endl;
10254 return iterator_ ==
10255 CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
10259 Iterator(const Iterator& other)
10260 // The explicit constructor call suppresses a false warning
10261 // emitted by gcc when supplied with the -Wextra option.
10262 : ParamIteratorInterface<T>(),
10263 base_(other.base_),
10264 iterator_(other.iterator_) {}
10266 const ParamGeneratorInterface<T>* const base_;
10267 typename ContainerType::const_iterator iterator_;
10268 // A cached value of *iterator_. We keep it here to allow access by
10269 // pointer in the wrapping iterator's operator->().
10270 // value_ needs to be mutable to be accessed in Current().
10271 // Use of scoped_ptr helps manage cached value's lifetime,
10272 // which is bound by the lifespan of the iterator itself.
10273 mutable scoped_ptr<const T> value_;
10274 }; // class ValuesInIteratorRangeGenerator::Iterator
10276 // No implementation - assignment is unsupported.
10277 void operator=(const ValuesInIteratorRangeGenerator& other);
10279 const ContainerType container_;
10280 }; // class ValuesInIteratorRangeGenerator
10282 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10284 // Stores a parameter value and later creates tests parameterized with that
10286 template <class TestClass>
10287 class ParameterizedTestFactory : public TestFactoryBase {
10289 typedef typename TestClass::ParamType ParamType;
10290 explicit ParameterizedTestFactory(ParamType parameter) :
10291 parameter_(parameter) {}
10292 virtual Test* CreateTest() {
10293 TestClass::SetParam(¶meter_);
10294 return new TestClass();
10298 const ParamType parameter_;
10300 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
10303 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10305 // TestMetaFactoryBase is a base class for meta-factories that create
10306 // test factories for passing into MakeAndRegisterTestInfo function.
10307 template <class ParamType>
10308 class TestMetaFactoryBase {
10310 virtual ~TestMetaFactoryBase() {}
10312 virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
10315 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10317 // TestMetaFactory creates test factories for passing into
10318 // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
10319 // ownership of test factory pointer, same factory object cannot be passed
10320 // into that method twice. But ParameterizedTestCaseInfo is going to call
10321 // it for each Test/Parameter value combination. Thus it needs meta factory
10323 template <class TestCase>
10324 class TestMetaFactory
10325 : public TestMetaFactoryBase<typename TestCase::ParamType> {
10327 typedef typename TestCase::ParamType ParamType;
10329 TestMetaFactory() {}
10331 virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
10332 return new ParameterizedTestFactory<TestCase>(parameter);
10336 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
10339 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10341 // ParameterizedTestCaseInfoBase is a generic interface
10342 // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
10343 // accumulates test information provided by TEST_P macro invocations
10344 // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
10345 // and uses that information to register all resulting test instances
10346 // in RegisterTests method. The ParameterizeTestCaseRegistry class holds
10347 // a collection of pointers to the ParameterizedTestCaseInfo objects
10348 // and calls RegisterTests() on each of them when asked.
10349 class ParameterizedTestCaseInfoBase {
10351 virtual ~ParameterizedTestCaseInfoBase() {}
10353 // Base part of test case name for display purposes.
10354 virtual const string& GetTestCaseName() const = 0;
10355 // Test case id to verify identity.
10356 virtual TypeId GetTestCaseTypeId() const = 0;
10357 // UnitTest class invokes this method to register tests in this
10358 // test case right before running them in RUN_ALL_TESTS macro.
10359 // This method should not be called more then once on any single
10360 // instance of a ParameterizedTestCaseInfoBase derived class.
10361 virtual void RegisterTests() = 0;
10364 ParameterizedTestCaseInfoBase() {}
10367 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
10370 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10372 // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
10373 // macro invocations for a particular test case and generators
10374 // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
10375 // test case. It registers tests with all values generated by all
10376 // generators when asked.
10377 template <class TestCase>
10378 class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
10380 // ParamType and GeneratorCreationFunc are private types but are required
10381 // for declarations of public methods AddTestPattern() and
10382 // AddTestCaseInstantiation().
10383 typedef typename TestCase::ParamType ParamType;
10384 // A function that returns an instance of appropriate generator type.
10385 typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
10387 explicit ParameterizedTestCaseInfo(const char* name)
10388 : test_case_name_(name) {}
10390 // Test case base name for display purposes.
10391 virtual const string& GetTestCaseName() const { return test_case_name_; }
10392 // Test case id to verify identity.
10393 virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
10394 // TEST_P macro uses AddTestPattern() to record information
10395 // about a single test in a LocalTestInfo structure.
10396 // test_case_name is the base name of the test case (without invocation
10397 // prefix). test_base_name is the name of an individual test without
10398 // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
10399 // test case base name and DoBar is test base name.
10400 void AddTestPattern(const char* test_case_name,
10401 const char* test_base_name,
10402 TestMetaFactoryBase<ParamType>* meta_factory) {
10403 tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
10407 // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
10408 // about a generator.
10409 int AddTestCaseInstantiation(const string& instantiation_name,
10410 GeneratorCreationFunc* func,
10411 const char* /* file */,
10413 instantiations_.push_back(::std::make_pair(instantiation_name, func));
10414 return 0; // Return value used only to run this method in namespace scope.
10416 // UnitTest class invokes this method to register tests in this test case
10417 // test cases right before running tests in RUN_ALL_TESTS macro.
10418 // This method should not be called more then once on any single
10419 // instance of a ParameterizedTestCaseInfoBase derived class.
10420 // UnitTest has a guard to prevent from calling this method more then once.
10421 virtual void RegisterTests() {
10422 for (typename TestInfoContainer::iterator test_it = tests_.begin();
10423 test_it != tests_.end(); ++test_it) {
10424 linked_ptr<TestInfo> test_info = *test_it;
10425 for (typename InstantiationContainer::iterator gen_it =
10426 instantiations_.begin(); gen_it != instantiations_.end();
10428 const string& instantiation_name = gen_it->first;
10429 ParamGenerator<ParamType> generator((*gen_it->second)());
10431 Message test_case_name_stream;
10432 if ( !instantiation_name.empty() )
10433 test_case_name_stream << instantiation_name << "/";
10434 test_case_name_stream << test_info->test_case_base_name;
10437 for (typename ParamGenerator<ParamType>::iterator param_it =
10439 param_it != generator.end(); ++param_it, ++i) {
10440 Message test_name_stream;
10441 test_name_stream << test_info->test_base_name << "/" << i;
10442 MakeAndRegisterTestInfo(
10443 test_case_name_stream.GetString().c_str(),
10444 test_name_stream.GetString().c_str(),
10445 NULL, // No type parameter.
10446 PrintToString(*param_it).c_str(),
10447 GetTestCaseTypeId(),
10448 TestCase::SetUpTestCase,
10449 TestCase::TearDownTestCase,
10450 test_info->test_meta_factory->CreateTestFactory(*param_it));
10457 // LocalTestInfo structure keeps information about a single test registered
10458 // with TEST_P macro.
10460 TestInfo(const char* a_test_case_base_name,
10461 const char* a_test_base_name,
10462 TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
10463 test_case_base_name(a_test_case_base_name),
10464 test_base_name(a_test_base_name),
10465 test_meta_factory(a_test_meta_factory) {}
10467 const string test_case_base_name;
10468 const string test_base_name;
10469 const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
10471 typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
10472 // Keeps pairs of <Instantiation name, Sequence generator creation function>
10473 // received from INSTANTIATE_TEST_CASE_P macros.
10474 typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
10475 InstantiationContainer;
10477 const string test_case_name_;
10478 TestInfoContainer tests_;
10479 InstantiationContainer instantiations_;
10481 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
10482 }; // class ParameterizedTestCaseInfo
10484 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10486 // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
10487 // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
10488 // macros use it to locate their corresponding ParameterizedTestCaseInfo
10490 class ParameterizedTestCaseRegistry {
10492 ParameterizedTestCaseRegistry() {}
10493 ~ParameterizedTestCaseRegistry() {
10494 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10495 it != test_case_infos_.end(); ++it) {
10500 // Looks up or creates and returns a structure containing information about
10501 // tests and instantiations of a particular test case.
10502 template <class TestCase>
10503 ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
10504 const char* test_case_name,
10507 ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
10508 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10509 it != test_case_infos_.end(); ++it) {
10510 if ((*it)->GetTestCaseName() == test_case_name) {
10511 if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
10512 // Complain about incorrect usage of Google Test facilities
10513 // and terminate the program since we cannot guaranty correct
10514 // test case setup and tear-down in this case.
10515 ReportInvalidTestCaseType(test_case_name, file, line);
10518 // At this point we are sure that the object we found is of the same
10519 // type we are looking for, so we downcast it to that type
10520 // without further checks.
10521 typed_test_info = CheckedDowncastToActualType<
10522 ParameterizedTestCaseInfo<TestCase> >(*it);
10527 if (typed_test_info == NULL) {
10528 typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
10529 test_case_infos_.push_back(typed_test_info);
10531 return typed_test_info;
10533 void RegisterTests() {
10534 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10535 it != test_case_infos_.end(); ++it) {
10536 (*it)->RegisterTests();
10541 typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
10543 TestCaseInfoContainer test_case_infos_;
10545 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
10548 } // namespace internal
10549 } // namespace testing
10551 #endif // GTEST_HAS_PARAM_TEST
10553 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
10554 // This file was GENERATED by command:
10555 // pump.py gtest-param-util-generated.h.pump
10556 // DO NOT EDIT BY HAND!!!
10558 // Copyright 2008 Google Inc.
10559 // All Rights Reserved.
10561 // Redistribution and use in source and binary forms, with or without
10562 // modification, are permitted provided that the following conditions are
10565 // * Redistributions of source code must retain the above copyright
10566 // notice, this list of conditions and the following disclaimer.
10567 // * Redistributions in binary form must reproduce the above
10568 // copyright notice, this list of conditions and the following disclaimer
10569 // in the documentation and/or other materials provided with the
10571 // * Neither the name of Google Inc. nor the names of its
10572 // contributors may be used to endorse or promote products derived from
10573 // this software without specific prior written permission.
10575 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10576 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10577 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10578 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10579 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10580 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10581 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10582 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
10583 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10584 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
10585 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10587 // Author: vladl@google.com (Vlad Losev)
10589 // Type and function utilities for implementing parameterized tests.
10590 // This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
10592 // Currently Google Test supports at most 50 arguments in Values,
10593 // and at most 10 arguments in Combine. Please contact
10594 // googletestframework@googlegroups.com if you need more.
10595 // Please note that the number of arguments to Combine is limited
10596 // by the maximum arity of the implementation of tr1::tuple which is
10597 // currently set at 10.
10599 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
10600 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
10602 // scripts/fuse_gtest.py depends on gtest's own header being #included
10603 // *unconditionally*. Therefore these #includes cannot be moved
10604 // inside #if GTEST_HAS_PARAM_TEST.
10606 #if GTEST_HAS_PARAM_TEST
10608 namespace testing {
10610 // Forward declarations of ValuesIn(), which is implemented in
10611 // include/gtest/gtest-param-test.h.
10612 template <typename ForwardIterator>
10613 internal::ParamGenerator<
10614 typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
10615 ValuesIn(ForwardIterator begin, ForwardIterator end);
10617 template <typename T, size_t N>
10618 internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
10620 template <class Container>
10621 internal::ParamGenerator<typename Container::value_type> ValuesIn(
10622 const Container& container);
10624 namespace internal {
10626 // Used in the Values() function to provide polymorphic capabilities.
10627 template <typename T1>
10628 class ValueArray1 {
10630 explicit ValueArray1(T1 v1) : v1_(v1) {}
10632 template <typename T>
10633 operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
10636 // No implementation - assignment is unsupported.
10637 void operator=(const ValueArray1& other);
10642 template <typename T1, typename T2>
10643 class ValueArray2 {
10645 ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
10647 template <typename T>
10648 operator ParamGenerator<T>() const {
10649 const T array[] = {v1_, v2_};
10650 return ValuesIn(array);
10654 // No implementation - assignment is unsupported.
10655 void operator=(const ValueArray2& other);
10661 template <typename T1, typename T2, typename T3>
10662 class ValueArray3 {
10664 ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
10666 template <typename T>
10667 operator ParamGenerator<T>() const {
10668 const T array[] = {v1_, v2_, v3_};
10669 return ValuesIn(array);
10673 // No implementation - assignment is unsupported.
10674 void operator=(const ValueArray3& other);
10681 template <typename T1, typename T2, typename T3, typename T4>
10682 class ValueArray4 {
10684 ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
10687 template <typename T>
10688 operator ParamGenerator<T>() const {
10689 const T array[] = {v1_, v2_, v3_, v4_};
10690 return ValuesIn(array);
10694 // No implementation - assignment is unsupported.
10695 void operator=(const ValueArray4& other);
10703 template <typename T1, typename T2, typename T3, typename T4, typename T5>
10704 class ValueArray5 {
10706 ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
10707 v4_(v4), v5_(v5) {}
10709 template <typename T>
10710 operator ParamGenerator<T>() const {
10711 const T array[] = {v1_, v2_, v3_, v4_, v5_};
10712 return ValuesIn(array);
10716 // No implementation - assignment is unsupported.
10717 void operator=(const ValueArray5& other);
10726 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10728 class ValueArray6 {
10730 ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
10731 v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
10733 template <typename T>
10734 operator ParamGenerator<T>() const {
10735 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_};
10736 return ValuesIn(array);
10740 // No implementation - assignment is unsupported.
10741 void operator=(const ValueArray6& other);
10751 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10752 typename T6, typename T7>
10753 class ValueArray7 {
10755 ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
10756 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
10758 template <typename T>
10759 operator ParamGenerator<T>() const {
10760 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_};
10761 return ValuesIn(array);
10765 // No implementation - assignment is unsupported.
10766 void operator=(const ValueArray7& other);
10777 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10778 typename T6, typename T7, typename T8>
10779 class ValueArray8 {
10781 ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
10782 T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10785 template <typename T>
10786 operator ParamGenerator<T>() const {
10787 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_};
10788 return ValuesIn(array);
10792 // No implementation - assignment is unsupported.
10793 void operator=(const ValueArray8& other);
10805 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10806 typename T6, typename T7, typename T8, typename T9>
10807 class ValueArray9 {
10809 ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
10810 T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10811 v8_(v8), v9_(v9) {}
10813 template <typename T>
10814 operator ParamGenerator<T>() const {
10815 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_};
10816 return ValuesIn(array);
10820 // No implementation - assignment is unsupported.
10821 void operator=(const ValueArray9& other);
10834 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10835 typename T6, typename T7, typename T8, typename T9, typename T10>
10836 class ValueArray10 {
10838 ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10839 T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10840 v8_(v8), v9_(v9), v10_(v10) {}
10842 template <typename T>
10843 operator ParamGenerator<T>() const {
10844 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_};
10845 return ValuesIn(array);
10849 // No implementation - assignment is unsupported.
10850 void operator=(const ValueArray10& other);
10864 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10865 typename T6, typename T7, typename T8, typename T9, typename T10,
10867 class ValueArray11 {
10869 ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10870 T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
10871 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
10873 template <typename T>
10874 operator ParamGenerator<T>() const {
10875 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_};
10876 return ValuesIn(array);
10880 // No implementation - assignment is unsupported.
10881 void operator=(const ValueArray11& other);
10896 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10897 typename T6, typename T7, typename T8, typename T9, typename T10,
10898 typename T11, typename T12>
10899 class ValueArray12 {
10901 ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10902 T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
10903 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
10905 template <typename T>
10906 operator ParamGenerator<T>() const {
10907 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10909 return ValuesIn(array);
10913 // No implementation - assignment is unsupported.
10914 void operator=(const ValueArray12& other);
10930 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10931 typename T6, typename T7, typename T8, typename T9, typename T10,
10932 typename T11, typename T12, typename T13>
10933 class ValueArray13 {
10935 ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10936 T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
10937 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
10938 v12_(v12), v13_(v13) {}
10940 template <typename T>
10941 operator ParamGenerator<T>() const {
10942 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10944 return ValuesIn(array);
10948 // No implementation - assignment is unsupported.
10949 void operator=(const ValueArray13& other);
10966 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10967 typename T6, typename T7, typename T8, typename T9, typename T10,
10968 typename T11, typename T12, typename T13, typename T14>
10969 class ValueArray14 {
10971 ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10972 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
10973 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
10974 v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
10976 template <typename T>
10977 operator ParamGenerator<T>() const {
10978 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10980 return ValuesIn(array);
10984 // No implementation - assignment is unsupported.
10985 void operator=(const ValueArray14& other);
11003 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11004 typename T6, typename T7, typename T8, typename T9, typename T10,
11005 typename T11, typename T12, typename T13, typename T14, typename T15>
11006 class ValueArray15 {
11008 ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11009 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
11010 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11011 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
11013 template <typename T>
11014 operator ParamGenerator<T>() const {
11015 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11016 v12_, v13_, v14_, v15_};
11017 return ValuesIn(array);
11021 // No implementation - assignment is unsupported.
11022 void operator=(const ValueArray15& other);
11041 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11042 typename T6, typename T7, typename T8, typename T9, typename T10,
11043 typename T11, typename T12, typename T13, typename T14, typename T15,
11045 class ValueArray16 {
11047 ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11048 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
11049 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11050 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11053 template <typename T>
11054 operator ParamGenerator<T>() const {
11055 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11056 v12_, v13_, v14_, v15_, v16_};
11057 return ValuesIn(array);
11061 // No implementation - assignment is unsupported.
11062 void operator=(const ValueArray16& other);
11082 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11083 typename T6, typename T7, typename T8, typename T9, typename T10,
11084 typename T11, typename T12, typename T13, typename T14, typename T15,
11085 typename T16, typename T17>
11086 class ValueArray17 {
11088 ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11089 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
11090 T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11091 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11092 v15_(v15), v16_(v16), v17_(v17) {}
11094 template <typename T>
11095 operator ParamGenerator<T>() const {
11096 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11097 v12_, v13_, v14_, v15_, v16_, v17_};
11098 return ValuesIn(array);
11102 // No implementation - assignment is unsupported.
11103 void operator=(const ValueArray17& other);
11124 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11125 typename T6, typename T7, typename T8, typename T9, typename T10,
11126 typename T11, typename T12, typename T13, typename T14, typename T15,
11127 typename T16, typename T17, typename T18>
11128 class ValueArray18 {
11130 ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11131 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11132 T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11133 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11134 v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
11136 template <typename T>
11137 operator ParamGenerator<T>() const {
11138 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11139 v12_, v13_, v14_, v15_, v16_, v17_, v18_};
11140 return ValuesIn(array);
11144 // No implementation - assignment is unsupported.
11145 void operator=(const ValueArray18& other);
11167 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11168 typename T6, typename T7, typename T8, typename T9, typename T10,
11169 typename T11, typename T12, typename T13, typename T14, typename T15,
11170 typename T16, typename T17, typename T18, typename T19>
11171 class ValueArray19 {
11173 ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11174 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11175 T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11176 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11177 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
11179 template <typename T>
11180 operator ParamGenerator<T>() const {
11181 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11182 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_};
11183 return ValuesIn(array);
11187 // No implementation - assignment is unsupported.
11188 void operator=(const ValueArray19& other);
11211 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11212 typename T6, typename T7, typename T8, typename T9, typename T10,
11213 typename T11, typename T12, typename T13, typename T14, typename T15,
11214 typename T16, typename T17, typename T18, typename T19, typename T20>
11215 class ValueArray20 {
11217 ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11218 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11219 T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11220 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11221 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11222 v19_(v19), v20_(v20) {}
11224 template <typename T>
11225 operator ParamGenerator<T>() const {
11226 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11227 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_};
11228 return ValuesIn(array);
11232 // No implementation - assignment is unsupported.
11233 void operator=(const ValueArray20& other);
11257 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11258 typename T6, typename T7, typename T8, typename T9, typename T10,
11259 typename T11, typename T12, typename T13, typename T14, typename T15,
11260 typename T16, typename T17, typename T18, typename T19, typename T20,
11262 class ValueArray21 {
11264 ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11265 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11266 T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11267 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11268 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11269 v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
11271 template <typename T>
11272 operator ParamGenerator<T>() const {
11273 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11274 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_};
11275 return ValuesIn(array);
11279 // No implementation - assignment is unsupported.
11280 void operator=(const ValueArray21& other);
11305 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11306 typename T6, typename T7, typename T8, typename T9, typename T10,
11307 typename T11, typename T12, typename T13, typename T14, typename T15,
11308 typename T16, typename T17, typename T18, typename T19, typename T20,
11309 typename T21, typename T22>
11310 class ValueArray22 {
11312 ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11313 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11314 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
11315 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11316 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11317 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
11319 template <typename T>
11320 operator ParamGenerator<T>() const {
11321 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11322 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_};
11323 return ValuesIn(array);
11327 // No implementation - assignment is unsupported.
11328 void operator=(const ValueArray22& other);
11354 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11355 typename T6, typename T7, typename T8, typename T9, typename T10,
11356 typename T11, typename T12, typename T13, typename T14, typename T15,
11357 typename T16, typename T17, typename T18, typename T19, typename T20,
11358 typename T21, typename T22, typename T23>
11359 class ValueArray23 {
11361 ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11362 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11363 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
11364 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11365 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11366 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11369 template <typename T>
11370 operator ParamGenerator<T>() const {
11371 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11372 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_,
11374 return ValuesIn(array);
11378 // No implementation - assignment is unsupported.
11379 void operator=(const ValueArray23& other);
11406 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11407 typename T6, typename T7, typename T8, typename T9, typename T10,
11408 typename T11, typename T12, typename T13, typename T14, typename T15,
11409 typename T16, typename T17, typename T18, typename T19, typename T20,
11410 typename T21, typename T22, typename T23, typename T24>
11411 class ValueArray24 {
11413 ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11414 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11415 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
11416 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11417 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11418 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
11419 v22_(v22), v23_(v23), v24_(v24) {}
11421 template <typename T>
11422 operator ParamGenerator<T>() const {
11423 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11424 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11426 return ValuesIn(array);
11430 // No implementation - assignment is unsupported.
11431 void operator=(const ValueArray24& other);
11459 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11460 typename T6, typename T7, typename T8, typename T9, typename T10,
11461 typename T11, typename T12, typename T13, typename T14, typename T15,
11462 typename T16, typename T17, typename T18, typename T19, typename T20,
11463 typename T21, typename T22, typename T23, typename T24, typename T25>
11464 class ValueArray25 {
11466 ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11467 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11468 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
11469 T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11470 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11471 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11472 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
11474 template <typename T>
11475 operator ParamGenerator<T>() const {
11476 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11477 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11479 return ValuesIn(array);
11483 // No implementation - assignment is unsupported.
11484 void operator=(const ValueArray25& other);
11513 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11514 typename T6, typename T7, typename T8, typename T9, typename T10,
11515 typename T11, typename T12, typename T13, typename T14, typename T15,
11516 typename T16, typename T17, typename T18, typename T19, typename T20,
11517 typename T21, typename T22, typename T23, typename T24, typename T25,
11519 class ValueArray26 {
11521 ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11522 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11523 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11524 T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11525 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11526 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11527 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
11529 template <typename T>
11530 operator ParamGenerator<T>() const {
11531 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11532 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11534 return ValuesIn(array);
11538 // No implementation - assignment is unsupported.
11539 void operator=(const ValueArray26& other);
11569 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11570 typename T6, typename T7, typename T8, typename T9, typename T10,
11571 typename T11, typename T12, typename T13, typename T14, typename T15,
11572 typename T16, typename T17, typename T18, typename T19, typename T20,
11573 typename T21, typename T22, typename T23, typename T24, typename T25,
11574 typename T26, typename T27>
11575 class ValueArray27 {
11577 ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11578 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11579 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11580 T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11581 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11582 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
11583 v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
11584 v26_(v26), v27_(v27) {}
11586 template <typename T>
11587 operator ParamGenerator<T>() const {
11588 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11589 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11590 v24_, v25_, v26_, v27_};
11591 return ValuesIn(array);
11595 // No implementation - assignment is unsupported.
11596 void operator=(const ValueArray27& other);
11627 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11628 typename T6, typename T7, typename T8, typename T9, typename T10,
11629 typename T11, typename T12, typename T13, typename T14, typename T15,
11630 typename T16, typename T17, typename T18, typename T19, typename T20,
11631 typename T21, typename T22, typename T23, typename T24, typename T25,
11632 typename T26, typename T27, typename T28>
11633 class ValueArray28 {
11635 ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11636 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11637 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11638 T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11639 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11640 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11641 v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
11642 v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
11644 template <typename T>
11645 operator ParamGenerator<T>() const {
11646 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11647 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11648 v24_, v25_, v26_, v27_, v28_};
11649 return ValuesIn(array);
11653 // No implementation - assignment is unsupported.
11654 void operator=(const ValueArray28& other);
11686 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11687 typename T6, typename T7, typename T8, typename T9, typename T10,
11688 typename T11, typename T12, typename T13, typename T14, typename T15,
11689 typename T16, typename T17, typename T18, typename T19, typename T20,
11690 typename T21, typename T22, typename T23, typename T24, typename T25,
11691 typename T26, typename T27, typename T28, typename T29>
11692 class ValueArray29 {
11694 ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11695 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11696 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11697 T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11698 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11699 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11700 v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
11701 v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
11703 template <typename T>
11704 operator ParamGenerator<T>() const {
11705 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11706 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11707 v24_, v25_, v26_, v27_, v28_, v29_};
11708 return ValuesIn(array);
11712 // No implementation - assignment is unsupported.
11713 void operator=(const ValueArray29& other);
11746 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11747 typename T6, typename T7, typename T8, typename T9, typename T10,
11748 typename T11, typename T12, typename T13, typename T14, typename T15,
11749 typename T16, typename T17, typename T18, typename T19, typename T20,
11750 typename T21, typename T22, typename T23, typename T24, typename T25,
11751 typename T26, typename T27, typename T28, typename T29, typename T30>
11752 class ValueArray30 {
11754 ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11755 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11756 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11757 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
11758 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11759 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11760 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11761 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
11762 v29_(v29), v30_(v30) {}
11764 template <typename T>
11765 operator ParamGenerator<T>() const {
11766 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11767 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11768 v24_, v25_, v26_, v27_, v28_, v29_, v30_};
11769 return ValuesIn(array);
11773 // No implementation - assignment is unsupported.
11774 void operator=(const ValueArray30& other);
11808 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11809 typename T6, typename T7, typename T8, typename T9, typename T10,
11810 typename T11, typename T12, typename T13, typename T14, typename T15,
11811 typename T16, typename T17, typename T18, typename T19, typename T20,
11812 typename T21, typename T22, typename T23, typename T24, typename T25,
11813 typename T26, typename T27, typename T28, typename T29, typename T30,
11815 class ValueArray31 {
11817 ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11818 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11819 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11820 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
11821 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11822 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11823 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11824 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
11825 v29_(v29), v30_(v30), v31_(v31) {}
11827 template <typename T>
11828 operator ParamGenerator<T>() const {
11829 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11830 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11831 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_};
11832 return ValuesIn(array);
11836 // No implementation - assignment is unsupported.
11837 void operator=(const ValueArray31& other);
11872 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11873 typename T6, typename T7, typename T8, typename T9, typename T10,
11874 typename T11, typename T12, typename T13, typename T14, typename T15,
11875 typename T16, typename T17, typename T18, typename T19, typename T20,
11876 typename T21, typename T22, typename T23, typename T24, typename T25,
11877 typename T26, typename T27, typename T28, typename T29, typename T30,
11878 typename T31, typename T32>
11879 class ValueArray32 {
11881 ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11882 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11883 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11884 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
11885 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11886 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11887 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
11888 v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
11889 v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
11891 template <typename T>
11892 operator ParamGenerator<T>() const {
11893 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11894 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11895 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_};
11896 return ValuesIn(array);
11900 // No implementation - assignment is unsupported.
11901 void operator=(const ValueArray32& other);
11937 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11938 typename T6, typename T7, typename T8, typename T9, typename T10,
11939 typename T11, typename T12, typename T13, typename T14, typename T15,
11940 typename T16, typename T17, typename T18, typename T19, typename T20,
11941 typename T21, typename T22, typename T23, typename T24, typename T25,
11942 typename T26, typename T27, typename T28, typename T29, typename T30,
11943 typename T31, typename T32, typename T33>
11944 class ValueArray33 {
11946 ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11947 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11948 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11949 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
11950 T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11951 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11952 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11953 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
11954 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
11957 template <typename T>
11958 operator ParamGenerator<T>() const {
11959 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11960 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11961 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_};
11962 return ValuesIn(array);
11966 // No implementation - assignment is unsupported.
11967 void operator=(const ValueArray33& other);
12004 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12005 typename T6, typename T7, typename T8, typename T9, typename T10,
12006 typename T11, typename T12, typename T13, typename T14, typename T15,
12007 typename T16, typename T17, typename T18, typename T19, typename T20,
12008 typename T21, typename T22, typename T23, typename T24, typename T25,
12009 typename T26, typename T27, typename T28, typename T29, typename T30,
12010 typename T31, typename T32, typename T33, typename T34>
12011 class ValueArray34 {
12013 ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12014 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12015 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12016 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12017 T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12018 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12019 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12020 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12021 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12022 v33_(v33), v34_(v34) {}
12024 template <typename T>
12025 operator ParamGenerator<T>() const {
12026 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
12027 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
12028 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_};
12029 return ValuesIn(array);
12033 // No implementation - assignment is unsupported.
12034 void operator=(const ValueArray34& other);
12072 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12073 typename T6, typename T7, typename T8, typename T9, typename T10,
12074 typename T11, typename T12, typename T13, typename T14, typename T15,
12075 typename T16, typename T17, typename T18, typename T19, typename T20,
12076 typename T21, typename T22, typename T23, typename T24, typename T25,
12077 typename T26, typename T27, typename T28, typename T29, typename T30,
12078 typename T31, typename T32, typename T33, typename T34, typename T35>
12079 class ValueArray35 {
12081 ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12082 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12083 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12084 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12085 T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12086 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12087 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
12088 v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
12089 v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
12090 v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
12092 template <typename T>
12093 operator ParamGenerator<T>() const {
12094 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
12095 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
12096 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_,
12098 return ValuesIn(array);
12102 // No implementation - assignment is unsupported.
12103 void operator=(const ValueArray35& other);
12142 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12143 typename T6, typename T7, typename T8, typename T9, typename T10,
12144 typename T11, typename T12, typename T13, typename T14, typename T15,
12145 typename T16, typename T17, typename T18, typename T19, typename T20,
12146 typename T21, typename T22, typename T23, typename T24, typename T25,
12147 typename T26, typename T27, typename T28, typename T29, typename T30,
12148 typename T31, typename T32, typename T33, typename T34, typename T35,
12150 class ValueArray36 {
12152 ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12153 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12154 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12155 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12156 T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
12157 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
12158 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
12159 v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
12160 v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
12161 v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
12163 template <typename T>
12164 operator ParamGenerator<T>() const {
12165 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
12166 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
12167 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
12169 return ValuesIn(array);
12173 // No implementation - assignment is unsupported.
12174 void operator=(const ValueArray36& other);
12214 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12215 typename T6, typename T7, typename T8, typename T9, typename T10,
12216 typename T11, typename T12, typename T13, typename T14, typename T15,
12217 typename T16, typename T17, typename T18, typename T19, typename T20,
12218 typename T21, typename T22, typename T23, typename T24, typename T25,
12219 typename T26, typename T27, typename T28, typename T29, typename T30,
12220 typename T31, typename T32, typename T33, typename T34, typename T35,
12221 typename T36, typename T37>
12222 class ValueArray37 {
12224 ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12225 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12226 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12227 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12228 T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
12229 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
12230 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
12231 v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
12232 v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
12233 v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
12234 v36_(v36), v37_(v37) {}
12236 template <typename T>
12237 operator ParamGenerator<T>() const {
12238 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
12239 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
12240 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
12242 return ValuesIn(array);
12246 // No implementation - assignment is unsupported.
12247 void operator=(const ValueArray37& other);
12288 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12289 typename T6, typename T7, typename T8, typename T9, typename T10,
12290 typename T11, typename T12, typename T13, typename T14, typename T15,
12291 typename T16, typename T17, typename T18, typename T19, typename T20,
12292 typename T21, typename T22, typename T23, typename T24, typename T25,
12293 typename T26, typename T27, typename T28, typename T29, typename T30,
12294 typename T31, typename T32, typename T33, typename T34, typename T35,
12295 typename T36, typename T37, typename T38>
12296 class ValueArray38 {
12298 ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12299 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12300 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12301 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12302 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
12303 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12304 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12305 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12306 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12307 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12308 v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
12310 template <typename T>
12311 operator ParamGenerator<T>() const {
12312 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
12313 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
12314 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
12316 return ValuesIn(array);
12320 // No implementation - assignment is unsupported.
12321 void operator=(const ValueArray38& other);
12363 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12364 typename T6, typename T7, typename T8, typename T9, typename T10,
12365 typename T11, typename T12, typename T13, typename T14, typename T15,
12366 typename T16, typename T17, typename T18, typename T19, typename T20,
12367 typename T21, typename T22, typename T23, typename T24, typename T25,
12368 typename T26, typename T27, typename T28, typename T29, typename T30,
12369 typename T31, typename T32, typename T33, typename T34, typename T35,
12370 typename T36, typename T37, typename T38, typename T39>
12371 class ValueArray39 {
12373 ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12374 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12375 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12376 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12377 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
12378 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12379 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12380 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12381 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12382 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12383 v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
12385 template <typename T>
12386 operator ParamGenerator<T>() const {
12387 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
12388 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
12389 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
12390 v36_, v37_, v38_, v39_};
12391 return ValuesIn(array);
12395 // No implementation - assignment is unsupported.
12396 void operator=(const ValueArray39& other);
12439 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12440 typename T6, typename T7, typename T8, typename T9, typename T10,
12441 typename T11, typename T12, typename T13, typename T14, typename T15,
12442 typename T16, typename T17, typename T18, typename T19, typename T20,
12443 typename T21, typename T22, typename T23, typename T24, typename T25,
12444 typename T26, typename T27, typename T28, typename T29, typename T30,
12445 typename T31, typename T32, typename T33, typename T34, typename T35,
12446 typename T36, typename T37, typename T38, typename T39, typename T40>
12447 class ValueArray40 {
12449 ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12450 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12451 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12452 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12453 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
12454 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12455 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12456 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
12457 v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
12458 v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
12459 v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
12462 template <typename T>
12463 operator ParamGenerator<T>() const {
12464 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
12465 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
12466 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
12467 v36_, v37_, v38_, v39_, v40_};
12468 return ValuesIn(array);
12472 // No implementation - assignment is unsupported.
12473 void operator=(const ValueArray40& other);
12517 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12518 typename T6, typename T7, typename T8, typename T9, typename T10,
12519 typename T11, typename T12, typename T13, typename T14, typename T15,
12520 typename T16, typename T17, typename T18, typename T19, typename T20,
12521 typename T21, typename T22, typename T23, typename T24, typename T25,
12522 typename T26, typename T27, typename T28, typename T29, typename T30,
12523 typename T31, typename T32, typename T33, typename T34, typename T35,
12524 typename T36, typename T37, typename T38, typename T39, typename T40,
12526 class ValueArray41 {
12528 ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12529 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12530 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12531 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12532 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
12533 T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12534 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12535 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12536 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12537 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12538 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
12539 v39_(v39), v40_(v40), v41_(v41) {}
12541 template <typename T>
12542 operator ParamGenerator<T>() const {
12543 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
12544 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
12545 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
12546 v36_, v37_, v38_, v39_, v40_, v41_};
12547 return ValuesIn(array);
12551 // No implementation - assignment is unsupported.
12552 void operator=(const ValueArray41& other);
12597 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12598 typename T6, typename T7, typename T8, typename T9, typename T10,
12599 typename T11, typename T12, typename T13, typename T14, typename T15,
12600 typename T16, typename T17, typename T18, typename T19, typename T20,
12601 typename T21, typename T22, typename T23, typename T24, typename T25,
12602 typename T26, typename T27, typename T28, typename T29, typename T30,
12603 typename T31, typename T32, typename T33, typename T34, typename T35,
12604 typename T36, typename T37, typename T38, typename T39, typename T40,
12605 typename T41, typename T42>
12606 class ValueArray42 {
12608 ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12609 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12610 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12611 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12612 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
12613 T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12614 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12615 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12616 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12617 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12618 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
12619 v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
12621 template <typename T>
12622 operator ParamGenerator<T>() const {
12623 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
12624 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
12625 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
12626 v36_, v37_, v38_, v39_, v40_, v41_, v42_};
12627 return ValuesIn(array);
12631 // No implementation - assignment is unsupported.
12632 void operator=(const ValueArray42& other);
12678 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12679 typename T6, typename T7, typename T8, typename T9, typename T10,
12680 typename T11, typename T12, typename T13, typename T14, typename T15,
12681 typename T16, typename T17, typename T18, typename T19, typename T20,
12682 typename T21, typename T22, typename T23, typename T24, typename T25,
12683 typename T26, typename T27, typename T28, typename T29, typename T30,
12684 typename T31, typename T32, typename T33, typename T34, typename T35,
12685 typename T36, typename T37, typename T38, typename T39, typename T40,
12686 typename T41, typename T42, typename T43>
12687 class ValueArray43 {
12689 ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12690 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12691 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12692 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12693 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
12694 T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12695 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12696 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
12697 v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
12698 v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
12699 v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
12700 v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
12702 template <typename T>
12703 operator ParamGenerator<T>() const {
12704 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
12705 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
12706 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
12707 v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_};
12708 return ValuesIn(array);
12712 // No implementation - assignment is unsupported.
12713 void operator=(const ValueArray43& other);
12760 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12761 typename T6, typename T7, typename T8, typename T9, typename T10,
12762 typename T11, typename T12, typename T13, typename T14, typename T15,
12763 typename T16, typename T17, typename T18, typename T19, typename T20,
12764 typename T21, typename T22, typename T23, typename T24, typename T25,
12765 typename T26, typename T27, typename T28, typename T29, typename T30,
12766 typename T31, typename T32, typename T33, typename T34, typename T35,
12767 typename T36, typename T37, typename T38, typename T39, typename T40,
12768 typename T41, typename T42, typename T43, typename T44>
12769 class ValueArray44 {
12771 ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12772 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12773 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12774 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12775 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
12776 T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
12777 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
12778 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
12779 v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
12780 v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
12781 v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
12782 v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
12783 v43_(v43), v44_(v44) {}
12785 template <typename T>
12786 operator ParamGenerator<T>() const {
12787 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
12788 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
12789 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
12790 v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_};
12791 return ValuesIn(array);
12795 // No implementation - assignment is unsupported.
12796 void operator=(const ValueArray44& other);
12844 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12845 typename T6, typename T7, typename T8, typename T9, typename T10,
12846 typename T11, typename T12, typename T13, typename T14, typename T15,
12847 typename T16, typename T17, typename T18, typename T19, typename T20,
12848 typename T21, typename T22, typename T23, typename T24, typename T25,
12849 typename T26, typename T27, typename T28, typename T29, typename T30,
12850 typename T31, typename T32, typename T33, typename T34, typename T35,
12851 typename T36, typename T37, typename T38, typename T39, typename T40,
12852 typename T41, typename T42, typename T43, typename T44, typename T45>
12853 class ValueArray45 {
12855 ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12856 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12857 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12858 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12859 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
12860 T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
12861 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
12862 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
12863 v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
12864 v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
12865 v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
12866 v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
12867 v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
12869 template <typename T>
12870 operator ParamGenerator<T>() const {
12871 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
12872 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
12873 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
12874 v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_};
12875 return ValuesIn(array);
12879 // No implementation - assignment is unsupported.
12880 void operator=(const ValueArray45& 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, typename T43, typename T44, typename T45,
12939 class ValueArray46 {
12941 ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12942 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12943 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12944 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12945 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
12946 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
12947 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12948 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12949 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12950 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12951 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12952 v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
12953 v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
12955 template <typename T>
12956 operator ParamGenerator<T>() const {
12957 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
12958 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
12959 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
12960 v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_};
12961 return ValuesIn(array);
12965 // No implementation - assignment is unsupported.
12966 void operator=(const ValueArray46& other);
13016 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13017 typename T6, typename T7, typename T8, typename T9, typename T10,
13018 typename T11, typename T12, typename T13, typename T14, typename T15,
13019 typename T16, typename T17, typename T18, typename T19, typename T20,
13020 typename T21, typename T22, typename T23, typename T24, typename T25,
13021 typename T26, typename T27, typename T28, typename T29, typename T30,
13022 typename T31, typename T32, typename T33, typename T34, typename T35,
13023 typename T36, typename T37, typename T38, typename T39, typename T40,
13024 typename T41, typename T42, typename T43, typename T44, typename T45,
13025 typename T46, typename T47>
13026 class ValueArray47 {
13028 ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13029 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13030 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13031 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13032 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13033 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
13034 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13035 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13036 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13037 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13038 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13039 v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
13040 v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
13043 template <typename T>
13044 operator ParamGenerator<T>() const {
13045 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
13046 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
13047 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
13048 v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_,
13050 return ValuesIn(array);
13054 // No implementation - assignment is unsupported.
13055 void operator=(const ValueArray47& other);
13106 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13107 typename T6, typename T7, typename T8, typename T9, typename T10,
13108 typename T11, typename T12, typename T13, typename T14, typename T15,
13109 typename T16, typename T17, typename T18, typename T19, typename T20,
13110 typename T21, typename T22, typename T23, typename T24, typename T25,
13111 typename T26, typename T27, typename T28, typename T29, typename T30,
13112 typename T31, typename T32, typename T33, typename T34, typename T35,
13113 typename T36, typename T37, typename T38, typename T39, typename T40,
13114 typename T41, typename T42, typename T43, typename T44, typename T45,
13115 typename T46, typename T47, typename T48>
13116 class ValueArray48 {
13118 ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13119 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13120 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13121 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13122 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13123 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
13124 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
13125 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
13126 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
13127 v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
13128 v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
13129 v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
13130 v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
13131 v46_(v46), v47_(v47), v48_(v48) {}
13133 template <typename T>
13134 operator ParamGenerator<T>() const {
13135 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
13136 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
13137 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
13138 v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
13140 return ValuesIn(array);
13144 // No implementation - assignment is unsupported.
13145 void operator=(const ValueArray48& other);
13197 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13198 typename T6, typename T7, typename T8, typename T9, typename T10,
13199 typename T11, typename T12, typename T13, typename T14, typename T15,
13200 typename T16, typename T17, typename T18, typename T19, typename T20,
13201 typename T21, typename T22, typename T23, typename T24, typename T25,
13202 typename T26, typename T27, typename T28, typename T29, typename T30,
13203 typename T31, typename T32, typename T33, typename T34, typename T35,
13204 typename T36, typename T37, typename T38, typename T39, typename T40,
13205 typename T41, typename T42, typename T43, typename T44, typename T45,
13206 typename T46, typename T47, typename T48, typename T49>
13207 class ValueArray49 {
13209 ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13210 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13211 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13212 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13213 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13214 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
13215 T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13216 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13217 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13218 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13219 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13220 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13221 v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
13222 v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
13224 template <typename T>
13225 operator ParamGenerator<T>() const {
13226 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
13227 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
13228 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
13229 v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
13231 return ValuesIn(array);
13235 // No implementation - assignment is unsupported.
13236 void operator=(const ValueArray49& other);
13289 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13290 typename T6, typename T7, typename T8, typename T9, typename T10,
13291 typename T11, typename T12, typename T13, typename T14, typename T15,
13292 typename T16, typename T17, typename T18, typename T19, typename T20,
13293 typename T21, typename T22, typename T23, typename T24, typename T25,
13294 typename T26, typename T27, typename T28, typename T29, typename T30,
13295 typename T31, typename T32, typename T33, typename T34, typename T35,
13296 typename T36, typename T37, typename T38, typename T39, typename T40,
13297 typename T41, typename T42, typename T43, typename T44, typename T45,
13298 typename T46, typename T47, typename T48, typename T49, typename T50>
13299 class ValueArray50 {
13301 ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13302 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13303 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13304 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13305 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13306 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
13307 T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13308 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13309 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13310 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13311 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13312 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13313 v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
13314 v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
13316 template <typename T>
13317 operator ParamGenerator<T>() const {
13318 const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
13319 v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
13320 v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
13321 v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
13323 return ValuesIn(array);
13327 // No implementation - assignment is unsupported.
13328 void operator=(const ValueArray50& other);
13382 # if GTEST_HAS_COMBINE
13383 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
13385 // Generates values from the Cartesian product of values produced
13386 // by the argument generators.
13388 template <typename T1, typename T2>
13389 class CartesianProductGenerator2
13390 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
13392 typedef ::std::tr1::tuple<T1, T2> ParamType;
13394 CartesianProductGenerator2(const ParamGenerator<T1>& g1,
13395 const ParamGenerator<T2>& g2)
13396 : g1_(g1), g2_(g2) {}
13397 virtual ~CartesianProductGenerator2() {}
13399 virtual ParamIteratorInterface<ParamType>* Begin() const {
13400 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
13402 virtual ParamIteratorInterface<ParamType>* End() const {
13403 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
13407 class Iterator : public ParamIteratorInterface<ParamType> {
13409 Iterator(const ParamGeneratorInterface<ParamType>* base,
13410 const ParamGenerator<T1>& g1,
13411 const typename ParamGenerator<T1>::iterator& current1,
13412 const ParamGenerator<T2>& g2,
13413 const typename ParamGenerator<T2>::iterator& current2)
13415 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13416 begin2_(g2.begin()), end2_(g2.end()), current2_(current2) {
13417 ComputeCurrentValue();
13419 virtual ~Iterator() {}
13421 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13424 // Advance should not be called on beyond-of-range iterators
13425 // so no component iterators must be beyond end of range, either.
13426 virtual void Advance() {
13429 if (current2_ == end2_) {
13430 current2_ = begin2_;
13433 ComputeCurrentValue();
13435 virtual ParamIteratorInterface<ParamType>* Clone() const {
13436 return new Iterator(*this);
13438 virtual const ParamType* Current() const { return ¤t_value_; }
13439 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13440 // Having the same base generator guarantees that the other
13441 // iterator is of the same type and we can downcast.
13442 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13443 << "The program attempted to compare iterators "
13444 << "from different generators." << std::endl;
13445 const Iterator* typed_other =
13446 CheckedDowncastToActualType<const Iterator>(&other);
13447 // We must report iterators equal if they both point beyond their
13448 // respective ranges. That can happen in a variety of fashions,
13449 // so we have to consult AtEnd().
13450 return (AtEnd() && typed_other->AtEnd()) ||
13452 current1_ == typed_other->current1_ &&
13453 current2_ == typed_other->current2_);
13457 Iterator(const Iterator& other)
13458 : base_(other.base_),
13459 begin1_(other.begin1_),
13460 end1_(other.end1_),
13461 current1_(other.current1_),
13462 begin2_(other.begin2_),
13463 end2_(other.end2_),
13464 current2_(other.current2_) {
13465 ComputeCurrentValue();
13468 void ComputeCurrentValue() {
13470 current_value_ = ParamType(*current1_, *current2_);
13472 bool AtEnd() const {
13473 // We must report iterator past the end of the range when either of the
13474 // component iterators has reached the end of its range.
13476 current1_ == end1_ ||
13477 current2_ == end2_;
13480 // No implementation - assignment is unsupported.
13481 void operator=(const Iterator& other);
13483 const ParamGeneratorInterface<ParamType>* const base_;
13484 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
13485 // current[i]_ is the actual traversing iterator.
13486 const typename ParamGenerator<T1>::iterator begin1_;
13487 const typename ParamGenerator<T1>::iterator end1_;
13488 typename ParamGenerator<T1>::iterator current1_;
13489 const typename ParamGenerator<T2>::iterator begin2_;
13490 const typename ParamGenerator<T2>::iterator end2_;
13491 typename ParamGenerator<T2>::iterator current2_;
13492 ParamType current_value_;
13493 }; // class CartesianProductGenerator2::Iterator
13495 // No implementation - assignment is unsupported.
13496 void operator=(const CartesianProductGenerator2& other);
13498 const ParamGenerator<T1> g1_;
13499 const ParamGenerator<T2> g2_;
13500 }; // class CartesianProductGenerator2
13503 template <typename T1, typename T2, typename T3>
13504 class CartesianProductGenerator3
13505 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
13507 typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
13509 CartesianProductGenerator3(const ParamGenerator<T1>& g1,
13510 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
13511 : g1_(g1), g2_(g2), g3_(g3) {}
13512 virtual ~CartesianProductGenerator3() {}
13514 virtual ParamIteratorInterface<ParamType>* Begin() const {
13515 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
13518 virtual ParamIteratorInterface<ParamType>* End() const {
13519 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
13523 class Iterator : public ParamIteratorInterface<ParamType> {
13525 Iterator(const ParamGeneratorInterface<ParamType>* base,
13526 const ParamGenerator<T1>& g1,
13527 const typename ParamGenerator<T1>::iterator& current1,
13528 const ParamGenerator<T2>& g2,
13529 const typename ParamGenerator<T2>::iterator& current2,
13530 const ParamGenerator<T3>& g3,
13531 const typename ParamGenerator<T3>::iterator& current3)
13533 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13534 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
13535 begin3_(g3.begin()), end3_(g3.end()), current3_(current3) {
13536 ComputeCurrentValue();
13538 virtual ~Iterator() {}
13540 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13543 // Advance should not be called on beyond-of-range iterators
13544 // so no component iterators must be beyond end of range, either.
13545 virtual void Advance() {
13548 if (current3_ == end3_) {
13549 current3_ = begin3_;
13552 if (current2_ == end2_) {
13553 current2_ = begin2_;
13556 ComputeCurrentValue();
13558 virtual ParamIteratorInterface<ParamType>* Clone() const {
13559 return new Iterator(*this);
13561 virtual const ParamType* Current() const { return ¤t_value_; }
13562 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13563 // Having the same base generator guarantees that the other
13564 // iterator is of the same type and we can downcast.
13565 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13566 << "The program attempted to compare iterators "
13567 << "from different generators." << std::endl;
13568 const Iterator* typed_other =
13569 CheckedDowncastToActualType<const Iterator>(&other);
13570 // We must report iterators equal if they both point beyond their
13571 // respective ranges. That can happen in a variety of fashions,
13572 // so we have to consult AtEnd().
13573 return (AtEnd() && typed_other->AtEnd()) ||
13575 current1_ == typed_other->current1_ &&
13576 current2_ == typed_other->current2_ &&
13577 current3_ == typed_other->current3_);
13581 Iterator(const Iterator& other)
13582 : base_(other.base_),
13583 begin1_(other.begin1_),
13584 end1_(other.end1_),
13585 current1_(other.current1_),
13586 begin2_(other.begin2_),
13587 end2_(other.end2_),
13588 current2_(other.current2_),
13589 begin3_(other.begin3_),
13590 end3_(other.end3_),
13591 current3_(other.current3_) {
13592 ComputeCurrentValue();
13595 void ComputeCurrentValue() {
13597 current_value_ = ParamType(*current1_, *current2_, *current3_);
13599 bool AtEnd() const {
13600 // We must report iterator past the end of the range when either of the
13601 // component iterators has reached the end of its range.
13603 current1_ == end1_ ||
13604 current2_ == end2_ ||
13605 current3_ == end3_;
13608 // No implementation - assignment is unsupported.
13609 void operator=(const Iterator& other);
13611 const ParamGeneratorInterface<ParamType>* const base_;
13612 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
13613 // current[i]_ is the actual traversing iterator.
13614 const typename ParamGenerator<T1>::iterator begin1_;
13615 const typename ParamGenerator<T1>::iterator end1_;
13616 typename ParamGenerator<T1>::iterator current1_;
13617 const typename ParamGenerator<T2>::iterator begin2_;
13618 const typename ParamGenerator<T2>::iterator end2_;
13619 typename ParamGenerator<T2>::iterator current2_;
13620 const typename ParamGenerator<T3>::iterator begin3_;
13621 const typename ParamGenerator<T3>::iterator end3_;
13622 typename ParamGenerator<T3>::iterator current3_;
13623 ParamType current_value_;
13624 }; // class CartesianProductGenerator3::Iterator
13626 // No implementation - assignment is unsupported.
13627 void operator=(const CartesianProductGenerator3& other);
13629 const ParamGenerator<T1> g1_;
13630 const ParamGenerator<T2> g2_;
13631 const ParamGenerator<T3> g3_;
13632 }; // class CartesianProductGenerator3
13635 template <typename T1, typename T2, typename T3, typename T4>
13636 class CartesianProductGenerator4
13637 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
13639 typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
13641 CartesianProductGenerator4(const ParamGenerator<T1>& g1,
13642 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
13643 const ParamGenerator<T4>& g4)
13644 : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
13645 virtual ~CartesianProductGenerator4() {}
13647 virtual ParamIteratorInterface<ParamType>* Begin() const {
13648 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
13649 g3_.begin(), g4_, g4_.begin());
13651 virtual ParamIteratorInterface<ParamType>* End() const {
13652 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
13657 class Iterator : public ParamIteratorInterface<ParamType> {
13659 Iterator(const ParamGeneratorInterface<ParamType>* base,
13660 const ParamGenerator<T1>& g1,
13661 const typename ParamGenerator<T1>::iterator& current1,
13662 const ParamGenerator<T2>& g2,
13663 const typename ParamGenerator<T2>::iterator& current2,
13664 const ParamGenerator<T3>& g3,
13665 const typename ParamGenerator<T3>::iterator& current3,
13666 const ParamGenerator<T4>& g4,
13667 const typename ParamGenerator<T4>::iterator& current4)
13669 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13670 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
13671 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
13672 begin4_(g4.begin()), end4_(g4.end()), current4_(current4) {
13673 ComputeCurrentValue();
13675 virtual ~Iterator() {}
13677 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13680 // Advance should not be called on beyond-of-range iterators
13681 // so no component iterators must be beyond end of range, either.
13682 virtual void Advance() {
13685 if (current4_ == end4_) {
13686 current4_ = begin4_;
13689 if (current3_ == end3_) {
13690 current3_ = begin3_;
13693 if (current2_ == end2_) {
13694 current2_ = begin2_;
13697 ComputeCurrentValue();
13699 virtual ParamIteratorInterface<ParamType>* Clone() const {
13700 return new Iterator(*this);
13702 virtual const ParamType* Current() const { return ¤t_value_; }
13703 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13704 // Having the same base generator guarantees that the other
13705 // iterator is of the same type and we can downcast.
13706 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13707 << "The program attempted to compare iterators "
13708 << "from different generators." << std::endl;
13709 const Iterator* typed_other =
13710 CheckedDowncastToActualType<const Iterator>(&other);
13711 // We must report iterators equal if they both point beyond their
13712 // respective ranges. That can happen in a variety of fashions,
13713 // so we have to consult AtEnd().
13714 return (AtEnd() && typed_other->AtEnd()) ||
13716 current1_ == typed_other->current1_ &&
13717 current2_ == typed_other->current2_ &&
13718 current3_ == typed_other->current3_ &&
13719 current4_ == typed_other->current4_);
13723 Iterator(const Iterator& other)
13724 : base_(other.base_),
13725 begin1_(other.begin1_),
13726 end1_(other.end1_),
13727 current1_(other.current1_),
13728 begin2_(other.begin2_),
13729 end2_(other.end2_),
13730 current2_(other.current2_),
13731 begin3_(other.begin3_),
13732 end3_(other.end3_),
13733 current3_(other.current3_),
13734 begin4_(other.begin4_),
13735 end4_(other.end4_),
13736 current4_(other.current4_) {
13737 ComputeCurrentValue();
13740 void ComputeCurrentValue() {
13742 current_value_ = ParamType(*current1_, *current2_, *current3_,
13745 bool AtEnd() const {
13746 // We must report iterator past the end of the range when either of the
13747 // component iterators has reached the end of its range.
13749 current1_ == end1_ ||
13750 current2_ == end2_ ||
13751 current3_ == end3_ ||
13752 current4_ == end4_;
13755 // No implementation - assignment is unsupported.
13756 void operator=(const Iterator& other);
13758 const ParamGeneratorInterface<ParamType>* const base_;
13759 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
13760 // current[i]_ is the actual traversing iterator.
13761 const typename ParamGenerator<T1>::iterator begin1_;
13762 const typename ParamGenerator<T1>::iterator end1_;
13763 typename ParamGenerator<T1>::iterator current1_;
13764 const typename ParamGenerator<T2>::iterator begin2_;
13765 const typename ParamGenerator<T2>::iterator end2_;
13766 typename ParamGenerator<T2>::iterator current2_;
13767 const typename ParamGenerator<T3>::iterator begin3_;
13768 const typename ParamGenerator<T3>::iterator end3_;
13769 typename ParamGenerator<T3>::iterator current3_;
13770 const typename ParamGenerator<T4>::iterator begin4_;
13771 const typename ParamGenerator<T4>::iterator end4_;
13772 typename ParamGenerator<T4>::iterator current4_;
13773 ParamType current_value_;
13774 }; // class CartesianProductGenerator4::Iterator
13776 // No implementation - assignment is unsupported.
13777 void operator=(const CartesianProductGenerator4& other);
13779 const ParamGenerator<T1> g1_;
13780 const ParamGenerator<T2> g2_;
13781 const ParamGenerator<T3> g3_;
13782 const ParamGenerator<T4> g4_;
13783 }; // class CartesianProductGenerator4
13786 template <typename T1, typename T2, typename T3, typename T4, typename T5>
13787 class CartesianProductGenerator5
13788 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
13790 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
13792 CartesianProductGenerator5(const ParamGenerator<T1>& g1,
13793 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
13794 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
13795 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
13796 virtual ~CartesianProductGenerator5() {}
13798 virtual ParamIteratorInterface<ParamType>* Begin() const {
13799 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
13800 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
13802 virtual ParamIteratorInterface<ParamType>* End() const {
13803 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
13804 g4_, g4_.end(), g5_, g5_.end());
13808 class Iterator : public ParamIteratorInterface<ParamType> {
13810 Iterator(const ParamGeneratorInterface<ParamType>* base,
13811 const ParamGenerator<T1>& g1,
13812 const typename ParamGenerator<T1>::iterator& current1,
13813 const ParamGenerator<T2>& g2,
13814 const typename ParamGenerator<T2>::iterator& current2,
13815 const ParamGenerator<T3>& g3,
13816 const typename ParamGenerator<T3>::iterator& current3,
13817 const ParamGenerator<T4>& g4,
13818 const typename ParamGenerator<T4>::iterator& current4,
13819 const ParamGenerator<T5>& g5,
13820 const typename ParamGenerator<T5>::iterator& current5)
13822 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13823 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
13824 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
13825 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
13826 begin5_(g5.begin()), end5_(g5.end()), current5_(current5) {
13827 ComputeCurrentValue();
13829 virtual ~Iterator() {}
13831 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13834 // Advance should not be called on beyond-of-range iterators
13835 // so no component iterators must be beyond end of range, either.
13836 virtual void Advance() {
13839 if (current5_ == end5_) {
13840 current5_ = begin5_;
13843 if (current4_ == end4_) {
13844 current4_ = begin4_;
13847 if (current3_ == end3_) {
13848 current3_ = begin3_;
13851 if (current2_ == end2_) {
13852 current2_ = begin2_;
13855 ComputeCurrentValue();
13857 virtual ParamIteratorInterface<ParamType>* Clone() const {
13858 return new Iterator(*this);
13860 virtual const ParamType* Current() const { return ¤t_value_; }
13861 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13862 // Having the same base generator guarantees that the other
13863 // iterator is of the same type and we can downcast.
13864 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13865 << "The program attempted to compare iterators "
13866 << "from different generators." << std::endl;
13867 const Iterator* typed_other =
13868 CheckedDowncastToActualType<const Iterator>(&other);
13869 // We must report iterators equal if they both point beyond their
13870 // respective ranges. That can happen in a variety of fashions,
13871 // so we have to consult AtEnd().
13872 return (AtEnd() && typed_other->AtEnd()) ||
13874 current1_ == typed_other->current1_ &&
13875 current2_ == typed_other->current2_ &&
13876 current3_ == typed_other->current3_ &&
13877 current4_ == typed_other->current4_ &&
13878 current5_ == typed_other->current5_);
13882 Iterator(const Iterator& other)
13883 : base_(other.base_),
13884 begin1_(other.begin1_),
13885 end1_(other.end1_),
13886 current1_(other.current1_),
13887 begin2_(other.begin2_),
13888 end2_(other.end2_),
13889 current2_(other.current2_),
13890 begin3_(other.begin3_),
13891 end3_(other.end3_),
13892 current3_(other.current3_),
13893 begin4_(other.begin4_),
13894 end4_(other.end4_),
13895 current4_(other.current4_),
13896 begin5_(other.begin5_),
13897 end5_(other.end5_),
13898 current5_(other.current5_) {
13899 ComputeCurrentValue();
13902 void ComputeCurrentValue() {
13904 current_value_ = ParamType(*current1_, *current2_, *current3_,
13905 *current4_, *current5_);
13907 bool AtEnd() const {
13908 // We must report iterator past the end of the range when either of the
13909 // component iterators has reached the end of its range.
13911 current1_ == end1_ ||
13912 current2_ == end2_ ||
13913 current3_ == end3_ ||
13914 current4_ == end4_ ||
13915 current5_ == end5_;
13918 // No implementation - assignment is unsupported.
13919 void operator=(const Iterator& other);
13921 const ParamGeneratorInterface<ParamType>* const base_;
13922 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
13923 // current[i]_ is the actual traversing iterator.
13924 const typename ParamGenerator<T1>::iterator begin1_;
13925 const typename ParamGenerator<T1>::iterator end1_;
13926 typename ParamGenerator<T1>::iterator current1_;
13927 const typename ParamGenerator<T2>::iterator begin2_;
13928 const typename ParamGenerator<T2>::iterator end2_;
13929 typename ParamGenerator<T2>::iterator current2_;
13930 const typename ParamGenerator<T3>::iterator begin3_;
13931 const typename ParamGenerator<T3>::iterator end3_;
13932 typename ParamGenerator<T3>::iterator current3_;
13933 const typename ParamGenerator<T4>::iterator begin4_;
13934 const typename ParamGenerator<T4>::iterator end4_;
13935 typename ParamGenerator<T4>::iterator current4_;
13936 const typename ParamGenerator<T5>::iterator begin5_;
13937 const typename ParamGenerator<T5>::iterator end5_;
13938 typename ParamGenerator<T5>::iterator current5_;
13939 ParamType current_value_;
13940 }; // class CartesianProductGenerator5::Iterator
13942 // No implementation - assignment is unsupported.
13943 void operator=(const CartesianProductGenerator5& other);
13945 const ParamGenerator<T1> g1_;
13946 const ParamGenerator<T2> g2_;
13947 const ParamGenerator<T3> g3_;
13948 const ParamGenerator<T4> g4_;
13949 const ParamGenerator<T5> g5_;
13950 }; // class CartesianProductGenerator5
13953 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13955 class CartesianProductGenerator6
13956 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
13959 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
13961 CartesianProductGenerator6(const ParamGenerator<T1>& g1,
13962 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
13963 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
13964 const ParamGenerator<T6>& g6)
13965 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
13966 virtual ~CartesianProductGenerator6() {}
13968 virtual ParamIteratorInterface<ParamType>* Begin() const {
13969 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
13970 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
13972 virtual ParamIteratorInterface<ParamType>* End() const {
13973 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
13974 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
13978 class Iterator : public ParamIteratorInterface<ParamType> {
13980 Iterator(const ParamGeneratorInterface<ParamType>* base,
13981 const ParamGenerator<T1>& g1,
13982 const typename ParamGenerator<T1>::iterator& current1,
13983 const ParamGenerator<T2>& g2,
13984 const typename ParamGenerator<T2>::iterator& current2,
13985 const ParamGenerator<T3>& g3,
13986 const typename ParamGenerator<T3>::iterator& current3,
13987 const ParamGenerator<T4>& g4,
13988 const typename ParamGenerator<T4>::iterator& current4,
13989 const ParamGenerator<T5>& g5,
13990 const typename ParamGenerator<T5>::iterator& current5,
13991 const ParamGenerator<T6>& g6,
13992 const typename ParamGenerator<T6>::iterator& current6)
13994 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13995 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
13996 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
13997 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
13998 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
13999 begin6_(g6.begin()), end6_(g6.end()), current6_(current6) {
14000 ComputeCurrentValue();
14002 virtual ~Iterator() {}
14004 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14007 // Advance should not be called on beyond-of-range iterators
14008 // so no component iterators must be beyond end of range, either.
14009 virtual void Advance() {
14012 if (current6_ == end6_) {
14013 current6_ = begin6_;
14016 if (current5_ == end5_) {
14017 current5_ = begin5_;
14020 if (current4_ == end4_) {
14021 current4_ = begin4_;
14024 if (current3_ == end3_) {
14025 current3_ = begin3_;
14028 if (current2_ == end2_) {
14029 current2_ = begin2_;
14032 ComputeCurrentValue();
14034 virtual ParamIteratorInterface<ParamType>* Clone() const {
14035 return new Iterator(*this);
14037 virtual const ParamType* Current() const { return ¤t_value_; }
14038 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14039 // Having the same base generator guarantees that the other
14040 // iterator is of the same type and we can downcast.
14041 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14042 << "The program attempted to compare iterators "
14043 << "from different generators." << std::endl;
14044 const Iterator* typed_other =
14045 CheckedDowncastToActualType<const Iterator>(&other);
14046 // We must report iterators equal if they both point beyond their
14047 // respective ranges. That can happen in a variety of fashions,
14048 // so we have to consult AtEnd().
14049 return (AtEnd() && typed_other->AtEnd()) ||
14051 current1_ == typed_other->current1_ &&
14052 current2_ == typed_other->current2_ &&
14053 current3_ == typed_other->current3_ &&
14054 current4_ == typed_other->current4_ &&
14055 current5_ == typed_other->current5_ &&
14056 current6_ == typed_other->current6_);
14060 Iterator(const Iterator& other)
14061 : base_(other.base_),
14062 begin1_(other.begin1_),
14063 end1_(other.end1_),
14064 current1_(other.current1_),
14065 begin2_(other.begin2_),
14066 end2_(other.end2_),
14067 current2_(other.current2_),
14068 begin3_(other.begin3_),
14069 end3_(other.end3_),
14070 current3_(other.current3_),
14071 begin4_(other.begin4_),
14072 end4_(other.end4_),
14073 current4_(other.current4_),
14074 begin5_(other.begin5_),
14075 end5_(other.end5_),
14076 current5_(other.current5_),
14077 begin6_(other.begin6_),
14078 end6_(other.end6_),
14079 current6_(other.current6_) {
14080 ComputeCurrentValue();
14083 void ComputeCurrentValue() {
14085 current_value_ = ParamType(*current1_, *current2_, *current3_,
14086 *current4_, *current5_, *current6_);
14088 bool AtEnd() const {
14089 // We must report iterator past the end of the range when either of the
14090 // component iterators has reached the end of its range.
14092 current1_ == end1_ ||
14093 current2_ == end2_ ||
14094 current3_ == end3_ ||
14095 current4_ == end4_ ||
14096 current5_ == end5_ ||
14097 current6_ == end6_;
14100 // No implementation - assignment is unsupported.
14101 void operator=(const Iterator& other);
14103 const ParamGeneratorInterface<ParamType>* const base_;
14104 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14105 // current[i]_ is the actual traversing iterator.
14106 const typename ParamGenerator<T1>::iterator begin1_;
14107 const typename ParamGenerator<T1>::iterator end1_;
14108 typename ParamGenerator<T1>::iterator current1_;
14109 const typename ParamGenerator<T2>::iterator begin2_;
14110 const typename ParamGenerator<T2>::iterator end2_;
14111 typename ParamGenerator<T2>::iterator current2_;
14112 const typename ParamGenerator<T3>::iterator begin3_;
14113 const typename ParamGenerator<T3>::iterator end3_;
14114 typename ParamGenerator<T3>::iterator current3_;
14115 const typename ParamGenerator<T4>::iterator begin4_;
14116 const typename ParamGenerator<T4>::iterator end4_;
14117 typename ParamGenerator<T4>::iterator current4_;
14118 const typename ParamGenerator<T5>::iterator begin5_;
14119 const typename ParamGenerator<T5>::iterator end5_;
14120 typename ParamGenerator<T5>::iterator current5_;
14121 const typename ParamGenerator<T6>::iterator begin6_;
14122 const typename ParamGenerator<T6>::iterator end6_;
14123 typename ParamGenerator<T6>::iterator current6_;
14124 ParamType current_value_;
14125 }; // class CartesianProductGenerator6::Iterator
14127 // No implementation - assignment is unsupported.
14128 void operator=(const CartesianProductGenerator6& other);
14130 const ParamGenerator<T1> g1_;
14131 const ParamGenerator<T2> g2_;
14132 const ParamGenerator<T3> g3_;
14133 const ParamGenerator<T4> g4_;
14134 const ParamGenerator<T5> g5_;
14135 const ParamGenerator<T6> g6_;
14136 }; // class CartesianProductGenerator6
14139 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14140 typename T6, typename T7>
14141 class CartesianProductGenerator7
14142 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14145 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
14147 CartesianProductGenerator7(const ParamGenerator<T1>& g1,
14148 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14149 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14150 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
14151 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
14152 virtual ~CartesianProductGenerator7() {}
14154 virtual ParamIteratorInterface<ParamType>* Begin() const {
14155 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14156 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14159 virtual ParamIteratorInterface<ParamType>* End() const {
14160 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14161 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
14165 class Iterator : public ParamIteratorInterface<ParamType> {
14167 Iterator(const ParamGeneratorInterface<ParamType>* base,
14168 const ParamGenerator<T1>& g1,
14169 const typename ParamGenerator<T1>::iterator& current1,
14170 const ParamGenerator<T2>& g2,
14171 const typename ParamGenerator<T2>::iterator& current2,
14172 const ParamGenerator<T3>& g3,
14173 const typename ParamGenerator<T3>::iterator& current3,
14174 const ParamGenerator<T4>& g4,
14175 const typename ParamGenerator<T4>::iterator& current4,
14176 const ParamGenerator<T5>& g5,
14177 const typename ParamGenerator<T5>::iterator& current5,
14178 const ParamGenerator<T6>& g6,
14179 const typename ParamGenerator<T6>::iterator& current6,
14180 const ParamGenerator<T7>& g7,
14181 const typename ParamGenerator<T7>::iterator& current7)
14183 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14184 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14185 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14186 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14187 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14188 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14189 begin7_(g7.begin()), end7_(g7.end()), current7_(current7) {
14190 ComputeCurrentValue();
14192 virtual ~Iterator() {}
14194 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14197 // Advance should not be called on beyond-of-range iterators
14198 // so no component iterators must be beyond end of range, either.
14199 virtual void Advance() {
14202 if (current7_ == end7_) {
14203 current7_ = begin7_;
14206 if (current6_ == end6_) {
14207 current6_ = begin6_;
14210 if (current5_ == end5_) {
14211 current5_ = begin5_;
14214 if (current4_ == end4_) {
14215 current4_ = begin4_;
14218 if (current3_ == end3_) {
14219 current3_ = begin3_;
14222 if (current2_ == end2_) {
14223 current2_ = begin2_;
14226 ComputeCurrentValue();
14228 virtual ParamIteratorInterface<ParamType>* Clone() const {
14229 return new Iterator(*this);
14231 virtual const ParamType* Current() const { return ¤t_value_; }
14232 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14233 // Having the same base generator guarantees that the other
14234 // iterator is of the same type and we can downcast.
14235 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14236 << "The program attempted to compare iterators "
14237 << "from different generators." << std::endl;
14238 const Iterator* typed_other =
14239 CheckedDowncastToActualType<const Iterator>(&other);
14240 // We must report iterators equal if they both point beyond their
14241 // respective ranges. That can happen in a variety of fashions,
14242 // so we have to consult AtEnd().
14243 return (AtEnd() && typed_other->AtEnd()) ||
14245 current1_ == typed_other->current1_ &&
14246 current2_ == typed_other->current2_ &&
14247 current3_ == typed_other->current3_ &&
14248 current4_ == typed_other->current4_ &&
14249 current5_ == typed_other->current5_ &&
14250 current6_ == typed_other->current6_ &&
14251 current7_ == typed_other->current7_);
14255 Iterator(const Iterator& other)
14256 : base_(other.base_),
14257 begin1_(other.begin1_),
14258 end1_(other.end1_),
14259 current1_(other.current1_),
14260 begin2_(other.begin2_),
14261 end2_(other.end2_),
14262 current2_(other.current2_),
14263 begin3_(other.begin3_),
14264 end3_(other.end3_),
14265 current3_(other.current3_),
14266 begin4_(other.begin4_),
14267 end4_(other.end4_),
14268 current4_(other.current4_),
14269 begin5_(other.begin5_),
14270 end5_(other.end5_),
14271 current5_(other.current5_),
14272 begin6_(other.begin6_),
14273 end6_(other.end6_),
14274 current6_(other.current6_),
14275 begin7_(other.begin7_),
14276 end7_(other.end7_),
14277 current7_(other.current7_) {
14278 ComputeCurrentValue();
14281 void ComputeCurrentValue() {
14283 current_value_ = ParamType(*current1_, *current2_, *current3_,
14284 *current4_, *current5_, *current6_, *current7_);
14286 bool AtEnd() const {
14287 // We must report iterator past the end of the range when either of the
14288 // component iterators has reached the end of its range.
14290 current1_ == end1_ ||
14291 current2_ == end2_ ||
14292 current3_ == end3_ ||
14293 current4_ == end4_ ||
14294 current5_ == end5_ ||
14295 current6_ == end6_ ||
14296 current7_ == end7_;
14299 // No implementation - assignment is unsupported.
14300 void operator=(const Iterator& other);
14302 const ParamGeneratorInterface<ParamType>* const base_;
14303 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14304 // current[i]_ is the actual traversing iterator.
14305 const typename ParamGenerator<T1>::iterator begin1_;
14306 const typename ParamGenerator<T1>::iterator end1_;
14307 typename ParamGenerator<T1>::iterator current1_;
14308 const typename ParamGenerator<T2>::iterator begin2_;
14309 const typename ParamGenerator<T2>::iterator end2_;
14310 typename ParamGenerator<T2>::iterator current2_;
14311 const typename ParamGenerator<T3>::iterator begin3_;
14312 const typename ParamGenerator<T3>::iterator end3_;
14313 typename ParamGenerator<T3>::iterator current3_;
14314 const typename ParamGenerator<T4>::iterator begin4_;
14315 const typename ParamGenerator<T4>::iterator end4_;
14316 typename ParamGenerator<T4>::iterator current4_;
14317 const typename ParamGenerator<T5>::iterator begin5_;
14318 const typename ParamGenerator<T5>::iterator end5_;
14319 typename ParamGenerator<T5>::iterator current5_;
14320 const typename ParamGenerator<T6>::iterator begin6_;
14321 const typename ParamGenerator<T6>::iterator end6_;
14322 typename ParamGenerator<T6>::iterator current6_;
14323 const typename ParamGenerator<T7>::iterator begin7_;
14324 const typename ParamGenerator<T7>::iterator end7_;
14325 typename ParamGenerator<T7>::iterator current7_;
14326 ParamType current_value_;
14327 }; // class CartesianProductGenerator7::Iterator
14329 // No implementation - assignment is unsupported.
14330 void operator=(const CartesianProductGenerator7& other);
14332 const ParamGenerator<T1> g1_;
14333 const ParamGenerator<T2> g2_;
14334 const ParamGenerator<T3> g3_;
14335 const ParamGenerator<T4> g4_;
14336 const ParamGenerator<T5> g5_;
14337 const ParamGenerator<T6> g6_;
14338 const ParamGenerator<T7> g7_;
14339 }; // class CartesianProductGenerator7
14342 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14343 typename T6, typename T7, typename T8>
14344 class CartesianProductGenerator8
14345 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14348 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
14350 CartesianProductGenerator8(const ParamGenerator<T1>& g1,
14351 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14352 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14353 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
14354 const ParamGenerator<T8>& g8)
14355 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
14357 virtual ~CartesianProductGenerator8() {}
14359 virtual ParamIteratorInterface<ParamType>* Begin() const {
14360 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14361 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14362 g7_.begin(), g8_, g8_.begin());
14364 virtual ParamIteratorInterface<ParamType>* End() const {
14365 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14366 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
14371 class Iterator : public ParamIteratorInterface<ParamType> {
14373 Iterator(const ParamGeneratorInterface<ParamType>* base,
14374 const ParamGenerator<T1>& g1,
14375 const typename ParamGenerator<T1>::iterator& current1,
14376 const ParamGenerator<T2>& g2,
14377 const typename ParamGenerator<T2>::iterator& current2,
14378 const ParamGenerator<T3>& g3,
14379 const typename ParamGenerator<T3>::iterator& current3,
14380 const ParamGenerator<T4>& g4,
14381 const typename ParamGenerator<T4>::iterator& current4,
14382 const ParamGenerator<T5>& g5,
14383 const typename ParamGenerator<T5>::iterator& current5,
14384 const ParamGenerator<T6>& g6,
14385 const typename ParamGenerator<T6>::iterator& current6,
14386 const ParamGenerator<T7>& g7,
14387 const typename ParamGenerator<T7>::iterator& current7,
14388 const ParamGenerator<T8>& g8,
14389 const typename ParamGenerator<T8>::iterator& current8)
14391 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14392 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14393 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14394 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14395 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14396 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14397 begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
14398 begin8_(g8.begin()), end8_(g8.end()), current8_(current8) {
14399 ComputeCurrentValue();
14401 virtual ~Iterator() {}
14403 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14406 // Advance should not be called on beyond-of-range iterators
14407 // so no component iterators must be beyond end of range, either.
14408 virtual void Advance() {
14411 if (current8_ == end8_) {
14412 current8_ = begin8_;
14415 if (current7_ == end7_) {
14416 current7_ = begin7_;
14419 if (current6_ == end6_) {
14420 current6_ = begin6_;
14423 if (current5_ == end5_) {
14424 current5_ = begin5_;
14427 if (current4_ == end4_) {
14428 current4_ = begin4_;
14431 if (current3_ == end3_) {
14432 current3_ = begin3_;
14435 if (current2_ == end2_) {
14436 current2_ = begin2_;
14439 ComputeCurrentValue();
14441 virtual ParamIteratorInterface<ParamType>* Clone() const {
14442 return new Iterator(*this);
14444 virtual const ParamType* Current() const { return ¤t_value_; }
14445 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14446 // Having the same base generator guarantees that the other
14447 // iterator is of the same type and we can downcast.
14448 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14449 << "The program attempted to compare iterators "
14450 << "from different generators." << std::endl;
14451 const Iterator* typed_other =
14452 CheckedDowncastToActualType<const Iterator>(&other);
14453 // We must report iterators equal if they both point beyond their
14454 // respective ranges. That can happen in a variety of fashions,
14455 // so we have to consult AtEnd().
14456 return (AtEnd() && typed_other->AtEnd()) ||
14458 current1_ == typed_other->current1_ &&
14459 current2_ == typed_other->current2_ &&
14460 current3_ == typed_other->current3_ &&
14461 current4_ == typed_other->current4_ &&
14462 current5_ == typed_other->current5_ &&
14463 current6_ == typed_other->current6_ &&
14464 current7_ == typed_other->current7_ &&
14465 current8_ == typed_other->current8_);
14469 Iterator(const Iterator& other)
14470 : base_(other.base_),
14471 begin1_(other.begin1_),
14472 end1_(other.end1_),
14473 current1_(other.current1_),
14474 begin2_(other.begin2_),
14475 end2_(other.end2_),
14476 current2_(other.current2_),
14477 begin3_(other.begin3_),
14478 end3_(other.end3_),
14479 current3_(other.current3_),
14480 begin4_(other.begin4_),
14481 end4_(other.end4_),
14482 current4_(other.current4_),
14483 begin5_(other.begin5_),
14484 end5_(other.end5_),
14485 current5_(other.current5_),
14486 begin6_(other.begin6_),
14487 end6_(other.end6_),
14488 current6_(other.current6_),
14489 begin7_(other.begin7_),
14490 end7_(other.end7_),
14491 current7_(other.current7_),
14492 begin8_(other.begin8_),
14493 end8_(other.end8_),
14494 current8_(other.current8_) {
14495 ComputeCurrentValue();
14498 void ComputeCurrentValue() {
14500 current_value_ = ParamType(*current1_, *current2_, *current3_,
14501 *current4_, *current5_, *current6_, *current7_, *current8_);
14503 bool AtEnd() const {
14504 // We must report iterator past the end of the range when either of the
14505 // component iterators has reached the end of its range.
14507 current1_ == end1_ ||
14508 current2_ == end2_ ||
14509 current3_ == end3_ ||
14510 current4_ == end4_ ||
14511 current5_ == end5_ ||
14512 current6_ == end6_ ||
14513 current7_ == end7_ ||
14514 current8_ == end8_;
14517 // No implementation - assignment is unsupported.
14518 void operator=(const Iterator& other);
14520 const ParamGeneratorInterface<ParamType>* const base_;
14521 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14522 // current[i]_ is the actual traversing iterator.
14523 const typename ParamGenerator<T1>::iterator begin1_;
14524 const typename ParamGenerator<T1>::iterator end1_;
14525 typename ParamGenerator<T1>::iterator current1_;
14526 const typename ParamGenerator<T2>::iterator begin2_;
14527 const typename ParamGenerator<T2>::iterator end2_;
14528 typename ParamGenerator<T2>::iterator current2_;
14529 const typename ParamGenerator<T3>::iterator begin3_;
14530 const typename ParamGenerator<T3>::iterator end3_;
14531 typename ParamGenerator<T3>::iterator current3_;
14532 const typename ParamGenerator<T4>::iterator begin4_;
14533 const typename ParamGenerator<T4>::iterator end4_;
14534 typename ParamGenerator<T4>::iterator current4_;
14535 const typename ParamGenerator<T5>::iterator begin5_;
14536 const typename ParamGenerator<T5>::iterator end5_;
14537 typename ParamGenerator<T5>::iterator current5_;
14538 const typename ParamGenerator<T6>::iterator begin6_;
14539 const typename ParamGenerator<T6>::iterator end6_;
14540 typename ParamGenerator<T6>::iterator current6_;
14541 const typename ParamGenerator<T7>::iterator begin7_;
14542 const typename ParamGenerator<T7>::iterator end7_;
14543 typename ParamGenerator<T7>::iterator current7_;
14544 const typename ParamGenerator<T8>::iterator begin8_;
14545 const typename ParamGenerator<T8>::iterator end8_;
14546 typename ParamGenerator<T8>::iterator current8_;
14547 ParamType current_value_;
14548 }; // class CartesianProductGenerator8::Iterator
14550 // No implementation - assignment is unsupported.
14551 void operator=(const CartesianProductGenerator8& other);
14553 const ParamGenerator<T1> g1_;
14554 const ParamGenerator<T2> g2_;
14555 const ParamGenerator<T3> g3_;
14556 const ParamGenerator<T4> g4_;
14557 const ParamGenerator<T5> g5_;
14558 const ParamGenerator<T6> g6_;
14559 const ParamGenerator<T7> g7_;
14560 const ParamGenerator<T8> g8_;
14561 }; // class CartesianProductGenerator8
14564 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14565 typename T6, typename T7, typename T8, typename T9>
14566 class CartesianProductGenerator9
14567 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14570 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
14572 CartesianProductGenerator9(const ParamGenerator<T1>& g1,
14573 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14574 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14575 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
14576 const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
14577 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
14579 virtual ~CartesianProductGenerator9() {}
14581 virtual ParamIteratorInterface<ParamType>* Begin() const {
14582 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14583 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14584 g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
14586 virtual ParamIteratorInterface<ParamType>* End() const {
14587 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14588 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
14589 g8_.end(), g9_, g9_.end());
14593 class Iterator : public ParamIteratorInterface<ParamType> {
14595 Iterator(const ParamGeneratorInterface<ParamType>* base,
14596 const ParamGenerator<T1>& g1,
14597 const typename ParamGenerator<T1>::iterator& current1,
14598 const ParamGenerator<T2>& g2,
14599 const typename ParamGenerator<T2>::iterator& current2,
14600 const ParamGenerator<T3>& g3,
14601 const typename ParamGenerator<T3>::iterator& current3,
14602 const ParamGenerator<T4>& g4,
14603 const typename ParamGenerator<T4>::iterator& current4,
14604 const ParamGenerator<T5>& g5,
14605 const typename ParamGenerator<T5>::iterator& current5,
14606 const ParamGenerator<T6>& g6,
14607 const typename ParamGenerator<T6>::iterator& current6,
14608 const ParamGenerator<T7>& g7,
14609 const typename ParamGenerator<T7>::iterator& current7,
14610 const ParamGenerator<T8>& g8,
14611 const typename ParamGenerator<T8>::iterator& current8,
14612 const ParamGenerator<T9>& g9,
14613 const typename ParamGenerator<T9>::iterator& current9)
14615 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14616 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14617 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14618 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14619 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14620 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14621 begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
14622 begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
14623 begin9_(g9.begin()), end9_(g9.end()), current9_(current9) {
14624 ComputeCurrentValue();
14626 virtual ~Iterator() {}
14628 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14631 // Advance should not be called on beyond-of-range iterators
14632 // so no component iterators must be beyond end of range, either.
14633 virtual void Advance() {
14636 if (current9_ == end9_) {
14637 current9_ = begin9_;
14640 if (current8_ == end8_) {
14641 current8_ = begin8_;
14644 if (current7_ == end7_) {
14645 current7_ = begin7_;
14648 if (current6_ == end6_) {
14649 current6_ = begin6_;
14652 if (current5_ == end5_) {
14653 current5_ = begin5_;
14656 if (current4_ == end4_) {
14657 current4_ = begin4_;
14660 if (current3_ == end3_) {
14661 current3_ = begin3_;
14664 if (current2_ == end2_) {
14665 current2_ = begin2_;
14668 ComputeCurrentValue();
14670 virtual ParamIteratorInterface<ParamType>* Clone() const {
14671 return new Iterator(*this);
14673 virtual const ParamType* Current() const { return ¤t_value_; }
14674 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14675 // Having the same base generator guarantees that the other
14676 // iterator is of the same type and we can downcast.
14677 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14678 << "The program attempted to compare iterators "
14679 << "from different generators." << std::endl;
14680 const Iterator* typed_other =
14681 CheckedDowncastToActualType<const Iterator>(&other);
14682 // We must report iterators equal if they both point beyond their
14683 // respective ranges. That can happen in a variety of fashions,
14684 // so we have to consult AtEnd().
14685 return (AtEnd() && typed_other->AtEnd()) ||
14687 current1_ == typed_other->current1_ &&
14688 current2_ == typed_other->current2_ &&
14689 current3_ == typed_other->current3_ &&
14690 current4_ == typed_other->current4_ &&
14691 current5_ == typed_other->current5_ &&
14692 current6_ == typed_other->current6_ &&
14693 current7_ == typed_other->current7_ &&
14694 current8_ == typed_other->current8_ &&
14695 current9_ == typed_other->current9_);
14699 Iterator(const Iterator& other)
14700 : base_(other.base_),
14701 begin1_(other.begin1_),
14702 end1_(other.end1_),
14703 current1_(other.current1_),
14704 begin2_(other.begin2_),
14705 end2_(other.end2_),
14706 current2_(other.current2_),
14707 begin3_(other.begin3_),
14708 end3_(other.end3_),
14709 current3_(other.current3_),
14710 begin4_(other.begin4_),
14711 end4_(other.end4_),
14712 current4_(other.current4_),
14713 begin5_(other.begin5_),
14714 end5_(other.end5_),
14715 current5_(other.current5_),
14716 begin6_(other.begin6_),
14717 end6_(other.end6_),
14718 current6_(other.current6_),
14719 begin7_(other.begin7_),
14720 end7_(other.end7_),
14721 current7_(other.current7_),
14722 begin8_(other.begin8_),
14723 end8_(other.end8_),
14724 current8_(other.current8_),
14725 begin9_(other.begin9_),
14726 end9_(other.end9_),
14727 current9_(other.current9_) {
14728 ComputeCurrentValue();
14731 void ComputeCurrentValue() {
14733 current_value_ = ParamType(*current1_, *current2_, *current3_,
14734 *current4_, *current5_, *current6_, *current7_, *current8_,
14737 bool AtEnd() const {
14738 // We must report iterator past the end of the range when either of the
14739 // component iterators has reached the end of its range.
14741 current1_ == end1_ ||
14742 current2_ == end2_ ||
14743 current3_ == end3_ ||
14744 current4_ == end4_ ||
14745 current5_ == end5_ ||
14746 current6_ == end6_ ||
14747 current7_ == end7_ ||
14748 current8_ == end8_ ||
14749 current9_ == end9_;
14752 // No implementation - assignment is unsupported.
14753 void operator=(const Iterator& other);
14755 const ParamGeneratorInterface<ParamType>* const base_;
14756 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14757 // current[i]_ is the actual traversing iterator.
14758 const typename ParamGenerator<T1>::iterator begin1_;
14759 const typename ParamGenerator<T1>::iterator end1_;
14760 typename ParamGenerator<T1>::iterator current1_;
14761 const typename ParamGenerator<T2>::iterator begin2_;
14762 const typename ParamGenerator<T2>::iterator end2_;
14763 typename ParamGenerator<T2>::iterator current2_;
14764 const typename ParamGenerator<T3>::iterator begin3_;
14765 const typename ParamGenerator<T3>::iterator end3_;
14766 typename ParamGenerator<T3>::iterator current3_;
14767 const typename ParamGenerator<T4>::iterator begin4_;
14768 const typename ParamGenerator<T4>::iterator end4_;
14769 typename ParamGenerator<T4>::iterator current4_;
14770 const typename ParamGenerator<T5>::iterator begin5_;
14771 const typename ParamGenerator<T5>::iterator end5_;
14772 typename ParamGenerator<T5>::iterator current5_;
14773 const typename ParamGenerator<T6>::iterator begin6_;
14774 const typename ParamGenerator<T6>::iterator end6_;
14775 typename ParamGenerator<T6>::iterator current6_;
14776 const typename ParamGenerator<T7>::iterator begin7_;
14777 const typename ParamGenerator<T7>::iterator end7_;
14778 typename ParamGenerator<T7>::iterator current7_;
14779 const typename ParamGenerator<T8>::iterator begin8_;
14780 const typename ParamGenerator<T8>::iterator end8_;
14781 typename ParamGenerator<T8>::iterator current8_;
14782 const typename ParamGenerator<T9>::iterator begin9_;
14783 const typename ParamGenerator<T9>::iterator end9_;
14784 typename ParamGenerator<T9>::iterator current9_;
14785 ParamType current_value_;
14786 }; // class CartesianProductGenerator9::Iterator
14788 // No implementation - assignment is unsupported.
14789 void operator=(const CartesianProductGenerator9& other);
14791 const ParamGenerator<T1> g1_;
14792 const ParamGenerator<T2> g2_;
14793 const ParamGenerator<T3> g3_;
14794 const ParamGenerator<T4> g4_;
14795 const ParamGenerator<T5> g5_;
14796 const ParamGenerator<T6> g6_;
14797 const ParamGenerator<T7> g7_;
14798 const ParamGenerator<T8> g8_;
14799 const ParamGenerator<T9> g9_;
14800 }; // class CartesianProductGenerator9
14803 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14804 typename T6, typename T7, typename T8, typename T9, typename T10>
14805 class CartesianProductGenerator10
14806 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14807 T7, T8, T9, T10> > {
14809 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
14811 CartesianProductGenerator10(const ParamGenerator<T1>& g1,
14812 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14813 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14814 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
14815 const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
14816 const ParamGenerator<T10>& g10)
14817 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
14818 g9_(g9), g10_(g10) {}
14819 virtual ~CartesianProductGenerator10() {}
14821 virtual ParamIteratorInterface<ParamType>* Begin() const {
14822 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14823 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14824 g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
14826 virtual ParamIteratorInterface<ParamType>* End() const {
14827 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14828 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
14829 g8_.end(), g9_, g9_.end(), g10_, g10_.end());
14833 class Iterator : public ParamIteratorInterface<ParamType> {
14835 Iterator(const ParamGeneratorInterface<ParamType>* base,
14836 const ParamGenerator<T1>& g1,
14837 const typename ParamGenerator<T1>::iterator& current1,
14838 const ParamGenerator<T2>& g2,
14839 const typename ParamGenerator<T2>::iterator& current2,
14840 const ParamGenerator<T3>& g3,
14841 const typename ParamGenerator<T3>::iterator& current3,
14842 const ParamGenerator<T4>& g4,
14843 const typename ParamGenerator<T4>::iterator& current4,
14844 const ParamGenerator<T5>& g5,
14845 const typename ParamGenerator<T5>::iterator& current5,
14846 const ParamGenerator<T6>& g6,
14847 const typename ParamGenerator<T6>::iterator& current6,
14848 const ParamGenerator<T7>& g7,
14849 const typename ParamGenerator<T7>::iterator& current7,
14850 const ParamGenerator<T8>& g8,
14851 const typename ParamGenerator<T8>::iterator& current8,
14852 const ParamGenerator<T9>& g9,
14853 const typename ParamGenerator<T9>::iterator& current9,
14854 const ParamGenerator<T10>& g10,
14855 const typename ParamGenerator<T10>::iterator& current10)
14857 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14858 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14859 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14860 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14861 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14862 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14863 begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
14864 begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
14865 begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
14866 begin10_(g10.begin()), end10_(g10.end()), current10_(current10) {
14867 ComputeCurrentValue();
14869 virtual ~Iterator() {}
14871 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14874 // Advance should not be called on beyond-of-range iterators
14875 // so no component iterators must be beyond end of range, either.
14876 virtual void Advance() {
14879 if (current10_ == end10_) {
14880 current10_ = begin10_;
14883 if (current9_ == end9_) {
14884 current9_ = begin9_;
14887 if (current8_ == end8_) {
14888 current8_ = begin8_;
14891 if (current7_ == end7_) {
14892 current7_ = begin7_;
14895 if (current6_ == end6_) {
14896 current6_ = begin6_;
14899 if (current5_ == end5_) {
14900 current5_ = begin5_;
14903 if (current4_ == end4_) {
14904 current4_ = begin4_;
14907 if (current3_ == end3_) {
14908 current3_ = begin3_;
14911 if (current2_ == end2_) {
14912 current2_ = begin2_;
14915 ComputeCurrentValue();
14917 virtual ParamIteratorInterface<ParamType>* Clone() const {
14918 return new Iterator(*this);
14920 virtual const ParamType* Current() const { return ¤t_value_; }
14921 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14922 // Having the same base generator guarantees that the other
14923 // iterator is of the same type and we can downcast.
14924 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14925 << "The program attempted to compare iterators "
14926 << "from different generators." << std::endl;
14927 const Iterator* typed_other =
14928 CheckedDowncastToActualType<const Iterator>(&other);
14929 // We must report iterators equal if they both point beyond their
14930 // respective ranges. That can happen in a variety of fashions,
14931 // so we have to consult AtEnd().
14932 return (AtEnd() && typed_other->AtEnd()) ||
14934 current1_ == typed_other->current1_ &&
14935 current2_ == typed_other->current2_ &&
14936 current3_ == typed_other->current3_ &&
14937 current4_ == typed_other->current4_ &&
14938 current5_ == typed_other->current5_ &&
14939 current6_ == typed_other->current6_ &&
14940 current7_ == typed_other->current7_ &&
14941 current8_ == typed_other->current8_ &&
14942 current9_ == typed_other->current9_ &&
14943 current10_ == typed_other->current10_);
14947 Iterator(const Iterator& other)
14948 : base_(other.base_),
14949 begin1_(other.begin1_),
14950 end1_(other.end1_),
14951 current1_(other.current1_),
14952 begin2_(other.begin2_),
14953 end2_(other.end2_),
14954 current2_(other.current2_),
14955 begin3_(other.begin3_),
14956 end3_(other.end3_),
14957 current3_(other.current3_),
14958 begin4_(other.begin4_),
14959 end4_(other.end4_),
14960 current4_(other.current4_),
14961 begin5_(other.begin5_),
14962 end5_(other.end5_),
14963 current5_(other.current5_),
14964 begin6_(other.begin6_),
14965 end6_(other.end6_),
14966 current6_(other.current6_),
14967 begin7_(other.begin7_),
14968 end7_(other.end7_),
14969 current7_(other.current7_),
14970 begin8_(other.begin8_),
14971 end8_(other.end8_),
14972 current8_(other.current8_),
14973 begin9_(other.begin9_),
14974 end9_(other.end9_),
14975 current9_(other.current9_),
14976 begin10_(other.begin10_),
14977 end10_(other.end10_),
14978 current10_(other.current10_) {
14979 ComputeCurrentValue();
14982 void ComputeCurrentValue() {
14984 current_value_ = ParamType(*current1_, *current2_, *current3_,
14985 *current4_, *current5_, *current6_, *current7_, *current8_,
14986 *current9_, *current10_);
14988 bool AtEnd() const {
14989 // We must report iterator past the end of the range when either of the
14990 // component iterators has reached the end of its range.
14992 current1_ == end1_ ||
14993 current2_ == end2_ ||
14994 current3_ == end3_ ||
14995 current4_ == end4_ ||
14996 current5_ == end5_ ||
14997 current6_ == end6_ ||
14998 current7_ == end7_ ||
14999 current8_ == end8_ ||
15000 current9_ == end9_ ||
15001 current10_ == end10_;
15004 // No implementation - assignment is unsupported.
15005 void operator=(const Iterator& other);
15007 const ParamGeneratorInterface<ParamType>* const base_;
15008 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15009 // current[i]_ is the actual traversing iterator.
15010 const typename ParamGenerator<T1>::iterator begin1_;
15011 const typename ParamGenerator<T1>::iterator end1_;
15012 typename ParamGenerator<T1>::iterator current1_;
15013 const typename ParamGenerator<T2>::iterator begin2_;
15014 const typename ParamGenerator<T2>::iterator end2_;
15015 typename ParamGenerator<T2>::iterator current2_;
15016 const typename ParamGenerator<T3>::iterator begin3_;
15017 const typename ParamGenerator<T3>::iterator end3_;
15018 typename ParamGenerator<T3>::iterator current3_;
15019 const typename ParamGenerator<T4>::iterator begin4_;
15020 const typename ParamGenerator<T4>::iterator end4_;
15021 typename ParamGenerator<T4>::iterator current4_;
15022 const typename ParamGenerator<T5>::iterator begin5_;
15023 const typename ParamGenerator<T5>::iterator end5_;
15024 typename ParamGenerator<T5>::iterator current5_;
15025 const typename ParamGenerator<T6>::iterator begin6_;
15026 const typename ParamGenerator<T6>::iterator end6_;
15027 typename ParamGenerator<T6>::iterator current6_;
15028 const typename ParamGenerator<T7>::iterator begin7_;
15029 const typename ParamGenerator<T7>::iterator end7_;
15030 typename ParamGenerator<T7>::iterator current7_;
15031 const typename ParamGenerator<T8>::iterator begin8_;
15032 const typename ParamGenerator<T8>::iterator end8_;
15033 typename ParamGenerator<T8>::iterator current8_;
15034 const typename ParamGenerator<T9>::iterator begin9_;
15035 const typename ParamGenerator<T9>::iterator end9_;
15036 typename ParamGenerator<T9>::iterator current9_;
15037 const typename ParamGenerator<T10>::iterator begin10_;
15038 const typename ParamGenerator<T10>::iterator end10_;
15039 typename ParamGenerator<T10>::iterator current10_;
15040 ParamType current_value_;
15041 }; // class CartesianProductGenerator10::Iterator
15043 // No implementation - assignment is unsupported.
15044 void operator=(const CartesianProductGenerator10& other);
15046 const ParamGenerator<T1> g1_;
15047 const ParamGenerator<T2> g2_;
15048 const ParamGenerator<T3> g3_;
15049 const ParamGenerator<T4> g4_;
15050 const ParamGenerator<T5> g5_;
15051 const ParamGenerator<T6> g6_;
15052 const ParamGenerator<T7> g7_;
15053 const ParamGenerator<T8> g8_;
15054 const ParamGenerator<T9> g9_;
15055 const ParamGenerator<T10> g10_;
15056 }; // class CartesianProductGenerator10
15059 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
15061 // Helper classes providing Combine() with polymorphic features. They allow
15062 // casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
15063 // convertible to U.
15065 template <class Generator1, class Generator2>
15066 class CartesianProductHolder2 {
15068 CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
15069 : g1_(g1), g2_(g2) {}
15070 template <typename T1, typename T2>
15071 operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
15072 return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
15073 new CartesianProductGenerator2<T1, T2>(
15074 static_cast<ParamGenerator<T1> >(g1_),
15075 static_cast<ParamGenerator<T2> >(g2_)));
15079 // No implementation - assignment is unsupported.
15080 void operator=(const CartesianProductHolder2& other);
15082 const Generator1 g1_;
15083 const Generator2 g2_;
15084 }; // class CartesianProductHolder2
15086 template <class Generator1, class Generator2, class Generator3>
15087 class CartesianProductHolder3 {
15089 CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
15090 const Generator3& g3)
15091 : g1_(g1), g2_(g2), g3_(g3) {}
15092 template <typename T1, typename T2, typename T3>
15093 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
15094 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
15095 new CartesianProductGenerator3<T1, T2, T3>(
15096 static_cast<ParamGenerator<T1> >(g1_),
15097 static_cast<ParamGenerator<T2> >(g2_),
15098 static_cast<ParamGenerator<T3> >(g3_)));
15102 // No implementation - assignment is unsupported.
15103 void operator=(const CartesianProductHolder3& other);
15105 const Generator1 g1_;
15106 const Generator2 g2_;
15107 const Generator3 g3_;
15108 }; // class CartesianProductHolder3
15110 template <class Generator1, class Generator2, class Generator3,
15112 class CartesianProductHolder4 {
15114 CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
15115 const Generator3& g3, const Generator4& g4)
15116 : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
15117 template <typename T1, typename T2, typename T3, typename T4>
15118 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
15119 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
15120 new CartesianProductGenerator4<T1, T2, T3, T4>(
15121 static_cast<ParamGenerator<T1> >(g1_),
15122 static_cast<ParamGenerator<T2> >(g2_),
15123 static_cast<ParamGenerator<T3> >(g3_),
15124 static_cast<ParamGenerator<T4> >(g4_)));
15128 // No implementation - assignment is unsupported.
15129 void operator=(const CartesianProductHolder4& other);
15131 const Generator1 g1_;
15132 const Generator2 g2_;
15133 const Generator3 g3_;
15134 const Generator4 g4_;
15135 }; // class CartesianProductHolder4
15137 template <class Generator1, class Generator2, class Generator3,
15138 class Generator4, class Generator5>
15139 class CartesianProductHolder5 {
15141 CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
15142 const Generator3& g3, const Generator4& g4, const Generator5& g5)
15143 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
15144 template <typename T1, typename T2, typename T3, typename T4, typename T5>
15145 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
15146 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
15147 new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
15148 static_cast<ParamGenerator<T1> >(g1_),
15149 static_cast<ParamGenerator<T2> >(g2_),
15150 static_cast<ParamGenerator<T3> >(g3_),
15151 static_cast<ParamGenerator<T4> >(g4_),
15152 static_cast<ParamGenerator<T5> >(g5_)));
15156 // No implementation - assignment is unsupported.
15157 void operator=(const CartesianProductHolder5& other);
15159 const Generator1 g1_;
15160 const Generator2 g2_;
15161 const Generator3 g3_;
15162 const Generator4 g4_;
15163 const Generator5 g5_;
15164 }; // class CartesianProductHolder5
15166 template <class Generator1, class Generator2, class Generator3,
15167 class Generator4, class Generator5, class Generator6>
15168 class CartesianProductHolder6 {
15170 CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
15171 const Generator3& g3, const Generator4& g4, const Generator5& g5,
15172 const Generator6& g6)
15173 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
15174 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15176 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
15177 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
15178 new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
15179 static_cast<ParamGenerator<T1> >(g1_),
15180 static_cast<ParamGenerator<T2> >(g2_),
15181 static_cast<ParamGenerator<T3> >(g3_),
15182 static_cast<ParamGenerator<T4> >(g4_),
15183 static_cast<ParamGenerator<T5> >(g5_),
15184 static_cast<ParamGenerator<T6> >(g6_)));
15188 // No implementation - assignment is unsupported.
15189 void operator=(const CartesianProductHolder6& other);
15191 const Generator1 g1_;
15192 const Generator2 g2_;
15193 const Generator3 g3_;
15194 const Generator4 g4_;
15195 const Generator5 g5_;
15196 const Generator6 g6_;
15197 }; // class CartesianProductHolder6
15199 template <class Generator1, class Generator2, class Generator3,
15200 class Generator4, class Generator5, class Generator6, class Generator7>
15201 class CartesianProductHolder7 {
15203 CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
15204 const Generator3& g3, const Generator4& g4, const Generator5& g5,
15205 const Generator6& g6, const Generator7& g7)
15206 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
15207 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15208 typename T6, typename T7>
15209 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15211 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
15212 new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
15213 static_cast<ParamGenerator<T1> >(g1_),
15214 static_cast<ParamGenerator<T2> >(g2_),
15215 static_cast<ParamGenerator<T3> >(g3_),
15216 static_cast<ParamGenerator<T4> >(g4_),
15217 static_cast<ParamGenerator<T5> >(g5_),
15218 static_cast<ParamGenerator<T6> >(g6_),
15219 static_cast<ParamGenerator<T7> >(g7_)));
15223 // No implementation - assignment is unsupported.
15224 void operator=(const CartesianProductHolder7& other);
15226 const Generator1 g1_;
15227 const Generator2 g2_;
15228 const Generator3 g3_;
15229 const Generator4 g4_;
15230 const Generator5 g5_;
15231 const Generator6 g6_;
15232 const Generator7 g7_;
15233 }; // class CartesianProductHolder7
15235 template <class Generator1, class Generator2, class Generator3,
15236 class Generator4, class Generator5, class Generator6, class Generator7,
15238 class CartesianProductHolder8 {
15240 CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
15241 const Generator3& g3, const Generator4& g4, const Generator5& g5,
15242 const Generator6& g6, const Generator7& g7, const Generator8& g8)
15243 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
15245 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15246 typename T6, typename T7, typename T8>
15247 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
15249 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
15250 new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
15251 static_cast<ParamGenerator<T1> >(g1_),
15252 static_cast<ParamGenerator<T2> >(g2_),
15253 static_cast<ParamGenerator<T3> >(g3_),
15254 static_cast<ParamGenerator<T4> >(g4_),
15255 static_cast<ParamGenerator<T5> >(g5_),
15256 static_cast<ParamGenerator<T6> >(g6_),
15257 static_cast<ParamGenerator<T7> >(g7_),
15258 static_cast<ParamGenerator<T8> >(g8_)));
15262 // No implementation - assignment is unsupported.
15263 void operator=(const CartesianProductHolder8& other);
15265 const Generator1 g1_;
15266 const Generator2 g2_;
15267 const Generator3 g3_;
15268 const Generator4 g4_;
15269 const Generator5 g5_;
15270 const Generator6 g6_;
15271 const Generator7 g7_;
15272 const Generator8 g8_;
15273 }; // class CartesianProductHolder8
15275 template <class Generator1, class Generator2, class Generator3,
15276 class Generator4, class Generator5, class Generator6, class Generator7,
15277 class Generator8, class Generator9>
15278 class CartesianProductHolder9 {
15280 CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
15281 const Generator3& g3, const Generator4& g4, const Generator5& g5,
15282 const Generator6& g6, const Generator7& g7, const Generator8& g8,
15283 const Generator9& g9)
15284 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15286 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15287 typename T6, typename T7, typename T8, typename T9>
15288 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15290 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15292 new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
15293 static_cast<ParamGenerator<T1> >(g1_),
15294 static_cast<ParamGenerator<T2> >(g2_),
15295 static_cast<ParamGenerator<T3> >(g3_),
15296 static_cast<ParamGenerator<T4> >(g4_),
15297 static_cast<ParamGenerator<T5> >(g5_),
15298 static_cast<ParamGenerator<T6> >(g6_),
15299 static_cast<ParamGenerator<T7> >(g7_),
15300 static_cast<ParamGenerator<T8> >(g8_),
15301 static_cast<ParamGenerator<T9> >(g9_)));
15305 // No implementation - assignment is unsupported.
15306 void operator=(const CartesianProductHolder9& other);
15308 const Generator1 g1_;
15309 const Generator2 g2_;
15310 const Generator3 g3_;
15311 const Generator4 g4_;
15312 const Generator5 g5_;
15313 const Generator6 g6_;
15314 const Generator7 g7_;
15315 const Generator8 g8_;
15316 const Generator9 g9_;
15317 }; // class CartesianProductHolder9
15319 template <class Generator1, class Generator2, class Generator3,
15320 class Generator4, class Generator5, class Generator6, class Generator7,
15321 class Generator8, class Generator9, class Generator10>
15322 class CartesianProductHolder10 {
15324 CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
15325 const Generator3& g3, const Generator4& g4, const Generator5& g5,
15326 const Generator6& g6, const Generator7& g7, const Generator8& g8,
15327 const Generator9& g9, const Generator10& g10)
15328 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15329 g9_(g9), g10_(g10) {}
15330 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15331 typename T6, typename T7, typename T8, typename T9, typename T10>
15332 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15333 T9, T10> >() const {
15334 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15336 new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
15338 static_cast<ParamGenerator<T1> >(g1_),
15339 static_cast<ParamGenerator<T2> >(g2_),
15340 static_cast<ParamGenerator<T3> >(g3_),
15341 static_cast<ParamGenerator<T4> >(g4_),
15342 static_cast<ParamGenerator<T5> >(g5_),
15343 static_cast<ParamGenerator<T6> >(g6_),
15344 static_cast<ParamGenerator<T7> >(g7_),
15345 static_cast<ParamGenerator<T8> >(g8_),
15346 static_cast<ParamGenerator<T9> >(g9_),
15347 static_cast<ParamGenerator<T10> >(g10_)));
15351 // No implementation - assignment is unsupported.
15352 void operator=(const CartesianProductHolder10& other);
15354 const Generator1 g1_;
15355 const Generator2 g2_;
15356 const Generator3 g3_;
15357 const Generator4 g4_;
15358 const Generator5 g5_;
15359 const Generator6 g6_;
15360 const Generator7 g7_;
15361 const Generator8 g8_;
15362 const Generator9 g9_;
15363 const Generator10 g10_;
15364 }; // class CartesianProductHolder10
15366 # endif // GTEST_HAS_COMBINE
15368 } // namespace internal
15369 } // namespace testing
15371 #endif // GTEST_HAS_PARAM_TEST
15373 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
15375 #if GTEST_HAS_PARAM_TEST
15377 namespace testing {
15379 // Functions producing parameter generators.
15381 // Google Test uses these generators to produce parameters for value-
15382 // parameterized tests. When a parameterized test case is instantiated
15383 // with a particular generator, Google Test creates and runs tests
15384 // for each element in the sequence produced by the generator.
15386 // In the following sample, tests from test case FooTest are instantiated
15387 // each three times with parameter values 3, 5, and 8:
15389 // class FooTest : public TestWithParam<int> { ... };
15391 // TEST_P(FooTest, TestThis) {
15393 // TEST_P(FooTest, TestThat) {
15395 // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
15398 // Range() returns generators providing sequences of values in a range.
15401 // Range(start, end)
15402 // - returns a generator producing a sequence of values {start, start+1,
15403 // start+2, ..., }.
15404 // Range(start, end, step)
15405 // - returns a generator producing a sequence of values {start, start+step,
15406 // start+step+step, ..., }.
15408 // * The generated sequences never include end. For example, Range(1, 5)
15409 // returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
15410 // returns a generator producing {1, 3, 5, 7}.
15411 // * start and end must have the same type. That type may be any integral or
15412 // floating-point type or a user defined type satisfying these conditions:
15413 // * It must be assignable (have operator=() defined).
15414 // * It must have operator+() (operator+(int-compatible type) for
15415 // two-operand version).
15416 // * It must have operator<() defined.
15417 // Elements in the resulting sequences will also have that type.
15418 // * Condition start < end must be satisfied in order for resulting sequences
15419 // to contain any elements.
15421 template <typename T, typename IncrementT>
15422 internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
15423 return internal::ParamGenerator<T>(
15424 new internal::RangeGenerator<T, IncrementT>(start, end, step));
15427 template <typename T>
15428 internal::ParamGenerator<T> Range(T start, T end) {
15429 return Range(start, end, 1);
15432 // ValuesIn() function allows generation of tests with parameters coming from
15436 // ValuesIn(const T (&array)[N])
15437 // - returns a generator producing sequences with elements from
15438 // a C-style array.
15439 // ValuesIn(const Container& container)
15440 // - returns a generator producing sequences with elements from
15441 // an STL-style container.
15442 // ValuesIn(Iterator begin, Iterator end)
15443 // - returns a generator producing sequences with elements from
15444 // a range [begin, end) defined by a pair of STL-style iterators. These
15445 // iterators can also be plain C pointers.
15447 // Please note that ValuesIn copies the values from the containers
15448 // passed in and keeps them to generate tests in RUN_ALL_TESTS().
15452 // This instantiates tests from test case StringTest
15453 // each with C-string values of "foo", "bar", and "baz":
15455 // const char* strings[] = {"foo", "bar", "baz"};
15456 // INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
15458 // This instantiates tests from test case StlStringTest
15459 // each with STL strings with values "a" and "b":
15461 // ::std::vector< ::std::string> GetParameterStrings() {
15462 // ::std::vector< ::std::string> v;
15463 // v.push_back("a");
15464 // v.push_back("b");
15468 // INSTANTIATE_TEST_CASE_P(CharSequence,
15470 // ValuesIn(GetParameterStrings()));
15473 // This will also instantiate tests from CharTest
15474 // each with parameter values 'a' and 'b':
15476 // ::std::list<char> GetParameterChars() {
15477 // ::std::list<char> list;
15478 // list.push_back('a');
15479 // list.push_back('b');
15482 // ::std::list<char> l = GetParameterChars();
15483 // INSTANTIATE_TEST_CASE_P(CharSequence2,
15485 // ValuesIn(l.begin(), l.end()));
15487 template <typename ForwardIterator>
15488 internal::ParamGenerator<
15489 typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
15490 ValuesIn(ForwardIterator begin, ForwardIterator end) {
15491 typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
15492 ::value_type ParamType;
15493 return internal::ParamGenerator<ParamType>(
15494 new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
15497 template <typename T, size_t N>
15498 internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
15499 return ValuesIn(array, array + N);
15502 template <class Container>
15503 internal::ParamGenerator<typename Container::value_type> ValuesIn(
15504 const Container& container) {
15505 return ValuesIn(container.begin(), container.end());
15508 // Values() allows generating tests from explicitly specified list of
15512 // Values(T v1, T v2, ..., T vN)
15513 // - returns a generator producing sequences with elements v1, v2, ..., vN.
15515 // For example, this instantiates tests from test case BarTest each
15516 // with values "one", "two", and "three":
15518 // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
15520 // This instantiates tests from test case BazTest each with values 1, 2, 3.5.
15521 // The exact type of values will depend on the type of parameter in BazTest.
15523 // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
15525 // Currently, Values() supports from 1 to 50 parameters.
15527 template <typename T1>
15528 internal::ValueArray1<T1> Values(T1 v1) {
15529 return internal::ValueArray1<T1>(v1);
15532 template <typename T1, typename T2>
15533 internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
15534 return internal::ValueArray2<T1, T2>(v1, v2);
15537 template <typename T1, typename T2, typename T3>
15538 internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
15539 return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
15542 template <typename T1, typename T2, typename T3, typename T4>
15543 internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
15544 return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
15547 template <typename T1, typename T2, typename T3, typename T4, typename T5>
15548 internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
15550 return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
15553 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15555 internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
15556 T4 v4, T5 v5, T6 v6) {
15557 return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
15560 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15561 typename T6, typename T7>
15562 internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
15563 T4 v4, T5 v5, T6 v6, T7 v7) {
15564 return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
15568 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15569 typename T6, typename T7, typename T8>
15570 internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
15571 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
15572 return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
15576 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15577 typename T6, typename T7, typename T8, typename T9>
15578 internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
15579 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
15580 return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
15581 v4, v5, v6, v7, v8, v9);
15584 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15585 typename T6, typename T7, typename T8, typename T9, typename T10>
15586 internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
15587 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
15588 return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
15589 v2, v3, v4, v5, v6, v7, v8, v9, v10);
15592 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15593 typename T6, typename T7, typename T8, typename T9, typename T10,
15595 internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
15596 T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15597 T10 v10, T11 v11) {
15598 return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
15599 T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
15602 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15603 typename T6, typename T7, typename T8, typename T9, typename T10,
15604 typename T11, typename T12>
15605 internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15606 T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15607 T10 v10, T11 v11, T12 v12) {
15608 return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15609 T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
15612 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15613 typename T6, typename T7, typename T8, typename T9, typename T10,
15614 typename T11, typename T12, typename T13>
15615 internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
15616 T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15617 T10 v10, T11 v11, T12 v12, T13 v13) {
15618 return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15619 T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
15622 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15623 typename T6, typename T7, typename T8, typename T9, typename T10,
15624 typename T11, typename T12, typename T13, typename T14>
15625 internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15626 T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15627 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
15628 return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15629 T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
15633 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15634 typename T6, typename T7, typename T8, typename T9, typename T10,
15635 typename T11, typename T12, typename T13, typename T14, typename T15>
15636 internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15637 T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
15638 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
15639 return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15640 T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
15644 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15645 typename T6, typename T7, typename T8, typename T9, typename T10,
15646 typename T11, typename T12, typename T13, typename T14, typename T15,
15648 internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15649 T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
15650 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
15652 return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15653 T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
15654 v12, v13, v14, v15, v16);
15657 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15658 typename T6, typename T7, typename T8, typename T9, typename T10,
15659 typename T11, typename T12, typename T13, typename T14, typename T15,
15660 typename T16, typename T17>
15661 internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15662 T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
15663 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
15664 T16 v16, T17 v17) {
15665 return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15666 T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
15667 v11, v12, v13, v14, v15, v16, v17);
15670 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15671 typename T6, typename T7, typename T8, typename T9, typename T10,
15672 typename T11, typename T12, typename T13, typename T14, typename T15,
15673 typename T16, typename T17, typename T18>
15674 internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15675 T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
15676 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
15677 T16 v16, T17 v17, T18 v18) {
15678 return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15679 T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
15680 v10, v11, v12, v13, v14, v15, v16, v17, v18);
15683 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15684 typename T6, typename T7, typename T8, typename T9, typename T10,
15685 typename T11, typename T12, typename T13, typename T14, typename T15,
15686 typename T16, typename T17, typename T18, typename T19>
15687 internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15688 T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
15689 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
15690 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
15691 return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15692 T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
15693 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
15696 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15697 typename T6, typename T7, typename T8, typename T9, typename T10,
15698 typename T11, typename T12, typename T13, typename T14, typename T15,
15699 typename T16, typename T17, typename T18, typename T19, typename T20>
15700 internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15701 T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
15702 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
15703 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
15704 return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15705 T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
15706 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
15709 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15710 typename T6, typename T7, typename T8, typename T9, typename T10,
15711 typename T11, typename T12, typename T13, typename T14, typename T15,
15712 typename T16, typename T17, typename T18, typename T19, typename T20,
15714 internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15715 T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
15716 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
15717 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
15718 return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15719 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
15720 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
15723 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15724 typename T6, typename T7, typename T8, typename T9, typename T10,
15725 typename T11, typename T12, typename T13, typename T14, typename T15,
15726 typename T16, typename T17, typename T18, typename T19, typename T20,
15727 typename T21, typename T22>
15728 internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15729 T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
15730 T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
15731 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
15732 T21 v21, T22 v22) {
15733 return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15734 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
15735 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
15739 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15740 typename T6, typename T7, typename T8, typename T9, typename T10,
15741 typename T11, typename T12, typename T13, typename T14, typename T15,
15742 typename T16, typename T17, typename T18, typename T19, typename T20,
15743 typename T21, typename T22, typename T23>
15744 internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15745 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
15746 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
15747 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
15748 T21 v21, T22 v22, T23 v23) {
15749 return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15750 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
15751 v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
15752 v20, v21, v22, v23);
15755 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15756 typename T6, typename T7, typename T8, typename T9, typename T10,
15757 typename T11, typename T12, typename T13, typename T14, typename T15,
15758 typename T16, typename T17, typename T18, typename T19, typename T20,
15759 typename T21, typename T22, typename T23, typename T24>
15760 internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15761 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
15762 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
15763 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
15764 T21 v21, T22 v22, T23 v23, T24 v24) {
15765 return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15766 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
15767 v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
15768 v19, v20, v21, v22, v23, v24);
15771 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15772 typename T6, typename T7, typename T8, typename T9, typename T10,
15773 typename T11, typename T12, typename T13, typename T14, typename T15,
15774 typename T16, typename T17, typename T18, typename T19, typename T20,
15775 typename T21, typename T22, typename T23, typename T24, typename T25>
15776 internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15777 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
15778 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
15779 T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
15780 T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
15781 return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15782 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
15783 v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
15784 v18, v19, v20, v21, v22, v23, v24, v25);
15787 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15788 typename T6, typename T7, typename T8, typename T9, typename T10,
15789 typename T11, typename T12, typename T13, typename T14, typename T15,
15790 typename T16, typename T17, typename T18, typename T19, typename T20,
15791 typename T21, typename T22, typename T23, typename T24, typename T25,
15793 internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15794 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
15795 T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15796 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
15797 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
15799 return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15800 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
15801 T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
15802 v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
15805 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15806 typename T6, typename T7, typename T8, typename T9, typename T10,
15807 typename T11, typename T12, typename T13, typename T14, typename T15,
15808 typename T16, typename T17, typename T18, typename T19, typename T20,
15809 typename T21, typename T22, typename T23, typename T24, typename T25,
15810 typename T26, typename T27>
15811 internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15812 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
15813 T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15814 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
15815 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
15816 T26 v26, T27 v27) {
15817 return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15818 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
15819 T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
15820 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
15823 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15824 typename T6, typename T7, typename T8, typename T9, typename T10,
15825 typename T11, typename T12, typename T13, typename T14, typename T15,
15826 typename T16, typename T17, typename T18, typename T19, typename T20,
15827 typename T21, typename T22, typename T23, typename T24, typename T25,
15828 typename T26, typename T27, typename T28>
15829 internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15830 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
15831 T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15832 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
15833 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
15834 T26 v26, T27 v27, T28 v28) {
15835 return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15836 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
15837 T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
15838 v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
15842 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15843 typename T6, typename T7, typename T8, typename T9, typename T10,
15844 typename T11, typename T12, typename T13, typename T14, typename T15,
15845 typename T16, typename T17, typename T18, typename T19, typename T20,
15846 typename T21, typename T22, typename T23, typename T24, typename T25,
15847 typename T26, typename T27, typename T28, typename T29>
15848 internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15849 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
15850 T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15851 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
15852 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
15853 T26 v26, T27 v27, T28 v28, T29 v29) {
15854 return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15855 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
15856 T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
15857 v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
15861 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15862 typename T6, typename T7, typename T8, typename T9, typename T10,
15863 typename T11, typename T12, typename T13, typename T14, typename T15,
15864 typename T16, typename T17, typename T18, typename T19, typename T20,
15865 typename T21, typename T22, typename T23, typename T24, typename T25,
15866 typename T26, typename T27, typename T28, typename T29, typename T30>
15867 internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15868 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
15869 T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
15870 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
15871 T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
15872 T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
15873 return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15874 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
15875 T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
15876 v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
15877 v26, v27, v28, v29, v30);
15880 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15881 typename T6, typename T7, typename T8, typename T9, typename T10,
15882 typename T11, typename T12, typename T13, typename T14, typename T15,
15883 typename T16, typename T17, typename T18, typename T19, typename T20,
15884 typename T21, typename T22, typename T23, typename T24, typename T25,
15885 typename T26, typename T27, typename T28, typename T29, typename T30,
15887 internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15888 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
15889 T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
15890 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
15891 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
15892 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
15893 return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15894 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
15895 T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
15896 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
15897 v25, v26, v27, v28, v29, v30, v31);
15900 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15901 typename T6, typename T7, typename T8, typename T9, typename T10,
15902 typename T11, typename T12, typename T13, typename T14, typename T15,
15903 typename T16, typename T17, typename T18, typename T19, typename T20,
15904 typename T21, typename T22, typename T23, typename T24, typename T25,
15905 typename T26, typename T27, typename T28, typename T29, typename T30,
15906 typename T31, typename T32>
15907 internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15908 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
15909 T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
15910 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
15911 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
15912 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
15914 return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15915 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
15916 T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
15917 v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
15918 v24, v25, v26, v27, v28, v29, v30, v31, v32);
15921 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15922 typename T6, typename T7, typename T8, typename T9, typename T10,
15923 typename T11, typename T12, typename T13, typename T14, typename T15,
15924 typename T16, typename T17, typename T18, typename T19, typename T20,
15925 typename T21, typename T22, typename T23, typename T24, typename T25,
15926 typename T26, typename T27, typename T28, typename T29, typename T30,
15927 typename T31, typename T32, typename T33>
15928 internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15929 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
15930 T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
15931 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
15932 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
15933 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
15934 T32 v32, T33 v33) {
15935 return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15936 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
15937 T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
15938 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
15939 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
15942 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15943 typename T6, typename T7, typename T8, typename T9, typename T10,
15944 typename T11, typename T12, typename T13, typename T14, typename T15,
15945 typename T16, typename T17, typename T18, typename T19, typename T20,
15946 typename T21, typename T22, typename T23, typename T24, typename T25,
15947 typename T26, typename T27, typename T28, typename T29, typename T30,
15948 typename T31, typename T32, typename T33, typename T34>
15949 internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15950 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
15951 T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
15952 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
15953 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
15954 T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
15955 T31 v31, T32 v32, T33 v33, T34 v34) {
15956 return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15957 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
15958 T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
15959 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
15960 v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
15963 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15964 typename T6, typename T7, typename T8, typename T9, typename T10,
15965 typename T11, typename T12, typename T13, typename T14, typename T15,
15966 typename T16, typename T17, typename T18, typename T19, typename T20,
15967 typename T21, typename T22, typename T23, typename T24, typename T25,
15968 typename T26, typename T27, typename T28, typename T29, typename T30,
15969 typename T31, typename T32, typename T33, typename T34, typename T35>
15970 internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15971 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
15972 T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
15973 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
15974 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
15975 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
15976 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
15977 return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15978 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
15979 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
15980 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
15981 v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
15984 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15985 typename T6, typename T7, typename T8, typename T9, typename T10,
15986 typename T11, typename T12, typename T13, typename T14, typename T15,
15987 typename T16, typename T17, typename T18, typename T19, typename T20,
15988 typename T21, typename T22, typename T23, typename T24, typename T25,
15989 typename T26, typename T27, typename T28, typename T29, typename T30,
15990 typename T31, typename T32, typename T33, typename T34, typename T35,
15992 internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
15993 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
15994 T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
15995 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
15996 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
15997 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
15998 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
15999 return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16000 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16001 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
16002 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16003 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16007 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16008 typename T6, typename T7, typename T8, typename T9, typename T10,
16009 typename T11, typename T12, typename T13, typename T14, typename T15,
16010 typename T16, typename T17, typename T18, typename T19, typename T20,
16011 typename T21, typename T22, typename T23, typename T24, typename T25,
16012 typename T26, typename T27, typename T28, typename T29, typename T30,
16013 typename T31, typename T32, typename T33, typename T34, typename T35,
16014 typename T36, typename T37>
16015 internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16016 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16017 T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
16018 T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16019 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16020 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16021 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16023 return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16024 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16025 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
16026 v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16027 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16028 v34, v35, v36, v37);
16031 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16032 typename T6, typename T7, typename T8, typename T9, typename T10,
16033 typename T11, typename T12, typename T13, typename T14, typename T15,
16034 typename T16, typename T17, typename T18, typename T19, typename T20,
16035 typename T21, typename T22, typename T23, typename T24, typename T25,
16036 typename T26, typename T27, typename T28, typename T29, typename T30,
16037 typename T31, typename T32, typename T33, typename T34, typename T35,
16038 typename T36, typename T37, typename T38>
16039 internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16040 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16041 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
16042 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16043 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16044 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16045 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16046 T37 v37, T38 v38) {
16047 return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16048 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16049 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
16050 v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
16051 v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
16052 v33, v34, v35, v36, v37, v38);
16055 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16056 typename T6, typename T7, typename T8, typename T9, typename T10,
16057 typename T11, typename T12, typename T13, typename T14, typename T15,
16058 typename T16, typename T17, typename T18, typename T19, typename T20,
16059 typename T21, typename T22, typename T23, typename T24, typename T25,
16060 typename T26, typename T27, typename T28, typename T29, typename T30,
16061 typename T31, typename T32, typename T33, typename T34, typename T35,
16062 typename T36, typename T37, typename T38, typename T39>
16063 internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16064 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16065 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
16066 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16067 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16068 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16069 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16070 T37 v37, T38 v38, T39 v39) {
16071 return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16072 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16073 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
16074 v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
16075 v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
16076 v32, v33, v34, v35, v36, v37, v38, v39);
16079 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16080 typename T6, typename T7, typename T8, typename T9, typename T10,
16081 typename T11, typename T12, typename T13, typename T14, typename T15,
16082 typename T16, typename T17, typename T18, typename T19, typename T20,
16083 typename T21, typename T22, typename T23, typename T24, typename T25,
16084 typename T26, typename T27, typename T28, typename T29, typename T30,
16085 typename T31, typename T32, typename T33, typename T34, typename T35,
16086 typename T36, typename T37, typename T38, typename T39, typename T40>
16087 internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16088 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16089 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
16090 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
16091 T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
16092 T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
16093 T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
16094 T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
16095 return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16096 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16097 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16098 T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
16099 v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
16100 v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
16103 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16104 typename T6, typename T7, typename T8, typename T9, typename T10,
16105 typename T11, typename T12, typename T13, typename T14, typename T15,
16106 typename T16, typename T17, typename T18, typename T19, typename T20,
16107 typename T21, typename T22, typename T23, typename T24, typename T25,
16108 typename T26, typename T27, typename T28, typename T29, typename T30,
16109 typename T31, typename T32, typename T33, typename T34, typename T35,
16110 typename T36, typename T37, typename T38, typename T39, typename T40,
16112 internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16113 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16114 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
16115 T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16116 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16117 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16118 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16119 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
16120 return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16121 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16122 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16123 T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
16124 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
16125 v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
16128 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16129 typename T6, typename T7, typename T8, typename T9, typename T10,
16130 typename T11, typename T12, typename T13, typename T14, typename T15,
16131 typename T16, typename T17, typename T18, typename T19, typename T20,
16132 typename T21, typename T22, typename T23, typename T24, typename T25,
16133 typename T26, typename T27, typename T28, typename T29, typename T30,
16134 typename T31, typename T32, typename T33, typename T34, typename T35,
16135 typename T36, typename T37, typename T38, typename T39, typename T40,
16136 typename T41, typename T42>
16137 internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16138 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16139 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
16140 T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16141 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16142 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16143 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16144 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16146 return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16147 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16148 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16149 T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16150 v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
16151 v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
16155 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16156 typename T6, typename T7, typename T8, typename T9, typename T10,
16157 typename T11, typename T12, typename T13, typename T14, typename T15,
16158 typename T16, typename T17, typename T18, typename T19, typename T20,
16159 typename T21, typename T22, typename T23, typename T24, typename T25,
16160 typename T26, typename T27, typename T28, typename T29, typename T30,
16161 typename T31, typename T32, typename T33, typename T34, typename T35,
16162 typename T36, typename T37, typename T38, typename T39, typename T40,
16163 typename T41, typename T42, typename T43>
16164 internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16165 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16166 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
16167 T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16168 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16169 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16170 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16171 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16172 T42 v42, T43 v43) {
16173 return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16174 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16175 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16176 T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16177 v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
16178 v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
16182 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16183 typename T6, typename T7, typename T8, typename T9, typename T10,
16184 typename T11, typename T12, typename T13, typename T14, typename T15,
16185 typename T16, typename T17, typename T18, typename T19, typename T20,
16186 typename T21, typename T22, typename T23, typename T24, typename T25,
16187 typename T26, typename T27, typename T28, typename T29, typename T30,
16188 typename T31, typename T32, typename T33, typename T34, typename T35,
16189 typename T36, typename T37, typename T38, typename T39, typename T40,
16190 typename T41, typename T42, typename T43, typename T44>
16191 internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16192 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16193 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16194 T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16195 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16196 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16197 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16198 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16199 T42 v42, T43 v43, T44 v44) {
16200 return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16201 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16202 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16203 T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16204 v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
16205 v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
16206 v40, v41, v42, v43, v44);
16209 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16210 typename T6, typename T7, typename T8, typename T9, typename T10,
16211 typename T11, typename T12, typename T13, typename T14, typename T15,
16212 typename T16, typename T17, typename T18, typename T19, typename T20,
16213 typename T21, typename T22, typename T23, typename T24, typename T25,
16214 typename T26, typename T27, typename T28, typename T29, typename T30,
16215 typename T31, typename T32, typename T33, typename T34, typename T35,
16216 typename T36, typename T37, typename T38, typename T39, typename T40,
16217 typename T41, typename T42, typename T43, typename T44, typename T45>
16218 internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16219 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16220 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16221 T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16222 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
16223 T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
16224 T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
16225 T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
16226 T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
16227 return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16228 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16229 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16230 T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16231 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
16232 v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
16233 v39, v40, v41, v42, v43, v44, v45);
16236 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16237 typename T6, typename T7, typename T8, typename T9, typename T10,
16238 typename T11, typename T12, typename T13, typename T14, typename T15,
16239 typename T16, typename T17, typename T18, typename T19, typename T20,
16240 typename T21, typename T22, typename T23, typename T24, typename T25,
16241 typename T26, typename T27, typename T28, typename T29, typename T30,
16242 typename T31, typename T32, typename T33, typename T34, typename T35,
16243 typename T36, typename T37, typename T38, typename T39, typename T40,
16244 typename T41, typename T42, typename T43, typename T44, typename T45,
16246 internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16247 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16248 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16249 T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16250 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16251 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16252 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16253 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16254 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
16255 return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16256 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16257 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16258 T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16259 v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16260 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
16261 v38, v39, v40, v41, v42, v43, v44, v45, v46);
16264 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16265 typename T6, typename T7, typename T8, typename T9, typename T10,
16266 typename T11, typename T12, typename T13, typename T14, typename T15,
16267 typename T16, typename T17, typename T18, typename T19, typename T20,
16268 typename T21, typename T22, typename T23, typename T24, typename T25,
16269 typename T26, typename T27, typename T28, typename T29, typename T30,
16270 typename T31, typename T32, typename T33, typename T34, typename T35,
16271 typename T36, typename T37, typename T38, typename T39, typename T40,
16272 typename T41, typename T42, typename T43, typename T44, typename T45,
16273 typename T46, typename T47>
16274 internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16275 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16276 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16277 T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16278 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16279 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16280 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16281 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16282 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
16283 return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16284 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16285 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16286 T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
16287 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16288 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
16289 v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
16292 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16293 typename T6, typename T7, typename T8, typename T9, typename T10,
16294 typename T11, typename T12, typename T13, typename T14, typename T15,
16295 typename T16, typename T17, typename T18, typename T19, typename T20,
16296 typename T21, typename T22, typename T23, typename T24, typename T25,
16297 typename T26, typename T27, typename T28, typename T29, typename T30,
16298 typename T31, typename T32, typename T33, typename T34, typename T35,
16299 typename T36, typename T37, typename T38, typename T39, typename T40,
16300 typename T41, typename T42, typename T43, typename T44, typename T45,
16301 typename T46, typename T47, typename T48>
16302 internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16303 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16304 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16305 T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16306 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16307 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16308 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16309 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16310 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
16312 return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16313 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16314 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16315 T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
16316 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
16317 v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
16318 v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
16321 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16322 typename T6, typename T7, typename T8, typename T9, typename T10,
16323 typename T11, typename T12, typename T13, typename T14, typename T15,
16324 typename T16, typename T17, typename T18, typename T19, typename T20,
16325 typename T21, typename T22, typename T23, typename T24, typename T25,
16326 typename T26, typename T27, typename T28, typename T29, typename T30,
16327 typename T31, typename T32, typename T33, typename T34, typename T35,
16328 typename T36, typename T37, typename T38, typename T39, typename T40,
16329 typename T41, typename T42, typename T43, typename T44, typename T45,
16330 typename T46, typename T47, typename T48, typename T49>
16331 internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16332 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16333 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16334 T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16335 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16336 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
16337 T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
16338 T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
16339 T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
16340 T47 v47, T48 v48, T49 v49) {
16341 return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16342 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16343 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16344 T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
16345 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
16346 v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
16347 v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
16350 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16351 typename T6, typename T7, typename T8, typename T9, typename T10,
16352 typename T11, typename T12, typename T13, typename T14, typename T15,
16353 typename T16, typename T17, typename T18, typename T19, typename T20,
16354 typename T21, typename T22, typename T23, typename T24, typename T25,
16355 typename T26, typename T27, typename T28, typename T29, typename T30,
16356 typename T31, typename T32, typename T33, typename T34, typename T35,
16357 typename T36, typename T37, typename T38, typename T39, typename T40,
16358 typename T41, typename T42, typename T43, typename T44, typename T45,
16359 typename T46, typename T47, typename T48, typename T49, typename T50>
16360 internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16361 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16362 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16363 T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16364 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16365 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16366 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16367 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
16368 T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
16369 T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
16370 return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16371 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16372 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16373 T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
16374 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16375 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16376 v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
16380 // Bool() allows generating tests with parameters in a set of (false, true).
16384 // - returns a generator producing sequences with elements {false, true}.
16386 // It is useful when testing code that depends on Boolean flags. Combinations
16387 // of multiple flags can be tested when several Bool()'s are combined using
16388 // Combine() function.
16390 // In the following example all tests in the test case FlagDependentTest
16391 // will be instantiated twice with parameters false and true.
16393 // class FlagDependentTest : public testing::TestWithParam<bool> {
16394 // virtual void SetUp() {
16395 // external_flag = GetParam();
16398 // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
16400 inline internal::ParamGenerator<bool> Bool() {
16401 return Values(false, true);
16404 # if GTEST_HAS_COMBINE
16405 // Combine() allows the user to combine two or more sequences to produce
16406 // values of a Cartesian product of those sequences' elements.
16409 // Combine(gen1, gen2, ..., genN)
16410 // - returns a generator producing sequences with elements coming from
16411 // the Cartesian product of elements from the sequences generated by
16412 // gen1, gen2, ..., genN. The sequence elements will have a type of
16413 // tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
16414 // of elements from sequences produces by gen1, gen2, ..., genN.
16416 // Combine can have up to 10 arguments. This number is currently limited
16417 // by the maximum number of elements in the tuple implementation used by Google
16422 // This will instantiate tests in test case AnimalTest each one with
16423 // the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
16424 // tuple("dog", BLACK), and tuple("dog", WHITE):
16426 // enum Color { BLACK, GRAY, WHITE };
16427 // class AnimalTest
16428 // : public testing::TestWithParam<tuple<const char*, Color> > {...};
16430 // TEST_P(AnimalTest, AnimalLooksNice) {...}
16432 // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
16433 // Combine(Values("cat", "dog"),
16434 // Values(BLACK, WHITE)));
16436 // This will instantiate tests in FlagDependentTest with all variations of two
16439 // class FlagDependentTest
16440 // : public testing::TestWithParam<tuple(bool, bool)> > {
16441 // virtual void SetUp() {
16442 // // Assigns external_flag_1 and external_flag_2 values from the tuple.
16443 // tie(external_flag_1, external_flag_2) = GetParam();
16447 // TEST_P(FlagDependentTest, TestFeature1) {
16448 // // Test your code using external_flag_1 and external_flag_2 here.
16450 // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
16451 // Combine(Bool(), Bool()));
16453 template <typename Generator1, typename Generator2>
16454 internal::CartesianProductHolder2<Generator1, Generator2> Combine(
16455 const Generator1& g1, const Generator2& g2) {
16456 return internal::CartesianProductHolder2<Generator1, Generator2>(
16460 template <typename Generator1, typename Generator2, typename Generator3>
16461 internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
16462 const Generator1& g1, const Generator2& g2, const Generator3& g3) {
16463 return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
16467 template <typename Generator1, typename Generator2, typename Generator3,
16468 typename Generator4>
16469 internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
16470 Generator4> Combine(
16471 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16472 const Generator4& g4) {
16473 return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
16478 template <typename Generator1, typename Generator2, typename Generator3,
16479 typename Generator4, typename Generator5>
16480 internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
16481 Generator4, Generator5> Combine(
16482 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16483 const Generator4& g4, const Generator5& g5) {
16484 return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
16485 Generator4, Generator5>(
16486 g1, g2, g3, g4, g5);
16489 template <typename Generator1, typename Generator2, typename Generator3,
16490 typename Generator4, typename Generator5, typename Generator6>
16491 internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
16492 Generator4, Generator5, Generator6> Combine(
16493 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16494 const Generator4& g4, const Generator5& g5, const Generator6& g6) {
16495 return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
16496 Generator4, Generator5, Generator6>(
16497 g1, g2, g3, g4, g5, g6);
16500 template <typename Generator1, typename Generator2, typename Generator3,
16501 typename Generator4, typename Generator5, typename Generator6,
16502 typename Generator7>
16503 internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
16504 Generator4, Generator5, Generator6, Generator7> Combine(
16505 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16506 const Generator4& g4, const Generator5& g5, const Generator6& g6,
16507 const Generator7& g7) {
16508 return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
16509 Generator4, Generator5, Generator6, Generator7>(
16510 g1, g2, g3, g4, g5, g6, g7);
16513 template <typename Generator1, typename Generator2, typename Generator3,
16514 typename Generator4, typename Generator5, typename Generator6,
16515 typename Generator7, typename Generator8>
16516 internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
16517 Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
16518 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16519 const Generator4& g4, const Generator5& g5, const Generator6& g6,
16520 const Generator7& g7, const Generator8& g8) {
16521 return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
16522 Generator4, Generator5, Generator6, Generator7, Generator8>(
16523 g1, g2, g3, g4, g5, g6, g7, g8);
16526 template <typename Generator1, typename Generator2, typename Generator3,
16527 typename Generator4, typename Generator5, typename Generator6,
16528 typename Generator7, typename Generator8, typename Generator9>
16529 internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
16530 Generator4, Generator5, Generator6, Generator7, Generator8,
16531 Generator9> Combine(
16532 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16533 const Generator4& g4, const Generator5& g5, const Generator6& g6,
16534 const Generator7& g7, const Generator8& g8, const Generator9& g9) {
16535 return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
16536 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
16537 g1, g2, g3, g4, g5, g6, g7, g8, g9);
16540 template <typename Generator1, typename Generator2, typename Generator3,
16541 typename Generator4, typename Generator5, typename Generator6,
16542 typename Generator7, typename Generator8, typename Generator9,
16543 typename Generator10>
16544 internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
16545 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
16546 Generator10> Combine(
16547 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16548 const Generator4& g4, const Generator5& g5, const Generator6& g6,
16549 const Generator7& g7, const Generator8& g8, const Generator9& g9,
16550 const Generator10& g10) {
16551 return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
16552 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
16554 g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
16556 # endif // GTEST_HAS_COMBINE
16560 # define TEST_P(test_case_name, test_name) \
16561 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
16562 : public test_case_name { \
16564 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
16565 virtual void TestBody(); \
16567 static int AddToRegistry() { \
16568 ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
16569 GetTestCasePatternHolder<test_case_name>(\
16570 #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
16573 new ::testing::internal::TestMetaFactory< \
16574 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
16577 static int gtest_registering_dummy_; \
16578 GTEST_DISALLOW_COPY_AND_ASSIGN_(\
16579 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
16581 int GTEST_TEST_CLASS_NAME_(test_case_name, \
16582 test_name)::gtest_registering_dummy_ = \
16583 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
16584 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
16586 # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
16587 ::testing::internal::ParamGenerator<test_case_name::ParamType> \
16588 gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
16589 int gtest_##prefix##test_case_name##_dummy_ = \
16590 ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
16591 GetTestCasePatternHolder<test_case_name>(\
16592 #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
16594 >est_##prefix##test_case_name##_EvalGenerator_, \
16595 __FILE__, __LINE__)
16597 } // namespace testing
16599 #endif // GTEST_HAS_PARAM_TEST
16601 #endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
16602 // Copyright 2006, Google Inc.
16603 // All rights reserved.
16605 // Redistribution and use in source and binary forms, with or without
16606 // modification, are permitted provided that the following conditions are
16609 // * Redistributions of source code must retain the above copyright
16610 // notice, this list of conditions and the following disclaimer.
16611 // * Redistributions in binary form must reproduce the above
16612 // copyright notice, this list of conditions and the following disclaimer
16613 // in the documentation and/or other materials provided with the
16615 // * Neither the name of Google Inc. nor the names of its
16616 // contributors may be used to endorse or promote products derived from
16617 // this software without specific prior written permission.
16619 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16620 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16621 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
16622 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
16623 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
16624 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16625 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
16626 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
16627 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
16628 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
16629 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16631 // Author: wan@google.com (Zhanyong Wan)
16633 // Google C++ Testing Framework definitions useful in production code.
16635 #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
16636 #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
16638 // When you need to test the private or protected members of a class,
16639 // use the FRIEND_TEST macro to declare your tests as friends of the
16640 // class. For example:
16644 // void MyMethod();
16645 // FRIEND_TEST(MyClassTest, MyMethod);
16648 // class MyClassTest : public testing::Test {
16652 // TEST_F(MyClassTest, MyMethod) {
16653 // // Can call MyClass::MyMethod() here.
16656 #define FRIEND_TEST(test_case_name, test_name)\
16657 friend class test_case_name##_##test_name##_Test
16659 #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
16660 // Copyright 2008, Google Inc.
16661 // All rights reserved.
16663 // Redistribution and use in source and binary forms, with or without
16664 // modification, are permitted provided that the following conditions are
16667 // * Redistributions of source code must retain the above copyright
16668 // notice, this list of conditions and the following disclaimer.
16669 // * Redistributions in binary form must reproduce the above
16670 // copyright notice, this list of conditions and the following disclaimer
16671 // in the documentation and/or other materials provided with the
16673 // * Neither the name of Google Inc. nor the names of its
16674 // contributors may be used to endorse or promote products derived from
16675 // this software without specific prior written permission.
16677 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16678 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16679 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
16680 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
16681 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
16682 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16683 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
16684 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
16685 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
16686 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
16687 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16689 // Author: mheule@google.com (Markus Heule)
16692 #ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
16693 #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
16698 namespace testing {
16700 // A copyable object representing the result of a test part (i.e. an
16701 // assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
16703 // Don't inherit from TestPartResult as its destructor is not virtual.
16704 class GTEST_API_ TestPartResult {
16706 // The possible outcomes of a test part (i.e. an assertion or an
16707 // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
16709 kSuccess, // Succeeded.
16710 kNonFatalFailure, // Failed but the test can continue.
16711 kFatalFailure // Failed and the test should be terminated.
16714 // C'tor. TestPartResult does NOT have a default constructor.
16715 // Always use this constructor (with parameters) to create a
16716 // TestPartResult object.
16717 TestPartResult(Type a_type,
16718 const char* a_file_name,
16720 const char* a_message)
16722 file_name_(a_file_name),
16723 line_number_(a_line_number),
16724 summary_(ExtractSummary(a_message)),
16725 message_(a_message) {
16728 // Gets the outcome of the test part.
16729 Type type() const { return type_; }
16731 // Gets the name of the source file where the test part took place, or
16732 // NULL if it's unknown.
16733 const char* file_name() const { return file_name_.c_str(); }
16735 // Gets the line in the source file where the test part took place,
16736 // or -1 if it's unknown.
16737 int line_number() const { return line_number_; }
16739 // Gets the summary of the failure message.
16740 const char* summary() const { return summary_.c_str(); }
16742 // Gets the message associated with the test part.
16743 const char* message() const { return message_.c_str(); }
16745 // Returns true iff the test part passed.
16746 bool passed() const { return type_ == kSuccess; }
16748 // Returns true iff the test part failed.
16749 bool failed() const { return type_ != kSuccess; }
16751 // Returns true iff the test part non-fatally failed.
16752 bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
16754 // Returns true iff the test part fatally failed.
16755 bool fatally_failed() const { return type_ == kFatalFailure; }
16759 // Gets the summary of the failure message by omitting the stack
16761 static internal::String ExtractSummary(const char* message);
16763 // The name of the source file where the test part took place, or
16764 // NULL if the source file is unknown.
16765 internal::String file_name_;
16766 // The line in the source file where the test part took place, or -1
16767 // if the line number is unknown.
16769 internal::String summary_; // The test failure summary.
16770 internal::String message_; // The test failure message.
16773 // Prints a TestPartResult object.
16774 std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
16776 // An array of TestPartResult objects.
16778 // Don't inherit from TestPartResultArray as its destructor is not
16780 class GTEST_API_ TestPartResultArray {
16782 TestPartResultArray() {}
16784 // Appends the given TestPartResult to the array.
16785 void Append(const TestPartResult& result);
16787 // Returns the TestPartResult at the given index (0-based).
16788 const TestPartResult& GetTestPartResult(int index) const;
16790 // Returns the number of TestPartResult objects in the array.
16794 std::vector<TestPartResult> array_;
16796 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
16799 // This interface knows how to report a test part result.
16800 class TestPartResultReporterInterface {
16802 virtual ~TestPartResultReporterInterface() {}
16804 virtual void ReportTestPartResult(const TestPartResult& result) = 0;
16807 namespace internal {
16809 // This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
16810 // statement generates new fatal failures. To do so it registers itself as the
16811 // current test part result reporter. Besides checking if fatal failures were
16812 // reported, it only delegates the reporting to the former result reporter.
16813 // The original result reporter is restored in the destructor.
16814 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
16815 class GTEST_API_ HasNewFatalFailureHelper
16816 : public TestPartResultReporterInterface {
16818 HasNewFatalFailureHelper();
16819 virtual ~HasNewFatalFailureHelper();
16820 virtual void ReportTestPartResult(const TestPartResult& result);
16821 bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
16823 bool has_new_fatal_failure_;
16824 TestPartResultReporterInterface* original_reporter_;
16826 GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
16829 } // namespace internal
16831 } // namespace testing
16833 #endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
16834 // Copyright 2008 Google Inc.
16835 // All Rights Reserved.
16837 // Redistribution and use in source and binary forms, with or without
16838 // modification, are permitted provided that the following conditions are
16841 // * Redistributions of source code must retain the above copyright
16842 // notice, this list of conditions and the following disclaimer.
16843 // * Redistributions in binary form must reproduce the above
16844 // copyright notice, this list of conditions and the following disclaimer
16845 // in the documentation and/or other materials provided with the
16847 // * Neither the name of Google Inc. nor the names of its
16848 // contributors may be used to endorse or promote products derived from
16849 // this software without specific prior written permission.
16851 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16852 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16853 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
16854 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
16855 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
16856 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16857 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
16858 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
16859 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
16860 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
16861 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16863 // Author: wan@google.com (Zhanyong Wan)
16865 #ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
16866 #define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
16868 // This header implements typed tests and type-parameterized tests.
16870 // Typed (aka type-driven) tests repeat the same test for types in a
16871 // list. You must know which types you want to test with when writing
16872 // typed tests. Here's how you do it:
16876 // First, define a fixture class template. It should be parameterized
16877 // by a type. Remember to derive it from testing::Test.
16878 template <typename T>
16879 class FooTest : public testing::Test {
16882 typedef std::list<T> List;
16887 // Next, associate a list of types with the test case, which will be
16888 // repeated for each type in the list. The typedef is necessary for
16889 // the macro to parse correctly.
16890 typedef testing::Types<char, int, unsigned int> MyTypes;
16891 TYPED_TEST_CASE(FooTest, MyTypes);
16893 // If the type list contains only one type, you can write that type
16894 // directly without Types<...>:
16895 // TYPED_TEST_CASE(FooTest, int);
16897 // Then, use TYPED_TEST() instead of TEST_F() to define as many typed
16898 // tests for this test case as you want.
16899 TYPED_TEST(FooTest, DoesBlah) {
16900 // Inside a test, refer to TypeParam to get the type parameter.
16901 // Since we are inside a derived class template, C++ requires use to
16902 // visit the members of FooTest via 'this'.
16903 TypeParam n = this->value_;
16905 // To visit static members of the fixture, add the TestFixture::
16907 n += TestFixture::shared_;
16909 // To refer to typedefs in the fixture, add the "typename
16910 // TestFixture::" prefix.
16911 typename TestFixture::List values;
16912 values.push_back(n);
16916 TYPED_TEST(FooTest, HasPropertyA) { ... }
16920 // Type-parameterized tests are abstract test patterns parameterized
16921 // by a type. Compared with typed tests, type-parameterized tests
16922 // allow you to define the test pattern without knowing what the type
16923 // parameters are. The defined pattern can be instantiated with
16924 // different types any number of times, in any number of translation
16927 // If you are designing an interface or concept, you can define a
16928 // suite of type-parameterized tests to verify properties that any
16929 // valid implementation of the interface/concept should have. Then,
16930 // each implementation can easily instantiate the test suite to verify
16931 // that it conforms to the requirements, without having to write
16932 // similar tests repeatedly. Here's an example:
16936 // First, define a fixture class template. It should be parameterized
16937 // by a type. Remember to derive it from testing::Test.
16938 template <typename T>
16939 class FooTest : public testing::Test {
16943 // Next, declare that you will define a type-parameterized test case
16944 // (the _P suffix is for "parameterized" or "pattern", whichever you
16946 TYPED_TEST_CASE_P(FooTest);
16948 // Then, use TYPED_TEST_P() to define as many type-parameterized tests
16949 // for this type-parameterized test case as you want.
16950 TYPED_TEST_P(FooTest, DoesBlah) {
16951 // Inside a test, refer to TypeParam to get the type parameter.
16956 TYPED_TEST_P(FooTest, HasPropertyA) { ... }
16958 // Now the tricky part: you need to register all test patterns before
16959 // you can instantiate them. The first argument of the macro is the
16960 // test case name; the rest are the names of the tests in this test
16962 REGISTER_TYPED_TEST_CASE_P(FooTest,
16963 DoesBlah, HasPropertyA);
16965 // Finally, you are free to instantiate the pattern with the types you
16966 // want. If you put the above code in a header file, you can #include
16967 // it in multiple C++ source files and instantiate it multiple times.
16969 // To distinguish different instances of the pattern, the first
16970 // argument to the INSTANTIATE_* macro is a prefix that will be added
16971 // to the actual test case name. Remember to pick unique prefixes for
16972 // different instances.
16973 typedef testing::Types<char, int, unsigned int> MyTypes;
16974 INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
16976 // If the type list contains only one type, you can write that type
16977 // directly without Types<...>:
16978 // INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
16983 // Implements typed tests.
16985 #if GTEST_HAS_TYPED_TEST
16987 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
16989 // Expands to the name of the typedef for the type parameters of the
16990 // given test case.
16991 # define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
16993 // The 'Types' template argument below must have spaces around it
16994 // since some compilers may choke on '>>' when passing a template
16995 // instance (e.g. Types<int>)
16996 # define TYPED_TEST_CASE(CaseName, Types) \
16997 typedef ::testing::internal::TypeList< Types >::type \
16998 GTEST_TYPE_PARAMS_(CaseName)
17000 # define TYPED_TEST(CaseName, TestName) \
17001 template <typename gtest_TypeParam_> \
17002 class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
17003 : public CaseName<gtest_TypeParam_> { \
17005 typedef CaseName<gtest_TypeParam_> TestFixture; \
17006 typedef gtest_TypeParam_ TypeParam; \
17007 virtual void TestBody(); \
17009 bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
17010 ::testing::internal::TypeParameterizedTest< \
17012 ::testing::internal::TemplateSel< \
17013 GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
17014 GTEST_TYPE_PARAMS_(CaseName)>::Register(\
17015 "", #CaseName, #TestName, 0); \
17016 template <typename gtest_TypeParam_> \
17017 void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
17019 #endif // GTEST_HAS_TYPED_TEST
17021 // Implements type-parameterized tests.
17023 #if GTEST_HAS_TYPED_TEST_P
17025 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17027 // Expands to the namespace name that the type-parameterized tests for
17028 // the given type-parameterized test case are defined in. The exact
17029 // name of the namespace is subject to change without notice.
17030 # define GTEST_CASE_NAMESPACE_(TestCaseName) \
17031 gtest_case_##TestCaseName##_
17033 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17035 // Expands to the name of the variable used to remember the names of
17036 // the defined tests in the given test case.
17037 # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
17038 gtest_typed_test_case_p_state_##TestCaseName##_
17040 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
17042 // Expands to the name of the variable used to remember the names of
17043 // the registered tests in the given test case.
17044 # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
17045 gtest_registered_test_names_##TestCaseName##_
17047 // The variables defined in the type-parameterized test macros are
17048 // static as typically these macros are used in a .h file that can be
17049 // #included in multiple translation units linked together.
17050 # define TYPED_TEST_CASE_P(CaseName) \
17051 static ::testing::internal::TypedTestCasePState \
17052 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
17054 # define TYPED_TEST_P(CaseName, TestName) \
17055 namespace GTEST_CASE_NAMESPACE_(CaseName) { \
17056 template <typename gtest_TypeParam_> \
17057 class TestName : public CaseName<gtest_TypeParam_> { \
17059 typedef CaseName<gtest_TypeParam_> TestFixture; \
17060 typedef gtest_TypeParam_ TypeParam; \
17061 virtual void TestBody(); \
17063 static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
17064 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
17065 __FILE__, __LINE__, #CaseName, #TestName); \
17067 template <typename gtest_TypeParam_> \
17068 void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
17070 # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
17071 namespace GTEST_CASE_NAMESPACE_(CaseName) { \
17072 typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
17074 static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
17075 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
17076 __FILE__, __LINE__, #__VA_ARGS__)
17078 // The 'Types' template argument below must have spaces around it
17079 // since some compilers may choke on '>>' when passing a template
17080 // instance (e.g. Types<int>)
17081 # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
17082 bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
17083 ::testing::internal::TypeParameterizedTestCase<CaseName, \
17084 GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
17085 ::testing::internal::TypeList< Types >::type>::Register(\
17086 #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
17088 #endif // GTEST_HAS_TYPED_TEST_P
17090 #endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17092 // Depending on the platform, different string classes are available.
17093 // On Linux, in addition to ::std::string, Google also makes use of
17094 // class ::string, which has the same interface as ::std::string, but
17095 // has a different implementation.
17097 // The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
17098 // ::string is available AND is a distinct type to ::std::string, or
17099 // define it to 0 to indicate otherwise.
17101 // If the user's ::std::string and ::string are the same class due to
17102 // aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
17104 // If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
17107 namespace testing {
17109 // Declares the flags.
17111 // This flag temporary enables the disabled tests.
17112 GTEST_DECLARE_bool_(also_run_disabled_tests);
17114 // This flag brings the debugger on an assertion failure.
17115 GTEST_DECLARE_bool_(break_on_failure);
17117 // This flag controls whether Google Test catches all test-thrown exceptions
17118 // and logs them as failures.
17119 GTEST_DECLARE_bool_(catch_exceptions);
17121 // This flag enables using colors in terminal output. Available values are
17122 // "yes" to enable colors, "no" (disable colors), or "auto" (the default)
17123 // to let Google Test decide.
17124 GTEST_DECLARE_string_(color);
17126 // This flag sets up the filter to select by name using a glob pattern
17127 // the tests to run. If the filter is not given all tests are executed.
17128 GTEST_DECLARE_string_(filter);
17130 // This flag causes the Google Test to list tests. None of the tests listed
17131 // are actually run if the flag is provided.
17132 GTEST_DECLARE_bool_(list_tests);
17134 // This flag controls whether Google Test emits a detailed XML report to a file
17135 // in addition to its normal textual output.
17136 GTEST_DECLARE_string_(output);
17138 // This flags control whether Google Test prints the elapsed time for each
17140 GTEST_DECLARE_bool_(print_time);
17142 // This flag specifies the random number seed.
17143 GTEST_DECLARE_int32_(random_seed);
17145 // This flag sets how many times the tests are repeated. The default value
17146 // is 1. If the value is -1 the tests are repeating forever.
17147 GTEST_DECLARE_int32_(repeat);
17149 // This flag controls whether Google Test includes Google Test internal
17150 // stack frames in failure stack traces.
17151 GTEST_DECLARE_bool_(show_internal_stack_frames);
17153 // When this flag is specified, tests' order is randomized on every iteration.
17154 GTEST_DECLARE_bool_(shuffle);
17156 // This flag specifies the maximum number of stack frames to be
17157 // printed in a failure message.
17158 GTEST_DECLARE_int32_(stack_trace_depth);
17160 // When this flag is specified, a failed assertion will throw an
17161 // exception if exceptions are enabled, or exit the program with a
17162 // non-zero code otherwise.
17163 GTEST_DECLARE_bool_(throw_on_failure);
17165 // When this flag is set with a "host:port" string, on supported
17166 // platforms test results are streamed to the specified port on
17167 // the specified host machine.
17168 GTEST_DECLARE_string_(stream_result_to);
17170 // The upper limit for valid stack trace depths.
17171 const int kMaxStackTraceDepth = 100;
17173 namespace internal {
17175 class AssertHelper;
17176 class DefaultGlobalTestPartResultReporter;
17177 class ExecDeathTest;
17178 class NoExecDeathTest;
17179 class FinalSuccessChecker;
17180 class GTestFlagSaver;
17181 class TestResultAccessor;
17182 class TestEventListenersAccessor;
17183 class TestEventRepeater;
17184 class WindowsDeathTest;
17185 class UnitTestImpl* GetUnitTestImpl();
17186 void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
17187 const String& message);
17189 // Converts a streamable value to a String. A NULL pointer is
17190 // converted to "(null)". When the input value is a ::string,
17191 // ::std::string, ::wstring, or ::std::wstring object, each NUL
17192 // character in it is replaced with "\\0".
17193 // Declared in gtest-internal.h but defined here, so that it has access
17194 // to the definition of the Message class, required by the ARM
17196 template <typename T>
17197 String StreamableToString(const T& streamable) {
17198 return (Message() << streamable).GetString();
17201 } // namespace internal
17203 // The friend relationship of some of these classes is cyclic.
17204 // If we don't forward declare them the compiler might confuse the classes
17205 // in friendship clauses with same named classes on the scope.
17211 // A class for indicating whether an assertion was successful. When
17212 // the assertion wasn't successful, the AssertionResult object
17213 // remembers a non-empty message that describes how it failed.
17215 // To create an instance of this class, use one of the factory functions
17216 // (AssertionSuccess() and AssertionFailure()).
17218 // This class is useful for two purposes:
17219 // 1. Defining predicate functions to be used with Boolean test assertions
17220 // EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
17221 // 2. Defining predicate-format functions to be
17222 // used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
17224 // For example, if you define IsEven predicate:
17226 // testing::AssertionResult IsEven(int n) {
17227 // if ((n % 2) == 0)
17228 // return testing::AssertionSuccess();
17230 // return testing::AssertionFailure() << n << " is odd";
17233 // Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
17234 // will print the message
17236 // Value of: IsEven(Fib(5))
17237 // Actual: false (5 is odd)
17240 // instead of a more opaque
17242 // Value of: IsEven(Fib(5))
17246 // in case IsEven is a simple Boolean predicate.
17248 // If you expect your predicate to be reused and want to support informative
17249 // messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
17250 // about half as often as positive ones in our tests), supply messages for
17251 // both success and failure cases:
17253 // testing::AssertionResult IsEven(int n) {
17254 // if ((n % 2) == 0)
17255 // return testing::AssertionSuccess() << n << " is even";
17257 // return testing::AssertionFailure() << n << " is odd";
17260 // Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
17262 // Value of: IsEven(Fib(6))
17263 // Actual: true (8 is even)
17266 // NB: Predicates that support negative Boolean assertions have reduced
17267 // performance in positive ones so be careful not to use them in tests
17268 // that have lots (tens of thousands) of positive Boolean assertions.
17270 // To use this class with EXPECT_PRED_FORMAT assertions such as:
17272 // // Verifies that Foo() returns an even number.
17273 // EXPECT_PRED_FORMAT1(IsEven, Foo());
17275 // you need to define:
17277 // testing::AssertionResult IsEven(const char* expr, int n) {
17278 // if ((n % 2) == 0)
17279 // return testing::AssertionSuccess();
17281 // return testing::AssertionFailure()
17282 // << "Expected: " << expr << " is even\n Actual: it's " << n;
17285 // If Foo() returns 5, you will see the following message:
17287 // Expected: Foo() is even
17290 class GTEST_API_ AssertionResult {
17292 // Copy constructor.
17293 // Used in EXPECT_TRUE/FALSE(assertion_result).
17294 AssertionResult(const AssertionResult& other);
17295 // Used in the EXPECT_TRUE/FALSE(bool_expression).
17296 explicit AssertionResult(bool success) : success_(success) {}
17298 // Returns true iff the assertion succeeded.
17299 operator bool() const { return success_; } // NOLINT
17301 // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
17302 AssertionResult operator!() const;
17304 // Returns the text streamed into this AssertionResult. Test assertions
17305 // use it when they fail (i.e., the predicate's outcome doesn't match the
17306 // assertion's expectation). When nothing has been streamed into the
17307 // object, returns an empty string.
17308 const char* message() const {
17309 return message_.get() != NULL ? message_->c_str() : "";
17311 // TODO(vladl@google.com): Remove this after making sure no clients use it.
17312 // Deprecated; please use message() instead.
17313 const char* failure_message() const { return message(); }
17315 // Streams a custom failure message into this object.
17316 template <typename T> AssertionResult& operator<<(const T& value) {
17317 AppendMessage(Message() << value);
17321 // Allows streaming basic output manipulators such as endl or flush into
17323 AssertionResult& operator<<(
17324 ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
17325 AppendMessage(Message() << basic_manipulator);
17330 // Appends the contents of message to message_.
17331 void AppendMessage(const Message& a_message) {
17332 if (message_.get() == NULL)
17333 message_.reset(new ::std::string);
17334 message_->append(a_message.GetString().c_str());
17337 // Stores result of the assertion predicate.
17339 // Stores the message describing the condition in case the expectation
17340 // construct is not satisfied with the predicate's outcome.
17341 // Referenced via a pointer to avoid taking too much stack frame space
17342 // with test assertions.
17343 internal::scoped_ptr< ::std::string> message_;
17345 GTEST_DISALLOW_ASSIGN_(AssertionResult);
17348 // Makes a successful assertion result.
17349 GTEST_API_ AssertionResult AssertionSuccess();
17351 // Makes a failed assertion result.
17352 GTEST_API_ AssertionResult AssertionFailure();
17354 // Makes a failed assertion result with the given failure message.
17355 // Deprecated; use AssertionFailure() << msg.
17356 GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
17358 // The abstract class that all tests inherit from.
17360 // In Google Test, a unit test program contains one or many TestCases, and
17361 // each TestCase contains one or many Tests.
17363 // When you define a test using the TEST macro, you don't need to
17364 // explicitly derive from Test - the TEST macro automatically does
17367 // The only time you derive from Test is when defining a test fixture
17368 // to be used a TEST_F. For example:
17370 // class FooTest : public testing::Test {
17372 // virtual void SetUp() { ... }
17373 // virtual void TearDown() { ... }
17377 // TEST_F(FooTest, Bar) { ... }
17378 // TEST_F(FooTest, Baz) { ... }
17380 // Test is not copyable.
17381 class GTEST_API_ Test {
17383 friend class TestInfo;
17385 // Defines types for pointers to functions that set up and tear down
17387 typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
17388 typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
17390 // The d'tor is virtual as we intend to inherit from Test.
17393 // Sets up the stuff shared by all tests in this test case.
17395 // Google Test will call Foo::SetUpTestCase() before running the first
17396 // test in test case Foo. Hence a sub-class can define its own
17397 // SetUpTestCase() method to shadow the one defined in the super
17399 static void SetUpTestCase() {}
17401 // Tears down the stuff shared by all tests in this test case.
17403 // Google Test will call Foo::TearDownTestCase() after running the last
17404 // test in test case Foo. Hence a sub-class can define its own
17405 // TearDownTestCase() method to shadow the one defined in the super
17407 static void TearDownTestCase() {}
17409 // Returns true iff the current test has a fatal failure.
17410 static bool HasFatalFailure();
17412 // Returns true iff the current test has a non-fatal failure.
17413 static bool HasNonfatalFailure();
17415 // Returns true iff the current test has a (either fatal or
17416 // non-fatal) failure.
17417 static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
17419 // Logs a property for the current test. Only the last value for a given
17420 // key is remembered.
17421 // These are public static so they can be called from utility functions
17422 // that are not members of the test fixture.
17423 // The arguments are const char* instead strings, as Google Test is used
17424 // on platforms where string doesn't compile.
17426 // Note that a driving consideration for these RecordProperty methods
17427 // was to produce xml output suited to the Greenspan charting utility,
17428 // which at present will only chart values that fit in a 32-bit int. It
17429 // is the user's responsibility to restrict their values to 32-bit ints
17430 // if they intend them to be used with Greenspan.
17431 static void RecordProperty(const char* key, const char* value);
17432 static void RecordProperty(const char* key, int value);
17435 // Creates a Test object.
17438 // Sets up the test fixture.
17439 virtual void SetUp();
17441 // Tears down the test fixture.
17442 virtual void TearDown();
17445 // Returns true iff the current test has the same fixture class as
17446 // the first test in the current test case.
17447 static bool HasSameFixtureClass();
17449 // Runs the test after the test fixture has been set up.
17451 // A sub-class must implement this to define the test logic.
17453 // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
17454 // Instead, use the TEST or TEST_F macro.
17455 virtual void TestBody() = 0;
17457 // Sets up, executes, and tears down the test.
17460 // Deletes self. We deliberately pick an unusual name for this
17461 // internal method to avoid clashing with names used in user TESTs.
17462 void DeleteSelf_() { delete this; }
17464 // Uses a GTestFlagSaver to save and restore all Google Test flags.
17465 const internal::GTestFlagSaver* const gtest_flag_saver_;
17467 // Often a user mis-spells SetUp() as Setup() and spends a long time
17468 // wondering why it is never called by Google Test. The declaration of
17469 // the following method is solely for catching such an error at
17472 // - The return type is deliberately chosen to be not void, so it
17473 // will be a conflict if a user declares void Setup() in his test
17476 // - This method is private, so it will be another compiler error
17477 // if a user calls it from his test fixture.
17479 // DO NOT OVERRIDE THIS FUNCTION.
17481 // If you see an error about overriding the following function or
17482 // about it being private, you have mis-spelled SetUp() as Setup().
17483 struct Setup_should_be_spelled_SetUp {};
17484 virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
17486 // We disallow copying Tests.
17487 GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
17490 typedef internal::TimeInMillis TimeInMillis;
17492 // A copyable object representing a user specified test property which can be
17493 // output as a key/value string pair.
17495 // Don't inherit from TestProperty as its destructor is not virtual.
17496 class TestProperty {
17498 // C'tor. TestProperty does NOT have a default constructor.
17499 // Always use this constructor (with parameters) to create a
17500 // TestProperty object.
17501 TestProperty(const char* a_key, const char* a_value) :
17502 key_(a_key), value_(a_value) {
17505 // Gets the user supplied key.
17506 const char* key() const {
17507 return key_.c_str();
17510 // Gets the user supplied value.
17511 const char* value() const {
17512 return value_.c_str();
17515 // Sets a new value, overriding the one supplied in the constructor.
17516 void SetValue(const char* new_value) {
17517 value_ = new_value;
17521 // The key supplied by the user.
17522 internal::String key_;
17523 // The value supplied by the user.
17524 internal::String value_;
17527 // The result of a single Test. This includes a list of
17528 // TestPartResults, a list of TestProperties, a count of how many
17529 // death tests there are in the Test, and how much time it took to run
17532 // TestResult is not copyable.
17533 class GTEST_API_ TestResult {
17535 // Creates an empty TestResult.
17538 // D'tor. Do not inherit from TestResult.
17541 // Gets the number of all test parts. This is the sum of the number
17542 // of successful test parts and the number of failed test parts.
17543 int total_part_count() const;
17545 // Returns the number of the test properties.
17546 int test_property_count() const;
17548 // Returns true iff the test passed (i.e. no test part failed).
17549 bool Passed() const { return !Failed(); }
17551 // Returns true iff the test failed.
17552 bool Failed() const;
17554 // Returns true iff the test fatally failed.
17555 bool HasFatalFailure() const;
17557 // Returns true iff the test has a non-fatal failure.
17558 bool HasNonfatalFailure() const;
17560 // Returns the elapsed time, in milliseconds.
17561 TimeInMillis elapsed_time() const { return elapsed_time_; }
17563 // Returns the i-th test part result among all the results. i can range
17564 // from 0 to test_property_count() - 1. If i is not in that range, aborts
17566 const TestPartResult& GetTestPartResult(int i) const;
17568 // Returns the i-th test property. i can range from 0 to
17569 // test_property_count() - 1. If i is not in that range, aborts the
17571 const TestProperty& GetTestProperty(int i) const;
17574 friend class TestInfo;
17575 friend class UnitTest;
17576 friend class internal::DefaultGlobalTestPartResultReporter;
17577 friend class internal::ExecDeathTest;
17578 friend class internal::TestResultAccessor;
17579 friend class internal::UnitTestImpl;
17580 friend class internal::WindowsDeathTest;
17582 // Gets the vector of TestPartResults.
17583 const std::vector<TestPartResult>& test_part_results() const {
17584 return test_part_results_;
17587 // Gets the vector of TestProperties.
17588 const std::vector<TestProperty>& test_properties() const {
17589 return test_properties_;
17592 // Sets the elapsed time.
17593 void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
17595 // Adds a test property to the list. The property is validated and may add
17596 // a non-fatal failure if invalid (e.g., if it conflicts with reserved
17597 // key names). If a property is already recorded for the same key, the
17598 // value will be updated, rather than storing multiple values for the same
17600 void RecordProperty(const TestProperty& test_property);
17602 // Adds a failure if the key is a reserved attribute of Google Test
17603 // testcase tags. Returns true if the property is valid.
17604 // TODO(russr): Validate attribute names are legal and human readable.
17605 static bool ValidateTestProperty(const TestProperty& test_property);
17607 // Adds a test part result to the list.
17608 void AddTestPartResult(const TestPartResult& test_part_result);
17610 // Returns the death test count.
17611 int death_test_count() const { return death_test_count_; }
17613 // Increments the death test count, returning the new count.
17614 int increment_death_test_count() { return ++death_test_count_; }
17616 // Clears the test part results.
17617 void ClearTestPartResults();
17619 // Clears the object.
17622 // Protects mutable state of the property vector and of owned
17623 // properties, whose values may be updated.
17624 internal::Mutex test_properites_mutex_;
17626 // The vector of TestPartResults
17627 std::vector<TestPartResult> test_part_results_;
17628 // The vector of TestProperties
17629 std::vector<TestProperty> test_properties_;
17630 // Running count of death tests.
17631 int death_test_count_;
17632 // The elapsed time, in milliseconds.
17633 TimeInMillis elapsed_time_;
17635 // We disallow copying TestResult.
17636 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
17637 }; // class TestResult
17639 // A TestInfo object stores the following information about a test:
17643 // Whether the test should be run
17644 // A function pointer that creates the test object when invoked
17647 // The constructor of TestInfo registers itself with the UnitTest
17648 // singleton such that the RUN_ALL_TESTS() macro knows which tests to
17650 class GTEST_API_ TestInfo {
17652 // Destructs a TestInfo object. This function is not virtual, so
17653 // don't inherit from TestInfo.
17656 // Returns the test case name.
17657 const char* test_case_name() const { return test_case_name_.c_str(); }
17659 // Returns the test name.
17660 const char* name() const { return name_.c_str(); }
17662 // Returns the name of the parameter type, or NULL if this is not a typed
17663 // or a type-parameterized test.
17664 const char* type_param() const {
17665 if (type_param_.get() != NULL)
17666 return type_param_->c_str();
17670 // Returns the text representation of the value parameter, or NULL if this
17671 // is not a value-parameterized test.
17672 const char* value_param() const {
17673 if (value_param_.get() != NULL)
17674 return value_param_->c_str();
17678 // Returns true if this test should run, that is if the test is not disabled
17679 // (or it is disabled but the also_run_disabled_tests flag has been specified)
17680 // and its full name matches the user-specified filter.
17682 // Google Test allows the user to filter the tests by their full names.
17683 // The full name of a test Bar in test case Foo is defined as
17684 // "Foo.Bar". Only the tests that match the filter will run.
17686 // A filter is a colon-separated list of glob (not regex) patterns,
17687 // optionally followed by a '-' and a colon-separated list of
17688 // negative patterns (tests to exclude). A test is run if it
17689 // matches one of the positive patterns and does not match any of
17690 // the negative patterns.
17692 // For example, *A*:Foo.* is a filter that matches any string that
17693 // contains the character 'A' or starts with "Foo.".
17694 bool should_run() const { return should_run_; }
17696 // Returns the result of the test.
17697 const TestResult* result() const { return &result_; }
17701 #if GTEST_HAS_DEATH_TEST
17702 friend class internal::DefaultDeathTestFactory;
17703 #endif // GTEST_HAS_DEATH_TEST
17705 friend class TestCase;
17706 friend class internal::UnitTestImpl;
17707 friend TestInfo* internal::MakeAndRegisterTestInfo(
17708 const char* test_case_name, const char* name,
17709 const char* type_param,
17710 const char* value_param,
17711 internal::TypeId fixture_class_id,
17712 Test::SetUpTestCaseFunc set_up_tc,
17713 Test::TearDownTestCaseFunc tear_down_tc,
17714 internal::TestFactoryBase* factory);
17716 // Constructs a TestInfo object. The newly constructed instance assumes
17717 // ownership of the factory object.
17718 TestInfo(const char* test_case_name, const char* name,
17719 const char* a_type_param,
17720 const char* a_value_param,
17721 internal::TypeId fixture_class_id,
17722 internal::TestFactoryBase* factory);
17724 // Increments the number of death tests encountered in this test so
17726 int increment_death_test_count() {
17727 return result_.increment_death_test_count();
17730 // Creates the test object, runs it, records its result, and then
17734 static void ClearTestResult(TestInfo* test_info) {
17735 test_info->result_.Clear();
17738 // These fields are immutable properties of the test.
17739 const std::string test_case_name_; // Test case name
17740 const std::string name_; // Test name
17741 // Name of the parameter type, or NULL if this is not a typed or a
17742 // type-parameterized test.
17743 const internal::scoped_ptr<const ::std::string> type_param_;
17744 // Text representation of the value parameter, or NULL if this is not a
17745 // value-parameterized test.
17746 const internal::scoped_ptr<const ::std::string> value_param_;
17747 const internal::TypeId fixture_class_id_; // ID of the test fixture class
17748 bool should_run_; // True iff this test should run
17749 bool is_disabled_; // True iff this test is disabled
17750 bool matches_filter_; // True if this test matches the
17751 // user-specified filter.
17752 internal::TestFactoryBase* const factory_; // The factory that creates
17755 // This field is mutable and needs to be reset before running the
17756 // test for the second time.
17757 TestResult result_;
17759 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
17762 // A test case, which consists of a vector of TestInfos.
17764 // TestCase is not copyable.
17765 class GTEST_API_ TestCase {
17767 // Creates a TestCase with the given name.
17769 // TestCase does NOT have a default constructor. Always use this
17770 // constructor to create a TestCase object.
17774 // name: name of the test case
17775 // a_type_param: the name of the test's type parameter, or NULL if
17776 // this is not a type-parameterized test.
17777 // set_up_tc: pointer to the function that sets up the test case
17778 // tear_down_tc: pointer to the function that tears down the test case
17779 TestCase(const char* name, const char* a_type_param,
17780 Test::SetUpTestCaseFunc set_up_tc,
17781 Test::TearDownTestCaseFunc tear_down_tc);
17783 // Destructor of TestCase.
17784 virtual ~TestCase();
17786 // Gets the name of the TestCase.
17787 const char* name() const { return name_.c_str(); }
17789 // Returns the name of the parameter type, or NULL if this is not a
17790 // type-parameterized test case.
17791 const char* type_param() const {
17792 if (type_param_.get() != NULL)
17793 return type_param_->c_str();
17797 // Returns true if any test in this test case should run.
17798 bool should_run() const { return should_run_; }
17800 // Gets the number of successful tests in this test case.
17801 int successful_test_count() const;
17803 // Gets the number of failed tests in this test case.
17804 int failed_test_count() const;
17806 // Gets the number of disabled tests in this test case.
17807 int disabled_test_count() const;
17809 // Get the number of tests in this test case that should run.
17810 int test_to_run_count() const;
17812 // Gets the number of all tests in this test case.
17813 int total_test_count() const;
17815 // Returns true iff the test case passed.
17816 bool Passed() const { return !Failed(); }
17818 // Returns true iff the test case failed.
17819 bool Failed() const { return failed_test_count() > 0; }
17821 // Returns the elapsed time, in milliseconds.
17822 TimeInMillis elapsed_time() const { return elapsed_time_; }
17824 // Returns the i-th test among all the tests. i can range from 0 to
17825 // total_test_count() - 1. If i is not in that range, returns NULL.
17826 const TestInfo* GetTestInfo(int i) const;
17830 friend class internal::UnitTestImpl;
17832 // Gets the (mutable) vector of TestInfos in this TestCase.
17833 std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
17835 // Gets the (immutable) vector of TestInfos in this TestCase.
17836 const std::vector<TestInfo*>& test_info_list() const {
17837 return test_info_list_;
17840 // Returns the i-th test among all the tests. i can range from 0 to
17841 // total_test_count() - 1. If i is not in that range, returns NULL.
17842 TestInfo* GetMutableTestInfo(int i);
17844 // Sets the should_run member.
17845 void set_should_run(bool should) { should_run_ = should; }
17847 // Adds a TestInfo to this test case. Will delete the TestInfo upon
17848 // destruction of the TestCase object.
17849 void AddTestInfo(TestInfo * test_info);
17851 // Clears the results of all tests in this test case.
17852 void ClearResult();
17854 // Clears the results of all tests in the given test case.
17855 static void ClearTestCaseResult(TestCase* test_case) {
17856 test_case->ClearResult();
17859 // Runs every test in this TestCase.
17862 // Runs SetUpTestCase() for this TestCase. This wrapper is needed
17863 // for catching exceptions thrown from SetUpTestCase().
17864 void RunSetUpTestCase() { (*set_up_tc_)(); }
17866 // Runs TearDownTestCase() for this TestCase. This wrapper is
17867 // needed for catching exceptions thrown from TearDownTestCase().
17868 void RunTearDownTestCase() { (*tear_down_tc_)(); }
17870 // Returns true iff test passed.
17871 static bool TestPassed(const TestInfo* test_info) {
17872 return test_info->should_run() && test_info->result()->Passed();
17875 // Returns true iff test failed.
17876 static bool TestFailed(const TestInfo* test_info) {
17877 return test_info->should_run() && test_info->result()->Failed();
17880 // Returns true iff test is disabled.
17881 static bool TestDisabled(const TestInfo* test_info) {
17882 return test_info->is_disabled_;
17885 // Returns true if the given test should run.
17886 static bool ShouldRunTest(const TestInfo* test_info) {
17887 return test_info->should_run();
17890 // Shuffles the tests in this test case.
17891 void ShuffleTests(internal::Random* random);
17893 // Restores the test order to before the first shuffle.
17894 void UnshuffleTests();
17896 // Name of the test case.
17897 internal::String name_;
17898 // Name of the parameter type, or NULL if this is not a typed or a
17899 // type-parameterized test.
17900 const internal::scoped_ptr<const ::std::string> type_param_;
17901 // The vector of TestInfos in their original order. It owns the
17902 // elements in the vector.
17903 std::vector<TestInfo*> test_info_list_;
17904 // Provides a level of indirection for the test list to allow easy
17905 // shuffling and restoring the test order. The i-th element in this
17906 // vector is the index of the i-th test in the shuffled test list.
17907 std::vector<int> test_indices_;
17908 // Pointer to the function that sets up the test case.
17909 Test::SetUpTestCaseFunc set_up_tc_;
17910 // Pointer to the function that tears down the test case.
17911 Test::TearDownTestCaseFunc tear_down_tc_;
17912 // True iff any test in this test case should run.
17914 // Elapsed time, in milliseconds.
17915 TimeInMillis elapsed_time_;
17917 // We disallow copying TestCases.
17918 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
17921 // An Environment object is capable of setting up and tearing down an
17922 // environment. The user should subclass this to define his own
17925 // An Environment object does the set-up and tear-down in virtual
17926 // methods SetUp() and TearDown() instead of the constructor and the
17929 // 1. You cannot safely throw from a destructor. This is a problem
17930 // as in some cases Google Test is used where exceptions are enabled, and
17931 // we may want to implement ASSERT_* using exceptions where they are
17933 // 2. You cannot use ASSERT_* directly in a constructor or
17935 class Environment {
17937 // The d'tor is virtual as we need to subclass Environment.
17938 virtual ~Environment() {}
17940 // Override this to define how to set up the environment.
17941 virtual void SetUp() {}
17943 // Override this to define how to tear down the environment.
17944 virtual void TearDown() {}
17946 // If you see an error about overriding the following function or
17947 // about it being private, you have mis-spelled SetUp() as Setup().
17948 struct Setup_should_be_spelled_SetUp {};
17949 virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
17952 // The interface for tracing execution of tests. The methods are organized in
17953 // the order the corresponding events are fired.
17954 class TestEventListener {
17956 virtual ~TestEventListener() {}
17958 // Fired before any test activity starts.
17959 virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
17961 // Fired before each iteration of tests starts. There may be more than
17962 // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
17963 // index, starting from 0.
17964 virtual void OnTestIterationStart(const UnitTest& unit_test,
17965 int iteration) = 0;
17967 // Fired before environment set-up for each iteration of tests starts.
17968 virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
17970 // Fired after environment set-up for each iteration of tests ends.
17971 virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
17973 // Fired before the test case starts.
17974 virtual void OnTestCaseStart(const TestCase& test_case) = 0;
17976 // Fired before the test starts.
17977 virtual void OnTestStart(const TestInfo& test_info) = 0;
17979 // Fired after a failed assertion or a SUCCEED() invocation.
17980 virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
17982 // Fired after the test ends.
17983 virtual void OnTestEnd(const TestInfo& test_info) = 0;
17985 // Fired after the test case ends.
17986 virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
17988 // Fired before environment tear-down for each iteration of tests starts.
17989 virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
17991 // Fired after environment tear-down for each iteration of tests ends.
17992 virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
17994 // Fired after each iteration of tests finishes.
17995 virtual void OnTestIterationEnd(const UnitTest& unit_test,
17996 int iteration) = 0;
17998 // Fired after all test activities have ended.
17999 virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
18002 // The convenience class for users who need to override just one or two
18003 // methods and are not concerned that a possible change to a signature of
18004 // the methods they override will not be caught during the build. For
18005 // comments about each method please see the definition of TestEventListener
18007 class EmptyTestEventListener : public TestEventListener {
18009 virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
18010 virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
18011 int /*iteration*/) {}
18012 virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
18013 virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
18014 virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
18015 virtual void OnTestStart(const TestInfo& /*test_info*/) {}
18016 virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
18017 virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
18018 virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
18019 virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
18020 virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
18021 virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
18022 int /*iteration*/) {}
18023 virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
18026 // TestEventListeners lets users add listeners to track events in Google Test.
18027 class GTEST_API_ TestEventListeners {
18029 TestEventListeners();
18030 ~TestEventListeners();
18032 // Appends an event listener to the end of the list. Google Test assumes
18033 // the ownership of the listener (i.e. it will delete the listener when
18034 // the test program finishes).
18035 void Append(TestEventListener* listener);
18037 // Removes the given event listener from the list and returns it. It then
18038 // becomes the caller's responsibility to delete the listener. Returns
18039 // NULL if the listener is not found in the list.
18040 TestEventListener* Release(TestEventListener* listener);
18042 // Returns the standard listener responsible for the default console
18043 // output. Can be removed from the listeners list to shut down default
18044 // console output. Note that removing this object from the listener list
18045 // with Release transfers its ownership to the caller and makes this
18046 // function return NULL the next time.
18047 TestEventListener* default_result_printer() const {
18048 return default_result_printer_;
18051 // Returns the standard listener responsible for the default XML output
18052 // controlled by the --gtest_output=xml flag. Can be removed from the
18053 // listeners list by users who want to shut down the default XML output
18054 // controlled by this flag and substitute it with custom one. Note that
18055 // removing this object from the listener list with Release transfers its
18056 // ownership to the caller and makes this function return NULL the next
18058 TestEventListener* default_xml_generator() const {
18059 return default_xml_generator_;
18063 friend class TestCase;
18064 friend class TestInfo;
18065 friend class internal::DefaultGlobalTestPartResultReporter;
18066 friend class internal::NoExecDeathTest;
18067 friend class internal::TestEventListenersAccessor;
18068 friend class internal::UnitTestImpl;
18070 // Returns repeater that broadcasts the TestEventListener events to all
18072 TestEventListener* repeater();
18074 // Sets the default_result_printer attribute to the provided listener.
18075 // The listener is also added to the listener list and previous
18076 // default_result_printer is removed from it and deleted. The listener can
18077 // also be NULL in which case it will not be added to the list. Does
18078 // nothing if the previous and the current listener objects are the same.
18079 void SetDefaultResultPrinter(TestEventListener* listener);
18081 // Sets the default_xml_generator attribute to the provided listener. The
18082 // listener is also added to the listener list and previous
18083 // default_xml_generator is removed from it and deleted. The listener can
18084 // also be NULL in which case it will not be added to the list. Does
18085 // nothing if the previous and the current listener objects are the same.
18086 void SetDefaultXmlGenerator(TestEventListener* listener);
18088 // Controls whether events will be forwarded by the repeater to the
18089 // listeners in the list.
18090 bool EventForwardingEnabled() const;
18091 void SuppressEventForwarding();
18093 // The actual list of listeners.
18094 internal::TestEventRepeater* repeater_;
18095 // Listener responsible for the standard result output.
18096 TestEventListener* default_result_printer_;
18097 // Listener responsible for the creation of the XML output file.
18098 TestEventListener* default_xml_generator_;
18100 // We disallow copying TestEventListeners.
18101 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
18104 // A UnitTest consists of a vector of TestCases.
18106 // This is a singleton class. The only instance of UnitTest is
18107 // created when UnitTest::GetInstance() is first called. This
18108 // instance is never deleted.
18110 // UnitTest is not copyable.
18112 // This class is thread-safe as long as the methods are called
18113 // according to their specification.
18114 class GTEST_API_ UnitTest {
18116 // Gets the singleton UnitTest object. The first time this method
18117 // is called, a UnitTest object is constructed and returned.
18118 // Consecutive calls will return the same object.
18119 static UnitTest* GetInstance();
18121 // Runs all tests in this UnitTest object and prints the result.
18122 // Returns 0 if successful, or 1 otherwise.
18124 // This method can only be called from the main thread.
18126 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18127 int Run() GTEST_MUST_USE_RESULT_;
18129 // Returns the working directory when the first TEST() or TEST_F()
18130 // was executed. The UnitTest object owns the string.
18131 const char* original_working_dir() const;
18133 // Returns the TestCase object for the test that's currently running,
18134 // or NULL if no test is running.
18135 const TestCase* current_test_case() const;
18137 // Returns the TestInfo object for the test that's currently running,
18138 // or NULL if no test is running.
18139 const TestInfo* current_test_info() const;
18141 // Returns the random seed used at the start of the current test run.
18142 int random_seed() const;
18144 #if GTEST_HAS_PARAM_TEST
18145 // Returns the ParameterizedTestCaseRegistry object used to keep track of
18146 // value-parameterized tests and instantiate and register them.
18148 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18149 internal::ParameterizedTestCaseRegistry& parameterized_test_registry();
18150 #endif // GTEST_HAS_PARAM_TEST
18152 // Gets the number of successful test cases.
18153 int successful_test_case_count() const;
18155 // Gets the number of failed test cases.
18156 int failed_test_case_count() const;
18158 // Gets the number of all test cases.
18159 int total_test_case_count() const;
18161 // Gets the number of all test cases that contain at least one test
18162 // that should run.
18163 int test_case_to_run_count() const;
18165 // Gets the number of successful tests.
18166 int successful_test_count() const;
18168 // Gets the number of failed tests.
18169 int failed_test_count() const;
18171 // Gets the number of disabled tests.
18172 int disabled_test_count() const;
18174 // Gets the number of all tests.
18175 int total_test_count() const;
18177 // Gets the number of tests that should run.
18178 int test_to_run_count() const;
18180 // Gets the elapsed time, in milliseconds.
18181 TimeInMillis elapsed_time() const;
18183 // Returns true iff the unit test passed (i.e. all test cases passed).
18184 bool Passed() const;
18186 // Returns true iff the unit test failed (i.e. some test case failed
18187 // or something outside of all tests failed).
18188 bool Failed() const;
18190 // Gets the i-th test case among all the test cases. i can range from 0 to
18191 // total_test_case_count() - 1. If i is not in that range, returns NULL.
18192 const TestCase* GetTestCase(int i) const;
18194 // Returns the list of event listeners that can be used to track events
18195 // inside Google Test.
18196 TestEventListeners& listeners();
18199 // Registers and returns a global test environment. When a test
18200 // program is run, all global test environments will be set-up in
18201 // the order they were registered. After all tests in the program
18202 // have finished, all global test environments will be torn-down in
18203 // the *reverse* order they were registered.
18205 // The UnitTest object takes ownership of the given environment.
18207 // This method can only be called from the main thread.
18208 Environment* AddEnvironment(Environment* env);
18210 // Adds a TestPartResult to the current TestResult object. All
18211 // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
18212 // eventually call this to report their results. The user code
18213 // should use the assertion macros instead of calling this directly.
18214 void AddTestPartResult(TestPartResult::Type result_type,
18215 const char* file_name,
18217 const internal::String& message,
18218 const internal::String& os_stack_trace);
18220 // Adds a TestProperty to the current TestResult object. If the result already
18221 // contains a property with the same key, the value will be updated.
18222 void RecordPropertyForCurrentTest(const char* key, const char* value);
18224 // Gets the i-th test case among all the test cases. i can range from 0 to
18225 // total_test_case_count() - 1. If i is not in that range, returns NULL.
18226 TestCase* GetMutableTestCase(int i);
18228 // Accessors for the implementation object.
18229 internal::UnitTestImpl* impl() { return impl_; }
18230 const internal::UnitTestImpl* impl() const { return impl_; }
18232 // These classes and funcions are friends as they need to access private
18233 // members of UnitTest.
18235 friend class internal::AssertHelper;
18236 friend class internal::ScopedTrace;
18237 friend Environment* AddGlobalTestEnvironment(Environment* env);
18238 friend internal::UnitTestImpl* internal::GetUnitTestImpl();
18239 friend void internal::ReportFailureInUnknownLocation(
18240 TestPartResult::Type result_type,
18241 const internal::String& message);
18243 // Creates an empty UnitTest.
18247 virtual ~UnitTest();
18249 // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
18250 // Google Test trace stack.
18251 void PushGTestTrace(const internal::TraceInfo& trace);
18253 // Pops a trace from the per-thread Google Test trace stack.
18254 void PopGTestTrace();
18256 // Protects mutable state in *impl_. This is mutable as some const
18257 // methods need to lock it too.
18258 mutable internal::Mutex mutex_;
18260 // Opaque implementation object. This field is never changed once
18261 // the object is constructed. We don't mark it as const here, as
18262 // doing so will cause a warning in the constructor of UnitTest.
18263 // Mutable state in *impl_ is protected by mutex_.
18264 internal::UnitTestImpl* impl_;
18266 // We disallow copying UnitTest.
18267 GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
18270 // A convenient wrapper for adding an environment for the test
18273 // You should call this before RUN_ALL_TESTS() is called, probably in
18274 // main(). If you use gtest_main, you need to call this before main()
18275 // starts for it to take effect. For example, you can define a global
18276 // variable like this:
18278 // testing::Environment* const foo_env =
18279 // testing::AddGlobalTestEnvironment(new FooEnvironment);
18281 // However, we strongly recommend you to write your own main() and
18282 // call AddGlobalTestEnvironment() there, as relying on initialization
18283 // of global variables makes the code harder to read and may cause
18284 // problems when you register multiple environments from different
18285 // translation units and the environments have dependencies among them
18286 // (remember that the compiler doesn't guarantee the order in which
18287 // global variables from different translation units are initialized).
18288 inline Environment* AddGlobalTestEnvironment(Environment* env) {
18289 return UnitTest::GetInstance()->AddEnvironment(env);
18292 // Initializes Google Test. This must be called before calling
18293 // RUN_ALL_TESTS(). In particular, it parses a command line for the
18294 // flags that Google Test recognizes. Whenever a Google Test flag is
18295 // seen, it is removed from argv, and *argc is decremented.
18297 // No value is returned. Instead, the Google Test flag variables are
18300 // Calling the function for the second time has no user-visible effect.
18301 GTEST_API_ void InitGoogleTest(int* argc, char** argv);
18303 // This overloaded version can be used in Windows programs compiled in
18305 GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
18307 namespace internal {
18309 // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
18310 // operand to be used in a failure message. The type (but not value)
18311 // of the other operand may affect the format. This allows us to
18312 // print a char* as a raw pointer when it is compared against another
18313 // char*, and print it as a C string when it is compared against an
18314 // std::string object, for example.
18316 // The default implementation ignores the type of the other operand.
18317 // Some specialized versions are used to handle formatting wide or
18318 // narrow C strings.
18320 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18321 template <typename T1, typename T2>
18322 String FormatForComparisonFailureMessage(const T1& value,
18323 const T2& /* other_operand */) {
18324 // C++Builder compiles this incorrectly if the namespace isn't explicitly
18326 return ::testing::PrintToString(value);
18329 // The helper function for {ASSERT|EXPECT}_EQ.
18330 template <typename T1, typename T2>
18331 AssertionResult CmpHelperEQ(const char* expected_expression,
18332 const char* actual_expression,
18333 const T1& expected,
18334 const T2& actual) {
18336 # pragma warning(push) // Saves the current warning state.
18337 # pragma warning(disable:4389) // Temporarily disables warning on
18338 // signed/unsigned mismatch.
18341 if (expected == actual) {
18342 return AssertionSuccess();
18346 # pragma warning(pop) // Restores the warning state.
18349 return EqFailure(expected_expression,
18351 FormatForComparisonFailureMessage(expected, actual),
18352 FormatForComparisonFailureMessage(actual, expected),
18356 // With this overloaded version, we allow anonymous enums to be used
18357 // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
18358 // can be implicitly cast to BiggestInt.
18359 GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
18360 const char* actual_expression,
18361 BiggestInt expected,
18362 BiggestInt actual);
18364 // The helper class for {ASSERT|EXPECT}_EQ. The template argument
18365 // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
18366 // is a null pointer literal. The following default implementation is
18367 // for lhs_is_null_literal being false.
18368 template <bool lhs_is_null_literal>
18371 // This templatized version is for the general case.
18372 template <typename T1, typename T2>
18373 static AssertionResult Compare(const char* expected_expression,
18374 const char* actual_expression,
18375 const T1& expected,
18376 const T2& actual) {
18377 return CmpHelperEQ(expected_expression, actual_expression, expected,
18381 // With this overloaded version, we allow anonymous enums to be used
18382 // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
18383 // enums can be implicitly cast to BiggestInt.
18385 // Even though its body looks the same as the above version, we
18386 // cannot merge the two, as it will make anonymous enums unhappy.
18387 static AssertionResult Compare(const char* expected_expression,
18388 const char* actual_expression,
18389 BiggestInt expected,
18390 BiggestInt actual) {
18391 return CmpHelperEQ(expected_expression, actual_expression, expected,
18396 // This specialization is used when the first argument to ASSERT_EQ()
18397 // is a null pointer literal, like NULL, false, or 0.
18399 class EqHelper<true> {
18401 // We define two overloaded versions of Compare(). The first
18402 // version will be picked when the second argument to ASSERT_EQ() is
18403 // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
18404 // EXPECT_EQ(false, a_bool).
18405 template <typename T1, typename T2>
18406 static AssertionResult Compare(
18407 const char* expected_expression,
18408 const char* actual_expression,
18409 const T1& expected,
18411 // The following line prevents this overload from being considered if T2
18412 // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr)
18413 // expands to Compare("", "", NULL, my_ptr), which requires a conversion
18414 // to match the Secret* in the other overload, which would otherwise make
18415 // this template match better.
18416 typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
18417 return CmpHelperEQ(expected_expression, actual_expression, expected,
18421 // This version will be picked when the second argument to ASSERT_EQ() is a
18422 // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
18423 template <typename T>
18424 static AssertionResult Compare(
18425 const char* expected_expression,
18426 const char* actual_expression,
18427 // We used to have a second template parameter instead of Secret*. That
18428 // template parameter would deduce to 'long', making this a better match
18429 // than the first overload even without the first overload's EnableIf.
18430 // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
18431 // non-pointer argument" (even a deduced integral argument), so the old
18432 // implementation caused warnings in user code.
18433 Secret* /* expected (NULL) */,
18435 // We already know that 'expected' is a null pointer.
18436 return CmpHelperEQ(expected_expression, actual_expression,
18437 static_cast<T*>(NULL), actual);
18441 // A macro for implementing the helper functions needed to implement
18442 // ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
18443 // of similar code.
18445 // For each templatized helper function, we also define an overloaded
18446 // version for BiggestInt in order to reduce code bloat and allow
18447 // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
18450 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18451 #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
18452 template <typename T1, typename T2>\
18453 AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
18454 const T1& val1, const T2& val2) {\
18455 if (val1 op val2) {\
18456 return AssertionSuccess();\
18458 return AssertionFailure() \
18459 << "Expected: (" << expr1 << ") " #op " (" << expr2\
18460 << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
18461 << " vs " << FormatForComparisonFailureMessage(val2, val1);\
18464 GTEST_API_ AssertionResult CmpHelper##op_name(\
18465 const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
18467 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18469 // Implements the helper function for {ASSERT|EXPECT}_NE
18470 GTEST_IMPL_CMP_HELPER_(NE, !=);
18471 // Implements the helper function for {ASSERT|EXPECT}_LE
18472 GTEST_IMPL_CMP_HELPER_(LE, <=);
18473 // Implements the helper function for {ASSERT|EXPECT}_LT
18474 GTEST_IMPL_CMP_HELPER_(LT, < );
18475 // Implements the helper function for {ASSERT|EXPECT}_GE
18476 GTEST_IMPL_CMP_HELPER_(GE, >=);
18477 // Implements the helper function for {ASSERT|EXPECT}_GT
18478 GTEST_IMPL_CMP_HELPER_(GT, > );
18480 #undef GTEST_IMPL_CMP_HELPER_
18482 // The helper function for {ASSERT|EXPECT}_STREQ.
18484 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18485 GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
18486 const char* actual_expression,
18487 const char* expected,
18488 const char* actual);
18490 // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
18492 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18493 GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
18494 const char* actual_expression,
18495 const char* expected,
18496 const char* actual);
18498 // The helper function for {ASSERT|EXPECT}_STRNE.
18500 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18501 GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
18502 const char* s2_expression,
18506 // The helper function for {ASSERT|EXPECT}_STRCASENE.
18508 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18509 GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
18510 const char* s2_expression,
18515 // Helper function for *_STREQ on wide strings.
18517 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18518 GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
18519 const char* actual_expression,
18520 const wchar_t* expected,
18521 const wchar_t* actual);
18523 // Helper function for *_STRNE on wide strings.
18525 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18526 GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
18527 const char* s2_expression,
18529 const wchar_t* s2);
18531 } // namespace internal
18533 // IsSubstring() and IsNotSubstring() are intended to be used as the
18534 // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
18535 // themselves. They check whether needle is a substring of haystack
18536 // (NULL is considered a substring of itself only), and return an
18537 // appropriate error message when they fail.
18539 // The {needle,haystack}_expr arguments are the stringified
18540 // expressions that generated the two real arguments.
18541 GTEST_API_ AssertionResult IsSubstring(
18542 const char* needle_expr, const char* haystack_expr,
18543 const char* needle, const char* haystack);
18544 GTEST_API_ AssertionResult IsSubstring(
18545 const char* needle_expr, const char* haystack_expr,
18546 const wchar_t* needle, const wchar_t* haystack);
18547 GTEST_API_ AssertionResult IsNotSubstring(
18548 const char* needle_expr, const char* haystack_expr,
18549 const char* needle, const char* haystack);
18550 GTEST_API_ AssertionResult IsNotSubstring(
18551 const char* needle_expr, const char* haystack_expr,
18552 const wchar_t* needle, const wchar_t* haystack);
18553 GTEST_API_ AssertionResult IsSubstring(
18554 const char* needle_expr, const char* haystack_expr,
18555 const ::std::string& needle, const ::std::string& haystack);
18556 GTEST_API_ AssertionResult IsNotSubstring(
18557 const char* needle_expr, const char* haystack_expr,
18558 const ::std::string& needle, const ::std::string& haystack);
18560 #if GTEST_HAS_STD_WSTRING
18561 GTEST_API_ AssertionResult IsSubstring(
18562 const char* needle_expr, const char* haystack_expr,
18563 const ::std::wstring& needle, const ::std::wstring& haystack);
18564 GTEST_API_ AssertionResult IsNotSubstring(
18565 const char* needle_expr, const char* haystack_expr,
18566 const ::std::wstring& needle, const ::std::wstring& haystack);
18567 #endif // GTEST_HAS_STD_WSTRING
18569 namespace internal {
18571 // Helper template function for comparing floating-points.
18573 // Template parameter:
18575 // RawType: the raw floating-point type (either float or double)
18577 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18578 template <typename RawType>
18579 AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
18580 const char* actual_expression,
18583 const FloatingPoint<RawType> lhs(expected), rhs(actual);
18585 if (lhs.AlmostEquals(rhs)) {
18586 return AssertionSuccess();
18589 ::std::stringstream expected_ss;
18590 expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
18593 ::std::stringstream actual_ss;
18594 actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
18597 return EqFailure(expected_expression,
18599 StringStreamToString(&expected_ss),
18600 StringStreamToString(&actual_ss),
18604 // Helper function for implementing ASSERT_NEAR.
18606 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18607 GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
18609 const char* abs_error_expr,
18614 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
18615 // A class that enables one to stream messages to assertion macros
18616 class GTEST_API_ AssertHelper {
18619 AssertHelper(TestPartResult::Type type,
18622 const char* message);
18625 // Message assignment is a semantic trick to enable assertion
18626 // streaming; see the GTEST_MESSAGE_ macro below.
18627 void operator=(const Message& message) const;
18630 // We put our data in a struct so that the size of the AssertHelper class can
18631 // be as small as possible. This is important because gcc is incapable of
18632 // re-using stack space even for temporary variables, so every EXPECT_EQ
18633 // reserves stack space for another AssertHelper.
18634 struct AssertHelperData {
18635 AssertHelperData(TestPartResult::Type t,
18636 const char* srcfile,
18639 : type(t), file(srcfile), line(line_num), message(msg) { }
18641 TestPartResult::Type const type;
18642 const char* const file;
18644 String const message;
18647 GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
18650 AssertHelperData* const data_;
18652 GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
18655 } // namespace internal
18657 #if GTEST_HAS_PARAM_TEST
18658 // The pure interface class that all value-parameterized tests inherit from.
18659 // A value-parameterized class must inherit from both ::testing::Test and
18660 // ::testing::WithParamInterface. In most cases that just means inheriting
18661 // from ::testing::TestWithParam, but more complicated test hierarchies
18662 // may need to inherit from Test and WithParamInterface at different levels.
18664 // This interface has support for accessing the test parameter value via
18665 // the GetParam() method.
18667 // Use it with one of the parameter generator defining functions, like Range(),
18668 // Values(), ValuesIn(), Bool(), and Combine().
18670 // class FooTest : public ::testing::TestWithParam<int> {
18673 // // Can use GetParam() here.
18675 // virtual ~FooTest() {
18676 // // Can use GetParam() here.
18678 // virtual void SetUp() {
18679 // // Can use GetParam() here.
18681 // virtual void TearDown {
18682 // // Can use GetParam() here.
18685 // TEST_P(FooTest, DoesBar) {
18686 // // Can use GetParam() method here.
18688 // ASSERT_TRUE(foo.DoesBar(GetParam()));
18690 // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
18692 template <typename T>
18693 class WithParamInterface {
18695 typedef T ParamType;
18696 virtual ~WithParamInterface() {}
18698 // The current parameter value. Is also available in the test fixture's
18699 // constructor. This member function is non-static, even though it only
18700 // references static data, to reduce the opportunity for incorrect uses
18701 // like writing 'WithParamInterface<bool>::GetParam()' for a test that
18702 // uses a fixture whose parameter type is int.
18703 const ParamType& GetParam() const { return *parameter_; }
18706 // Sets parameter value. The caller is responsible for making sure the value
18707 // remains alive and unchanged throughout the current test.
18708 static void SetParam(const ParamType* parameter) {
18709 parameter_ = parameter;
18712 // Static value used for accessing parameter during a test lifetime.
18713 static const ParamType* parameter_;
18715 // TestClass must be a subclass of WithParamInterface<T> and Test.
18716 template <class TestClass> friend class internal::ParameterizedTestFactory;
18719 template <typename T>
18720 const T* WithParamInterface<T>::parameter_ = NULL;
18722 // Most value-parameterized classes can ignore the existence of
18723 // WithParamInterface, and can just inherit from ::testing::TestWithParam.
18725 template <typename T>
18726 class TestWithParam : public Test, public WithParamInterface<T> {
18729 #endif // GTEST_HAS_PARAM_TEST
18731 // Macros for indicating success/failure in test code.
18733 // ADD_FAILURE unconditionally adds a failure to the current test.
18734 // SUCCEED generates a success - it doesn't automatically make the
18735 // current test successful, as a test is only successful when it has
18738 // EXPECT_* verifies that a certain condition is satisfied. If not,
18739 // it behaves like ADD_FAILURE. In particular:
18741 // EXPECT_TRUE verifies that a Boolean condition is true.
18742 // EXPECT_FALSE verifies that a Boolean condition is false.
18744 // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
18745 // that they will also abort the current function on failure. People
18746 // usually want the fail-fast behavior of FAIL and ASSERT_*, but those
18747 // writing data-driven tests often find themselves using ADD_FAILURE
18748 // and EXPECT_* more.
18752 // EXPECT_TRUE(server.StatusIsOK());
18753 // ASSERT_FALSE(server.HasPendingRequest(port))
18754 // << "There are still pending requests " << "on port " << port;
18756 // Generates a nonfatal failure with a generic message.
18757 #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
18759 // Generates a nonfatal failure at the given source file location with
18760 // a generic message.
18761 #define ADD_FAILURE_AT(file, line) \
18762 GTEST_MESSAGE_AT_(file, line, "Failed", \
18763 ::testing::TestPartResult::kNonFatalFailure)
18765 // Generates a fatal failure with a generic message.
18766 #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
18768 // Define this macro to 1 to omit the definition of FAIL(), which is a
18769 // generic name and clashes with some other libraries.
18770 #if !GTEST_DONT_DEFINE_FAIL
18771 # define FAIL() GTEST_FAIL()
18774 // Generates a success with a generic message.
18775 #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
18777 // Define this macro to 1 to omit the definition of SUCCEED(), which
18778 // is a generic name and clashes with some other libraries.
18779 #if !GTEST_DONT_DEFINE_SUCCEED
18780 # define SUCCEED() GTEST_SUCCEED()
18783 // Macros for testing exceptions.
18785 // * {ASSERT|EXPECT}_THROW(statement, expected_exception):
18786 // Tests that the statement throws the expected exception.
18787 // * {ASSERT|EXPECT}_NO_THROW(statement):
18788 // Tests that the statement doesn't throw any exception.
18789 // * {ASSERT|EXPECT}_ANY_THROW(statement):
18790 // Tests that the statement throws an exception.
18792 #define EXPECT_THROW(statement, expected_exception) \
18793 GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
18794 #define EXPECT_NO_THROW(statement) \
18795 GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
18796 #define EXPECT_ANY_THROW(statement) \
18797 GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
18798 #define ASSERT_THROW(statement, expected_exception) \
18799 GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
18800 #define ASSERT_NO_THROW(statement) \
18801 GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
18802 #define ASSERT_ANY_THROW(statement) \
18803 GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
18805 // Boolean assertions. Condition can be either a Boolean expression or an
18806 // AssertionResult. For more information on how to use AssertionResult with
18807 // these macros see comments on that class.
18808 #define EXPECT_TRUE(condition) \
18809 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
18810 GTEST_NONFATAL_FAILURE_)
18811 #define EXPECT_FALSE(condition) \
18812 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
18813 GTEST_NONFATAL_FAILURE_)
18814 #define ASSERT_TRUE(condition) \
18815 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
18816 GTEST_FATAL_FAILURE_)
18817 #define ASSERT_FALSE(condition) \
18818 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
18819 GTEST_FATAL_FAILURE_)
18821 // Includes the auto-generated header that implements a family of
18822 // generic predicate assertion macros.
18823 // Copyright 2006, Google Inc.
18824 // All rights reserved.
18826 // Redistribution and use in source and binary forms, with or without
18827 // modification, are permitted provided that the following conditions are
18830 // * Redistributions of source code must retain the above copyright
18831 // notice, this list of conditions and the following disclaimer.
18832 // * Redistributions in binary form must reproduce the above
18833 // copyright notice, this list of conditions and the following disclaimer
18834 // in the documentation and/or other materials provided with the
18836 // * Neither the name of Google Inc. nor the names of its
18837 // contributors may be used to endorse or promote products derived from
18838 // this software without specific prior written permission.
18840 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18841 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18842 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18843 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18844 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18845 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
18846 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
18847 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
18848 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
18849 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
18850 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18852 // This file is AUTOMATICALLY GENERATED on 09/24/2010 by command
18853 // 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
18855 // Implements a family of generic predicate assertion macros.
18857 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
18858 #define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
18860 // Makes sure this header is not included before gtest.h.
18861 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
18862 # error Do not include gtest_pred_impl.h directly. Include gtest.h instead.
18863 #endif // GTEST_INCLUDE_GTEST_GTEST_H_
18865 // This header implements a family of generic predicate assertion
18868 // ASSERT_PRED_FORMAT1(pred_format, v1)
18869 // ASSERT_PRED_FORMAT2(pred_format, v1, v2)
18872 // where pred_format is a function or functor that takes n (in the
18873 // case of ASSERT_PRED_FORMATn) values and their source expression
18874 // text, and returns a testing::AssertionResult. See the definition
18875 // of ASSERT_EQ in gtest.h for an example.
18877 // If you don't care about formatting, you can use the more
18878 // restrictive version:
18880 // ASSERT_PRED1(pred, v1)
18881 // ASSERT_PRED2(pred, v1, v2)
18884 // where pred is an n-ary function or functor that returns bool,
18885 // and the values v1, v2, ..., must support the << operator for
18886 // streaming to std::ostream.
18888 // We also define the EXPECT_* variations.
18890 // For now we only support predicates whose arity is at most 5.
18891 // Please email googletestframework@googlegroups.com if you need
18892 // support for higher arities.
18894 // GTEST_ASSERT_ is the basic statement to which all of the assertions
18895 // in this file reduce. Don't use this in your code.
18897 #define GTEST_ASSERT_(expression, on_failure) \
18898 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
18899 if (const ::testing::AssertionResult gtest_ar = (expression)) \
18902 on_failure(gtest_ar.failure_message())
18905 // Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use
18906 // this in your code.
18907 template <typename Pred,
18909 AssertionResult AssertPred1Helper(const char* pred_text,
18913 if (pred(v1)) return AssertionSuccess();
18915 return AssertionFailure() << pred_text << "("
18916 << e1 << ") evaluates to false, where"
18917 << "\n" << e1 << " evaluates to " << v1;
18920 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
18921 // Don't use this in your code.
18922 #define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
18923 GTEST_ASSERT_(pred_format(#v1, v1),\
18926 // Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use
18927 // this in your code.
18928 #define GTEST_PRED1_(pred, v1, on_failure)\
18929 GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
18934 // Unary predicate assertion macros.
18935 #define EXPECT_PRED_FORMAT1(pred_format, v1) \
18936 GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
18937 #define EXPECT_PRED1(pred, v1) \
18938 GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
18939 #define ASSERT_PRED_FORMAT1(pred_format, v1) \
18940 GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
18941 #define ASSERT_PRED1(pred, v1) \
18942 GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
18946 // Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use
18947 // this in your code.
18948 template <typename Pred,
18951 AssertionResult AssertPred2Helper(const char* pred_text,
18957 if (pred(v1, v2)) return AssertionSuccess();
18959 return AssertionFailure() << pred_text << "("
18961 << e2 << ") evaluates to false, where"
18962 << "\n" << e1 << " evaluates to " << v1
18963 << "\n" << e2 << " evaluates to " << v2;
18966 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
18967 // Don't use this in your code.
18968 #define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
18969 GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2),\
18972 // Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use
18973 // this in your code.
18974 #define GTEST_PRED2_(pred, v1, v2, on_failure)\
18975 GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
18982 // Binary predicate assertion macros.
18983 #define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
18984 GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
18985 #define EXPECT_PRED2(pred, v1, v2) \
18986 GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
18987 #define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
18988 GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
18989 #define ASSERT_PRED2(pred, v1, v2) \
18990 GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
18994 // Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use
18995 // this in your code.
18996 template <typename Pred,
19000 AssertionResult AssertPred3Helper(const char* pred_text,
19008 if (pred(v1, v2, v3)) return AssertionSuccess();
19010 return AssertionFailure() << pred_text << "("
19013 << e3 << ") evaluates to false, where"
19014 << "\n" << e1 << " evaluates to " << v1
19015 << "\n" << e2 << " evaluates to " << v2
19016 << "\n" << e3 << " evaluates to " << v3;
19019 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
19020 // Don't use this in your code.
19021 #define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
19022 GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3),\
19025 // Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use
19026 // this in your code.
19027 #define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
19028 GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
19037 // Ternary predicate assertion macros.
19038 #define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
19039 GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
19040 #define EXPECT_PRED3(pred, v1, v2, v3) \
19041 GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
19042 #define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
19043 GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
19044 #define ASSERT_PRED3(pred, v1, v2, v3) \
19045 GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
19049 // Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use
19050 // this in your code.
19051 template <typename Pred,
19056 AssertionResult AssertPred4Helper(const char* pred_text,
19066 if (pred(v1, v2, v3, v4)) return AssertionSuccess();
19068 return AssertionFailure() << pred_text << "("
19072 << e4 << ") evaluates to false, where"
19073 << "\n" << e1 << " evaluates to " << v1
19074 << "\n" << e2 << " evaluates to " << v2
19075 << "\n" << e3 << " evaluates to " << v3
19076 << "\n" << e4 << " evaluates to " << v4;
19079 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
19080 // Don't use this in your code.
19081 #define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
19082 GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4),\
19085 // Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use
19086 // this in your code.
19087 #define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
19088 GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
19099 // 4-ary predicate assertion macros.
19100 #define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
19101 GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
19102 #define EXPECT_PRED4(pred, v1, v2, v3, v4) \
19103 GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
19104 #define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
19105 GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
19106 #define ASSERT_PRED4(pred, v1, v2, v3, v4) \
19107 GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
19111 // Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use
19112 // this in your code.
19113 template <typename Pred,
19119 AssertionResult AssertPred5Helper(const char* pred_text,
19131 if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
19133 return AssertionFailure() << pred_text << "("
19138 << e5 << ") evaluates to false, where"
19139 << "\n" << e1 << " evaluates to " << v1
19140 << "\n" << e2 << " evaluates to " << v2
19141 << "\n" << e3 << " evaluates to " << v3
19142 << "\n" << e4 << " evaluates to " << v4
19143 << "\n" << e5 << " evaluates to " << v5;
19146 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
19147 // Don't use this in your code.
19148 #define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
19149 GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5),\
19152 // Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use
19153 // this in your code.
19154 #define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
19155 GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
19168 // 5-ary predicate assertion macros.
19169 #define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
19170 GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
19171 #define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
19172 GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
19173 #define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
19174 GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
19175 #define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
19176 GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
19180 #endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19182 // Macros for testing equalities and inequalities.
19184 // * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
19185 // * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
19186 // * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
19187 // * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
19188 // * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
19189 // * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
19191 // When they are not, Google Test prints both the tested expressions and
19192 // their actual values. The values must be compatible built-in types,
19193 // or you will get a compiler error. By "compatible" we mean that the
19194 // values can be compared by the respective operator.
19198 // 1. It is possible to make a user-defined type work with
19199 // {ASSERT|EXPECT}_??(), but that requires overloading the
19200 // comparison operators and is thus discouraged by the Google C++
19201 // Usage Guide. Therefore, you are advised to use the
19202 // {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
19205 // 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
19206 // pointers (in particular, C strings). Therefore, if you use it
19207 // with two C strings, you are testing how their locations in memory
19208 // are related, not how their content is related. To compare two C
19209 // strings by content, use {ASSERT|EXPECT}_STR*().
19211 // 3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
19212 // {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
19213 // what the actual value is when it fails, and similarly for the
19214 // other comparisons.
19216 // 4. Do not depend on the order in which {ASSERT|EXPECT}_??()
19217 // evaluate their arguments, which is undefined.
19219 // 5. These macros evaluate their arguments exactly once.
19223 // EXPECT_NE(5, Foo());
19224 // EXPECT_EQ(NULL, a_pointer);
19225 // ASSERT_LT(i, array_size);
19226 // ASSERT_GT(records.size(), 0) << "There is no record left.";
19228 #define EXPECT_EQ(expected, actual) \
19229 EXPECT_PRED_FORMAT2(::testing::internal:: \
19230 EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
19232 #define EXPECT_NE(expected, actual) \
19233 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
19234 #define EXPECT_LE(val1, val2) \
19235 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
19236 #define EXPECT_LT(val1, val2) \
19237 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
19238 #define EXPECT_GE(val1, val2) \
19239 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
19240 #define EXPECT_GT(val1, val2) \
19241 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19243 #define GTEST_ASSERT_EQ(expected, actual) \
19244 ASSERT_PRED_FORMAT2(::testing::internal:: \
19245 EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
19247 #define GTEST_ASSERT_NE(val1, val2) \
19248 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
19249 #define GTEST_ASSERT_LE(val1, val2) \
19250 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
19251 #define GTEST_ASSERT_LT(val1, val2) \
19252 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
19253 #define GTEST_ASSERT_GE(val1, val2) \
19254 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
19255 #define GTEST_ASSERT_GT(val1, val2) \
19256 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19258 // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
19259 // ASSERT_XY(), which clashes with some users' own code.
19261 #if !GTEST_DONT_DEFINE_ASSERT_EQ
19262 # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
19265 #if !GTEST_DONT_DEFINE_ASSERT_NE
19266 # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
19269 #if !GTEST_DONT_DEFINE_ASSERT_LE
19270 # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
19273 #if !GTEST_DONT_DEFINE_ASSERT_LT
19274 # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
19277 #if !GTEST_DONT_DEFINE_ASSERT_GE
19278 # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
19281 #if !GTEST_DONT_DEFINE_ASSERT_GT
19282 # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
19285 // C String Comparisons. All tests treat NULL and any non-NULL string
19286 // as different. Two NULLs are equal.
19288 // * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2
19289 // * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2
19290 // * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
19291 // * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
19293 // For wide or narrow string objects, you can use the
19294 // {ASSERT|EXPECT}_??() macros.
19296 // Don't depend on the order in which the arguments are evaluated,
19297 // which is undefined.
19299 // These macros evaluate their arguments exactly once.
19301 #define EXPECT_STREQ(expected, actual) \
19302 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
19303 #define EXPECT_STRNE(s1, s2) \
19304 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
19305 #define EXPECT_STRCASEEQ(expected, actual) \
19306 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
19307 #define EXPECT_STRCASENE(s1, s2)\
19308 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
19310 #define ASSERT_STREQ(expected, actual) \
19311 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
19312 #define ASSERT_STRNE(s1, s2) \
19313 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
19314 #define ASSERT_STRCASEEQ(expected, actual) \
19315 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
19316 #define ASSERT_STRCASENE(s1, s2)\
19317 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
19319 // Macros for comparing floating-point numbers.
19321 // * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
19322 // Tests that two float values are almost equal.
19323 // * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
19324 // Tests that two double values are almost equal.
19325 // * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
19326 // Tests that v1 and v2 are within the given distance to each other.
19328 // Google Test uses ULP-based comparison to automatically pick a default
19329 // error bound that is appropriate for the operands. See the
19330 // FloatingPoint template class in gtest-internal.h if you are
19331 // interested in the implementation details.
19333 #define EXPECT_FLOAT_EQ(expected, actual)\
19334 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
19337 #define EXPECT_DOUBLE_EQ(expected, actual)\
19338 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
19341 #define ASSERT_FLOAT_EQ(expected, actual)\
19342 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
19345 #define ASSERT_DOUBLE_EQ(expected, actual)\
19346 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
19349 #define EXPECT_NEAR(val1, val2, abs_error)\
19350 EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
19351 val1, val2, abs_error)
19353 #define ASSERT_NEAR(val1, val2, abs_error)\
19354 ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
19355 val1, val2, abs_error)
19357 // These predicate format functions work on floating-point values, and
19358 // can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
19360 // EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
19362 // Asserts that val1 is less than, or almost equal to, val2. Fails
19363 // otherwise. In particular, it fails if either val1 or val2 is NaN.
19364 GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
19365 float val1, float val2);
19366 GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
19367 double val1, double val2);
19370 #if GTEST_OS_WINDOWS
19372 // Macros that test for HRESULT failure and success, these are only useful
19373 // on Windows, and rely on Windows SDK macros and APIs to compile.
19375 // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
19377 // When expr unexpectedly fails or succeeds, Google Test prints the
19378 // expected result and the actual result with both a human-readable
19379 // string representation of the error, if available, as well as the
19380 // hex result code.
19381 # define EXPECT_HRESULT_SUCCEEDED(expr) \
19382 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
19384 # define ASSERT_HRESULT_SUCCEEDED(expr) \
19385 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
19387 # define EXPECT_HRESULT_FAILED(expr) \
19388 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
19390 # define ASSERT_HRESULT_FAILED(expr) \
19391 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
19393 #endif // GTEST_OS_WINDOWS
19395 // Macros that execute statement and check that it doesn't generate new fatal
19396 // failures in the current thread.
19398 // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
19402 // EXPECT_NO_FATAL_FAILURE(Process());
19403 // ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
19405 #define ASSERT_NO_FATAL_FAILURE(statement) \
19406 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
19407 #define EXPECT_NO_FATAL_FAILURE(statement) \
19408 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
19410 // Causes a trace (including the source file path, the current line
19411 // number, and the given message) to be included in every test failure
19412 // message generated by code in the current scope. The effect is
19413 // undone when the control leaves the current scope.
19415 // The message argument can be anything streamable to std::ostream.
19417 // In the implementation, we include the current line number as part
19418 // of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
19419 // to appear in the same block - as long as they are on different
19421 #define SCOPED_TRACE(message) \
19422 ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
19423 __FILE__, __LINE__, ::testing::Message() << (message))
19425 // Compile-time assertion for type equality.
19426 // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
19427 // the same type. The value it returns is not interesting.
19429 // Instead of making StaticAssertTypeEq a class template, we make it a
19430 // function template that invokes a helper class template. This
19431 // prevents a user from misusing StaticAssertTypeEq<T1, T2> by
19432 // defining objects of that type.
19436 // When used inside a method of a class template,
19437 // StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
19438 // instantiated. For example, given:
19440 // template <typename T> class Foo {
19442 // void Bar() { testing::StaticAssertTypeEq<int, T>(); }
19447 // void Test1() { Foo<bool> foo; }
19449 // will NOT generate a compiler error, as Foo<bool>::Bar() is never
19450 // actually instantiated. Instead, you need:
19452 // void Test2() { Foo<bool> foo; foo.Bar(); }
19454 // to cause a compiler error.
19455 template <typename T1, typename T2>
19456 bool StaticAssertTypeEq() {
19457 (void)internal::StaticAssertTypeEqHelper<T1, T2>();
19463 // The first parameter is the name of the test case, and the second
19464 // parameter is the name of the test within the test case.
19466 // The convention is to end the test case name with "Test". For
19467 // example, a test case for the Foo class can be named FooTest.
19469 // The user should put his test code between braces after using this
19472 // TEST(FooTest, InitializesCorrectly) {
19474 // EXPECT_TRUE(foo.StatusIsOK());
19477 // Note that we call GetTestTypeId() instead of GetTypeId<
19478 // ::testing::Test>() here to get the type ID of testing::Test. This
19479 // is to work around a suspected linker bug when using Google Test as
19480 // a framework on Mac OS X. The bug causes GetTypeId<
19481 // ::testing::Test>() to return different values depending on whether
19482 // the call is from the Google Test framework itself or from user test
19483 // code. GetTestTypeId() is guaranteed to always return the same
19484 // value, as it always calls GetTypeId<>() from the Google Test
19486 #define GTEST_TEST(test_case_name, test_name)\
19487 GTEST_TEST_(test_case_name, test_name, \
19488 ::testing::Test, ::testing::internal::GetTestTypeId())
19490 // Define this macro to 1 to omit the definition of TEST(), which
19491 // is a generic name and clashes with some other libraries.
19492 #if !GTEST_DONT_DEFINE_TEST
19493 # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
19496 // Defines a test that uses a test fixture.
19498 // The first parameter is the name of the test fixture class, which
19499 // also doubles as the test case name. The second parameter is the
19500 // name of the test within the test case.
19502 // A test fixture class must be declared earlier. The user should put
19503 // his test code between braces after using this macro. Example:
19505 // class FooTest : public testing::Test {
19507 // virtual void SetUp() { b_.AddElement(3); }
19513 // TEST_F(FooTest, InitializesCorrectly) {
19514 // EXPECT_TRUE(a_.StatusIsOK());
19517 // TEST_F(FooTest, ReturnsElementCountCorrectly) {
19518 // EXPECT_EQ(0, a_.size());
19519 // EXPECT_EQ(1, b_.size());
19522 #define TEST_F(test_fixture, test_name)\
19523 GTEST_TEST_(test_fixture, test_name, test_fixture, \
19524 ::testing::internal::GetTypeId<test_fixture>())
19526 // Use this macro in main() to run all tests. It returns 0 if all
19527 // tests are successful, or 1 otherwise.
19529 // RUN_ALL_TESTS() should be invoked after the command line has been
19530 // parsed by InitGoogleTest().
19532 #define RUN_ALL_TESTS()\
19533 (::testing::UnitTest::GetInstance()->Run())
19535 } // namespace testing
19537 #endif // GTEST_INCLUDE_GTEST_GTEST_H_